use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class MilestonePlanItemHandlerTest method testWithParent.
@Test
public void testWithParent() {
// given:
// a new activity as parent
CmmnCaseDefinition parent = new CmmnCaseDefinition("aParentActivity");
context.setParent(parent);
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
assertEquals(parent, activity.getParent());
assertTrue(parent.getActivities().contains(activity));
}
use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class MilestonePlanItemHandlerTest method testRequiredRuleByDefaultPlanItemControl.
@Test
public void testRequiredRuleByDefaultPlanItemControl() {
// given
PlanItemControl defaultControl = createElement(milestone, "ItemControl_1", DefaultControl.class);
RequiredRule requiredRule = createElement(defaultControl, "RequiredRule_1", RequiredRule.class);
ConditionExpression expression = createElement(requiredRule, "Expression_1", ConditionExpression.class);
expression.setText("${true}");
Cmmn.validateModel(modelInstance);
// when
CmmnActivity newActivity = handler.handleElement(planItem, context);
// then
Object rule = newActivity.getProperty(PROPERTY_REQUIRED_RULE);
assertNotNull(rule);
assertTrue(rule instanceof CaseControlRule);
}
use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class MilestonePlanItemHandlerTest method testActivityBehavior.
@Test
public void testActivityBehavior() {
// given: a planItem
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
CmmnActivityBehavior behavior = activity.getActivityBehavior();
assertTrue(behavior instanceof MilestoneActivityBehavior);
}
use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class MilestonePlanItemHandlerTest method testRepetitionRuleByDefaultPlanItemControl.
@Test
public void testRepetitionRuleByDefaultPlanItemControl() {
// given
PlanItemControl defaultControl = createElement(milestone, "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
Object rule = newActivity.getProperty(PROPERTY_REPETITION_RULE);
assertNotNull(rule);
assertTrue(rule instanceof CaseControlRule);
}
use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class MilestonePlanItemHandlerTest method testMilestoneActivityType.
@Test
public void testMilestoneActivityType() {
// given
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
String activityType = (String) activity.getProperty(PROPERTY_ACTIVITY_TYPE);
assertEquals("milestone", activityType);
}
Aggregations