Skip to content

Commit

Permalink
[incubator-kie-issues-1131] test migration from V7 to code generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhitocode committed Jun 28, 2024
1 parent dab18f1 commit 1f151c5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ActivityTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<RuleTaskModel> process = RuleTaskProcess.newProcess(application);
RuleTaskModel model = process.createModel();
ProcessInstance<RuleTaskModel> instance = process.createInstance(model);
List<String> 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
Expand Down

0 comments on commit 1f151c5

Please sign in to comment.