@Test
public void testMultiInstanceBasics() throws Exception {
ExecutableWorkflow workflow = new ExecutableWorkflow()
.variable("reviewers", new ListType(TextType.INSTANCE))
.activity("Review", msgExpression("reviewer")
.multiInstance(new MultiInstance()
.valuesExpression("reviewers")
.variable("reviewer", TextType.INSTANCE)));
deploy(workflow);
WorkflowInstance workflowInstance = workflowEngine.start(new TriggerInstance()
.workflowId(workflow.getId())
.data("reviewers", Lists.of(
"jack",
"john",
"mary")));
assertTrue(workflowInstance.isEnded());
assertEquals("jack", getMessage(0));
assertEquals("john", getMessage(1));
assertEquals("mary", getMessage(2));
}
}