Exemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testStartInstanceAfterDeleteLatestProcessVersionByIds()
        public virtual void testStartInstanceAfterDeleteLatestProcessVersionByIds()
        {
            // given a deployed process
            testRule.deploy(SINGLE_MESSAGE_START_EVENT_XML);
            // deploy second version of the process
            DeploymentWithDefinitions deployment        = testRule.deploy(SINGLE_MESSAGE_START_EVENT_XML);
            ProcessDefinition         processDefinition = deployment.DeployedProcessDefinitions[0];

            // delete it
            repositoryService.deleteProcessDefinitions().byIds(processDefinition.Id).delete();

            // when
            ProcessInstance processInstance = runtimeService.startProcessInstanceByMessage("newInvoiceMessage");

            // then
            assertFalse(processInstance.Ended);
            Task task = taskService.createTaskQuery().singleResult();

            assertNotNull(task);

            taskService.complete(task.Id);

            ProcessInstance completedInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstance.Id).singleResult();

            if (completedInstance != null)
            {
                throw new AssertionFailedError("Expected finished process instance '" + completedInstance + "' but it was still in the db");
            }
        }