use of org.kie.workbench.common.stunner.core.graph.command.impl.SetConnectionTargetNodeCommand in project kie-wb-common by kiegroup.
the class GraphBuilder method addEdge.
private void addEdge(Edge<? extends View<?>, Node> edge, Node source, Connection sourceConnection, Node target, Connection targetConnection) {
SetConnectionSourceNodeCommand setSourceNode = commandFactory.setSourceNode(source, edge, sourceConnection);
SetConnectionTargetNodeCommand setTargetNode = commandFactory.setTargetNode(target, edge, targetConnection);
execute(setSourceNode);
execute(setTargetNode);
}
use of org.kie.workbench.common.stunner.core.graph.command.impl.SetConnectionTargetNodeCommand in project kie-wb-common by kiegroup.
the class AbstractEdgeBuilder method buildTargetConnection.
private void buildTargetConnection(BuilderContext context, T edge, Node node, GraphCommandFactory commandFactory) {
Double[] targetDocker = null;
if (dockers != null && dockers.size() > 1) {
targetDocker = dockers.get(dockers.size() - 1);
}
Connection targetConnection = null;
if (null != targetDocker) {
targetConnection = MagnetConnection.Builder.at(targetDocker[0], targetDocker[1]).setAuto(isTargetAutoConnection());
}
SetConnectionTargetNodeCommand setTargetNodeCommand = commandFactory.setTargetNode(node, edge, targetConnection);
CommandResult<RuleViolation> setTargetResult = context.execute(setTargetNodeCommand);
if (hasErrors(setTargetResult)) {
throw new RuntimeException("Error building BPMN graph. Command 'SetConnectionTargetNodeCommand' execution failed.");
}
}
Aggregations