Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[incubator-kie-issues-1131] test migration from V7 to code generation-35 #3665

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 23 additions & 13 deletions jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/ActivityTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@
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.ErrorsBetweenSubProcessProcess;
import org.jbpm.bpmn2.subprocess.InputMappingUsingValueModel;
import org.jbpm.bpmn2.subprocess.InputMappingUsingValueProcess;
import org.jbpm.bpmn2.subprocess.MainGroupAssignmentModel;
Expand Down Expand Up @@ -175,6 +178,7 @@
import org.kie.api.definition.process.NodeContainer;
import org.kie.api.definition.process.Process;
import org.kie.api.definition.process.WorkflowElementIdentifier;
import org.kie.api.event.process.ProcessCompletedEvent;
import org.kie.api.event.process.ProcessNodeEvent;
import org.kie.api.event.process.ProcessNodeTriggeredEvent;
import org.kie.api.event.process.ProcessStartedEvent;
Expand Down Expand Up @@ -1489,20 +1493,26 @@ public void testServiceTaskWithMvelJaxbTransformation() throws Exception {
}

@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);
public void testErrorBetweenProcessesProcess() {
Application app = ProcessTestHelper.newApplication();
ProcessTestHelper.registerProcessEventListener(app, new DefaultKogitoProcessEventListener() {
@Override
public void afterProcessCompleted(ProcessCompletedEvent event) {
if ("ErrorsBetweenSubProcess".equals(event.getProcessInstance().getProcessId())) {
assertThat(event.getProcessInstance().getState()).isEqualTo(ProcessInstance.STATE_ABORTED);
}
}
});
ErrorsBetweenSubProcessProcess.newProcess(app);
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);

assertProcessVarValue(processInstance, "event", "error desde Subproceso");
Assertions.assertEquals("error desde Subproceso", processInstance.variables().getEvent());
}

@Test
Expand Down
Loading