use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class ProcessTaskPlanItemHandlerTest method testInputSourceExpression.
@Test
public void testInputSourceExpression() {
// given:
String source = "${a}";
ExtensionElements extensionElements = addExtensionElements(processTask);
CamundaIn sourceElement = createElement(extensionElements, null, CamundaIn.class);
sourceElement.setCamundaSourceExpression(source);
// 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);
assertFalse(parameter.isAllVariables());
ParameterValueProvider sourceExpressionValueProvider = parameter.getSourceValueProvider();
assertNotNull(sourceExpressionValueProvider);
assertTrue(sourceExpressionValueProvider instanceof ElValueProvider);
ElValueProvider valueProvider = (ElValueProvider) sourceExpressionValueProvider;
assertEquals(source, valueProvider.getExpression().getExpressionText());
}
use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class ProcessTaskPlanItemHandlerTest method testRequiredRule.
@Test
public void testRequiredRule() {
// given
ItemControl itemControl = createElement(planItem, "ItemControl_1", ItemControl.class);
RequiredRule requiredRule = createElement(itemControl, "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 ProcessTaskPlanItemHandlerTest method testRepetitionRule.
@Test
public void testRepetitionRule() {
// 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}");
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 ProcessTaskPlanItemHandlerTest method testCallableElement.
@Test
public void testCallableElement() {
// given: a plan item
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
// there exists a callableElement
ProcessTaskActivityBehavior behavior = (ProcessTaskActivityBehavior) activity.getActivityBehavior();
assertNotNull(behavior.getCallableElement());
}
use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class ProcessTaskPlanItemHandlerTest method testWithoutParent.
@Test
public void testWithoutParent() {
// given: a planItem
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
assertNull(activity.getParent());
}
Aggregations