Search in sources :

Example 1 with AdHocFragment

use of io.automatiko.engine.api.workflow.flexible.AdHocFragment in project automatiko-engine by automatiko-io.

the class AdHocFragmentsTest method testAdHocFragments.

@Test
void testAdHocFragments() throws Exception {
    Application app = generateCodeProcessesOnly("cases/AdHocFragments.bpmn");
    assertThat(app).isNotNull();
    Process<? extends Model> p = app.processes().processById("TestCase.AdHocFragments_1_0");
    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) Application(io.automatiko.engine.api.Application) AdHocFragment(io.automatiko.engine.api.workflow.flexible.AdHocFragment) AbstractCodegenTest(io.automatiko.engine.codegen.AbstractCodegenTest) Test(org.junit.jupiter.api.Test)

Aggregations

Application (io.automatiko.engine.api.Application)1 AdHocFragment (io.automatiko.engine.api.workflow.flexible.AdHocFragment)1 AbstractCodegenTest (io.automatiko.engine.codegen.AbstractCodegenTest)1 ArrayList (java.util.ArrayList)1 Test (org.junit.jupiter.api.Test)1