Search in sources :

Example 1 with AdHocFragment

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);
}
Also used : ArrayList(java.util.ArrayList) Processes(org.kie.kogito.process.Processes) Application(org.kie.kogito.Application) AdHocFragment(org.kie.kogito.process.flexible.AdHocFragment) Test(org.junit.jupiter.api.Test)

Aggregations

ArrayList (java.util.ArrayList)1 Test (org.junit.jupiter.api.Test)1 Application (org.kie.kogito.Application)1 Processes (org.kie.kogito.process.Processes)1 AdHocFragment (org.kie.kogito.process.flexible.AdHocFragment)1