use of org.kie.kogito.process.flexible.AdHocFragment in project kogito-runtimes by kiegroup.
the class AdHocFragmentsIT method testAdHocFragments.
@Test
void testAdHocFragments() throws Exception {
Application app = generateCodeProcessesOnly("cases/AdHocFragments.bpmn");
assertThat(app).isNotNull();
Process<? extends Model> p = app.get(Processes.class).processById("TestCase.AdHocFragments");
ProcessInstance<?> processInstance = p.createInstance(p.createModel());
Collection<AdHocFragment> adHocFragments = processInstance.adHocFragments();
List<AdHocFragment> expected = new ArrayList<>();
expected.add(new AdHocFragment.Builder(MilestoneNode.class).withName("AdHoc Milestone").withAutoStart(true).build());
expected.add(new AdHocFragment.Builder(ActionNode.class).withName("AdHoc Script").withAutoStart(false).build());
expected.add(new AdHocFragment.Builder(HumanTaskNode.class).withName("AdHoc User Task").withAutoStart(false).build());
expected.add(new AdHocFragment.Builder(WorkItemNode.class).withName("Service Task").withAutoStart(false).build());
assertAdHocFragments(expected, adHocFragments);
}
Aggregations