use of org.camunda.bpm.engine.impl.cmmn.behavior.DecisionTaskActivityBehavior in project camunda-bpm-platform by camunda.
the class DecisionTaskPlanItemHandlerTest method testConstantDecisionRef.
@Test
public void testConstantDecisionRef() {
// given:
String decisionRef = "aDecisionToCall";
decisionTask.setDecision(decisionRef);
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
DecisionTaskActivityBehavior behavior = (DecisionTaskActivityBehavior) activity.getActivityBehavior();
BaseCallableElement callableElement = behavior.getCallableElement();
ParameterValueProvider decisionRefValueProvider = callableElement.getDefinitionKeyValueProvider();
assertNotNull(decisionRefValueProvider);
assertTrue(decisionRefValueProvider instanceof ConstantValueProvider);
ConstantValueProvider valueProvider = (ConstantValueProvider) decisionRefValueProvider;
assertEquals(decisionRef, valueProvider.getValue(null));
}
use of org.camunda.bpm.engine.impl.cmmn.behavior.DecisionTaskActivityBehavior in project camunda-bpm-platform by camunda.
the class DecisionTaskPlanItemHandlerTest method testCallableElement.
@Test
public void testCallableElement() {
// given
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
DecisionTaskActivityBehavior behavior = (DecisionTaskActivityBehavior) activity.getActivityBehavior();
assertNotNull(behavior.getCallableElement());
}
use of org.camunda.bpm.engine.impl.cmmn.behavior.DecisionTaskActivityBehavior in project camunda-bpm-platform by camunda.
the class DecisionTaskPlanItemHandlerTest method testVersionExpression.
@Test
public void testVersionExpression() {
// given:
String caseVersion = "${aVersion}";
decisionTask.setCamundaDecisionVersion(caseVersion);
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
DecisionTaskActivityBehavior behavior = (DecisionTaskActivityBehavior) activity.getActivityBehavior();
BaseCallableElement callableElement = behavior.getCallableElement();
ParameterValueProvider caseVersionValueProvider = callableElement.getVersionValueProvider();
assertNotNull(caseVersionValueProvider);
assertTrue(caseVersionValueProvider instanceof ElValueProvider);
ElValueProvider valueProvider = (ElValueProvider) caseVersionValueProvider;
assertEquals(caseVersion, valueProvider.getExpression().getExpressionText());
}
use of org.camunda.bpm.engine.impl.cmmn.behavior.DecisionTaskActivityBehavior in project camunda-bpm-platform by camunda.
the class DecisionTaskPlanItemHandlerTest method testResultVariable.
@Test
public void testResultVariable() {
// given:
decisionTask.setCamundaResultVariable("aResultVariable");
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
DecisionTaskActivityBehavior behavior = (DecisionTaskActivityBehavior) activity.getActivityBehavior();
assertEquals("aResultVariable", behavior.getResultVariable());
}
Aggregations