use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationCompensationAddSubProcessTest method testCannotAddScopeOnTopOfEventSubProcess.
@Test
public void testCannotAddScopeOnTopOfEventSubProcess() {
// given
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(CompensationModels.COMPENSATION_EVENT_SUBPROCESS_MODEL);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(modify(CompensationModels.DOUBLE_SUBPROCESS_MODEL).addSubProcessTo("innerSubProcess").id("eventSubProcess").triggerByEvent().embeddedSubProcess().startEvent("eventSubProcessStart").compensateEventDefinition().compensateEventDefinitionDone().endEvent().done());
try {
// when
rule.getRuntimeService().createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()).mapActivities("subProcess", "outerSubProcess").mapActivities("eventSubProcessStart", "eventSubProcessStart").mapActivities("compensationBoundary", "compensationBoundary").mapActivities("userTask2", "userTask2").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 (innerSubProcess)");
}
}
use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationCompensationTest method testCannotMapCompensateStartEventWithoutMappingEventScopeCase1.
@Test
public void testCannotMapCompensateStartEventWithoutMappingEventScopeCase1() {
// given
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(CompensationModels.COMPENSATION_EVENT_SUBPROCESS_MODEL);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(CompensationModels.COMPENSATION_EVENT_SUBPROCESS_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 MigrationCompensationTest method testEventScopeHierarchyPreservation.
@Test
public void testEventScopeHierarchyPreservation() {
// given
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(CompensationModels.DOUBLE_SUBPROCESS_MODEL);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(CompensationModels.DOUBLE_SUBPROCESS_MODEL);
try {
// when
rule.getRuntimeService().createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()).mapActivities("outerSubProcess", "innerSubProcess").mapActivities("innerSubProcess", "outerSubProcess").build();
Assert.fail("exception expected");
} catch (MigrationPlanValidationException e) {
// then
assertThat(e.getValidationReport()).hasInstructionFailures("innerSubProcess", "The closest mapped ancestor 'outerSubProcess' is mapped to scope 'innerSubProcess' " + "which is not an ancestor of target scope 'outerSubProcess'");
}
}
use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationGatewayTest method testCannotMapMultipleGatewaysToOne.
/**
* Ensures that situations are avoided in which more tokens end up at the target gateway
* than it has incoming flows
*/
@Test
public void testCannotMapMultipleGatewaysToOne() {
// given
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(GatewayModels.PARALLEL_GW);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(GatewayModels.PARALLEL_GW);
try {
rule.getRuntimeService().createMigrationPlan(sourceProcessDefinition.getId(), targetProcessDefinition.getId()).mapActivities("join", "join").mapActivities("fork", "join").build();
Assert.fail("exception expected");
} catch (MigrationPlanValidationException e) {
// then
assertThat(e.getValidationReport()).hasInstructionFailures("join", "Only one gateway can be mapped to gateway 'join'");
}
}
use of org.camunda.bpm.engine.migration.MigrationPlanValidationException in project camunda-bpm-platform by camunda.
the class MigrationGatewayTest method testCannotRemoveGatewayIncomingSequenceFlow.
/**
* Ensures that situations are avoided in which more tokens end up at the target gateway
* than it has incoming flows
*/
@Test
public void testCannotRemoveGatewayIncomingSequenceFlow() {
// given
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(GatewayModels.PARALLEL_GW);
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(modify(GatewayModels.PARALLEL_GW).removeFlowNode("parallel2"));
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 target gateway must have at least the same number of incoming sequence flows that the source gateway has");
}
}
Aggregations