Search in sources :

Example 6 with DecisionTaskActivityBehavior

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));
}
Also used : ParameterValueProvider(org.camunda.bpm.engine.impl.core.variable.mapping.value.ParameterValueProvider) DecisionTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.DecisionTaskActivityBehavior) DmnDecisionTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.DmnDecisionTaskActivityBehavior) BaseCallableElement(org.camunda.bpm.engine.impl.core.model.BaseCallableElement) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) ConstantValueProvider(org.camunda.bpm.engine.impl.core.variable.mapping.value.ConstantValueProvider) Test(org.junit.Test)

Example 7 with DecisionTaskActivityBehavior

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());
}
Also used : DecisionTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.DecisionTaskActivityBehavior) DmnDecisionTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.DmnDecisionTaskActivityBehavior) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) Test(org.junit.Test)

Example 8 with DecisionTaskActivityBehavior

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());
}
Also used : ParameterValueProvider(org.camunda.bpm.engine.impl.core.variable.mapping.value.ParameterValueProvider) DecisionTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.DecisionTaskActivityBehavior) DmnDecisionTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.DmnDecisionTaskActivityBehavior) BaseCallableElement(org.camunda.bpm.engine.impl.core.model.BaseCallableElement) ElValueProvider(org.camunda.bpm.engine.impl.el.ElValueProvider) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) Test(org.junit.Test)

Example 9 with DecisionTaskActivityBehavior

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());
}
Also used : DecisionTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.DecisionTaskActivityBehavior) DmnDecisionTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.DmnDecisionTaskActivityBehavior) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) Test(org.junit.Test)

Aggregations

DecisionTaskActivityBehavior (org.camunda.bpm.engine.impl.cmmn.behavior.DecisionTaskActivityBehavior)9 DmnDecisionTaskActivityBehavior (org.camunda.bpm.engine.impl.cmmn.behavior.DmnDecisionTaskActivityBehavior)9 CmmnActivity (org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity)9 Test (org.junit.Test)9 BaseCallableElement (org.camunda.bpm.engine.impl.core.model.BaseCallableElement)7 ParameterValueProvider (org.camunda.bpm.engine.impl.core.variable.mapping.value.ParameterValueProvider)6 ConstantValueProvider (org.camunda.bpm.engine.impl.core.variable.mapping.value.ConstantValueProvider)3 ElValueProvider (org.camunda.bpm.engine.impl.el.ElValueProvider)3 DecisionRefExpression (org.camunda.bpm.model.cmmn.instance.DecisionRefExpression)2 CallableElementBinding (org.camunda.bpm.engine.impl.core.model.BaseCallableElement.CallableElementBinding)1