use of io.automatiko.engine.api.definition.process.Node in project automatiko-engine by automatiko-io.
the class XmlBPMNProcessDumper method visitConnections.
private void visitConnections(Node[] nodes, StringBuilder xmlDump, int metaDataType) {
xmlDump.append(" <!-- connections -->" + EOL);
List<Connection> connections = new ArrayList<Connection>();
for (Node node : nodes) {
for (List<Connection> connectionList : node.getIncomingConnections().values()) {
connections.addAll(connectionList);
}
}
for (Connection connection : connections) {
visitConnection(connection, xmlDump, metaDataType);
}
xmlDump.append(EOL);
}
use of io.automatiko.engine.api.definition.process.Node in project automatiko-engine by automatiko-io.
the class BPMNPlaneHandler method processConnectionInfo.
private boolean processConnectionInfo(ConnectionInfo connectionInfo, Node[] nodes) {
for (Node node : nodes) {
for (List<Connection> connections : node.getOutgoingConnections().values()) {
for (Connection connection : connections) {
String id = (String) connection.getMetaData().get("UniqueId");
if (id != null && id.equals(connectionInfo.getElementRef())) {
((ConnectionImpl) connection).setMetaData("bendpoints", connectionInfo.getBendpoints());
((ConnectionImpl) connection).setMetaData("x", connectionInfo.getXs());
((ConnectionImpl) connection).setMetaData("y", connectionInfo.getYs());
return true;
}
}
}
if (node instanceof NodeContainer) {
boolean found = processConnectionInfo(connectionInfo, ((NodeContainer) node).getNodes());
if (found) {
return true;
}
}
}
return false;
}
use of io.automatiko.engine.api.definition.process.Node in project automatiko-engine by automatiko-io.
the class JbpmBpmn2TestCase method assertNumOfIncommingConnections.
public void assertNumOfIncommingConnections(ProcessInstance process, String nodeName, int num) {
assertNodeExists(process, nodeName);
WorkflowProcessInstanceImpl instance = (WorkflowProcessInstanceImpl) process;
for (Node node : instance.getNodeContainer().getNodes()) {
if (node.getName().equals(nodeName)) {
if (node.getIncomingConnections().size() != num) {
fail("Expected incomming connections: " + num + " - found " + node.getIncomingConnections().size());
} else {
break;
}
}
}
}
use of io.automatiko.engine.api.definition.process.Node in project automatiko-engine by automatiko-io.
the class JbpmBpmn2TestCase method assertNodeExists.
public void assertNodeExists(ProcessInstance process, String... nodeNames) {
WorkflowProcessInstanceImpl instance = (WorkflowProcessInstanceImpl) process;
List<String> names = new ArrayList<String>();
for (String nodeName : nodeNames) {
names.add(nodeName);
}
for (Node node : instance.getNodeContainer().getNodes()) {
if (names.contains(node.getName())) {
names.remove(node.getName());
}
}
if (!names.isEmpty()) {
String s = names.get(0);
for (int i = 1; i < names.size(); i++) {
s += ", " + names.get(i);
}
fail("Node(s) do not exist: " + s);
}
}
use of io.automatiko.engine.api.definition.process.Node in project automatiko-engine by automatiko-io.
the class WorkItemNodeInstance method getNodeName.
@Override
public String getNodeName() {
Node node = getNode();
if (node == null) {
String nodeName = "[Dynamic]";
WorkItem item = getWorkItem();
if (item != null) {
nodeName += " " + item.getParameter("TaskName");
}
return nodeName;
}
return super.getNodeName();
}
Aggregations