本文整理了Java中org.camunda.bpm.model.bpmn.Bpmn
类的一些代码示例,展示了Bpmn
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bpmn
类的具体详情如下:
包路径:org.camunda.bpm.model.bpmn.Bpmn
类名称:Bpmn
[英]Provides access to the camunda BPMN model api.
[中]提供对camunda BPMN模型api的访问。
代码示例来源:origin: camunda/camunda-bpm-platform
@Deployment
public static WebArchive createProcessApplication() {
return initWebArchiveDeployment()
.addAsResource(new StringAsset(Bpmn.convertToString(Bpmn.createExecutableProcess(TEST_PROCESS).done())), "testProcess.bpmn20.xml");
}
代码示例来源:origin: camunda/camunda-bpm-platform
public static ProcessBuilder createExecutableProcess(String processId) {
return createProcess(processId).executable();
}
代码示例来源:origin: camunda/camunda-bpm-platform
public DeploymentBuilder addModelInstance(String resourceName, BpmnModelInstance modelInstance) {
ensureNotNull("modelInstance", modelInstance);
validateResouceName(resourceName, BpmnDeployer.BPMN_RESOURCE_SUFFIXES);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
Bpmn.writeModelToStream(outputStream, modelInstance);
return addBytes(resourceName, outputStream.toByteArray());
}
代码示例来源:origin: camunda/camunda-bpm-platform
private InputStream createMockDeploymentResourceBpmnDataNonExecutableProcess() {
// do not close the input stream, will be done in implementation
String model = Bpmn.convertToString(Bpmn.createProcess().startEvent().endEvent().done());
InputStream inputStream = new ByteArrayInputStream(model.getBytes());
return inputStream;
}
代码示例来源:origin: camunda/camunda-bpm-platform
private BpmnModelInstance prepareSimpleProcess(String name) {
BpmnModelInstance calledA = Bpmn.createExecutableProcess(name)
.startEvent()
.userTask("Task" + name)
.endEvent()
.done();
return calledA;
}
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Allows reading a {@link BpmnModelInstance} from an {@link InputStream}
*
* @param stream the {@link InputStream} to read the {@link BpmnModelInstance} from
* @return the model read
* @throws ModelParseException if the model cannot be read
*/
public static BpmnModelInstance readModelFromStream(InputStream stream) {
return INSTANCE.doReadModelFromInputStream(stream);
}
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Allows creating an new, empty {@link BpmnModelInstance}.
*
* @return the empty model.
*/
public static BpmnModelInstance createEmptyModel() {
return INSTANCE.doCreateEmptyModel();
}
代码示例来源:origin: com.camunda.consulting.util/camunda-util-demo-data-generator
String xmlString = Bpmn.convertToString(bpmn);
tweakedModels.put(processDefinitionKey + ".bpmn", xmlString);
LOG.debug("-----TWEAKED-----\n-----TWEAKED-----\n-----\n" + xmlString + "\n------");
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Allows reading a {@link BpmnModelInstance} from a File.
*
* @param file the {@link File} to read the {@link BpmnModelInstance} from
* @return the model read
* @throws BpmnModelException if the model cannot be read
*/
public static BpmnModelInstance readModelFromFile(File file) {
return INSTANCE.doReadModelFromFile(file);
}
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Register known types of the BPMN model
*/
protected Bpmn() {
bpmnModelBuilder = ModelBuilder.createInstance("BPMN Model");
bpmnModelBuilder.alternativeNamespace(ACTIVITI_NS, CAMUNDA_NS);
doRegisterTypes(bpmnModelBuilder);
bpmnModel = bpmnModelBuilder.build();
}
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Allows the conversion of a {@link BpmnModelInstance} to an {@link String}. It will
* be validated before conversion.
*
* @param modelInstance the model instance to convert
* @return the XML string representation of the model instance
*/
public static String convertToString(BpmnModelInstance modelInstance) {
return INSTANCE.doConvertToString(modelInstance);
}
代码示例来源:origin: camunda/camunda-bpm-platform
protected BpmnModelInstance createModelInstance() {
BpmnModelInstance instance = Bpmn.createExecutableProcess("process")
.startEvent("start")
.userTask("userTask1")
.endEvent("end")
.done();
return instance;
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
protected BpmnModelInstance doReadModelFromFile(File file) {
InputStream is = null;
try {
is = new FileInputStream(file);
return doReadModelFromInputStream(is);
} catch (FileNotFoundException e) {
throw new BpmnModelException("Cannot read model from file "+file+": file does not exist.");
} finally {
IoUtil.closeSilently(is);
}
}
代码示例来源:origin: org.camunda.bpm.model/camunda-bpmn-model
/**
* Allows creating an new, empty {@link BpmnModelInstance}.
*
* @return the empty model.
*/
public static BpmnModelInstance createEmptyModel() {
return INSTANCE.doCreateEmptyModel();
}
代码示例来源:origin: org.camunda.bpm.model/camunda-bpmn-model
/**
* Allows reading a {@link BpmnModelInstance} from a File.
*
* @param file the {@link File} to read the {@link BpmnModelInstance} from
* @return the model read
* @throws BpmnModelException if the model cannot be read
*/
public static BpmnModelInstance readModelFromFile(File file) {
return INSTANCE.doReadModelFromFile(file);
}
代码示例来源:origin: camunda/camunda-bpmn-model
/**
* Register known types of the BPMN model
*/
protected Bpmn() {
bpmnModelBuilder = ModelBuilder.createInstance("BPMN Model");
bpmnModelBuilder.alternativeNamespace(ACTIVITI_NS, CAMUNDA_NS);
doRegisterTypes(bpmnModelBuilder);
bpmnModel = bpmnModelBuilder.build();
}
代码示例来源:origin: camunda/camunda-bpmn-model
/**
* Allows the conversion of a {@link BpmnModelInstance} to an {@link String}. It will
* be validated before conversion.
*
* @param modelInstance the model instance to convert
* @return the XML string representation of the model instance
*/
public static String convertToString(BpmnModelInstance modelInstance) {
return INSTANCE.doConvertToString(modelInstance);
}
代码示例来源:origin: camunda/camunda-bpm-platform
protected BpmnModelInstance createProcess() {
return Bpmn.createExecutableProcess("Process")
.startEvent()
.userTask("user")
.endEvent()
.done();
}
代码示例来源:origin: camunda/camunda-bpm-platform
protected static StringAsset createScriptTaskProcess(String scriptFormat, String scriptText) {
BpmnModelInstance modelInstance = Bpmn.createExecutableProcess(PROCESS_ID)
.startEvent()
.scriptTask()
.scriptFormat(scriptFormat)
.scriptText(scriptText)
.userTask()
.endEvent()
.done();
return new StringAsset(Bpmn.convertToString(modelInstance));
}
代码示例来源:origin: camunda/camunda-bpm-platform
public static ProcessBuilder createProcess(String processId) {
return createProcess().id(processId);
}
内容来源于网络,如有侵权,请联系作者删除!