Exemple #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testNotMigrateUnknownProcessInstance()
        public virtual void testNotMigrateUnknownProcessInstance()
        {
            ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS);
            ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS);

            MigrationPlan migrationPlan = runtimeService.createMigrationPlan(sourceProcessDefinition.Id, targetProcessDefinition.Id).mapEqualActivities().build();

            try
            {
                runtimeService.newMigration(migrationPlan).processInstanceIds(Collections.singletonList("unknown")).execute();
                fail("Should not be able to migrate");
            }
            catch (ProcessEngineException e)
            {
                assertThat(e.Message, CoreMatchers.StartsWith("ENGINE-23003"));
            }
        }
Exemple #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testProcessInstanceQueryOfWrongProcessDefinition()
        public virtual void testProcessInstanceQueryOfWrongProcessDefinition()
        {
            ProcessDefinition testProcessDefinition  = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS);
            ProcessDefinition wrongProcessDefinition = testHelper.deployAndGetDefinition(ProcessModels.SUBPROCESS_PROCESS);

            runtimeService.startProcessInstanceById(wrongProcessDefinition.Id);

            MigrationPlan migrationPlan = runtimeService.createMigrationPlan(testProcessDefinition.Id, testProcessDefinition.Id).mapEqualActivities().build();

            ProcessInstanceQuery wrongProcessInstanceQuery = runtimeService.createProcessInstanceQuery().processDefinitionId(wrongProcessDefinition.Id);

            assertEquals(1, wrongProcessInstanceQuery.count());

            try
            {
                runtimeService.newMigration(migrationPlan).processInstanceQuery(wrongProcessInstanceQuery).execute();
                fail("Should not be able to migrate");
            }
            catch (ProcessEngineException e)
            {
                assertThat(e.Message, CoreMatchers.StartsWith("ENGINE-23002"));
            }
        }