Exemple #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testEndListenerInvocationForRemovedScope()
        public virtual void testEndListenerInvocationForRemovedScope()
        {
            // given
            DelegateEvent.clearEvents();

//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
            ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(modify(ProcessModels.SUBPROCESS_PROCESS).activityBuilder("subProcess").camundaExecutionListenerClass([email protected]_Fields.EVENTNAME_END, typeof(DelegateExecutionListener).FullName).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
            IList <DelegateEvent> recordedEvents = DelegateEvent.Events;

            assertEquals(1, recordedEvents.Count);

            DelegateEvent @event = recordedEvents[0];

            assertEquals(sourceProcessDefinition.Id, @event.ProcessDefinitionId);
            assertEquals("subProcess", @event.CurrentActivityId);
            assertEquals(testHelper.getSingleActivityInstanceBeforeMigration("subProcess").Id, @event.ActivityInstanceId);

            DelegateEvent.clearEvents();
        }
Exemple #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testListenerInvocationForNewlyCreatedScope()
        public virtual void testListenerInvocationForNewlyCreatedScope()
        {
            // given
            DelegateEvent.clearEvents();

            ProcessDefinition sourceProcessDefinition = migrationRule.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS);
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
            ProcessDefinition targetProcessDefinition = migrationRule.deployAndGetDefinition(modify(ProcessModels.SUBPROCESS_PROCESS).activityBuilder("subProcess").camundaExecutionListenerClass([email protected]_Fields.EVENTNAME_START, typeof(DelegateExecutionListener).FullName).done());

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

            ProcessInstance processInstance = engineRule.RuntimeService.startProcessInstanceById(sourceProcessDefinition.Id);

            Batch batch = engineRule.RuntimeService.newMigration(migrationPlan).processInstanceIds(Arrays.asList(processInstance.Id)).executeAsync();

            helper.executeSeedJob(batch);

            // when
            helper.executeJobs(batch);

            // then
            IList <DelegateEvent> recordedEvents = DelegateEvent.Events;

            assertEquals(1, recordedEvents.Count);

            DelegateEvent @event = recordedEvents[0];

            assertEquals(targetProcessDefinition.Id, @event.ProcessDefinitionId);
            assertEquals("subProcess", @event.CurrentActivityId);

            DelegateEvent.clearEvents();
        }
Exemple #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testSkipListenerInvocationForRemovedScope()
        public virtual void testSkipListenerInvocationForRemovedScope()
        {
            // given
            DelegateEvent.clearEvents();

//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
            ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(modify(ProcessModels.SUBPROCESS_PROCESS).activityBuilder("subProcess").camundaExecutionListenerClass([email protected]_Fields.EVENTNAME_END, typeof(DelegateExecutionListener).FullName).done());
            ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS);

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

            // when
            ProcessInstance processInstance = rule.RuntimeService.startProcessInstanceById(migrationPlan.SourceProcessDefinitionId);

            rule.RuntimeService.newMigration(migrationPlan).processInstanceIds(Arrays.asList(processInstance.Id)).skipCustomListeners().execute();

            // then
            IList <DelegateEvent> recordedEvents = DelegateEvent.Events;

            assertEquals(0, recordedEvents.Count);

            DelegateEvent.clearEvents();
        }