use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationAddMultiInstanceTest method testAddMultiInstanceBodyWithDeeperNestedMapping.
@Test
public void testAddMultiInstanceBodyWithDeeperNestedMapping() {
// given
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(MultiInstanceProcessModels.PAR_MI_SUBPROCESS_PROCESS);
try {
rule.getRuntimeService().createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()).mapActivities("userTask", "userTask").build();
fail("Should not succeed");
} catch (MigrationPlanValidationException e) {
e.printStackTrace();
assertThat(e.getValidationReport()).hasInstructionFailures("userTask", "Target activity 'userTask' is a descendant of multi-instance body 'subProcess#multiInstanceBody' " + "that is not mapped from the source process definition");
}
}
use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationAddMultiInstanceTest method testRemoveAndAddMultiInstanceBody.
@Test
public void testRemoveAndAddMultiInstanceBody() {
// given
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(MultiInstanceProcessModels.PAR_MI_ONE_TASK_PROCESS);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(MultiInstanceProcessModels.PAR_MI_ONE_TASK_PROCESS);
try {
rule.getRuntimeService().createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()).mapActivities("userTask", "userTask").build();
fail("Should not succeed");
} catch (MigrationPlanValidationException e) {
assertThat(e.getValidationReport()).hasInstructionFailures("userTask", "Target activity 'userTask' is a descendant of multi-instance body 'userTask#multiInstanceBody' " + "that is not mapped from the source process definition");
}
}
use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationAddMultiInstanceTest method testAddMultiInstanceBody.
@Test
public void testAddMultiInstanceBody() {
// given
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(MultiInstanceProcessModels.PAR_MI_ONE_TASK_PROCESS);
try {
rule.getRuntimeService().createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()).mapActivities("userTask", "userTask").build();
fail("Should not succeed");
} catch (MigrationPlanValidationException e) {
assertThat(e.getValidationReport()).hasInstructionFailures("userTask", "Target activity 'userTask' is a descendant of multi-instance body 'userTask#multiInstanceBody' " + "that is not mapped from the source process definition");
}
}
use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationMultiInstanceTest method testMigrateParallelMiBodyAddSubprocess.
@Test
public void testMigrateParallelMiBodyAddSubprocess() {
// given
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(MultiInstanceProcessModels.PAR_MI_ONE_TASK_PROCESS);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(MultiInstanceProcessModels.PAR_MI_SUBPROCESS_PROCESS);
try {
rule.getRuntimeService().createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()).mapActivities(miBodyOf("userTask"), miBodyOf("subProcess")).mapActivities("userTask", "userTask").build();
fail("Should not succeed");
} catch (MigrationPlanValidationException e) {
assertThat(e.getValidationReport()).hasInstructionFailures(miBodyOf("userTask"), "Must map the inner activity of a multi-instance body when the body is mapped");
}
}
use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationMultiInstanceTest method testMigrateParallelMiBodyRemoveSubprocess.
@Test
public void testMigrateParallelMiBodyRemoveSubprocess() {
// given
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(MultiInstanceProcessModels.PAR_MI_SUBPROCESS_PROCESS);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(MultiInstanceProcessModels.PAR_MI_ONE_TASK_PROCESS);
try {
rule.getRuntimeService().createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()).mapActivities(miBodyOf("subProcess"), miBodyOf("userTask")).mapActivities("userTask", "userTask").build();
fail("Should not succeed");
} catch (MigrationPlanValidationException e) {
assertThat(e.getValidationReport()).hasInstructionFailures(miBodyOf("subProcess"), "Cannot remove the inner activity of a multi-instance body when the body is mapped");
}
}
Aggregations