@Test public void testToFlowElementWithSourceMissingFailure() { when(process.getChildElement(SOURCE_NODE_ID)).thenReturn(null); Result<BasePropertyWriter> result = converter.toFlowElement(edge, process); verifyFailure(String.format(ERROR_PATTERN, EDGE_ID, null, pTgt), result); }
public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = "BasePropertyWriter was not found for source node or target node at edge: " + edge.getUUID() + ", pSrc = " + pSrc + ", pTgt = " + pTgt; return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); }
AssociationConverter { public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = "BasePropertyWriter was not found for source node or target node at edge: " + edge.getUUID() + ", pSrc = " + pSrc + ", pTgt = " + pTgt; return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); } }
AssociationConverter { public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = "BasePropertyWriter was not found for source node or target node at edge: " + edge.getUUID() + ", pSrc = " + pSrc + ", pTgt = " + pTgt; return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); } AssociationConverter(PropertyWriterFactory propertyWriterFactory); }
AssociationConverter { public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = "BasePropertyWriter was not found for source node or target node at edge: " + edge.getUUID() + ", pSrc = " + pSrc + ", pTgt = " + pTgt; return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); } AssociationConverter(PropertyWriterFactory propertyWriterFactory); Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process); }
AssociationConverter { public Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process) { ViewConnector<Association> connector = (ViewConnector<Association>) edge.getContent(); Association definition = connector.getDefinition(); org.eclipse.bpmn2.Association association = bpmn2.createAssociation(); AssociationPropertyWriter p = propertyWriterFactory.of(association); association.setId(edge.getUUID()); BasePropertyWriter pSrc = process.getChildElement(edge.getSourceNode().getUUID()); BasePropertyWriter pTgt = process.getChildElement(edge.getTargetNode().getUUID()); if (pSrc == null || pTgt == null) { String msg = "BasePropertyWriter was not found for source node or target node at edge: " + edge.getUUID() + ", pSrc = " + pSrc + ", pTgt = " + pTgt; return Result.failure(msg); } p.setSource(pSrc); p.setTarget(pTgt); p.setConnection(connector); BPMNGeneralSet general = definition.getGeneral(); p.setDocumentation(general.getDocumentation().getValue()); p.setDirectionAssociation(definition); return Result.of(p); } AssociationConverter(PropertyWriterFactory propertyWriterFactory); Result<BasePropertyWriter> toFlowElement(Edge<?, ?> edge, ElementContainer process);  }