Ulisses Telemaco edited processhub_BPMN_Manipulation2.md  over 8 years ago

Commit id: 67c733607b7f930529b274909b760a5f9493fdb9

deletions | additions      

       

## Camunda BPMN Model API  The Camunda BPMN model API is a Java library for parsing, creating and editing BPMN 2.0 XML files. This framework was the base for the API proposed at this work. It was chosen because it offers several features to BPMN manipulation that include:  * Fluent **Fluent  builder API: API**:  an API to build BPMN models BpmnModelInstance modelInstance = Bpmn.createExecutableProcess("processId") 

.endEvent()  .done();    * Validation: **Validation**:  a feature to validate a BPMN model against the BPMN 2.0 specification. BpmnModelInstance modelInstance = [...]  Bpmn.validateModel(modelInstance);  * Find **Find  elements inside the model model**  ModelElementInstance elementInstance = modelInstance.getModelElementById("start"); 

Collection elementInstances = modelInstance.getModelElementsByType(taskType);  //find all elements of the type task  **Save the BPMN model**  // create BPMN model  BpmnModelInstance modelInstance = [...]  // convert to string  String xmlString = Bpmn.convertToString(modelInstance);  // write to output stream  OutputStream outputStream = new OutputStream(...);  Bpmn.writeModelToStream(outputStream, modelInstance);  // write to file  File file = new File(...);  Bpmn.writeModelToFile(file, modelInstance);  ## Main Classes  ## Test Cases