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();
}
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;
}
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;
}
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");
}
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;
}
Aggregations