use of org.camunda.bpm.engine.impl.cmmn.behavior.DecisionTaskActivityBehavior in project camunda-bpm-platform by camunda.
the class DecisionTaskPlanItemHandlerTest method testVersionConstant.
@Test
public void testVersionConstant() {
// given:
String caseVersion = "2";
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 ConstantValueProvider);
assertEquals(caseVersion, caseVersionValueProvider.getValue(null));
}
use of org.camunda.bpm.engine.impl.cmmn.behavior.DecisionTaskActivityBehavior in project camunda-bpm-platform by camunda.
the class DecisionTaskPlanItemHandlerTest method testConstantDecisionRefExpression.
@Test
public void testConstantDecisionRefExpression() {
// 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 decisionRefValueProvider = callableElement.getDefinitionKeyValueProvider();
assertNotNull(decisionRefValueProvider);
assertTrue(decisionRefValueProvider instanceof ConstantValueProvider);
ConstantValueProvider valueProvider = (ConstantValueProvider) decisionRefValueProvider;
assertEquals(decision, valueProvider.getValue(null));
}
use of org.camunda.bpm.engine.impl.cmmn.behavior.DecisionTaskActivityBehavior in project camunda-bpm-platform by camunda.
the class DecisionTaskPlanItemHandlerTest method testBinding.
@Test
public void testBinding() {
// given:
CallableElementBinding caseBinding = CallableElementBinding.LATEST;
decisionTask.setCamundaDecisionBinding(caseBinding.getValue());
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
DecisionTaskActivityBehavior behavior = (DecisionTaskActivityBehavior) activity.getActivityBehavior();
BaseCallableElement callableElement = behavior.getCallableElement();
CallableElementBinding binding = callableElement.getBinding();
assertNotNull(binding);
assertEquals(caseBinding, binding);
}
use of org.camunda.bpm.engine.impl.cmmn.behavior.DecisionTaskActivityBehavior in project camunda-bpm-platform by camunda.
the class DecisionTaskPlanItemHandlerTest method testExpressionDecisionRef.
@Test
public void testExpressionDecisionRef() {
// 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 caseRefValueProvider = callableElement.getDefinitionKeyValueProvider();
assertNotNull(caseRefValueProvider);
assertTrue(caseRefValueProvider instanceof ElValueProvider);
ElValueProvider valueProvider = (ElValueProvider) caseRefValueProvider;
assertEquals(decisionRef, valueProvider.getExpression().getExpressionText());
}
use of org.camunda.bpm.engine.impl.cmmn.behavior.DecisionTaskActivityBehavior 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());
}
Aggregations