Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Deployment @Test public void testSingleIntermediateMessageEvent()
        public virtual void testSingleIntermediateMessageEvent()
        {
            ProcessInstance pi = runtimeService.startProcessInstanceByKey("process");

            IList <string> activeActivityIds = runtimeService.getActiveActivityIds(pi.Id);

            assertNotNull(activeActivityIds);
            assertEquals(1, activeActivityIds.Count);
            assertTrue(activeActivityIds.Contains("messageCatch"));

            string    messageName = "newInvoiceMessage";
            Execution execution   = runtimeService.createExecutionQuery().messageEventSubscriptionName(messageName).singleResult();

            assertNotNull(execution);

            runtimeService.messageEventReceived(messageName, execution.Id);

            Task task = taskService.createTaskQuery().singleResult();

            assertNotNull(task);
            taskService.complete(task.Id);
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void createSimpleModificationPlan()
        public virtual void createSimpleModificationPlan()
        {
            ProcessDefinition processDefinition = testRule.deployAndGetDefinition(instance);
            IList <string>    instances         = helper.startInstances("process1", 2);

            runtimeService.createModification(processDefinition.Id).startBeforeActivity("user2").cancelAllForActivity("user1").processInstanceIds(instances).execute();

            foreach (string instanceId in instances)
            {
                IList <string> activeActivityIds = runtimeService.getActiveActivityIds(instanceId);
                assertEquals(1, activeActivityIds.Count);
                assertEquals(activeActivityIds.GetEnumerator().next(), "user2");
            }
        }