コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testMigrateActiveEventSubProcess()
        public virtual void testMigrateActiveEventSubProcess()
        {
            // given
            ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(EventSubProcessModels.MESSAGE_EVENT_SUBPROCESS_PROCESS);
            ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(EventSubProcessModels.MESSAGE_EVENT_SUBPROCESS_PROCESS);

            ProcessInstance processInstance = rule.RuntimeService.createProcessInstanceById(sourceProcessDefinition.Id).startBeforeActivity(EVENT_SUB_PROCESS_TASK_ID).execute();

            MigrationPlan migrationPlan = rule.RuntimeService.createMigrationPlan(sourceProcessDefinition.Id, targetProcessDefinition.Id).mapActivities("eventSubProcess", "eventSubProcess").mapActivities(EVENT_SUB_PROCESS_TASK_ID, EVENT_SUB_PROCESS_TASK_ID).build();

            // when
            testHelper.migrateProcessInstance(migrationPlan, processInstance);

            // then
            testHelper.assertExecutionTreeAfterMigration().hasProcessDefinitionId(targetProcessDefinition.Id).matches(describeExecutionTree(null).scope().id(processInstance.Id).child(EVENT_SUB_PROCESS_TASK_ID).scope().id(testHelper.getSingleExecutionIdForActivityBeforeMigration("eventSubProcess")).done());

            testHelper.assertActivityTreeAfterMigration().hasStructure(describeActivityInstanceTree(targetProcessDefinition.Id).beginScope("eventSubProcess", testHelper.getSingleActivityInstanceBeforeMigration("eventSubProcess").Id).activity(EVENT_SUB_PROCESS_TASK_ID, testHelper.getSingleActivityInstanceBeforeMigration(EVENT_SUB_PROCESS_TASK_ID).Id).done());

            testHelper.assertEventSubscriptionRemoved(EVENT_SUB_PROCESS_START_ID, EventSubProcessModels.MESSAGE_NAME);
            testHelper.assertEventSubscriptionCreated(EVENT_SUB_PROCESS_START_ID, EventSubProcessModels.MESSAGE_NAME);

            // and it is possible to complete the process instance
            testHelper.completeTask(EVENT_SUB_PROCESS_TASK_ID);
            testHelper.assertProcessEnded(processInstance.Id);
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testMigrateMultipleBoundaryEvents()
        public virtual void testMigrateMultipleBoundaryEvents()
        {
            // given
            BpmnModelInstance testProcess = modify(ProcessModels.SUBPROCESS_PROCESS).activityBuilder("subProcess").boundaryEvent("timerBoundary1").timerWithDate(TIMER_DATE).moveToActivity("subProcess").boundaryEvent("messageBoundary1").message(MESSAGE_NAME).moveToActivity("subProcess").boundaryEvent("signalBoundary1").signal(SIGNAL_NAME).moveToActivity("subProcess").boundaryEvent("conditionalBoundary1").condition(VAR_CONDITION).moveToActivity(USER_TASK_ID).boundaryEvent("timerBoundary2").timerWithDate(TIMER_DATE).moveToActivity(USER_TASK_ID).boundaryEvent("messageBoundary2").message(MESSAGE_NAME).moveToActivity(USER_TASK_ID).boundaryEvent("signalBoundary2").signal(SIGNAL_NAME).moveToActivity(USER_TASK_ID).boundaryEvent("conditionalBoundary2").condition(VAR_CONDITION).done();

            ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(testProcess);
            ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(testProcess);

            MigrationPlan migrationPlan = rule.RuntimeService.createMigrationPlan(sourceProcessDefinition.Id, targetProcessDefinition.Id).mapActivities("subProcess", "subProcess").mapActivities("timerBoundary1", "timerBoundary1").mapActivities("signalBoundary1", "signalBoundary1").mapActivities("conditionalBoundary1", "conditionalBoundary1").updateEventTrigger().mapActivities(USER_TASK_ID, USER_TASK_ID).mapActivities("messageBoundary2", "messageBoundary2").build();

            // when
            testHelper.createProcessInstanceAndMigrate(migrationPlan);

            // then
            testHelper.assertEventSubscriptionRemoved("messageBoundary1", MESSAGE_NAME);
            testHelper.assertEventSubscriptionRemoved("signalBoundary2", SIGNAL_NAME);
            testHelper.assertEventSubscriptionRemoved("conditionalBoundary2", null);
            testHelper.assertEventSubscriptionMigrated("signalBoundary1", "signalBoundary1", SIGNAL_NAME);
            testHelper.assertEventSubscriptionMigrated("messageBoundary2", "messageBoundary2", MESSAGE_NAME);
            testHelper.assertEventSubscriptionMigrated("conditionalBoundary1", "conditionalBoundary1", null);
            testHelper.assertEventSubscriptionCreated("messageBoundary1", MESSAGE_NAME);
            testHelper.assertEventSubscriptionCreated("signalBoundary2", SIGNAL_NAME);
            testHelper.assertEventSubscriptionCreated("conditionalBoundary2", null);
            testHelper.assertBoundaryTimerJobRemoved("timerBoundary2");
            testHelper.assertBoundaryTimerJobMigrated("timerBoundary1", "timerBoundary1");
            testHelper.assertBoundaryTimerJobCreated("timerBoundary2");

            // and it is possible to successfully complete the migrated instance
            testHelper.completeTask(USER_TASK_ID);
            testHelper.assertProcessEnded(testHelper.snapshotBeforeMigration.ProcessInstanceId);
        }
コード例 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testMigrateGatewayWithMessageEvent()
        public virtual void testMigrateGatewayWithMessageEvent()
        {
            // given
            ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(EventBasedGatewayModels.MESSAGE_EVENT_BASED_GW_PROCESS);
            ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(EventBasedGatewayModels.MESSAGE_EVENT_BASED_GW_PROCESS);

            MigrationPlan migrationPlan = rule.RuntimeService.createMigrationPlan(sourceProcessDefinition.Id, targetProcessDefinition.Id).mapActivities("eventBasedGateway", "eventBasedGateway").build();

            // when
            ProcessInstance processInstance = testHelper.createProcessInstanceAndMigrate(migrationPlan);

            // then
            testHelper.assertEventSubscriptionRemoved("messageCatch", EventBasedGatewayModels.MESSAGE_NAME);
            testHelper.assertEventSubscriptionCreated("messageCatch", EventBasedGatewayModels.MESSAGE_NAME);

            rule.RuntimeService.correlateMessage(EventBasedGatewayModels.MESSAGE_NAME);

            testHelper.completeTask("afterMessageCatch");
            testHelper.assertProcessEnded(processInstance.Id);
        }
コード例 #4
0
		public virtual void assertMigration(MigrationTestRule testHelper)
		{
		  testHelper.assertEventSubscriptionRemoved(EVENT_SUB_PROCESS_START_ID, EventName);
		  testHelper.assertEventSubscriptionCreated(EVENT_SUB_PROCESS_START_ID, EventName);
		}
コード例 #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testRemoveMessageBoundaryEventFromUserTask()
        public virtual void testRemoveMessageBoundaryEventFromUserTask()
        {
            // given
            ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(modify(ProcessModels.ONE_TASK_PROCESS).activityBuilder("userTask").boundaryEvent("boundary").message(MESSAGE_NAME).userTask(AFTER_BOUNDARY_TASK).endEvent().done());
            ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS);

            MigrationPlan migrationPlan = rule.RuntimeService.createMigrationPlan(sourceProcessDefinition.Id, targetProcessDefinition.Id).mapActivities("userTask", "userTask").build();

            // when
            testHelper.createProcessInstanceAndMigrate(migrationPlan);

            // then
            testHelper.assertEventSubscriptionRemoved("boundary", MESSAGE_NAME);

            // and it is possible to successfully complete the migrated instance
            testHelper.completeTask("userTask");
            testHelper.assertProcessEnded(testHelper.snapshotBeforeMigration.ProcessInstanceId);
        }