use of org.camunda.bpm.model.cmmn.instance.RepetitionRule in project camunda-bpm-platform by camunda.
the class StagePlanItemHandlerTest method testRepetitionRuleCustomStandardEventsByDefaultPlanItemControl.
@Test
public void testRepetitionRuleCustomStandardEventsByDefaultPlanItemControl() {
// given
PlanItemControl defaultControl = createElement(stage, "DefaultControl_1", DefaultControl.class);
RepetitionRule repetitionRule = createElement(defaultControl, "RepititionRule_1", RepetitionRule.class);
ConditionExpression expression = createElement(repetitionRule, "Expression_1", ConditionExpression.class);
expression.setText("${true}");
repetitionRule.setCamundaRepeatOnStandardEvent(CaseExecutionListener.DISABLE);
Cmmn.validateModel(modelInstance);
// when
CmmnActivity newActivity = handler.handleElement(planItem, context);
// then
List<String> events = newActivity.getProperties().get(CmmnProperties.REPEAT_ON_STANDARD_EVENTS);
assertNotNull(events);
assertEquals(1, events.size());
assertTrue(events.contains(CaseExecutionListener.DISABLE));
}
use of org.camunda.bpm.model.cmmn.instance.RepetitionRule in project camunda-bpm-platform by camunda.
the class CaseTaskPlanItemHandlerTest method testRepetitionRuleCustomStandardEvents.
@Test
public void testRepetitionRuleCustomStandardEvents() {
// given
ItemControl itemControl = createElement(planItem, "ItemControl_1", ItemControl.class);
RepetitionRule repetitionRule = createElement(itemControl, "RepititionRule_1", RepetitionRule.class);
ConditionExpression expression = createElement(repetitionRule, "Expression_1", ConditionExpression.class);
expression.setText("${true}");
repetitionRule.setCamundaRepeatOnStandardEvent(CaseExecutionListener.DISABLE);
Cmmn.validateModel(modelInstance);
// when
CmmnActivity newActivity = handler.handleElement(planItem, context);
// then
List<String> events = newActivity.getProperties().get(CmmnProperties.REPEAT_ON_STANDARD_EVENTS);
assertNotNull(events);
assertEquals(1, events.size());
assertTrue(events.contains(CaseExecutionListener.DISABLE));
}
use of org.camunda.bpm.model.cmmn.instance.RepetitionRule in project camunda-bpm-platform by camunda.
the class CaseTaskPlanItemHandlerTest method testRepetitionRuleStandardEventsByDefaultPlanItemControl.
@Test
public void testRepetitionRuleStandardEventsByDefaultPlanItemControl() {
// given
PlanItemControl defaultControl = createElement(caseTask, "DefaultControl_1", DefaultControl.class);
RepetitionRule repetitionRule = createElement(defaultControl, "RepititionRule_1", RepetitionRule.class);
ConditionExpression expression = createElement(repetitionRule, "Expression_1", ConditionExpression.class);
expression.setText("${true}");
Cmmn.validateModel(modelInstance);
// when
CmmnActivity newActivity = handler.handleElement(planItem, context);
// then
List<String> events = newActivity.getProperties().get(CmmnProperties.REPEAT_ON_STANDARD_EVENTS);
assertNotNull(events);
assertEquals(2, events.size());
assertTrue(events.contains(CaseExecutionListener.COMPLETE));
assertTrue(events.contains(CaseExecutionListener.TERMINATE));
}
use of org.camunda.bpm.model.cmmn.instance.RepetitionRule in project camunda-bpm-platform by camunda.
the class DecisionTaskPlanItemHandlerTest method testRepetitionRuleCustomStandardEventsByDefaultPlanItemControl.
@Test
public void testRepetitionRuleCustomStandardEventsByDefaultPlanItemControl() {
// given
PlanItemControl defaultControl = createElement(decisionTask, "DefaultControl_1", DefaultControl.class);
RepetitionRule repetitionRule = createElement(defaultControl, "RepititionRule_1", RepetitionRule.class);
ConditionExpression expression = createElement(repetitionRule, "Expression_1", ConditionExpression.class);
expression.setText("${true}");
repetitionRule.setCamundaRepeatOnStandardEvent(CaseExecutionListener.DISABLE);
Cmmn.validateModel(modelInstance);
// when
CmmnActivity newActivity = handler.handleElement(planItem, context);
// then
List<String> events = newActivity.getProperties().get(CmmnProperties.REPEAT_ON_STANDARD_EVENTS);
assertNotNull(events);
assertEquals(1, events.size());
assertTrue(events.contains(CaseExecutionListener.DISABLE));
}
use of org.camunda.bpm.model.cmmn.instance.RepetitionRule in project camunda-bpm-platform by camunda.
the class DecisionTaskPlanItemHandlerTest method testRepetitionRuleStandardEventsByDefaultPlanItemControl.
@Test
public void testRepetitionRuleStandardEventsByDefaultPlanItemControl() {
// given
PlanItemControl defaultControl = createElement(decisionTask, "DefaultControl_1", DefaultControl.class);
RepetitionRule repetitionRule = createElement(defaultControl, "RepititionRule_1", RepetitionRule.class);
ConditionExpression expression = createElement(repetitionRule, "Expression_1", ConditionExpression.class);
expression.setText("${true}");
Cmmn.validateModel(modelInstance);
// when
CmmnActivity newActivity = handler.handleElement(planItem, context);
// then
List<String> events = newActivity.getProperties().get(CmmnProperties.REPEAT_ON_STANDARD_EVENTS);
assertNotNull(events);
assertEquals(2, events.size());
assertTrue(events.contains(CaseExecutionListener.COMPLETE));
assertTrue(events.contains(CaseExecutionListener.TERMINATE));
}
Aggregations