Exemple #1
0
        public virtual void testMigrateParallelMultiInstanceEventSubscription()
        {
            IBpmnModelInstance parallelMiReceiveTaskProcess =
                ModifiableBpmnModelInstance.Modify(MessageReceiveModels.ONE_RECEIVE_TASK_PROCESS)
                //.ActivityBuilder("receiveTask")
                //.MultiInstance()
                //.Parallel()
                //.Cardinality("3")
                //.Done()
            ;

            var sourceProcessDefinition = testHelper.DeployAndGetDefinition(parallelMiReceiveTaskProcess);
            var targetProcessDefinition = testHelper.DeployAndGetDefinition(parallelMiReceiveTaskProcess);

            var migrationPlan =
                rule.RuntimeService.CreateMigrationPlan(sourceProcessDefinition.Id, targetProcessDefinition.Id)
                .MapActivities("receiveTask#multiInstanceBody", "receiveTask#multiInstanceBody")
                .MapActivities("receiveTask", "receiveTask")
                .Build();

            // when
            var processInstance = testHelper.CreateProcessInstanceAndMigrate(migrationPlan);

            testHelper.AssertEventSubscriptionsMigrated("receiveTask", "receiveTask", MessageReceiveModels.MESSAGE_NAME);

            // and it is possible to trigger the receive tasks
            rule.RuntimeService.CreateMessageCorrelation(MessageReceiveModels.MESSAGE_NAME)
            .CorrelateAll();

            testHelper.CompleteTask("userTask");
            testHelper.AssertProcessEnded(processInstance.Id);
        }