@Test public void testAddEscalationBoundaryEventToSubProcessAndThrowEscalation() { // given ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(ProcessModels.SUBPROCESS_PROCESS); ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(modify(ProcessModels.SUBPROCESS_PROCESS) .endEventBuilder("subProcessEnd").escalation(ESCALATION_CODE) // let the end event of the subprocess escalate .moveToActivity("subProcess") .boundaryEvent().escalation(ESCALATION_CODE) // catch escalation with boundary event .userTask(AFTER_BOUNDARY_TASK) .endEvent() .done() ); MigrationPlan migrationPlan = rule.getRuntimeService() .createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()) .mapActivities("subProcess", "subProcess") .mapActivities("userTask", "userTask") .build(); // when testHelper.createProcessInstanceAndMigrate(migrationPlan); // then it is possible to successfully complete the migrated instance testHelper.completeTask("userTask"); testHelper.completeTask(AFTER_BOUNDARY_TASK); testHelper.assertProcessEnded(testHelper.snapshotBeforeMigration.getProcessInstanceId()); }
@Test public void testAddEscalationBoundaryEventToSubProcessAndThrowEscalation() { // given ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(ProcessModels.SUBPROCESS_PROCESS); ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(modify(ProcessModels.SUBPROCESS_PROCESS) .endEventBuilder("subProcessEnd").escalation(ESCALATION_CODE) // let the end event of the subprocess escalate .moveToActivity("subProcess") .boundaryEvent().escalation(ESCALATION_CODE) // catch escalation with boundary event .userTask(AFTER_BOUNDARY_TASK) .endEvent() .done() ); MigrationPlan migrationPlan = rule.getRuntimeService() .createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()) .mapActivities("subProcess", "subProcess") .mapActivities("userTask", "userTask") .build(); // when testHelper.createProcessInstanceAndMigrate(migrationPlan); // then it is possible to successfully complete the migrated instance testHelper.completeTask("userTask"); testHelper.completeTask(AFTER_BOUNDARY_TASK); testHelper.assertProcessEnded(testHelper.snapshotBeforeMigration.getProcessInstanceId()); }