SUNILathulya opened a new pull request, #4330: URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/4330
closes https://github.com/apache/incubator-kie-issues/issues/2360 Migrated SLAComplianceTest which are being compiled using legacy v7 to code generation approach. The tests can be identified by referring to SLAComplianceTest.java: https://github.com/apache/incubator-kie-kogito-runtimes/blob/main/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/SLAComplianceTest.java ## Tests Migrated **testSLAonProcessViolated()** - Line 62 - Migrates process-level SLA violation tracking - Converts from v7 `createKogitoProcessRuntime()` to v9 generated classes - Uses `UserTaskWithSLAProcess` and `UserTaskWithSLAModel` - Captures SLA compliance on process completion via `afterProcessCompleted()` event listener - Validates SLA is violated and remains violated after process completes **testSLAonUserTaskViolated()** - Line 140 - Migrates node-level SLA violation tracking on a human task - Uses `UserTaskWithSLAOnTaskProcess` and `UserTaskWithSLAOnTaskModel` - Captures node SLA compliance at violation time via `afterSLAViolated()` and after completion via `afterNodeLeft()` - Validates process-level SLA is `SLA_NA` while node-level SLA is `SLA_VIOLATED` **testSLAonCatchEventViolated()** - Line 444 - Migrates SLA violation tracking on an intermediate catch event node - Uses `IntermediateCatchEventSignalWithSLAOnEventProcess` and `IntermediateCatchEventSignalWithSLAOnEventModel` - Replaces `kruntime.signalEvent()` with `processInstance.send(SignalFactory.of(...))` - Validates event node SLA is `SLA_VIOLATED` and persists after signal received ## Migration Changes - Replaced `createKogitoProcessRuntime()` with generated process classes - Used `ProcessTestHelper` for application, handler and event listener setup - Replaced `getSLAComplianceForProcessInstance()` with `executeInWorkflowState(p -> p.getSlaCompliance())` - Replaced `getSLAComplianceForNodeInstance()` with `AtomicInteger` captured via event listeners - Replaced `assertProcessInstanceFinished()` with direct `processInstance.status()` check - Updated constants from `KogitoProcessInstance.STATE_*` / `SLA_*` to v9 equivalents ## BPMN Files - `BPMN2-UserTaskWithSLA.bpmn2` (test 1) - `BPMN2-UserTaskWithSLAOnTask.bpmn2` (test 2) - `BPMN2-IntermediateCatchEventSignalWithSLAOnEvent.bpmn2` (test 3) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
