Search in sources :

Example 1 with DmnDecisionTaskActivityBehavior

use of org.camunda.bpm.engine.impl.cmmn.behavior.DmnDecisionTaskActivityBehavior in project camunda-bpm-platform by camunda.

the class DecisionTaskItemHandler method initializeDecisionTableResultMapper.

protected void initializeDecisionTableResultMapper(CmmnElement element, CmmnActivity activity, CmmnHandlerContext context) {
    DecisionTask decisionTask = getDefinition(element);
    DmnDecisionTaskActivityBehavior behavior = getActivityBehavior(activity);
    String mapper = decisionTask.getCamundaMapDecisionResult();
    DecisionResultMapper decisionResultMapper = getDecisionResultMapperForName(mapper);
    behavior.setDecisionTableResultMapper(decisionResultMapper);
}
Also used : DmnDecisionTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.DmnDecisionTaskActivityBehavior) DecisionTask(org.camunda.bpm.model.cmmn.instance.DecisionTask) DecisionResultMapper(org.camunda.bpm.engine.impl.dmn.result.DecisionResultMapper)

Example 2 with DmnDecisionTaskActivityBehavior

use of org.camunda.bpm.engine.impl.cmmn.behavior.DmnDecisionTaskActivityBehavior in project camunda-bpm-platform by camunda.

the class DecisionTaskPlanItemHandlerTest method testActivityBehavior.

@Test
public void testActivityBehavior() {
    // given: a planItem
    // when
    CmmnActivity activity = handler.handleElement(planItem, context);
    // then
    CmmnActivityBehavior behavior = activity.getActivityBehavior();
    assertTrue(behavior instanceof DmnDecisionTaskActivityBehavior);
}
Also used : DmnDecisionTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.DmnDecisionTaskActivityBehavior) CmmnActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.CmmnActivityBehavior) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) Test(org.junit.Test)

Example 3 with DmnDecisionTaskActivityBehavior

use of org.camunda.bpm.engine.impl.cmmn.behavior.DmnDecisionTaskActivityBehavior in project camunda-bpm-platform by camunda.

the class DecisionTaskPlanItemHandlerTest method testDefaultMapDecisionResult.

@Test
public void testDefaultMapDecisionResult() {
    // given:
    // when
    CmmnActivity activity = handler.handleElement(planItem, context);
    // then
    DmnDecisionTaskActivityBehavior behavior = (DmnDecisionTaskActivityBehavior) activity.getActivityBehavior();
    DecisionResultMapper mapper = behavior.getDecisionTableResultMapper();
    assertTrue(mapper instanceof ResultListDecisionTableResultMapper);
}
Also used : DmnDecisionTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.DmnDecisionTaskActivityBehavior) ResultListDecisionTableResultMapper(org.camunda.bpm.engine.impl.dmn.result.ResultListDecisionTableResultMapper) SingleResultDecisionResultMapper(org.camunda.bpm.engine.impl.dmn.result.SingleResultDecisionResultMapper) DecisionResultMapper(org.camunda.bpm.engine.impl.dmn.result.DecisionResultMapper) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) Test(org.junit.Test)

Example 4 with DmnDecisionTaskActivityBehavior

use of org.camunda.bpm.engine.impl.cmmn.behavior.DmnDecisionTaskActivityBehavior in project camunda-bpm-platform by camunda.

the class DecisionTaskPlanItemHandlerTest method testMapDecisionResult.

@Test
public void testMapDecisionResult() {
    // given:
    decisionTask.setCamundaMapDecisionResult("singleResult");
    // when
    CmmnActivity activity = handler.handleElement(planItem, context);
    // then
    DmnDecisionTaskActivityBehavior behavior = (DmnDecisionTaskActivityBehavior) activity.getActivityBehavior();
    DecisionResultMapper mapper = behavior.getDecisionTableResultMapper();
    assertTrue(mapper instanceof SingleResultDecisionResultMapper);
}
Also used : DmnDecisionTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.DmnDecisionTaskActivityBehavior) SingleResultDecisionResultMapper(org.camunda.bpm.engine.impl.dmn.result.SingleResultDecisionResultMapper) DecisionResultMapper(org.camunda.bpm.engine.impl.dmn.result.DecisionResultMapper) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) SingleResultDecisionResultMapper(org.camunda.bpm.engine.impl.dmn.result.SingleResultDecisionResultMapper) Test(org.junit.Test)

Example 5 with DmnDecisionTaskActivityBehavior

use of org.camunda.bpm.engine.impl.cmmn.behavior.DmnDecisionTaskActivityBehavior in project camunda-bpm-platform by camunda.

the class DecisionTaskItemHandler method initializeResultVariable.

protected void initializeResultVariable(CmmnElement element, CmmnActivity activity, CmmnHandlerContext context) {
    DecisionTask decisionTask = getDefinition(element);
    DmnDecisionTaskActivityBehavior behavior = getActivityBehavior(activity);
    String resultVariable = decisionTask.getCamundaResultVariable();
    behavior.setResultVariable(resultVariable);
}
Also used : DmnDecisionTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.DmnDecisionTaskActivityBehavior) DecisionTask(org.camunda.bpm.model.cmmn.instance.DecisionTask)

Aggregations

DmnDecisionTaskActivityBehavior (org.camunda.bpm.engine.impl.cmmn.behavior.DmnDecisionTaskActivityBehavior)5 CmmnActivity (org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity)3 DecisionResultMapper (org.camunda.bpm.engine.impl.dmn.result.DecisionResultMapper)3 Test (org.junit.Test)3 SingleResultDecisionResultMapper (org.camunda.bpm.engine.impl.dmn.result.SingleResultDecisionResultMapper)2 DecisionTask (org.camunda.bpm.model.cmmn.instance.DecisionTask)2 CmmnActivityBehavior (org.camunda.bpm.engine.impl.cmmn.behavior.CmmnActivityBehavior)1 ResultListDecisionTableResultMapper (org.camunda.bpm.engine.impl.dmn.result.ResultListDecisionTableResultMapper)1