use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.AssociationPropertyWriter in project kie-wb-common by kiegroup.
the class AssociationPropertyWriterTest method setUp.
@Before
public void setUp() {
when(sourceWriter.getElement()).thenReturn(sourceElement);
when(targetWriter.getElement()).thenReturn(targetElement);
associationWriter = new AssociationPropertyWriter(association, variableScope);
}
use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.AssociationPropertyWriter in project kie-wb-common by kiegroup.
the class AssociationConverter method toFlowElement.
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 = String.format("BasePropertyWriter was not found for source node or target node at edge: %s, pSrc = %s, pTgt = %s", edge.getUUID(), pSrc, pTgt);
LOG.debug(msg);
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);
}
Aggregations