use of io.automatiko.engine.workflow.process.test.TestProcessEventListener in project automatiko-engine by automatiko-io.
the class NodeInnerClassesTest method testNodeReading.
@Test
public void testNodeReading() {
ExecutableProcess process = new ExecutableProcess();
process.setId("org.company.core.process.event");
process.setName("Event Process");
List<Variable> variables = new ArrayList<Variable>();
Variable variable = new Variable();
variable.setName("event");
ObjectDataType personDataType = new ObjectDataType(Person.class);
variable.setType(personDataType);
variables.add(variable);
process.getVariableScope().setVariables(variables);
process.setDynamic(true);
CompositeNode compositeNode = new CompositeNode();
compositeNode.setName("CompositeNode");
compositeNode.setId(2);
ForEachNode forEachNode = new ForEachNode();
ForEachNode.ForEachSplitNode split = new ForEachNode.ForEachSplitNode();
split.setName("ForEachSplit");
split.setMetaData("hidden", true);
split.setMetaData("UniqueId", forEachNode.getMetaData("Uniqueid") + ":foreach:split");
forEachNode.internalAddNode(split);
forEachNode.linkIncomingConnections(io.automatiko.engine.workflow.process.core.Node.CONNECTION_DEFAULT_TYPE, new CompositeNode.NodeAndType(split, io.automatiko.engine.workflow.process.core.Node.CONNECTION_DEFAULT_TYPE));
process.addNode(forEachNode);
InternalProcessRuntime ksession = createProcessRuntime(process);
TestProcessEventListener procEventListener = new TestProcessEventListener();
ksession.addEventListener(procEventListener);
ProcessInstance processInstance = ksession.startProcess("org.company.core.process.event");
assertNotNull(processInstance);
}
Aggregations