提交 9008c416 编写于 作者: J Joram Barrez

Cmmn: test for exit criteria with ifparts

上级 4060bf7e
......@@ -343,7 +343,7 @@ public class CmmnXmlConverter implements CmmnXmlConstants {
protected void processPlanFragment(CmmnModel cmmnModel, PlanFragment planFragment) {
processPlanItems(cmmnModel, planFragment);
processSentries(planFragment);
processSentries(cmmnModel.getPrimaryCase().getPlanModel(), planFragment);
if (planFragment instanceof Stage) {
Stage stage = (Stage) planFragment;
......@@ -433,10 +433,10 @@ public class CmmnXmlConverter implements CmmnXmlConstants {
}
}
protected void processSentries(PlanFragment planFragment) {
protected void processSentries(Stage planModelStage, PlanFragment planFragment) {
for (Sentry sentry : planFragment.getSentries()) {
for (SentryOnPart onPart : sentry.getOnParts()) {
PlanItem planItem = sentry.getParent().findPlanItem(onPart.getSourceRef());
PlanItem planItem = planModelStage.findPlanItemInPlanFragmentOrDownwards(onPart.getSourceRef());
if (planItem != null) {
onPart.setSource(planItem);
} else {
......
......@@ -83,6 +83,12 @@ public class CaseInstanceEntityManagerImpl extends AbstractCmmnEntityManager<Cas
for (VariableInstanceEntity variableInstanceEntity : variableInstanceEntities) {
variableInstanceEntityManager.delete(variableInstanceEntity);
}
// Sentry part instances
List<SentryPartInstanceEntity> sentryPartInstances = caseInstanceEntity.getSatisfiedSentryPartInstances();
for (SentryPartInstanceEntity sentryPartInstanceEntity : sentryPartInstances) {
CommandContextUtil.getSentryPartInstanceEntityManager(commandContext).delete(sentryPartInstanceEntity);
}
// Runtime milestones
MilestoneInstanceEntityManager milestoneInstanceEntityManager = CommandContextUtil.getMilestoneInstanceEntityManager(commandContext);
......
......@@ -149,6 +149,119 @@ public class IfPartTest extends FlowableCmmnTestCase {
assertNull(cmmnRuntimeService.createPlanItemInstanceQuery().planItemInstanceStateActive().planItemInstanceName("B").singleResult());
}
@Test
@CmmnDeployment
public void testExitPlanModelWithIfPart() {
CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder().caseDefinitionKey("testExitPlanModelWithIfPart").start();
List<PlanItemInstance> planItemInstances = cmmnRuntimeService.createPlanItemInstanceQuery().planItemInstanceStateActive().orderByName().asc().list();
assertEquals(2, planItemInstances.size());
assertEquals("A", planItemInstances.get(0).getName());
assertEquals("B", planItemInstances.get(1).getName());
// Completing B terminates the case through one of the exit criteria
cmmnRuntimeService.triggerPlanItemInstance(planItemInstances.get(1).getId());
assertCaseInstanceEnded(caseInstance);
// Now B isn't completed, but A is. When the variable is set, the case is terminated
caseInstance = cmmnRuntimeService.createCaseInstanceBuilder().caseDefinitionKey("testExitPlanModelWithIfPart").start();
planItemInstances = cmmnRuntimeService.createPlanItemInstanceQuery().planItemInstanceStateActive().orderByName().asc().list();
cmmnRuntimeService.triggerPlanItemInstance(planItemInstances.get(0).getId());
assertEquals(1, cmmnRuntimeService.createPlanItemInstanceQuery().planItemInstanceStateActive().count());
cmmnRuntimeService.setVariables(caseInstance.getId(), CollectionUtil.singletonMap("exitPlanModelVariable", true));
assertCaseInstanceEnded(caseInstance);
}
@Test
@CmmnDeployment
public void testNestedStagesWithIfPart() {
// Start case, activate inner nested stage
CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder().caseDefinitionKey("testNestedStagesWithIfPart").start();
List<PlanItemInstance> planItemInstances = cmmnRuntimeService.createPlanItemInstanceQuery().planItemInstanceStateActive().orderByName().asc().list();
assertEquals(4, planItemInstances.size());
assertEquals("A", planItemInstances.get(0).getName());
assertEquals("C", planItemInstances.get(1).getName());
assertEquals("Stage1", planItemInstances.get(2).getName());
assertEquals("Stage2", planItemInstances.get(3).getName());
assertNotNull(cmmnRuntimeService.createPlanItemInstanceQuery().planItemInstanceStateAvailable().planItemInstanceName("Stage3").singleResult());
cmmnRuntimeService.setVariables(caseInstance.getId(), CollectionUtil.singletonMap("nestedStageEntryVariable", true));
assertEquals(6, cmmnRuntimeService.createPlanItemInstanceQuery().planItemInstanceStateActive().orderByName().asc().count());
PlanItemInstance planItemInstanceB = cmmnRuntimeService.createPlanItemInstanceQuery().planItemInstanceStateActive().planItemInstanceName("B").singleResult();
assertNotNull(planItemInstanceB);
// Triggering B should delete all stages
cmmnRuntimeService.triggerPlanItemInstance(planItemInstanceB.getId());
planItemInstances = cmmnRuntimeService.createPlanItemInstanceQuery().planItemInstanceStateActive().orderByName().asc().list();
assertEquals(1, planItemInstances.size());
assertEquals("A", planItemInstances.get(0).getName());
cmmnRuntimeService.triggerPlanItemInstance(planItemInstances.get(0).getId());
assertCaseInstanceEnded(caseInstance);
}
@Test
@CmmnDeployment
public void testNestedStagesWithIfPart2() {
CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder().caseDefinitionKey("testNestedStagesWithIfPart").start();
List<PlanItemInstance> planItemInstances = cmmnRuntimeService.createPlanItemInstanceQuery().planItemInstanceStateActive().orderByName().asc().list();
assertEquals(4, planItemInstances.size());
// Setting the destroyStages variables, deletes all stages
cmmnRuntimeService.setVariables(caseInstance.getId(), CollectionUtil.singletonMap("destroyStages", true));
planItemInstances = cmmnRuntimeService.createPlanItemInstanceQuery().planItemInstanceStateActive().orderByName().asc().list();
assertEquals(1, planItemInstances.size());
assertEquals("A", planItemInstances.get(0).getName());
cmmnRuntimeService.triggerPlanItemInstance(planItemInstances.get(0).getId());
assertCaseInstanceEnded(caseInstance);
}
@Test
@CmmnDeployment
public void testNestedStagesWithIfPart3() {
CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder().caseDefinitionKey("testNestedStagesWithIfPart").start();
assertEquals(4, cmmnRuntimeService.createPlanItemInstanceQuery().planItemInstanceStateActive().count());
/// Setting the destroyAll variable should terminate all
cmmnRuntimeService.setVariables(caseInstance.getId(), CollectionUtil.singletonMap("destroyAll", true));
assertCaseInstanceEnded(caseInstance);
}
@Test
@CmmnDeployment
public void testStageWithExitIfPart() {
CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder()
.caseDefinitionKey("testStageWithExitIfPart")
.variable("enableStage", true)
.start();
List<PlanItemInstance> planItemInstances = cmmnRuntimeService.createPlanItemInstanceQuery().planItemInstanceStateActive().orderByName().asc().list();
assertEquals(4, planItemInstances.size());
assertEquals("A", planItemInstances.get(0).getName());
assertEquals("B", planItemInstances.get(1).getName());
assertEquals("C", planItemInstances.get(2).getName());
// Triggering A should terminate the stage and thus also the case
cmmnRuntimeService.triggerPlanItemInstance(planItemInstances.get(0).getId());
assertCaseInstanceEnded(caseInstance);
}
@Test
@CmmnDeployment
public void testStageWithExitIfPart2() {
// Not setting the enableStage variable now
CaseInstance caseInstance = cmmnRuntimeService.createCaseInstanceBuilder()
.caseDefinitionKey("testStageWithExitIfPart")
.start();
List<PlanItemInstance> planItemInstances = cmmnRuntimeService.createPlanItemInstanceQuery().planItemInstanceStateActive().orderByName().asc().list();
assertEquals(1, planItemInstances.size());
assertEquals("A", planItemInstances.get(0).getName());
cmmnRuntimeService.triggerPlanItemInstance(planItemInstances.get(0).getId());
assertCaseInstanceEnded(caseInstance);
}
public static class TestBean implements Serializable {
public static boolean RETURN_VALUE;
......
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/CMMN/20151109/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:flowable="http://flowable.org/cmmn" xmlns:cmmndi="http://www.omg.org/spec/CMMN/20151109/CMMNDI" xmlns:dc="http://www.omg.org/spec/CMMN/20151109/DC" xmlns:di="http://www.omg.org/spec/CMMN/20151109/DI" targetNamespace="http://www.flowable.org/casedef">
<case id="testExitPlanModelWithIfPart" name="testExitPlanModelWithIfPart">
<casePlanModel id="casePlanModel" name="testExitPlanModelWithIfPart">
<planItem id="planItem1" name="A" definitionRef="sid-F59B44F4-383E-4612-9469-5A2200B2E0BF"></planItem>
<planItem id="planItem2" name="B" definitionRef="sid-8FFD88A7-4977-440B-B6F3-498D0C0174B1"></planItem>
<sentry id="sentry1">
<planItemOnPart id="sentryOnPart1" sourceRef="planItem1">
<standardEvent>complete</standardEvent>
</planItemOnPart>
<ifPart>
<condition><![CDATA[${caseInstance.getVariable('exitPlanModelVariable') != null && exitPlanModelVariable}]]></condition>
</ifPart>
</sentry>
<sentry id="sentry2">
<planItemOnPart id="sentryOnPart2" sourceRef="planItem2">
<standardEvent>complete</standardEvent>
</planItemOnPart>
</sentry>
<task id="sid-F59B44F4-383E-4612-9469-5A2200B2E0BF" name="A"></task>
<task id="sid-8FFD88A7-4977-440B-B6F3-498D0C0174B1" name="B"></task>
<exitCriterion id="sid-4EEE1DC3-6FDE-45DF-9856-82ADB4E05FC9" sentryRef="sentry1"></exitCriterion>
<exitCriterion id="sid-860E5BFE-AED4-4524-A208-F0EDF8653C60" sentryRef="sentry2"></exitCriterion>
</casePlanModel>
</case>
<cmmndi:CMMNDI>
<cmmndi:CMMNDiagram id="CMMNDiagram_testExitPlanModelWithIfPart">
<cmmndi:CMMNShape id="CMMNShape_casePlanModel" cmmnElementRef="casePlanModel">
<dc:Bounds height="714.0" width="718.0" x="30.0" y="40.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_sid-4EEE1DC3-6FDE-45DF-9856-82ADB4E05FC9" cmmnElementRef="sid-4EEE1DC3-6FDE-45DF-9856-82ADB4E05FC9">
<dc:Bounds height="22.0" width="14.0" x="741.0596094042645" y="157.73706968955338"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_sid-860E5BFE-AED4-4524-A208-F0EDF8653C60" cmmnElementRef="sid-860E5BFE-AED4-4524-A208-F0EDF8653C60">
<dc:Bounds height="22.0" width="14.0" x="741.2017581402604" y="325.3752306936269"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem1" cmmnElementRef="planItem1">
<dc:Bounds height="80.0" width="100.0" x="425.0" y="90.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem2" cmmnElementRef="planItem2">
<dc:Bounds height="80.0" width="100.0" x="380.0" y="255.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNEdge id="CMMNEdge_sid-8A58310D-B5BB-4F1F-BD2C-C065B61C6B68" cmmnElementRef="sid-860E5BFE-AED4-4524-A208-F0EDF8653C60" targetCMMNElementRef="planItem2">
<di:waypoint x="742.3866837486956" y="334.5132047375144"></di:waypoint>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNEdge>
<cmmndi:CMMNEdge id="CMMNEdge_sid-C9AD5EDC-83B2-4A50-9BC3-AD02DDE3CCFC" cmmnElementRef="sid-4EEE1DC3-6FDE-45DF-9856-82ADB4E05FC9" targetCMMNElementRef="planItem1">
<di:waypoint x="742.2892283163566" y="166.80481139912308"></di:waypoint>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNEdge>
</cmmndi:CMMNDiagram>
</cmmndi:CMMNDI>
</definitions>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/CMMN/20151109/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:flowable="http://flowable.org/cmmn" xmlns:cmmndi="http://www.omg.org/spec/CMMN/20151109/CMMNDI" xmlns:dc="http://www.omg.org/spec/CMMN/20151109/DC" xmlns:di="http://www.omg.org/spec/CMMN/20151109/DI" targetNamespace="http://www.flowable.org/casedef">
<case id="testNestedStagesWithIfPart" name="testNestedStagesWithIfPart">
<casePlanModel id="casePlanModel" name="testNestedStagesWithIfPart">
<planItem id="planItem1" name="A" definitionRef="sid-89452C7A-0D5E-4E4A-92F8-4D9C6B8E7907"></planItem>
<planItem id="planItem6" name="Stage1" definitionRef="sid-0FE3E74C-347F-413A-87A1-5D85AE8C98C5">
<exitCriterion id="sid-860A2CC6-7AF6-4DC2-BC24-3865AECD7382" sentryRef="sentry2"></exitCriterion>
<exitCriterion id="sid-EBA55C01-76DF-4D60-88E8-D0673CA61ADF" sentryRef="sentry3"></exitCriterion>
</planItem>
<sentry id="sentry2">
<planItemOnPart id="sentryOnPart1" sourceRef="planItem2">
<standardEvent>complete</standardEvent>
</planItemOnPart>
</sentry>
<sentry id="sentry3">
<ifPart>
<condition><![CDATA[${caseInstance.getVariable('destroyStages') && destroyStages}]]></condition>
</ifPart>
</sentry>
<sentry id="sentry4">
<ifPart>
<condition><![CDATA[${caseInstance.getVariable('destroyAll') && destroyAll}]]></condition>
</ifPart>
</sentry>
<task id="sid-89452C7A-0D5E-4E4A-92F8-4D9C6B8E7907" name="A"></task>
<stage id="sid-0FE3E74C-347F-413A-87A1-5D85AE8C98C5" name="Stage1">
<planItem id="planItem5" name="Stage2" definitionRef="sid-C5A24474-050F-4371-AF8C-2370366D4F37"></planItem>
<stage id="sid-C5A24474-050F-4371-AF8C-2370366D4F37" name="Stage2">
<planItem id="planItem3" name="Stage3" definitionRef="sid-37947C27-AB29-4FC9-A084-EB1D51598E8D">
<entryCriterion id="sid-8243F668-8A65-470D-B969-724F85440473" sentryRef="sentry1"></entryCriterion>
</planItem>
<planItem id="planItem4" name="C" definitionRef="sid-9682A576-EAC0-4D25-8256-6A65065B2763"></planItem>
<sentry id="sentry1">
<ifPart>
<condition><![CDATA[${caseInstance.getVariable('nestedStageEntryVariable') && nestedStageEntryVariable}]]></condition>
</ifPart>
</sentry>
<stage id="sid-37947C27-AB29-4FC9-A084-EB1D51598E8D" name="Stage3">
<planItem id="planItem2" name="B" definitionRef="sid-F41958A5-7C5E-4E30-B055-15B888F22F6F"></planItem>
<task id="sid-F41958A5-7C5E-4E30-B055-15B888F22F6F" name="B"></task>
</stage>
<task id="sid-9682A576-EAC0-4D25-8256-6A65065B2763" name="C"></task>
</stage>
</stage>
<exitCriterion id="sid-F622518C-3544-40A6-8AC7-3AB4E485DCD4" sentryRef="sentry4"></exitCriterion>
</casePlanModel>
</case>
<cmmndi:CMMNDI>
<cmmndi:CMMNDiagram id="CMMNDiagram_testNestedStagesWithIfPart">
<cmmndi:CMMNShape id="CMMNShape_casePlanModel" cmmnElementRef="casePlanModel">
<dc:Bounds height="714.0" width="718.0" x="40.0" y="40.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_sid-F622518C-3544-40A6-8AC7-3AB4E485DCD4" cmmnElementRef="sid-F622518C-3544-40A6-8AC7-3AB4E485DCD4">
<dc:Bounds height="22.0" width="14.0" x="751.7192741582194" y="605.3532916545225"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem1" cmmnElementRef="planItem1">
<dc:Bounds height="80.0" width="100.0" x="101.0" y="72.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem6" cmmnElementRef="planItem6">
<dc:Bounds height="442.0" width="583.0" x="75.0" y="189.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_sid-860A2CC6-7AF6-4DC2-BC24-3865AECD7382" cmmnElementRef="sid-860A2CC6-7AF6-4DC2-BC24-3865AECD7382">
<dc:Bounds height="22.0" width="14.0" x="651.807623146555" y="357.3867619826085"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_sid-EBA55C01-76DF-4D60-88E8-D0673CA61ADF" cmmnElementRef="sid-EBA55C01-76DF-4D60-88E8-D0673CA61ADF">
<dc:Bounds height="22.0" width="14.0" x="651.9660763472504" y="465.46956280619327"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem5" cmmnElementRef="planItem5">
<dc:Bounds height="320.0" width="490.0" x="105.0" y="240.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem3" cmmnElementRef="planItem3">
<dc:Bounds height="162.0" width="238.0" x="135.0" y="285.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_sid-8243F668-8A65-470D-B969-724F85440473" cmmnElementRef="sid-8243F668-8A65-470D-B969-724F85440473">
<dc:Bounds height="22.0" width="14.0" x="127.28988837090176" y="356.04550315833274"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem2" cmmnElementRef="planItem2">
<dc:Bounds height="80.0" width="100.0" x="170.0" y="326.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem4" cmmnElementRef="planItem4">
<dc:Bounds height="80.0" width="100.0" x="437.0" y="420.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNEdge id="CMMNEdge_sid-65214E25-0C71-48EB-8B73-EACF6B8EE8B0" cmmnElementRef="sid-860A2CC6-7AF6-4DC2-BC24-3865AECD7382" targetCMMNElementRef="planItem2">
<di:waypoint x="652.4587325141407" y="367.3635901192595"></di:waypoint>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNEdge>
</cmmndi:CMMNDiagram>
</cmmndi:CMMNDI>
</definitions>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/CMMN/20151109/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:flowable="http://flowable.org/cmmn" xmlns:cmmndi="http://www.omg.org/spec/CMMN/20151109/CMMNDI" xmlns:dc="http://www.omg.org/spec/CMMN/20151109/DC" xmlns:di="http://www.omg.org/spec/CMMN/20151109/DI" targetNamespace="http://www.flowable.org/casedef">
<case id="testNestedStagesWithIfPart" name="testNestedStagesWithIfPart">
<casePlanModel id="casePlanModel" name="testNestedStagesWithIfPart">
<planItem id="planItem1" name="A" definitionRef="sid-89452C7A-0D5E-4E4A-92F8-4D9C6B8E7907"></planItem>
<planItem id="planItem6" name="Stage1" definitionRef="sid-0FE3E74C-347F-413A-87A1-5D85AE8C98C5">
<exitCriterion id="sid-860A2CC6-7AF6-4DC2-BC24-3865AECD7382" sentryRef="sentry2"></exitCriterion>
<exitCriterion id="sid-EBA55C01-76DF-4D60-88E8-D0673CA61ADF" sentryRef="sentry3"></exitCriterion>
</planItem>
<sentry id="sentry2">
<planItemOnPart id="sentryOnPart1" sourceRef="planItem2">
<standardEvent>complete</standardEvent>
</planItemOnPart>
</sentry>
<sentry id="sentry3">
<ifPart>
<condition><![CDATA[${caseInstance.getVariable('destroyStages') && destroyStages}]]></condition>
</ifPart>
</sentry>
<sentry id="sentry4">
<ifPart>
<condition><![CDATA[${caseInstance.getVariable('destroyAll') && destroyAll}]]></condition>
</ifPart>
</sentry>
<task id="sid-89452C7A-0D5E-4E4A-92F8-4D9C6B8E7907" name="A"></task>
<stage id="sid-0FE3E74C-347F-413A-87A1-5D85AE8C98C5" name="Stage1">
<planItem id="planItem5" name="Stage2" definitionRef="sid-C5A24474-050F-4371-AF8C-2370366D4F37"></planItem>
<stage id="sid-C5A24474-050F-4371-AF8C-2370366D4F37" name="Stage2">
<planItem id="planItem3" name="Stage3" definitionRef="sid-37947C27-AB29-4FC9-A084-EB1D51598E8D">
<entryCriterion id="sid-8243F668-8A65-470D-B969-724F85440473" sentryRef="sentry1"></entryCriterion>
</planItem>
<planItem id="planItem4" name="C" definitionRef="sid-9682A576-EAC0-4D25-8256-6A65065B2763"></planItem>
<sentry id="sentry1">
<ifPart>
<condition><![CDATA[${caseInstance.getVariable('nestedStageEntryVariable') && nestedStageEntryVariable}]]></condition>
</ifPart>
</sentry>
<stage id="sid-37947C27-AB29-4FC9-A084-EB1D51598E8D" name="Stage3">
<planItem id="planItem2" name="B" definitionRef="sid-F41958A5-7C5E-4E30-B055-15B888F22F6F"></planItem>
<task id="sid-F41958A5-7C5E-4E30-B055-15B888F22F6F" name="B"></task>
</stage>
<task id="sid-9682A576-EAC0-4D25-8256-6A65065B2763" name="C"></task>
</stage>
</stage>
<exitCriterion id="sid-F622518C-3544-40A6-8AC7-3AB4E485DCD4" sentryRef="sentry4"></exitCriterion>
</casePlanModel>
</case>
<cmmndi:CMMNDI>
<cmmndi:CMMNDiagram id="CMMNDiagram_testNestedStagesWithIfPart">
<cmmndi:CMMNShape id="CMMNShape_casePlanModel" cmmnElementRef="casePlanModel">
<dc:Bounds height="714.0" width="718.0" x="40.0" y="40.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_sid-F622518C-3544-40A6-8AC7-3AB4E485DCD4" cmmnElementRef="sid-F622518C-3544-40A6-8AC7-3AB4E485DCD4">
<dc:Bounds height="22.0" width="14.0" x="751.7192741582194" y="605.3532916545225"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem1" cmmnElementRef="planItem1">
<dc:Bounds height="80.0" width="100.0" x="101.0" y="72.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem6" cmmnElementRef="planItem6">
<dc:Bounds height="442.0" width="583.0" x="75.0" y="189.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_sid-860A2CC6-7AF6-4DC2-BC24-3865AECD7382" cmmnElementRef="sid-860A2CC6-7AF6-4DC2-BC24-3865AECD7382">
<dc:Bounds height="22.0" width="14.0" x="651.807623146555" y="357.3867619826085"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_sid-EBA55C01-76DF-4D60-88E8-D0673CA61ADF" cmmnElementRef="sid-EBA55C01-76DF-4D60-88E8-D0673CA61ADF">
<dc:Bounds height="22.0" width="14.0" x="651.9660763472504" y="465.46956280619327"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem5" cmmnElementRef="planItem5">
<dc:Bounds height="320.0" width="490.0" x="105.0" y="240.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem3" cmmnElementRef="planItem3">
<dc:Bounds height="162.0" width="238.0" x="135.0" y="285.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_sid-8243F668-8A65-470D-B969-724F85440473" cmmnElementRef="sid-8243F668-8A65-470D-B969-724F85440473">
<dc:Bounds height="22.0" width="14.0" x="127.28988837090176" y="356.04550315833274"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem2" cmmnElementRef="planItem2">
<dc:Bounds height="80.0" width="100.0" x="170.0" y="326.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem4" cmmnElementRef="planItem4">
<dc:Bounds height="80.0" width="100.0" x="437.0" y="420.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNEdge id="CMMNEdge_sid-65214E25-0C71-48EB-8B73-EACF6B8EE8B0" cmmnElementRef="sid-860A2CC6-7AF6-4DC2-BC24-3865AECD7382" targetCMMNElementRef="planItem2">
<di:waypoint x="652.4587325141407" y="367.3635901192595"></di:waypoint>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNEdge>
</cmmndi:CMMNDiagram>
</cmmndi:CMMNDI>
</definitions>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/CMMN/20151109/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:flowable="http://flowable.org/cmmn" xmlns:cmmndi="http://www.omg.org/spec/CMMN/20151109/CMMNDI" xmlns:dc="http://www.omg.org/spec/CMMN/20151109/DC" xmlns:di="http://www.omg.org/spec/CMMN/20151109/DI" targetNamespace="http://www.flowable.org/casedef">
<case id="testNestedStagesWithIfPart" name="testNestedStagesWithIfPart">
<casePlanModel id="casePlanModel" name="testNestedStagesWithIfPart">
<planItem id="planItem1" name="A" definitionRef="sid-89452C7A-0D5E-4E4A-92F8-4D9C6B8E7907"></planItem>
<planItem id="planItem6" name="Stage1" definitionRef="sid-0FE3E74C-347F-413A-87A1-5D85AE8C98C5">
<exitCriterion id="sid-860A2CC6-7AF6-4DC2-BC24-3865AECD7382" sentryRef="sentry2"></exitCriterion>
<exitCriterion id="sid-EBA55C01-76DF-4D60-88E8-D0673CA61ADF" sentryRef="sentry3"></exitCriterion>
</planItem>
<sentry id="sentry2">
<planItemOnPart id="sentryOnPart1" sourceRef="planItem2">
<standardEvent>complete</standardEvent>
</planItemOnPart>
</sentry>
<sentry id="sentry3">
<ifPart>
<condition><![CDATA[${caseInstance.getVariable('destroyStages') && destroyStages}]]></condition>
</ifPart>
</sentry>
<sentry id="sentry4">
<ifPart>
<condition><![CDATA[${caseInstance.getVariable('destroyAll') && destroyAll}]]></condition>
</ifPart>
</sentry>
<task id="sid-89452C7A-0D5E-4E4A-92F8-4D9C6B8E7907" name="A"></task>
<stage id="sid-0FE3E74C-347F-413A-87A1-5D85AE8C98C5" name="Stage1">
<planItem id="planItem5" name="Stage2" definitionRef="sid-C5A24474-050F-4371-AF8C-2370366D4F37"></planItem>
<stage id="sid-C5A24474-050F-4371-AF8C-2370366D4F37" name="Stage2">
<planItem id="planItem3" name="Stage3" definitionRef="sid-37947C27-AB29-4FC9-A084-EB1D51598E8D">
<entryCriterion id="sid-8243F668-8A65-470D-B969-724F85440473" sentryRef="sentry1"></entryCriterion>
</planItem>
<planItem id="planItem4" name="C" definitionRef="sid-9682A576-EAC0-4D25-8256-6A65065B2763"></planItem>
<sentry id="sentry1">
<ifPart>
<condition><![CDATA[${caseInstance.getVariable('nestedStageEntryVariable') && nestedStageEntryVariable}]]></condition>
</ifPart>
</sentry>
<stage id="sid-37947C27-AB29-4FC9-A084-EB1D51598E8D" name="Stage3">
<planItem id="planItem2" name="B" definitionRef="sid-F41958A5-7C5E-4E30-B055-15B888F22F6F"></planItem>
<task id="sid-F41958A5-7C5E-4E30-B055-15B888F22F6F" name="B"></task>
</stage>
<task id="sid-9682A576-EAC0-4D25-8256-6A65065B2763" name="C"></task>
</stage>
</stage>
<exitCriterion id="sid-F622518C-3544-40A6-8AC7-3AB4E485DCD4" sentryRef="sentry4"></exitCriterion>
</casePlanModel>
</case>
<cmmndi:CMMNDI>
<cmmndi:CMMNDiagram id="CMMNDiagram_testNestedStagesWithIfPart">
<cmmndi:CMMNShape id="CMMNShape_casePlanModel" cmmnElementRef="casePlanModel">
<dc:Bounds height="714.0" width="718.0" x="40.0" y="40.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_sid-F622518C-3544-40A6-8AC7-3AB4E485DCD4" cmmnElementRef="sid-F622518C-3544-40A6-8AC7-3AB4E485DCD4">
<dc:Bounds height="22.0" width="14.0" x="751.7192741582194" y="605.3532916545225"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem1" cmmnElementRef="planItem1">
<dc:Bounds height="80.0" width="100.0" x="101.0" y="72.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem6" cmmnElementRef="planItem6">
<dc:Bounds height="442.0" width="583.0" x="75.0" y="189.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_sid-860A2CC6-7AF6-4DC2-BC24-3865AECD7382" cmmnElementRef="sid-860A2CC6-7AF6-4DC2-BC24-3865AECD7382">
<dc:Bounds height="22.0" width="14.0" x="651.807623146555" y="357.3867619826085"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_sid-EBA55C01-76DF-4D60-88E8-D0673CA61ADF" cmmnElementRef="sid-EBA55C01-76DF-4D60-88E8-D0673CA61ADF">
<dc:Bounds height="22.0" width="14.0" x="651.9660763472504" y="465.46956280619327"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem5" cmmnElementRef="planItem5">
<dc:Bounds height="320.0" width="490.0" x="105.0" y="240.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem3" cmmnElementRef="planItem3">
<dc:Bounds height="162.0" width="238.0" x="135.0" y="285.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_sid-8243F668-8A65-470D-B969-724F85440473" cmmnElementRef="sid-8243F668-8A65-470D-B969-724F85440473">
<dc:Bounds height="22.0" width="14.0" x="127.28988837090176" y="356.04550315833274"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem2" cmmnElementRef="planItem2">
<dc:Bounds height="80.0" width="100.0" x="170.0" y="326.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem4" cmmnElementRef="planItem4">
<dc:Bounds height="80.0" width="100.0" x="437.0" y="420.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNEdge id="CMMNEdge_sid-65214E25-0C71-48EB-8B73-EACF6B8EE8B0" cmmnElementRef="sid-860A2CC6-7AF6-4DC2-BC24-3865AECD7382" targetCMMNElementRef="planItem2">
<di:waypoint x="652.4587325141407" y="367.3635901192595"></di:waypoint>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNEdge>
</cmmndi:CMMNDiagram>
</cmmndi:CMMNDI>
</definitions>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/CMMN/20151109/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:flowable="http://flowable.org/cmmn" xmlns:cmmndi="http://www.omg.org/spec/CMMN/20151109/CMMNDI" xmlns:dc="http://www.omg.org/spec/CMMN/20151109/DC" xmlns:di="http://www.omg.org/spec/CMMN/20151109/DI" targetNamespace="http://www.flowable.org/casedef">
<case id="testStageWithExitIfPart" name="testStageWithExitIfPart">
<casePlanModel id="casePlanModel" name="testStageWithExitIfPart">
<planItem id="planItem1" name="A" definitionRef="sid-C3667DEB-E198-4E7E-BDDC-C6F92E6BCD7F"></planItem>
<planItem id="planItem4" definitionRef="sid-3B7B0D2E-4C58-4D4A-82C3-55CD93141667" name="The Stage">
<entryCriterion id="sid-992B7FB1-4712-4F08-BF9C-313880A8E139" sentryRef="sentry1"></entryCriterion>
<exitCriterion id="sid-89B2156C-EFD1-4BC5-9595-7EF73BFFE79F" sentryRef="sentry2"></exitCriterion>
<exitCriterion id="sid-1E8087C3-7E51-4E15-A972-E5125589D0FC" sentryRef="sentry3"></exitCriterion>
</planItem>
<sentry id="sentry1">
<ifPart>
<condition><![CDATA[${caseInstance.getVariable('enableStage') != null && enableStage}]]></condition>
</ifPart>
</sentry>
<sentry id="sentry2">
<ifPart>
<condition><![CDATA[${caseInstance.getVariable('stageExitVariable') != null && stageExitVariable}]]></condition>
</ifPart>
</sentry>
<sentry id="sentry3">
<planItemOnPart id="sentryOnPart1" sourceRef="planItem1">
<standardEvent>complete</standardEvent>
</planItemOnPart>
</sentry>
<task id="sid-C3667DEB-E198-4E7E-BDDC-C6F92E6BCD7F" name="A"></task>
<stage id="sid-3B7B0D2E-4C58-4D4A-82C3-55CD93141667" name="The Stage">
<planItem id="planItem2" name="B" definitionRef="sid-AE0B3627-E05A-4E3F-9A68-70007708690C"></planItem>
<planItem id="planItem3" name="C" definitionRef="sid-80372593-1D3A-4C67-B79F-DC85D4E41A76"></planItem>
<task id="sid-AE0B3627-E05A-4E3F-9A68-70007708690C" name="B"></task>
<task id="sid-80372593-1D3A-4C67-B79F-DC85D4E41A76" name="C"></task>
</stage>
</casePlanModel>
</case>
<cmmndi:CMMNDI>
<cmmndi:CMMNDiagram id="CMMNDiagram_testStageWithExitIfPart">
<cmmndi:CMMNShape id="CMMNShape_casePlanModel" cmmnElementRef="casePlanModel">
<dc:Bounds height="712.0" width="968.0" x="30.0" y="30.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem1" cmmnElementRef="planItem1">
<dc:Bounds height="80.0" width="100.0" x="785.0" y="425.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem4" cmmnElementRef="planItem4">
<dc:Bounds height="306.0" width="576.0" x="102.0" y="302.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_sid-992B7FB1-4712-4F08-BF9C-313880A8E139" cmmnElementRef="sid-992B7FB1-4712-4F08-BF9C-313880A8E139">
<dc:Bounds height="22.0" width="14.0" x="94.13933902966205" y="411.0461991049882"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_sid-89B2156C-EFD1-4BC5-9595-7EF73BFFE79F" cmmnElementRef="sid-89B2156C-EFD1-4BC5-9595-7EF73BFFE79F">
<dc:Bounds height="22.0" width="14.0" x="671.8405226523423" y="376.0375240818018"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_sid-1E8087C3-7E51-4E15-A972-E5125589D0FC" cmmnElementRef="sid-1E8087C3-7E51-4E15-A972-E5125589D0FC">
<dc:Bounds height="22.0" width="14.0" x="671.568027434405" y="478.0706436684628"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem2" cmmnElementRef="planItem2">
<dc:Bounds height="80.0" width="100.0" x="185.0" y="411.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem3" cmmnElementRef="planItem3">
<dc:Bounds height="80.0" width="100.0" x="340.0" y="415.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNEdge id="CMMNEdge_sid-C09B854A-D959-4BF2-8356-98D223DA0284" cmmnElementRef="sid-1E8087C3-7E51-4E15-A972-E5125589D0FC" targetCMMNElementRef="planItem1">
<di:waypoint x="684.4687649013687" y="487.34323111654857"></di:waypoint>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNEdge>
</cmmndi:CMMNDiagram>
</cmmndi:CMMNDI>
</definitions>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/CMMN/20151109/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:flowable="http://flowable.org/cmmn" xmlns:cmmndi="http://www.omg.org/spec/CMMN/20151109/CMMNDI" xmlns:dc="http://www.omg.org/spec/CMMN/20151109/DC" xmlns:di="http://www.omg.org/spec/CMMN/20151109/DI" targetNamespace="http://www.flowable.org/casedef">
<case id="testStageWithExitIfPart" name="testStageWithExitIfPart">
<casePlanModel id="casePlanModel" name="testStageWithExitIfPart">
<planItem id="planItem1" name="A" definitionRef="sid-C3667DEB-E198-4E7E-BDDC-C6F92E6BCD7F"></planItem>
<planItem id="planItem4" definitionRef="sid-3B7B0D2E-4C58-4D4A-82C3-55CD93141667" name="The Stage">
<entryCriterion id="sid-992B7FB1-4712-4F08-BF9C-313880A8E139" sentryRef="sentry1"></entryCriterion>
<exitCriterion id="sid-89B2156C-EFD1-4BC5-9595-7EF73BFFE79F" sentryRef="sentry2"></exitCriterion>
<exitCriterion id="sid-1E8087C3-7E51-4E15-A972-E5125589D0FC" sentryRef="sentry3"></exitCriterion>
</planItem>
<sentry id="sentry1">
<ifPart>
<condition><![CDATA[${caseInstance.getVariable('enableStage') != null && enableStage}]]></condition>
</ifPart>
</sentry>
<sentry id="sentry2">
<ifPart>
<condition><![CDATA[${caseInstance.getVariable('stageExitVariable') != null && stageExitVariable}]]></condition>
</ifPart>
</sentry>
<sentry id="sentry3">
<planItemOnPart id="sentryOnPart1" sourceRef="planItem1">
<standardEvent>complete</standardEvent>
</planItemOnPart>
</sentry>
<task id="sid-C3667DEB-E198-4E7E-BDDC-C6F92E6BCD7F" name="A"></task>
<stage id="sid-3B7B0D2E-4C58-4D4A-82C3-55CD93141667" name="The Stage">
<planItem id="planItem2" name="B" definitionRef="sid-AE0B3627-E05A-4E3F-9A68-70007708690C"></planItem>
<planItem id="planItem3" name="C" definitionRef="sid-80372593-1D3A-4C67-B79F-DC85D4E41A76"></planItem>
<task id="sid-AE0B3627-E05A-4E3F-9A68-70007708690C" name="B"></task>
<task id="sid-80372593-1D3A-4C67-B79F-DC85D4E41A76" name="C"></task>
</stage>
</casePlanModel>
</case>
<cmmndi:CMMNDI>
<cmmndi:CMMNDiagram id="CMMNDiagram_testStageWithExitIfPart">
<cmmndi:CMMNShape id="CMMNShape_casePlanModel" cmmnElementRef="casePlanModel">
<dc:Bounds height="712.0" width="968.0" x="30.0" y="30.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem1" cmmnElementRef="planItem1">
<dc:Bounds height="80.0" width="100.0" x="785.0" y="425.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem4" cmmnElementRef="planItem4">
<dc:Bounds height="306.0" width="576.0" x="102.0" y="302.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_sid-992B7FB1-4712-4F08-BF9C-313880A8E139" cmmnElementRef="sid-992B7FB1-4712-4F08-BF9C-313880A8E139">
<dc:Bounds height="22.0" width="14.0" x="94.13933902966205" y="411.0461991049882"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_sid-89B2156C-EFD1-4BC5-9595-7EF73BFFE79F" cmmnElementRef="sid-89B2156C-EFD1-4BC5-9595-7EF73BFFE79F">
<dc:Bounds height="22.0" width="14.0" x="671.8405226523423" y="376.0375240818018"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_sid-1E8087C3-7E51-4E15-A972-E5125589D0FC" cmmnElementRef="sid-1E8087C3-7E51-4E15-A972-E5125589D0FC">
<dc:Bounds height="22.0" width="14.0" x="671.568027434405" y="478.0706436684628"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem2" cmmnElementRef="planItem2">
<dc:Bounds height="80.0" width="100.0" x="185.0" y="411.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNShape id="CMMNShape_planItem3" cmmnElementRef="planItem3">
<dc:Bounds height="80.0" width="100.0" x="340.0" y="415.0"></dc:Bounds>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNShape>
<cmmndi:CMMNEdge id="CMMNEdge_sid-C09B854A-D959-4BF2-8356-98D223DA0284" cmmnElementRef="sid-1E8087C3-7E51-4E15-A972-E5125589D0FC" targetCMMNElementRef="planItem1">
<di:waypoint x="684.4687649013687" y="487.34323111654857"></di:waypoint>
<cmmndi:CMMNLabel></cmmndi:CMMNLabel>
</cmmndi:CMMNEdge>
</cmmndi:CMMNDiagram>
</cmmndi:CMMNDI>
</definitions>
\ No newline at end of file
......@@ -370,13 +370,13 @@ public class CmmnJsonConverter implements EditorJsonConstants, StencilConstants,
for (PlanItem planItem : planItems) {
PlanItemDefinition planItemDefinition = planItem.getPlanItemDefinition();
if (planItemDefinition instanceof Stage) {
Stage stage = (Stage) planItemDefinition;
postProcessElements(stage, stage.getPlanItems(), edgeMap, associationMap, cmmnModel, cmmnModelIdHelper);
}
if (CollectionUtils.isNotEmpty(planItem.getCriteriaRefs())) {
if (planItemDefinition instanceof Stage) {
Stage stage = (Stage) planItemDefinition;
postProcessElements(stage, stage.getPlanItems(), edgeMap, associationMap, cmmnModel, cmmnModelIdHelper);
}
createSentryParts(planItem.getCriteriaRefs(), parentStage, associationMap, cmmnModel, cmmnModelIdHelper, planItem, planItem);
}
}
......
......@@ -64,7 +64,7 @@ public class SimpleConverterTest extends AbstractConverterTest {
assertEquals(718.0, graphicInfo.getWidth(), 0.1);
assertEquals(714.0, graphicInfo.getHeight(), 0.1);
PlanItem planItem = planModelStage.findPlanItem("planItem1");
PlanItem planItem = planModelStage.findPlanItemInPlanFragmentOrUpwards("planItem1");
assertNotNull(planItem);
assertEquals("planItem1", planItem.getId());
assertEquals("Task B", planItem.getName());
......
......@@ -66,7 +66,7 @@ public class StageConverterTest extends AbstractConverterTest {
assertEquals(819.0, graphicInfo.getWidth(), 0.1);
assertEquals(713.0, graphicInfo.getHeight(), 0.1);
PlanItem planItem = planModelStage.findPlanItem("planItem1");
PlanItem planItem = planModelStage.findPlanItemInPlanFragmentOrUpwards("planItem1");
assertNotNull(planItem);
assertEquals("planItem1", planItem.getId());
assertEquals("Task", planItem.getName());
......@@ -86,7 +86,7 @@ public class StageConverterTest extends AbstractConverterTest {
assertEquals(100.0, graphicInfo.getWidth(), 0.1);
assertEquals(80.0, graphicInfo.getHeight(), 0.1);
PlanItem taskPlanItem = planModelStage.findPlanItem("planItem2");
PlanItem taskPlanItem = planModelStage.findPlanItemInPlanFragmentOrUpwards("planItem2");
assertNotNull(planItem);
assertEquals("planItem2", taskPlanItem.getId());
assertEquals("Task2", taskPlanItem.getName());
......@@ -106,7 +106,7 @@ public class StageConverterTest extends AbstractConverterTest {
assertEquals(100.0, graphicInfo.getWidth(), 0.1);
assertEquals(80.0, graphicInfo.getHeight(), 0.1);
PlanItem milestonePlanItem = planModelStage.findPlanItem("planItem6");
PlanItem milestonePlanItem = planModelStage.findPlanItemInPlanFragmentOrUpwards("planItem6");
assertNotNull(milestonePlanItem);
assertEquals("planItem6", milestonePlanItem.getId());
assertEquals("Milestone 1", milestonePlanItem.getName());
......@@ -149,7 +149,7 @@ public class StageConverterTest extends AbstractConverterTest {
assertEquals("complete", onPart.getStandardEvent());
assertEquals("planItem2", onPart.getSourceRef());
PlanItem stagePlanItem = planModelStage.findPlanItem("planItem5");
PlanItem stagePlanItem = planModelStage.findPlanItemInPlanFragmentOrUpwards("planItem5");
assertNotNull(stagePlanItem);
assertEquals("planItem5", stagePlanItem.getId());
assertEquals("Child stage", stagePlanItem.getName());
......@@ -171,7 +171,7 @@ public class StageConverterTest extends AbstractConverterTest {
assertEquals(241.0, graphicInfo.getHeight(), 0.1);
assertEquals(2, stage.getPlanItems().size());
PlanItem subPlanItem1 = stage.findPlanItem("planItem3");
PlanItem subPlanItem1 = stage.findPlanItemInPlanFragmentOrUpwards("planItem3");
assertNotNull(subPlanItem1);
assertEquals("planItem3", subPlanItem1.getId());
assertEquals("Sub task 1", subPlanItem1.getName());
......@@ -192,7 +192,7 @@ public class StageConverterTest extends AbstractConverterTest {
assertEquals(100.0, graphicInfo.getWidth(), 0.1);
assertEquals(80.0, graphicInfo.getHeight(), 0.1);
PlanItem subPlanItem2 = stage.findPlanItem("planItem4");
PlanItem subPlanItem2 = stage.findPlanItemInPlanFragmentOrUpwards("planItem4");
assertNotNull(subPlanItem2);
assertEquals("planItem4", subPlanItem2.getId());
assertEquals("Sub task 2", subPlanItem2.getName());
......
......@@ -107,7 +107,7 @@ public class CmmnModel {
public PlanItem findPlanItem(String id) {
PlanItem foundPlanItem = null;
for (Case caseModel : cases) {
foundPlanItem = caseModel.getPlanModel().findPlanItem(id);
foundPlanItem = caseModel.getPlanModel().findPlanItemInPlanFragmentOrUpwards(id);
if (foundPlanItem != null) {
break;
}
......@@ -116,7 +116,7 @@ public class CmmnModel {
if (foundPlanItem == null) {
for (Case caseModel : cases) {
for (Stage stage : caseModel.getPlanModel().findPlanItemDefinitionsOfType(Stage.class, true)) {
foundPlanItem = stage.findPlanItem(id);
foundPlanItem = stage.findPlanItemInPlanFragmentOrUpwards(id);
if (foundPlanItem != null) {
break;
}
......
......@@ -25,15 +25,30 @@ public class PlanFragment extends PlanItemDefinition {
protected Case caze;
protected Map<String, PlanItem> planItemMap = new LinkedHashMap<>();
protected List<Sentry> sentries = new ArrayList<>();
public PlanItem findPlanItem(String planItemId) {
public PlanItem findPlanItemInPlanFragmentOrDownwards(String planItemId) {
for (PlanItem planItem : planItemMap.values()) {
if (planItem.getId().equals(planItemId)) {
return planItem;
}
if (planItem.getPlanItemDefinition() instanceof PlanFragment) {
PlanItem p = ((PlanFragment) planItem.getPlanItemDefinition()).findPlanItemInPlanFragmentOrDownwards(planItemId);
if (p != null) {
return p;
}
}
}
return null;
}
public PlanItem findPlanItemInPlanFragmentOrUpwards(String planItemId) {
if (planItemMap.containsKey(planItemId)) {
return planItemMap.get(planItemId);
}
PlanFragment parentPlanFragment = getParent();
if (parentPlanFragment != null) {
return parentPlanFragment.findPlanItem(planItemId);
return parentPlanFragment.findPlanItemInPlanFragmentOrUpwards(planItemId);
}
return null;
......@@ -45,7 +60,7 @@ public class PlanFragment extends PlanItemDefinition {
return sentry;
}
}
PlanFragment parentPlanFragment = getParent();
if (parentPlanFragment != null) {
return parentPlanFragment.findSentry(sentryId);
......
......@@ -23,7 +23,7 @@ angular.module('flowableModeler')
popupType = 'PROCESS';
} else if ($scope.model.caseModel) {
model = $scope.model.caseModel;
popupType = 'CASEMODEL';
popupType = 'CASE';
} else if ($scope.model.form) {
model = $scope.model.form;
popupType = 'FORM';
......@@ -87,7 +87,7 @@ angular.module('flowableModeler')
$location.path("/apps/" + $scope.popup.id);
} else if (popupType === 'DECISION-TABLE') {
$location.path("/decision-tables/" + $scope.popup.id);
} else if (popupType === 'CASEMODEL') {
} else if (popupType === 'CASE') {
$location.path("/casemodels/" + $scope.popup.id);
} else {
$location.path("/processes/" + $scope.popup.id);
......@@ -117,7 +117,7 @@ angular.module('flowableModeler')
popupType = 'PROCESS';
} else if ($scope.model.caseModel) {
model = $scope.model.caseModel;
popupType = 'CASEMODEL';
popupType = 'CASE';
} else if ($scope.model.form) {
model = $scope.model.form;
popupType = 'FORM';
......@@ -186,7 +186,7 @@ angular.module('flowableModeler')
popupType = 'PROCESS';
} else if ($scope.model.caseModel) {
model = $scope.model.caseModel;
popupType = 'CASEMODEL';
popupType = 'CASE';
} else if ($scope.model.form) {
model = $scope.model.form;
popupType = 'FORM';
......@@ -224,7 +224,7 @@ angular.module('flowableModeler')
$location.path("/apps/" + $scope.popup.latestModelId);
} else if (popupType === 'DECISION-TABLE') {
$location.path("/decision-tables/" + $scope.popup.latestModelId);
} else if (popupType === 'CASEMODEL') {
} else if (popupType === 'CASE') {
$location.path("/casemodels/" + $scope.popup.latestModelId);
} else {
$location.path("/processes/" + $scope.popup.latestModelId);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册