use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationMultiInstanceTest method testMigrateSequentialMiBodyAddSubprocess.
@Test
public void testMigrateSequentialMiBodyAddSubprocess() {
// given
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(MultiInstanceProcessModels.SEQ_MI_ONE_TASK_PROCESS);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(MultiInstanceProcessModels.SEQ_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 MigrationPlanCreationTest method testCannotUpdateEventTriggerForNonEvent.
@Test
public void testCannotUpdateEventTriggerForNonEvent() {
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS);
try {
runtimeService.createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()).mapActivities("userTask", "userTask").updateEventTrigger().build();
fail("Should not succeed");
} catch (MigrationPlanValidationException e) {
assertThat(e.getValidationReport()).hasInstructionFailures("userTask", "Cannot update event trigger because the activity does not define a persistent event trigger");
}
}
use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationPlanCreationTest method testNotMigrateActivitiesOfDifferentType.
@Test
public void testNotMigrateActivitiesOfDifferentType() {
ProcessDefinition sourceDefinition = testHelper.deployAndGetDefinition(ProcessModels.ONE_TASK_PROCESS);
ProcessDefinition targetDefinition = testHelper.deployAndGetDefinition(modify(ProcessModels.SUBPROCESS_PROCESS).swapElementIds("userTask", "subProcess"));
try {
runtimeService.createMigrationPlan(sourceDefinition.getId(), targetDefinition.getId()).mapActivities("userTask", "userTask").build();
fail("Should not succeed");
} catch (MigrationPlanValidationException e) {
assertThat(e.getValidationReport()).hasInstructionFailures("userTask", "Activities have incompatible types (UserTaskActivityBehavior is not " + "compatible with SubProcessActivityBehavior)");
}
}
use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationPlanCreationTest method testMapBoundaryToChildActivity.
@Test
public void testMapBoundaryToChildActivity() {
BpmnModelInstance sourceProcess = modify(ProcessModels.SUBPROCESS_PROCESS).activityBuilder("subProcess").boundaryEvent("boundary").message(MESSAGE_NAME).done();
BpmnModelInstance targetProcess = modify(ProcessModels.SUBPROCESS_PROCESS).activityBuilder("userTask").boundaryEvent("boundary").message(MESSAGE_NAME).done();
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(sourceProcess);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(targetProcess);
try {
runtimeService.createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()).mapActivities("subProcess", "subProcess").mapActivities("userTask", "userTask").mapActivities("boundary", "boundary").build();
fail("Should not succeed");
} catch (MigrationPlanValidationException e) {
assertThat(e.getValidationReport()).hasInstructionFailures("boundary", "The source activity's event scope (subProcess) must be mapped to the target activity's event scope (userTask)");
}
}
use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationPlanCreationTest method testMapBoundaryToParallelActivity.
@Test
public void testMapBoundaryToParallelActivity() {
BpmnModelInstance sourceProcess = modify(ProcessModels.PARALLEL_GATEWAY_PROCESS).activityBuilder("userTask1").boundaryEvent("boundary").message(MESSAGE_NAME).done();
BpmnModelInstance targetProcess = modify(ProcessModels.PARALLEL_GATEWAY_PROCESS).activityBuilder("userTask2").boundaryEvent("boundary").message(MESSAGE_NAME).done();
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(sourceProcess);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(targetProcess);
try {
runtimeService.createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()).mapActivities("userTask1", "userTask1").mapActivities("userTask2", "userTask2").mapActivities("boundary", "boundary").build();
fail("Should not succeed");
} catch (MigrationPlanValidationException e) {
assertThat(e.getValidationReport()).hasInstructionFailures("boundary", "The source activity's event scope (userTask1) must be mapped to the target activity's event scope (userTask2)");
}
}
Aggregations