Search in sources :

Example 1 with CallableElementBinding

use of org.camunda.bpm.engine.impl.core.model.BaseCallableElement.CallableElementBinding in project camunda-bpm-platform by camunda.

the class ProcessTaskPlanItemHandlerTest method testBinding.

@Test
public void testBinding() {
    // given:
    CallableElementBinding processBinding = CallableElementBinding.LATEST;
    processTask.setCamundaProcessBinding(processBinding.getValue());
    // when
    CmmnActivity activity = handler.handleElement(planItem, context);
    // then
    ProcessTaskActivityBehavior behavior = (ProcessTaskActivityBehavior) activity.getActivityBehavior();
    CallableElement callableElement = behavior.getCallableElement();
    CallableElementBinding binding = callableElement.getBinding();
    assertNotNull(binding);
    assertEquals(processBinding, binding);
}
Also used : CallableElement(org.camunda.bpm.engine.impl.core.model.CallableElement) ProcessTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.ProcessTaskActivityBehavior) CallableElementBinding(org.camunda.bpm.engine.impl.core.model.BaseCallableElement.CallableElementBinding) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) Test(org.junit.Test)

Example 2 with CallableElementBinding

use of org.camunda.bpm.engine.impl.core.model.BaseCallableElement.CallableElementBinding in project camunda-bpm-platform by camunda.

the class CaseTaskPlanItemHandlerTest method testBinding.

@Test
public void testBinding() {
    // given:
    CallableElementBinding caseBinding = CallableElementBinding.LATEST;
    caseTask.setCamundaCaseBinding(caseBinding.getValue());
    // when
    CmmnActivity activity = handler.handleElement(planItem, context);
    // then
    CaseTaskActivityBehavior behavior = (CaseTaskActivityBehavior) activity.getActivityBehavior();
    CallableElement callableElement = behavior.getCallableElement();
    CallableElementBinding binding = callableElement.getBinding();
    assertNotNull(binding);
    assertEquals(caseBinding, binding);
}
Also used : CallableElement(org.camunda.bpm.engine.impl.core.model.CallableElement) CallableElementBinding(org.camunda.bpm.engine.impl.core.model.BaseCallableElement.CallableElementBinding) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) CaseTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.CaseTaskActivityBehavior) Test(org.junit.Test)

Example 3 with CallableElementBinding

use of org.camunda.bpm.engine.impl.core.model.BaseCallableElement.CallableElementBinding 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);
}
Also used : 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) CallableElementBinding(org.camunda.bpm.engine.impl.core.model.BaseCallableElement.CallableElementBinding) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) Test(org.junit.Test)

Example 4 with CallableElementBinding

use of org.camunda.bpm.engine.impl.core.model.BaseCallableElement.CallableElementBinding in project camunda-bpm-platform by camunda.

the class BpmnParse method parseVersion.

protected void parseVersion(Element callingActivityElement, ActivityImpl activity, BaseCallableElement callableElement, String bindingAttributeName, String versionAttributeName) {
    String version = null;
    CallableElementBinding binding = callableElement.getBinding();
    version = callingActivityElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, versionAttributeName);
    if (binding != null && binding.equals(CallableElementBinding.VERSION) && version == null) {
        addError("Missing attribute '" + versionAttributeName + "' when '" + bindingAttributeName + "' has value '" + CallableElementBinding.VERSION.getValue() + "'", callingActivityElement);
    }
    ParameterValueProvider versionProvider = createParameterValueProvider(version, expressionManager);
    callableElement.setVersionValueProvider(versionProvider);
}
Also used : ParameterValueProvider(org.camunda.bpm.engine.impl.core.variable.mapping.value.ParameterValueProvider) CallableElementBinding(org.camunda.bpm.engine.impl.core.model.BaseCallableElement.CallableElementBinding)

Aggregations

CallableElementBinding (org.camunda.bpm.engine.impl.core.model.BaseCallableElement.CallableElementBinding)4 CmmnActivity (org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity)3 Test (org.junit.Test)3 CallableElement (org.camunda.bpm.engine.impl.core.model.CallableElement)2 CaseTaskActivityBehavior (org.camunda.bpm.engine.impl.cmmn.behavior.CaseTaskActivityBehavior)1 DecisionTaskActivityBehavior (org.camunda.bpm.engine.impl.cmmn.behavior.DecisionTaskActivityBehavior)1 DmnDecisionTaskActivityBehavior (org.camunda.bpm.engine.impl.cmmn.behavior.DmnDecisionTaskActivityBehavior)1 ProcessTaskActivityBehavior (org.camunda.bpm.engine.impl.cmmn.behavior.ProcessTaskActivityBehavior)1 BaseCallableElement (org.camunda.bpm.engine.impl.core.model.BaseCallableElement)1 ParameterValueProvider (org.camunda.bpm.engine.impl.core.variable.mapping.value.ParameterValueProvider)1