use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationRemoveSubprocessTest method testCannotRemoveParentScopeAndMoveOutOfGrandParentScope.
@Test
public void testCannotRemoveParentScopeAndMoveOutOfGrandParentScope() {
// given
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(ProcessModels.TRIPLE_SUBPROCESS_PROCESS);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(ProcessModels.TRIPLE_SUBPROCESS_PROCESS);
// when
try {
// subProcess2 is not migrated
// subProcess 3 is moved out of the subProcess1 scope (by becoming a subProcess1 itself)
rule.getRuntimeService().createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()).mapActivities("subProcess1", "subProcess1").mapActivities("subProcess3", "subProcess1").mapActivities("userTask", "userTask").build();
Assert.fail("should not validate");
} catch (MigrationPlanValidationException e) {
MigrationPlanValidationReportAssert.assertThat(e.getValidationReport()).hasInstructionFailures("subProcess3", "The closest mapped ancestor 'subProcess1' is mapped to scope 'subProcess1' which is not an ancestor of target scope 'subProcess1'");
}
}
use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationRemoveSubprocessTest method testCannotRemoveScopeAndMoveToConcurrentActivity.
/**
* Remove when implementing CAM-5407
*/
@Test
public void testCannotRemoveScopeAndMoveToConcurrentActivity() {
// given
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(ProcessModels.PARALLEL_GATEWAY_SUBPROCESS_PROCESS);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(ProcessModels.PARALLEL_TASK_AND_SUBPROCESS_PROCESS);
// when
try {
rule.getRuntimeService().createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()).mapActivities("subProcess", "subProcess").mapActivities("userTask1", "userTask1").mapActivities("userTask2", "userTask2").build();
Assert.fail("should not validate");
} catch (MigrationPlanValidationException e) {
MigrationPlanValidationReportAssert.assertThat(e.getValidationReport()).hasInstructionFailures("userTask2", "The closest mapped ancestor 'subProcess' is mapped to scope 'subProcess' which is not an ancestor of target scope 'userTask2'");
}
}
use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationMultiInstanceTest method testMigrateSequenatialMiBodyRemoveSubprocess.
@Test
public void testMigrateSequenatialMiBodyRemoveSubprocess() {
// given
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(MultiInstanceProcessModels.SEQ_MI_SUBPROCESS_PROCESS);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(MultiInstanceProcessModels.SEQ_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");
}
}
use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationMultiInstanceTest method testMigrateParallelToSequential.
@Test
public void testMigrateParallelToSequential() {
// given
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(MultiInstanceProcessModels.PAR_MI_ONE_TASK_PROCESS);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(MultiInstanceProcessModels.SEQ_MI_ONE_TASK_PROCESS);
try {
rule.getRuntimeService().createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()).mapActivities(miBodyOf("userTask"), miBodyOf("userTask")).mapActivities("userTask", "userTask").build();
fail("Should not succeed");
} catch (MigrationPlanValidationException e) {
assertThat(e.getValidationReport()).hasInstructionFailures(miBodyOf("userTask"), "Activities have incompatible types (ParallelMultiInstanceActivityBehavior is not " + "compatible with SequentialMultiInstanceActivityBehavior)");
}
}
use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationEventSubProcessTest method testMigrateEventSubprocessChangeStartEventType.
@Test
public void testMigrateEventSubprocessChangeStartEventType() {
// given
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(EventSubProcessModels.SIGNAL_EVENT_SUBPROCESS_PROCESS);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(EventSubProcessModels.TIMER_EVENT_SUBPROCESS_PROCESS);
try {
// when
rule.getRuntimeService().createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()).mapActivities(USER_TASK_ID, USER_TASK_ID).mapActivities(EVENT_SUB_PROCESS_START_ID, EVENT_SUB_PROCESS_START_ID).build();
Assert.fail("exception expected");
} catch (MigrationPlanValidationException e) {
// then
assertThat(e.getValidationReport()).hasInstructionFailures(EVENT_SUB_PROCESS_START_ID, "Events are not of the same type (signalStartEvent != startTimerEvent)");
}
}
Aggregations