Search in sources :

Example 26 with Node

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);
}
Also used : ActionNode(io.automatiko.engine.workflow.process.core.node.ActionNode) FaultNode(io.automatiko.engine.workflow.process.core.node.FaultNode) WorkItemNode(io.automatiko.engine.workflow.process.core.node.WorkItemNode) CompositeNode(io.automatiko.engine.workflow.process.core.node.CompositeNode) Node(io.automatiko.engine.api.definition.process.Node) HumanTaskNode(io.automatiko.engine.workflow.process.core.node.HumanTaskNode) ForEachNode(io.automatiko.engine.workflow.process.core.node.ForEachNode) StartNode(io.automatiko.engine.workflow.process.core.node.StartNode) EndNode(io.automatiko.engine.workflow.process.core.node.EndNode) EventNode(io.automatiko.engine.workflow.process.core.node.EventNode) Connection(io.automatiko.engine.api.definition.process.Connection) ArrayList(java.util.ArrayList)

Example 27 with Node

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;
}
Also used : ForEachNode(io.automatiko.engine.workflow.process.core.node.ForEachNode) Node(io.automatiko.engine.api.definition.process.Node) Connection(io.automatiko.engine.api.definition.process.Connection) ConnectionImpl(io.automatiko.engine.workflow.process.core.impl.ConnectionImpl) NodeContainer(io.automatiko.engine.api.definition.process.NodeContainer)

Example 28 with Node

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;
            }
        }
    }
}
Also used : Node(io.automatiko.engine.api.definition.process.Node) WorkflowProcessInstanceImpl(io.automatiko.engine.workflow.process.instance.impl.WorkflowProcessInstanceImpl)

Example 29 with Node

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);
    }
}
Also used : Node(io.automatiko.engine.api.definition.process.Node) WorkflowProcessInstanceImpl(io.automatiko.engine.workflow.process.instance.impl.WorkflowProcessInstanceImpl) ArrayList(java.util.ArrayList)

Example 30 with Node

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();
}
Also used : WorkItemNode(io.automatiko.engine.workflow.process.core.node.WorkItemNode) Node(io.automatiko.engine.api.definition.process.Node) HumanTaskWorkItem(io.automatiko.engine.api.runtime.process.HumanTaskWorkItem) WorkItem(io.automatiko.engine.api.runtime.process.WorkItem)

Aggregations

Node (io.automatiko.engine.api.definition.process.Node)67 StartNode (io.automatiko.engine.workflow.process.core.node.StartNode)37 EndNode (io.automatiko.engine.workflow.process.core.node.EndNode)33 EventNode (io.automatiko.engine.workflow.process.core.node.EventNode)33 ActionNode (io.automatiko.engine.workflow.process.core.node.ActionNode)32 CompositeNode (io.automatiko.engine.workflow.process.core.node.CompositeNode)28 WorkItemNode (io.automatiko.engine.workflow.process.core.node.WorkItemNode)28 ArrayList (java.util.ArrayList)26 EventSubProcessNode (io.automatiko.engine.workflow.process.core.node.EventSubProcessNode)24 FaultNode (io.automatiko.engine.workflow.process.core.node.FaultNode)24 BoundaryEventNode (io.automatiko.engine.workflow.process.core.node.BoundaryEventNode)23 HumanTaskNode (io.automatiko.engine.workflow.process.core.node.HumanTaskNode)20 SubProcessNode (io.automatiko.engine.workflow.process.core.node.SubProcessNode)19 StateBasedNode (io.automatiko.engine.workflow.process.core.node.StateBasedNode)17 ForEachNode (io.automatiko.engine.workflow.process.core.node.ForEachNode)16 StateNode (io.automatiko.engine.workflow.process.core.node.StateNode)16 NodeContainer (io.automatiko.engine.api.definition.process.NodeContainer)14 RuleSetNode (io.automatiko.engine.workflow.process.core.node.RuleSetNode)14 List (java.util.List)14 ConnectionImpl (io.automatiko.engine.workflow.process.core.impl.ConnectionImpl)13