use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationCompensationTest method testCannotMapCompensateStartEventWithoutMappingEventScopeCase2.
@Test
public void testCannotMapCompensateStartEventWithoutMappingEventScopeCase2() {
// given
BpmnModelInstance model = modify(CompensationModels.COMPENSATION_EVENT_SUBPROCESS_MODEL).removeFlowNode("compensationBoundary");
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(model);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(model);
try {
// when
rule.getRuntimeService().createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()).mapActivities("eventSubProcessStart", "eventSubProcessStart").build();
Assert.fail("exception expected");
} catch (MigrationPlanValidationException e) {
// then
assertThat(e.getValidationReport()).hasInstructionFailures("eventSubProcessStart", "The source activity's event scope (subProcess) must be mapped to the target activity's event scope (subProcess)");
}
}
use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationExternalTaskTest method cannotMigrateFromExternalToClassDelegateServiceTask.
@Test
public void cannotMigrateFromExternalToClassDelegateServiceTask() {
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(ExternalTaskModels.ONE_EXTERNAL_TASK_PROCESS);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(ServiceTaskModels.oneClassDelegateServiceTask("foo.Bar"));
try {
rule.getRuntimeService().createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()).mapActivities("externalTask", "serviceTask").build();
Assert.fail("exception expected");
} catch (MigrationPlanValidationException e) {
// then
assertThat(e.getValidationReport()).hasInstructionFailures("externalTask", "Activities have incompatible types (ExternalTaskActivityBehavior is not compatible with" + " ClassDelegateActivityBehavior)");
}
}
use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationGatewayTest method testCannotRemoveParentScope.
/**
* Ensures that situations are avoided in which more tokens end up at the target gateway
* than it has incoming flows
*/
@Test
public void testCannotRemoveParentScope() {
// given
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(GatewayModels.PARALLEL_GW_IN_SUBPROCESS);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(GatewayModels.PARALLEL_GW);
try {
rule.getRuntimeService().createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()).mapActivities("join", "join").build();
Assert.fail("exception expected");
} catch (MigrationPlanValidationException e) {
// then
assertThat(e.getValidationReport()).hasInstructionFailures("join", "The gateway's flow scope 'subProcess' must be mapped");
}
}
use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationGatewayTest method testCannotMigrateParallelToInclusiveGateway.
@Test
public void testCannotMigrateParallelToInclusiveGateway() {
// given
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(GatewayModels.PARALLEL_GW);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(GatewayModels.INCLUSIVE_GW);
try {
rule.getRuntimeService().createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()).mapActivities("join", "join").build();
Assert.fail("exception expected");
} catch (MigrationPlanValidationException e) {
// then
assertThat(e.getValidationReport()).hasInstructionFailures("join", "Activities have incompatible types " + "(ParallelGatewayActivityBehavior is not compatible with InclusiveGatewayActivityBehavior)");
}
}
use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationGatewayTest method testCannotMigrateInclusiveToParallelGateway.
@Test
public void testCannotMigrateInclusiveToParallelGateway() {
// given
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(GatewayModels.INCLUSIVE_GW);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(GatewayModels.PARALLEL_GW);
try {
rule.getRuntimeService().createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()).mapActivities("join", "join").build();
Assert.fail("exception expected");
} catch (MigrationPlanValidationException e) {
// then
assertThat(e.getValidationReport()).hasInstructionFailures("join", "Activities have incompatible types " + "(InclusiveGatewayActivityBehavior is not compatible with ParallelGatewayActivityBehavior)");
}
}
Aggregations