Search in sources :

Example 1 with MigrationEntry

use of org.jbpm.services.api.admin.MigrationEntry in project jbpm by kiegroup.

the class ProcessInstanceMigrationServiceImplTest method testMigrateSingleProcessInstanceWithoutNodeMappingWithNodeOrderChange.

@Test
public void testMigrateSingleProcessInstanceWithoutNodeMappingWithNodeOrderChange() {
    // JBPM-7598
    // RECREATEACTIVETASK_ID_V2 was modified from RECREATEACTIVETASK_ID_V1
    // Remove the UserTask and recreate the same UserTask so they look same but
    // - NodeId is different
    // - The order of userTask in bpmn2 file is different
    long processInstanceId = processService.startProcess(deploymentUnitV1.getIdentifier(), RECREATEACTIVETASK_ID_V1);
    assertNotNull(processInstanceId);
    MigrationReport report = migrationService.migrate(deploymentUnitV1.getIdentifier(), processInstanceId, deploymentUnitV2.getIdentifier(), RECREATEACTIVETASK_ID_V2);
    assertNotNull(report);
    assertFalse(report.isSuccessful());
    MigrationEntry error = report.getEntries().stream().filter(e -> e.getType().equals("ERROR")).findFirst().get();
    assertNotNull(error);
    assertEquals("Node with id _54C7BD3A-0BE4-4C87-9689-C492B8469D2D was not found in new process definition", error.getMessage());
}
Also used : MigrationReport(org.jbpm.services.api.admin.MigrationReport) MigrationEntry(org.jbpm.services.api.admin.MigrationEntry) KModuleDeploymentServiceTest(org.jbpm.kie.services.test.KModuleDeploymentServiceTest) AbstractKieServicesBaseTest(org.jbpm.kie.test.util.AbstractKieServicesBaseTest) Test(org.junit.Test)

Aggregations

KModuleDeploymentServiceTest (org.jbpm.kie.services.test.KModuleDeploymentServiceTest)1 AbstractKieServicesBaseTest (org.jbpm.kie.test.util.AbstractKieServicesBaseTest)1 MigrationEntry (org.jbpm.services.api.admin.MigrationEntry)1 MigrationReport (org.jbpm.services.api.admin.MigrationReport)1 Test (org.junit.Test)1