diff --git a/jbpm/jbpm-tests/src/test/resources/BPMN2-RuleTask.bpmn2 b/jbpm/jbpm-tests/src/test/bpmn/com/sample/BPMN2-RuleTask.bpmn2 similarity index 100% rename from jbpm/jbpm-tests/src/test/resources/BPMN2-RuleTask.bpmn2 rename to jbpm/jbpm-tests/src/test/bpmn/com/sample/BPMN2-RuleTask.bpmn2 diff --git a/jbpm/jbpm-tests/src/test/resources/BPMN2-RuleTask.drl b/jbpm/jbpm-tests/src/test/bpmn/com/sample/BPMN2-RuleTask.drl similarity index 100% rename from jbpm/jbpm-tests/src/test/resources/BPMN2-RuleTask.drl rename to jbpm/jbpm-tests/src/test/bpmn/com/sample/BPMN2-RuleTask.drl diff --git a/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ActivityTest.java b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ActivityTest.java index 2578981db0b..181be575eeb 100755 --- a/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ActivityTest.java +++ b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ActivityTest.java @@ -171,6 +171,9 @@ import org.kie.kogito.process.ProcessInstance; import org.kie.kogito.process.workitems.InternalKogitoWorkItem; +import com.sample.RuleTaskModel; +import com.sample.RuleTaskProcess; + import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.fail; @@ -321,16 +324,20 @@ public void testScriptTaskWithIO() { } @Test - public void testRuleTask() throws Exception { - kruntime = createKogitoProcessRuntime("BPMN2-RuleTask.bpmn2", - "BPMN2-RuleTask.drl"); - + public void testRuleTask() { + /* + Getting compilation error for this test case + com/sample/RuleTaskProcess.java:[85,94] package org.drools.project.model.ProjectRuntime does not exist + */ + Application application = ProcessTestHelper.newApplication(); + org.kie.kogito.process.Process process = RuleTaskProcess.newProcess(application); + RuleTaskModel model = process.createModel(); + ProcessInstance instance = process.createInstance(model); List list = new ArrayList<>(); - kruntime.getKieSession().setGlobal("list", list); - KogitoProcessInstance processInstance = kruntime.startProcess("RuleTask"); - kruntime.getKieSession().setGlobal("list", list); + instance.start(Map.of("list", list)); + System.out.println("list: " + list); assertThat(list).hasSize(1); - assertProcessInstanceFinished(processInstance, kruntime); + assertThat(instance.status()).isEqualTo(ProcessInstance.STATE_COMPLETED); } @Test