use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class ProcessTaskPlanItemHandlerTest method testInputVariables.
@Test
public void testInputVariables() {
// given:
ExtensionElements extensionElements = addExtensionElements(processTask);
CamundaIn variablesElement = createElement(extensionElements, null, CamundaIn.class);
variablesElement.setCamundaVariables("all");
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
ProcessTaskActivityBehavior behavior = (ProcessTaskActivityBehavior) activity.getActivityBehavior();
CallableElement callableElement = behavior.getCallableElement();
CallableElementParameter parameter = callableElement.getInputs().get(0);
assertNotNull(parameter);
assertTrue(parameter.isAllVariables());
}
use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class ProcessTaskPlanItemHandlerTest method testActivityBehavior.
@Test
public void testActivityBehavior() {
// given: a planItem
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
CmmnActivityBehavior behavior = activity.getActivityBehavior();
assertTrue(behavior instanceof ProcessTaskActivityBehavior);
}
use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class ProcessTaskPlanItemHandlerTest method testManualActivationRule.
@Test
public void testManualActivationRule() {
// given
ItemControl itemControl = createElement(planItem, "ItemControl_1", ItemControl.class);
ManualActivationRule manualActivationRule = createElement(itemControl, "ManualActivationRule_1", ManualActivationRule.class);
ConditionExpression expression = createElement(manualActivationRule, "Expression_1", ConditionExpression.class);
expression.setText("${true}");
Cmmn.validateModel(modelInstance);
// when
CmmnActivity newActivity = handler.handleElement(planItem, context);
// then
Object rule = newActivity.getProperty(PROPERTY_MANUAL_ACTIVATION_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 StageDiscretionaryItemHandlerTest method testRequiredRuleByDefaultPlanItemControl.
@Test
public void testRequiredRuleByDefaultPlanItemControl() {
// given
PlanItemControl defaultControl = createElement(stage, "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(discretionaryItem, 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 StageDiscretionaryItemHandlerTest method testDiscretionaryItemDescription.
@Test
public void testDiscretionaryItemDescription() {
// given
String description = "This is a discretionaryItem";
discretionaryItem.setDescription(description);
// when
CmmnActivity activity = handler.handleElement(discretionaryItem, context);
// then
assertEquals(description, activity.getProperty(PROPERTY_ACTIVITY_DESCRIPTION));
}
Aggregations