use of org.camunda.bpm.engine.impl.core.model.BaseCallableElement in project camunda-bpm-platform by camunda.
the class DecisionTaskPlanItemHandlerTest method testExpressionDecisionRefExpression.
@Test
public void testExpressionDecisionRefExpression() {
// given:
String decision = "${aDecisionToCall}";
DecisionRefExpression decisionRefExpression = createElement(decisionTask, DecisionRefExpression.class);
decisionRefExpression.setText(decision);
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
DecisionTaskActivityBehavior behavior = (DecisionTaskActivityBehavior) activity.getActivityBehavior();
BaseCallableElement callableElement = behavior.getCallableElement();
ParameterValueProvider caseRefValueProvider = callableElement.getDefinitionKeyValueProvider();
assertNotNull(caseRefValueProvider);
assertTrue(caseRefValueProvider instanceof ElValueProvider);
ElValueProvider valueProvider = (ElValueProvider) caseRefValueProvider;
assertEquals(decision, valueProvider.getExpression().getExpressionText());
}
use of org.camunda.bpm.engine.impl.core.model.BaseCallableElement 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.core.model.BaseCallableElement 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());
}
Aggregations