Search in sources :

Example 6 with BpmnEdge

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

the class ModifiableBpmnModelInstance method removeBpmnEdge.

protected void removeBpmnEdge(BaseElement element) {
    Collection<BpmnEdge> edges = modelInstance.getModelElementsByType(BpmnEdge.class);
    for (BpmnEdge edge : edges) {
        if (edge.getBpmnElement().equals(element)) {
            ModelElementInstance bpmnPlane = edge.getParentElement();
            bpmnPlane.removeChildElement(edge);
            break;
        }
    }
}
Also used : ModelElementInstance(org.camunda.bpm.model.xml.instance.ModelElementInstance) BpmnEdge(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge)

Example 7 with BpmnEdge

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

the class DiGeneratorForSequenceFlowsTest method assertBpmnEdgeExists.

protected void assertBpmnEdgeExists(String id) {
    BpmnEdge edge = findBpmnEdge(id);
    assertNotNull(edge);
}
Also used : BpmnEdge(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge)

Example 8 with BpmnEdge

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

the class DiGeneratorForSequenceFlowsTest method shouldGenerateEdgesWhenUsingConnectTo.

@Test
public void shouldGenerateEdgesWhenUsingConnectTo() {
    ProcessBuilder builder = Bpmn.createExecutableProcess();
    instance = builder.startEvent(START_EVENT_ID).sequenceFlowId("s1").exclusiveGateway("gateway").sequenceFlowId("s2").userTask(USER_TASK_ID).sequenceFlowId("s3").endEvent(END_EVENT_ID).moveToNode(USER_TASK_ID).sequenceFlowId("s4").connectTo("gateway").done();
    Collection<BpmnEdge> allEdges = instance.getModelElementsByType(BpmnEdge.class);
    assertEquals(4, allEdges.size());
    assertBpmnEdgeExists("s1");
    assertBpmnEdgeExists("s2");
    assertBpmnEdgeExists("s3");
    assertBpmnEdgeExists("s4");
}
Also used : ProcessBuilder(org.camunda.bpm.model.bpmn.builder.ProcessBuilder) BpmnEdge(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge) Test(org.junit.Test)

Example 9 with BpmnEdge

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

the class DiGeneratorForSequenceFlowsTest method shouldGenerateEdgesWhenUsingMoveToActivity.

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

Example 10 with BpmnEdge

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

the class DiGeneratorForSequenceFlowsTest method shouldGenerateEdgeForSequenceFlow.

@Test
public void shouldGenerateEdgeForSequenceFlow() {
    ProcessBuilder builder = Bpmn.createExecutableProcess();
    instance = builder.startEvent(START_EVENT_ID).sequenceFlowId(SEQUENCE_FLOW_ID).endEvent(END_EVENT_ID).done();
    Collection<BpmnEdge> allEdges = instance.getModelElementsByType(BpmnEdge.class);
    assertEquals(1, allEdges.size());
    assertBpmnEdgeExists(SEQUENCE_FLOW_ID);
}
Also used : ProcessBuilder(org.camunda.bpm.model.bpmn.builder.ProcessBuilder) BpmnEdge(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge) Test(org.junit.Test)

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