Search in sources :

Example 11 with BpmnEdge

use of org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge in project camunda-bpmn-model by camunda.

the class DiGeneratorForSequenceFlowsTest method shouldGenerateEdgesForSequenceFlowsUsingGateway.

@Test
public void shouldGenerateEdgesForSequenceFlowsUsingGateway() {
    ProcessBuilder builder = Bpmn.createExecutableProcess();
    instance = builder.startEvent(START_EVENT_ID).sequenceFlowId("s1").parallelGateway("gateway").sequenceFlowId("s2").endEvent("e1").moveToLastGateway().sequenceFlowId("s3").endEvent("e2").done();
    Collection<BpmnEdge> allEdges = instance.getModelElementsByType(BpmnEdge.class);
    assertEquals(3, allEdges.size());
    assertBpmnEdgeExists("s1");
    assertBpmnEdgeExists("s2");
    assertBpmnEdgeExists("s3");
}
Also used : ProcessBuilder(org.camunda.bpm.model.bpmn.builder.ProcessBuilder) BpmnEdge(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge) Test(org.junit.Test)

Example 12 with BpmnEdge

use of org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge in project camunda-bpmn-model by camunda.

the class AbstractBaseElementBuilder method createEdge.

public BpmnEdge createEdge(BaseElement baseElement) {
    BpmnPlane bpmnPlane = findBpmnPlane();
    if (bpmnPlane != null) {
        BpmnEdge edge = createInstance(BpmnEdge.class);
        edge.setBpmnElement(baseElement);
        setWaypoints(edge);
        bpmnPlane.addChildElement(edge);
        return edge;
    }
    return null;
}
Also used : BpmnPlane(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnPlane) BpmnEdge(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge)

Aggregations

BpmnEdge (org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge)12 ProcessBuilder (org.camunda.bpm.model.bpmn.builder.ProcessBuilder)5 Test (org.junit.Test)5 BpmnPlane (org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnPlane)1 LabeledEdge (org.camunda.bpm.model.bpmn.instance.di.LabeledEdge)1 ModelTypeInstanceContext (org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)1 ModelElementInstance (org.camunda.bpm.model.xml.instance.ModelElementInstance)1 ModelElementTypeBuilder (org.camunda.bpm.model.xml.type.ModelElementTypeBuilder)1 SequenceBuilder (org.camunda.bpm.model.xml.type.child.SequenceBuilder)1