org.camunda.bpm.model.bpmn.Bpmn类的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(389)

本文整理了Java中org.camunda.bpm.model.bpmn.Bpmn类的一些代码示例,展示了Bpmn类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bpmn类的具体详情如下:
包路径:org.camunda.bpm.model.bpmn.Bpmn
类名称:Bpmn

Bpmn介绍

[英]Provides access to the camunda BPMN model api.
[中]提供对camunda BPMN模型api的访问。

代码示例

代码示例来源:origin: camunda/camunda-bpm-platform

  1. @Deployment
  2. public static WebArchive createProcessApplication() {
  3. return initWebArchiveDeployment()
  4. .addAsResource(new StringAsset(Bpmn.convertToString(Bpmn.createExecutableProcess(TEST_PROCESS).done())), "testProcess.bpmn20.xml");
  5. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. public static ProcessBuilder createExecutableProcess(String processId) {
  2. return createProcess(processId).executable();
  3. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. public DeploymentBuilder addModelInstance(String resourceName, BpmnModelInstance modelInstance) {
  2. ensureNotNull("modelInstance", modelInstance);
  3. validateResouceName(resourceName, BpmnDeployer.BPMN_RESOURCE_SUFFIXES);
  4. ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
  5. Bpmn.writeModelToStream(outputStream, modelInstance);
  6. return addBytes(resourceName, outputStream.toByteArray());
  7. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. private InputStream createMockDeploymentResourceBpmnDataNonExecutableProcess() {
  2. // do not close the input stream, will be done in implementation
  3. String model = Bpmn.convertToString(Bpmn.createProcess().startEvent().endEvent().done());
  4. InputStream inputStream = new ByteArrayInputStream(model.getBytes());
  5. return inputStream;
  6. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. private BpmnModelInstance prepareSimpleProcess(String name) {
  2. BpmnModelInstance calledA = Bpmn.createExecutableProcess(name)
  3. .startEvent()
  4. .userTask("Task" + name)
  5. .endEvent()
  6. .done();
  7. return calledA;
  8. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. /**
  2. * Allows reading a {@link BpmnModelInstance} from an {@link InputStream}
  3. *
  4. * @param stream the {@link InputStream} to read the {@link BpmnModelInstance} from
  5. * @return the model read
  6. * @throws ModelParseException if the model cannot be read
  7. */
  8. public static BpmnModelInstance readModelFromStream(InputStream stream) {
  9. return INSTANCE.doReadModelFromInputStream(stream);
  10. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. /**
  2. * Allows creating an new, empty {@link BpmnModelInstance}.
  3. *
  4. * @return the empty model.
  5. */
  6. public static BpmnModelInstance createEmptyModel() {
  7. return INSTANCE.doCreateEmptyModel();
  8. }

代码示例来源:origin: com.camunda.consulting.util/camunda-util-demo-data-generator

  1. String xmlString = Bpmn.convertToString(bpmn);
  2. tweakedModels.put(processDefinitionKey + ".bpmn", xmlString);
  3. LOG.debug("-----TWEAKED-----\n-----TWEAKED-----\n-----\n" + xmlString + "\n------");

代码示例来源:origin: camunda/camunda-bpm-platform

  1. /**
  2. * Allows reading a {@link BpmnModelInstance} from a File.
  3. *
  4. * @param file the {@link File} to read the {@link BpmnModelInstance} from
  5. * @return the model read
  6. * @throws BpmnModelException if the model cannot be read
  7. */
  8. public static BpmnModelInstance readModelFromFile(File file) {
  9. return INSTANCE.doReadModelFromFile(file);
  10. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. /**
  2. * Register known types of the BPMN model
  3. */
  4. protected Bpmn() {
  5. bpmnModelBuilder = ModelBuilder.createInstance("BPMN Model");
  6. bpmnModelBuilder.alternativeNamespace(ACTIVITI_NS, CAMUNDA_NS);
  7. doRegisterTypes(bpmnModelBuilder);
  8. bpmnModel = bpmnModelBuilder.build();
  9. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. /**
  2. * Allows the conversion of a {@link BpmnModelInstance} to an {@link String}. It will
  3. * be validated before conversion.
  4. *
  5. * @param modelInstance the model instance to convert
  6. * @return the XML string representation of the model instance
  7. */
  8. public static String convertToString(BpmnModelInstance modelInstance) {
  9. return INSTANCE.doConvertToString(modelInstance);
  10. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. protected BpmnModelInstance createModelInstance() {
  2. BpmnModelInstance instance = Bpmn.createExecutableProcess("process")
  3. .startEvent("start")
  4. .userTask("userTask1")
  5. .endEvent("end")
  6. .done();
  7. return instance;
  8. }
  9. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. protected BpmnModelInstance doReadModelFromFile(File file) {
  2. InputStream is = null;
  3. try {
  4. is = new FileInputStream(file);
  5. return doReadModelFromInputStream(is);
  6. } catch (FileNotFoundException e) {
  7. throw new BpmnModelException("Cannot read model from file "+file+": file does not exist.");
  8. } finally {
  9. IoUtil.closeSilently(is);
  10. }
  11. }

代码示例来源:origin: org.camunda.bpm.model/camunda-bpmn-model

  1. /**
  2. * Allows creating an new, empty {@link BpmnModelInstance}.
  3. *
  4. * @return the empty model.
  5. */
  6. public static BpmnModelInstance createEmptyModel() {
  7. return INSTANCE.doCreateEmptyModel();
  8. }

代码示例来源:origin: org.camunda.bpm.model/camunda-bpmn-model

  1. /**
  2. * Allows reading a {@link BpmnModelInstance} from a File.
  3. *
  4. * @param file the {@link File} to read the {@link BpmnModelInstance} from
  5. * @return the model read
  6. * @throws BpmnModelException if the model cannot be read
  7. */
  8. public static BpmnModelInstance readModelFromFile(File file) {
  9. return INSTANCE.doReadModelFromFile(file);
  10. }

代码示例来源:origin: camunda/camunda-bpmn-model

  1. /**
  2. * Register known types of the BPMN model
  3. */
  4. protected Bpmn() {
  5. bpmnModelBuilder = ModelBuilder.createInstance("BPMN Model");
  6. bpmnModelBuilder.alternativeNamespace(ACTIVITI_NS, CAMUNDA_NS);
  7. doRegisterTypes(bpmnModelBuilder);
  8. bpmnModel = bpmnModelBuilder.build();
  9. }

代码示例来源:origin: camunda/camunda-bpmn-model

  1. /**
  2. * Allows the conversion of a {@link BpmnModelInstance} to an {@link String}. It will
  3. * be validated before conversion.
  4. *
  5. * @param modelInstance the model instance to convert
  6. * @return the XML string representation of the model instance
  7. */
  8. public static String convertToString(BpmnModelInstance modelInstance) {
  9. return INSTANCE.doConvertToString(modelInstance);
  10. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. protected BpmnModelInstance createProcess() {
  2. return Bpmn.createExecutableProcess("Process")
  3. .startEvent()
  4. .userTask("user")
  5. .endEvent()
  6. .done();
  7. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. protected static StringAsset createScriptTaskProcess(String scriptFormat, String scriptText) {
  2. BpmnModelInstance modelInstance = Bpmn.createExecutableProcess(PROCESS_ID)
  3. .startEvent()
  4. .scriptTask()
  5. .scriptFormat(scriptFormat)
  6. .scriptText(scriptText)
  7. .userTask()
  8. .endEvent()
  9. .done();
  10. return new StringAsset(Bpmn.convertToString(modelInstance));
  11. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. public static ProcessBuilder createProcess(String processId) {
  2. return createProcess().id(processId);
  3. }

相关文章