use of com.liferay.ide.kaleo.core.op.NewJoinXorNodeOp in project liferay-ide by liferay.
the class JoinXorNodeAddActionHandler method postDiagramNodePartAdded.
@Override
public void postDiagramNodePartAdded(NewNodeOp op, CanTransition newNodeFromWizard, CanTransition newNode) {
NewJoinXorNodeOp newJoinXorNodeOp = op.nearest(NewJoinXorNodeOp.class);
JoinXor newJoinXor = newNode.nearest(JoinXor.class);
WorkflowDefinition workflowDefinition = newJoinXor.nearest(WorkflowDefinition.class);
for (Node nodeName : newJoinXorNodeOp.getConnectedNodes()) {
for (WorkflowNode diagramNode : workflowDefinition.getDiagramNodes()) {
if (nodeName.getName().content() != null) {
String name = nodeName.getName().content();
if (name.equals(diagramNode.getName().content())) {
CanTransition canTransition = diagramNode.nearest(CanTransition.class);
Transition newTransition = canTransition.getTransitions().insert();
newTransition.setName(newJoinXor.getName().content());
newTransition.setTarget(newJoinXor.getName().content());
}
}
}
}
if (newJoinXorNodeOp.getExitTransitionName().content() != null) {
Transition newTransition = newJoinXor.getTransitions().insert();
newTransition.setTarget(newJoinXorNodeOp.getExitTransitionName().content());
newTransition.setName(newJoinXorNodeOp.getExitTransitionName().content());
}
}
Aggregations