Search in sources :

Example 1 with BpmnEdge

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

the class BpmnEdgeImpl method registerType.

public static void registerType(ModelBuilder modelBuilder) {
    ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(BpmnEdge.class, BPMNDI_ELEMENT_BPMN_EDGE).namespaceUri(BPMNDI_NS).extendsType(LabeledEdge.class).instanceProvider(new ModelTypeInstanceProvider<BpmnEdge>() {

        public BpmnEdge newInstance(ModelTypeInstanceContext instanceContext) {
            return new BpmnEdgeImpl(instanceContext);
        }
    });
    bpmnElementAttribute = typeBuilder.stringAttribute(BPMNDI_ATTRIBUTE_BPMN_ELEMENT).qNameAttributeReference(BaseElement.class).build();
    sourceElementAttribute = typeBuilder.stringAttribute(BPMNDI_ATTRIBUTE_SOURCE_ELEMENT).qNameAttributeReference(DiagramElement.class).build();
    targetElementAttribute = typeBuilder.stringAttribute(BPMNDI_ATTRIBUTE_TARGET_ELEMENT).qNameAttributeReference(DiagramElement.class).build();
    messageVisibleKindAttribute = typeBuilder.enumAttribute(BPMNDI_ATTRIBUTE_MESSAGE_VISIBLE_KIND, MessageVisibleKind.class).build();
    SequenceBuilder sequenceBuilder = typeBuilder.sequence();
    bpmnLabelChild = sequenceBuilder.element(BpmnLabel.class).build();
    typeBuilder.build();
}
Also used : SequenceBuilder(org.camunda.bpm.model.xml.type.child.SequenceBuilder) ModelElementTypeBuilder(org.camunda.bpm.model.xml.type.ModelElementTypeBuilder) BpmnEdge(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge) ModelTypeInstanceContext(org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext) LabeledEdge(org.camunda.bpm.model.bpmn.instance.di.LabeledEdge)

Example 2 with BpmnEdge

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

the class AbstractBaseElementBuilder method findBpmnEdge.

protected BpmnEdge findBpmnEdge(BaseElement sequenceFlow) {
    Collection<BpmnEdge> allEdges = modelInstance.getModelElementsByType(BpmnEdge.class);
    Iterator<BpmnEdge> iterator = allEdges.iterator();
    while (iterator.hasNext()) {
        BpmnEdge edge = iterator.next();
        if (edge.getBpmnElement().equals(sequenceFlow)) {
            return edge;
        }
    }
    return null;
}
Also used : BpmnEdge(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge)

Example 3 with BpmnEdge

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

the class DiGeneratorForSequenceFlowsTest method findBpmnEdge.

protected BpmnEdge findBpmnEdge(String sequenceFlowId) {
    Collection<BpmnEdge> allEdges = instance.getModelElementsByType(BpmnEdge.class);
    Iterator<BpmnEdge> iterator = allEdges.iterator();
    while (iterator.hasNext()) {
        BpmnEdge edge = iterator.next();
        if (edge.getBpmnElement().getId().equals(sequenceFlowId)) {
            return edge;
        }
    }
    return null;
}
Also used : BpmnEdge(org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnEdge)

Example 4 with BpmnEdge

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

the class DiGeneratorForSequenceFlowsTest method shouldGenerateEdgesWhenUsingMoveToNode.

@Test
public void shouldGenerateEdgesWhenUsingMoveToNode() {
    ProcessBuilder builder = Bpmn.createExecutableProcess();
    instance = builder.startEvent(START_EVENT_ID).sequenceFlowId("s1").exclusiveGateway().sequenceFlowId("s2").userTask(USER_TASK_ID).sequenceFlowId("s3").endEvent("e1").moveToNode(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 5 with BpmnEdge

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

the class CoordinatesGenerationTest method findBpmnEdge.

protected BpmnEdge findBpmnEdge(String sequenceFlowId) {
    Collection<BpmnEdge> allEdges = instance.getModelElementsByType(BpmnEdge.class);
    Iterator<BpmnEdge> iterator = allEdges.iterator();
    while (iterator.hasNext()) {
        BpmnEdge edge = iterator.next();
        if (edge.getBpmnElement().getId().equals(sequenceFlowId)) {
            return edge;
        }
    }
    return null;
}
Also used : 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