Skip to content

Commit

Permalink
[incubator-kie-issues-1131] v7 migration to code generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhitocode committed Jul 17, 2024
1 parent d167ae1 commit 1c941d9
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ActivityTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@
import org.jbpm.bpmn2.subprocess.CallActivityWithBoundaryEventProcess;
import org.jbpm.bpmn2.subprocess.CallActivityWithIOexpressionModel;
import org.jbpm.bpmn2.subprocess.CallActivityWithIOexpressionProcess;
import org.jbpm.bpmn2.subprocess.ErrorsBetweenProcessModel;
import org.jbpm.bpmn2.subprocess.ErrorsBetweenProcessProcess;
import org.jbpm.bpmn2.subprocess.ErrorsBetweenSubProcessModel;
import org.jbpm.bpmn2.subprocess.ErrorsBetweenSubProcessProcess;
import org.jbpm.bpmn2.subprocess.InputMappingUsingValueModel;
import org.jbpm.bpmn2.subprocess.InputMappingUsingValueProcess;
import org.jbpm.bpmn2.subprocess.MainGroupAssignmentModel;
Expand Down Expand Up @@ -1246,21 +1250,23 @@ public void testServiceTaskWithMvelJaxbTransformation() throws Exception {

}

//This test fails
@Test
public void testErrorBetweenProcessesProcess() throws Exception {
kruntime = createKogitoProcessRuntime("org/jbpm/bpmn2/subprocess/BPMN2-ErrorsBetweenProcess.bpmn2",
"org/jbpm/bpmn2/subprocess/BPMN2-ErrorsBetweenSubProcess.bpmn2");

Map<String, Object> variables = new HashMap<>();

variables.put("tipoEvento", "error");
variables.put("pasoVariable", 3);
KogitoProcessInstance processInstance = kruntime.startProcess("ErrorsBetweenProcess", variables);

assertProcessInstanceCompleted(processInstance.getStringId(), kruntime);
assertProcessInstanceAborted(processInstance.getStringId() + 1, kruntime);

assertProcessVarValue(processInstance, "event", "error desde Subproceso");
public void testErrorBetweenProcessesProcess() {
Application app = ProcessTestHelper.newApplication();
org.kie.kogito.process.Process<ErrorsBetweenSubProcessModel> errorsBetweenSubProcessProcess = ErrorsBetweenSubProcessProcess.newProcess(app);
ProcessInstance<ErrorsBetweenSubProcessModel> subProcessInstance = errorsBetweenSubProcessProcess
.createInstance(errorsBetweenSubProcessProcess.createModel());
org.kie.kogito.process.Process<ErrorsBetweenProcessModel> process = ErrorsBetweenProcessProcess.newProcess(app);
ErrorsBetweenProcessModel model = process.createModel();
model.setTipoEvento("error");
model.setPasoVariable(3);
ProcessInstance<ErrorsBetweenProcessModel> processInstance = process.createInstance(model);
processInstance.start();
assertThat(processInstance.status()).isEqualTo(ProcessInstance.STATE_COMPLETED);
//expected state of sub process should be aborted. But we are getting state pending
assertThat(subProcessInstance.status()).isEqualTo(ProcessInstance.STATE_ABORTED);
Assertions.assertEquals("error desde Subproceso", processInstance.variables().getEvent());
}

@Test
Expand Down

0 comments on commit 1c941d9

Please sign in to comment.