@Test public void testMapEqualUnsupportedAsyncAfterActivities() { BpmnModelInstance testModel = modify(ProcessModels.UNSUPPORTED_ACTIVITIES) .flowNodeBuilder("startEvent").camundaAsyncAfter() .moveToNode("decisionTask").camundaAsyncAfter() .moveToNode("throwEvent").camundaAsyncAfter() .moveToNode("serviceTask").camundaAsyncAfter() .moveToNode("sendTask").camundaAsyncAfter() .moveToNode("scriptTask").camundaAsyncAfter() .moveToNode("endEvent").camundaAsyncAfter() .done(); assertGeneratedMigrationPlan(testModel, testModel) .hasInstructions( migrate("startEvent").to("startEvent"), migrate("decisionTask").to("decisionTask"), migrate("throwEvent").to("throwEvent"), migrate("serviceTask").to("serviceTask"), migrate("sendTask").to("sendTask"), migrate("scriptTask").to("scriptTask"), migrate("endEvent").to("endEvent") ); }
@Test public void testMigrateAsyncAfterCompensateEventSubProcessStartEvent() { // given BpmnModelInstance model = modify(EventSubProcessModels.COMPENSATE_EVENT_SUBPROCESS_PROCESS) .flowNodeBuilder("eventSubProcessStart") .camundaAsyncAfter() .done(); ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(model); ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(model); MigrationPlan migrationPlan = rule.getRuntimeService() .createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()) .mapActivities("subProcess", "subProcess") .mapActivities("eventSubProcess", "eventSubProcess") .mapActivities("eventSubProcessStart", "eventSubProcessStart") .build(); ProcessInstance processInstance = rule.getRuntimeService().createProcessInstanceById(sourceProcessDefinition.getId()) .startBeforeActivity("eventSubProcess") .execute(); // when testHelper.migrateProcessInstance(migrationPlan, processInstance); // then testHelper.assertJobMigrated("eventSubProcessStart", "eventSubProcessStart", AsyncContinuationJobHandler.TYPE); }
@Test public void testMapEqualUnsupportedAsyncBeforeActivities() { BpmnModelInstance testModel = modify(ProcessModels.UNSUPPORTED_ACTIVITIES) .flowNodeBuilder("startEvent").camundaAsyncBefore() .moveToNode("decisionTask").camundaAsyncBefore() .moveToNode("throwEvent").camundaAsyncAfter() .moveToNode("serviceTask").camundaAsyncBefore() .moveToNode("sendTask").camundaAsyncBefore() .moveToNode("scriptTask").camundaAsyncBefore() .moveToNode("endEvent").camundaAsyncBefore() .done(); assertGeneratedMigrationPlan(testModel, testModel) .hasInstructions( migrate("startEvent").to("startEvent"), migrate("decisionTask").to("decisionTask"), migrate("throwEvent").to("throwEvent"), migrate("serviceTask").to("serviceTask"), migrate("sendTask").to("sendTask"), migrate("scriptTask").to("scriptTask"), migrate("endEvent").to("endEvent") ); }
@Test public void testMapEqualUnsupportedAsyncAfterActivities() { BpmnModelInstance testModel = modify(ProcessModels.UNSUPPORTED_ACTIVITIES) .flowNodeBuilder("startEvent").camundaAsyncAfter() .moveToNode("decisionTask").camundaAsyncAfter() .moveToNode("throwEvent").camundaAsyncAfter() .moveToNode("serviceTask").camundaAsyncAfter() .moveToNode("sendTask").camundaAsyncAfter() .moveToNode("scriptTask").camundaAsyncAfter() .moveToNode("endEvent").camundaAsyncAfter() .done(); assertGeneratedMigrationPlan(testModel, testModel) .hasInstructions( migrate("startEvent").to("startEvent"), migrate("decisionTask").to("decisionTask"), migrate("throwEvent").to("throwEvent"), migrate("serviceTask").to("serviceTask"), migrate("sendTask").to("sendTask"), migrate("scriptTask").to("scriptTask"), migrate("endEvent").to("endEvent") ); }
@Test public void testMigrateAsyncAfterCompensateEventSubProcessStartEvent() { // given BpmnModelInstance model = modify(EventSubProcessModels.COMPENSATE_EVENT_SUBPROCESS_PROCESS) .flowNodeBuilder("eventSubProcessStart") .camundaAsyncAfter() .done(); ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(model); ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(model); MigrationPlan migrationPlan = rule.getRuntimeService() .createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()) .mapActivities("subProcess", "subProcess") .mapActivities("eventSubProcess", "eventSubProcess") .mapActivities("eventSubProcessStart", "eventSubProcessStart") .build(); ProcessInstance processInstance = rule.getRuntimeService().createProcessInstanceById(sourceProcessDefinition.getId()) .startBeforeActivity("eventSubProcess") .execute(); // when testHelper.migrateProcessInstance(migrationPlan, processInstance); // then testHelper.assertJobMigrated("eventSubProcessStart", "eventSubProcessStart", AsyncContinuationJobHandler.TYPE); }
@Test public void testMapEqualUnsupportedAsyncBeforeActivities() { BpmnModelInstance testModel = modify(ProcessModels.UNSUPPORTED_ACTIVITIES) .flowNodeBuilder("startEvent").camundaAsyncBefore() .moveToNode("decisionTask").camundaAsyncBefore() .moveToNode("throwEvent").camundaAsyncAfter() .moveToNode("serviceTask").camundaAsyncBefore() .moveToNode("sendTask").camundaAsyncBefore() .moveToNode("scriptTask").camundaAsyncBefore() .moveToNode("endEvent").camundaAsyncBefore() .done(); assertGeneratedMigrationPlan(testModel, testModel) .hasInstructions( migrate("startEvent").to("startEvent"), migrate("decisionTask").to("decisionTask"), migrate("throwEvent").to("throwEvent"), migrate("serviceTask").to("serviceTask"), migrate("sendTask").to("sendTask"), migrate("scriptTask").to("scriptTask"), migrate("endEvent").to("endEvent") ); }