Java Code Examples for org.camunda.bpm.model.bpmn.instance.Process#addChildElement()

The following examples show how to use org.camunda.bpm.model.bpmn.instance.Process#addChildElement() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CreateModelTest.java    From camunda-bpmn-model with Apache License 2.0 5 votes vote down vote up
public SequenceFlow createSequenceFlow(Process process, FlowNode from, FlowNode to) {
  SequenceFlow sequenceFlow = createElement(process, from.getId() + "-" + to.getId(), SequenceFlow.class);
  process.addChildElement(sequenceFlow);
  sequenceFlow.setSource(from);
  from.getOutgoing().add(sequenceFlow);
  sequenceFlow.setTarget(to);
  to.getIncoming().add(sequenceFlow);
  return sequenceFlow;
}
 
Example 2
Source File: CreateModelTest.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
public SequenceFlow createSequenceFlow(Process process, FlowNode from, FlowNode to) {
  SequenceFlow sequenceFlow = createElement(process, from.getId() + "-" + to.getId(), SequenceFlow.class);
  process.addChildElement(sequenceFlow);
  sequenceFlow.setSource(from);
  from.getOutgoing().add(sequenceFlow);
  sequenceFlow.setTarget(to);
  to.getIncoming().add(sequenceFlow);
  return sequenceFlow;
}
 
Example 3
Source File: ModifiableBpmnModelInstance.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
public ModifiableBpmnModelInstance addDocumentation(String content) {
  Collection<Process> processes = modelInstance.getModelElementsByType(Process.class);
  Documentation documentation = modelInstance.newInstance(Documentation.class);
  documentation.setTextContent(content);
  for (Process process : processes) {
    process.addChildElement(documentation);
  }
  return this;
}