Search in sources :

Example 21 with ExtensionElements

use of org.camunda.bpm.model.cmmn.instance.ExtensionElements in project camunda-bpm-platform by camunda.

the class CaseTaskPlanItemHandlerTest method testOutputSource.

@Test
public void testOutputSource() {
    // given:
    String source = "a";
    ExtensionElements extensionElements = addExtensionElements(caseTask);
    CamundaOut sourceElement = createElement(extensionElements, null, CamundaOut.class);
    sourceElement.setCamundaSource(source);
    // when
    CmmnActivity activity = handler.handleElement(planItem, context);
    // then
    CaseTaskActivityBehavior behavior = (CaseTaskActivityBehavior) activity.getActivityBehavior();
    CallableElement callableElement = behavior.getCallableElement();
    CallableElementParameter parameter = callableElement.getOutputs().get(0);
    assertNotNull(parameter);
    assertFalse(parameter.isAllVariables());
    ParameterValueProvider sourceValueProvider = parameter.getSourceValueProvider();
    assertNotNull(sourceValueProvider);
    assertTrue(sourceValueProvider instanceof ConstantValueProvider);
    assertEquals(source, sourceValueProvider.getValue(null));
}
Also used : CallableElement(org.camunda.bpm.engine.impl.core.model.CallableElement) ExtensionElements(org.camunda.bpm.model.cmmn.instance.ExtensionElements) ParameterValueProvider(org.camunda.bpm.engine.impl.core.variable.mapping.value.ParameterValueProvider) CallableElementParameter(org.camunda.bpm.engine.impl.core.model.CallableElementParameter) CamundaOut(org.camunda.bpm.model.cmmn.instance.camunda.CamundaOut) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) ConstantValueProvider(org.camunda.bpm.engine.impl.core.variable.mapping.value.ConstantValueProvider) CaseTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.CaseTaskActivityBehavior) Test(org.junit.Test)

Example 22 with ExtensionElements

use of org.camunda.bpm.model.cmmn.instance.ExtensionElements in project camunda-bpm-platform by camunda.

the class CaseTaskPlanItemHandlerTest method testInputTarget.

@Test
public void testInputTarget() {
    // given:
    String target = "b";
    ExtensionElements extensionElements = addExtensionElements(caseTask);
    CamundaIn sourceElement = createElement(extensionElements, null, CamundaIn.class);
    sourceElement.setCamundaTarget(target);
    // when
    CmmnActivity activity = handler.handleElement(planItem, context);
    // then
    CaseTaskActivityBehavior behavior = (CaseTaskActivityBehavior) activity.getActivityBehavior();
    CallableElement callableElement = behavior.getCallableElement();
    CallableElementParameter parameter = callableElement.getInputs().get(0);
    assertNotNull(parameter);
    assertFalse(parameter.isAllVariables());
    assertEquals(target, parameter.getTarget());
}
Also used : CallableElement(org.camunda.bpm.engine.impl.core.model.CallableElement) ExtensionElements(org.camunda.bpm.model.cmmn.instance.ExtensionElements) CallableElementParameter(org.camunda.bpm.engine.impl.core.model.CallableElementParameter) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) CamundaIn(org.camunda.bpm.model.cmmn.instance.camunda.CamundaIn) CaseTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.CaseTaskActivityBehavior) Test(org.junit.Test)

Example 23 with ExtensionElements

use of org.camunda.bpm.model.cmmn.instance.ExtensionElements in project camunda-bpm-platform by camunda.

the class CaseTaskPlanItemHandlerTest method testInputSource.

@Test
public void testInputSource() {
    // given:
    String source = "a";
    ExtensionElements extensionElements = addExtensionElements(caseTask);
    CamundaIn sourceElement = createElement(extensionElements, null, CamundaIn.class);
    sourceElement.setCamundaSource(source);
    // when
    CmmnActivity activity = handler.handleElement(planItem, context);
    // then
    CaseTaskActivityBehavior behavior = (CaseTaskActivityBehavior) activity.getActivityBehavior();
    CallableElement callableElement = behavior.getCallableElement();
    CallableElementParameter parameter = callableElement.getInputs().get(0);
    assertNotNull(parameter);
    assertFalse(parameter.isAllVariables());
    ParameterValueProvider sourceValueProvider = parameter.getSourceValueProvider();
    assertNotNull(sourceValueProvider);
    assertTrue(sourceValueProvider instanceof ConstantValueProvider);
    assertEquals(source, sourceValueProvider.getValue(null));
}
Also used : CallableElement(org.camunda.bpm.engine.impl.core.model.CallableElement) ExtensionElements(org.camunda.bpm.model.cmmn.instance.ExtensionElements) ParameterValueProvider(org.camunda.bpm.engine.impl.core.variable.mapping.value.ParameterValueProvider) CallableElementParameter(org.camunda.bpm.engine.impl.core.model.CallableElementParameter) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) ConstantValueProvider(org.camunda.bpm.engine.impl.core.variable.mapping.value.ConstantValueProvider) CamundaIn(org.camunda.bpm.model.cmmn.instance.camunda.CamundaIn) CaseTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.CaseTaskActivityBehavior) Test(org.junit.Test)

Example 24 with ExtensionElements

use of org.camunda.bpm.model.cmmn.instance.ExtensionElements in project camunda-bpm-platform by camunda.

the class CaseTaskPlanItemHandlerTest method testBusinessKeyExpression.

@Test
public void testBusinessKeyExpression() {
    // given:
    String businessKey = "${myBusinessKey}";
    ExtensionElements extensionElements = addExtensionElements(caseTask);
    CamundaIn businessKeyElement = createElement(extensionElements, null, CamundaIn.class);
    businessKeyElement.setCamundaBusinessKey(businessKey);
    // when
    CmmnActivity activity = handler.handleElement(planItem, context);
    // then
    CaseTaskActivityBehavior behavior = (CaseTaskActivityBehavior) activity.getActivityBehavior();
    CallableElement callableElement = behavior.getCallableElement();
    ParameterValueProvider businessKeyValueProvider = callableElement.getBusinessKeyValueProvider();
    assertNotNull(businessKeyValueProvider);
    assertTrue(businessKeyValueProvider instanceof ElValueProvider);
    ElValueProvider valueProvider = (ElValueProvider) businessKeyValueProvider;
    assertEquals(businessKey, valueProvider.getExpression().getExpressionText());
}
Also used : CallableElement(org.camunda.bpm.engine.impl.core.model.CallableElement) ExtensionElements(org.camunda.bpm.model.cmmn.instance.ExtensionElements) ParameterValueProvider(org.camunda.bpm.engine.impl.core.variable.mapping.value.ParameterValueProvider) ElValueProvider(org.camunda.bpm.engine.impl.el.ElValueProvider) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) CamundaIn(org.camunda.bpm.model.cmmn.instance.camunda.CamundaIn) CaseTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.CaseTaskActivityBehavior) Test(org.junit.Test)

Example 25 with ExtensionElements

use of org.camunda.bpm.model.cmmn.instance.ExtensionElements in project camunda-bpm-platform by camunda.

the class CaseTaskPlanItemHandlerTest method testOutputTarget.

@Test
public void testOutputTarget() {
    // given:
    String target = "b";
    ExtensionElements extensionElements = addExtensionElements(caseTask);
    CamundaOut sourceElement = createElement(extensionElements, null, CamundaOut.class);
    sourceElement.setCamundaTarget(target);
    // when
    CmmnActivity activity = handler.handleElement(planItem, context);
    // then
    CaseTaskActivityBehavior behavior = (CaseTaskActivityBehavior) activity.getActivityBehavior();
    CallableElement callableElement = behavior.getCallableElement();
    CallableElementParameter parameter = callableElement.getOutputs().get(0);
    assertNotNull(parameter);
    assertFalse(parameter.isAllVariables());
    assertEquals(target, parameter.getTarget());
}
Also used : CallableElement(org.camunda.bpm.engine.impl.core.model.CallableElement) ExtensionElements(org.camunda.bpm.model.cmmn.instance.ExtensionElements) CallableElementParameter(org.camunda.bpm.engine.impl.core.model.CallableElementParameter) CamundaOut(org.camunda.bpm.model.cmmn.instance.camunda.CamundaOut) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) CaseTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.CaseTaskActivityBehavior) Test(org.junit.Test)

Aggregations

ExtensionElements (org.camunda.bpm.model.cmmn.instance.ExtensionElements)48 Test (org.junit.Test)46 CmmnActivity (org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity)39 CallableElement (org.camunda.bpm.engine.impl.core.model.CallableElement)24 CallableElementParameter (org.camunda.bpm.engine.impl.core.model.CallableElementParameter)20 CamundaIn (org.camunda.bpm.model.cmmn.instance.camunda.CamundaIn)14 TaskListener (org.camunda.bpm.engine.delegate.TaskListener)12 CaseTaskActivityBehavior (org.camunda.bpm.engine.impl.cmmn.behavior.CaseTaskActivityBehavior)12 HumanTaskActivityBehavior (org.camunda.bpm.engine.impl.cmmn.behavior.HumanTaskActivityBehavior)12 ProcessTaskActivityBehavior (org.camunda.bpm.engine.impl.cmmn.behavior.ProcessTaskActivityBehavior)12 ParameterValueProvider (org.camunda.bpm.engine.impl.core.variable.mapping.value.ParameterValueProvider)12 TaskDefinition (org.camunda.bpm.engine.impl.task.TaskDefinition)12 ClassDelegateTaskListener (org.camunda.bpm.engine.impl.task.listener.ClassDelegateTaskListener)12 DelegateExpressionTaskListener (org.camunda.bpm.engine.impl.task.listener.DelegateExpressionTaskListener)12 ExpressionTaskListener (org.camunda.bpm.engine.impl.task.listener.ExpressionTaskListener)12 CamundaTaskListener (org.camunda.bpm.model.cmmn.instance.camunda.CamundaTaskListener)12 CamundaOut (org.camunda.bpm.model.cmmn.instance.camunda.CamundaOut)10 CamundaVariableOnPart (org.camunda.bpm.model.cmmn.instance.camunda.CamundaVariableOnPart)7 ConstantValueProvider (org.camunda.bpm.engine.impl.core.variable.mapping.value.ConstantValueProvider)6 ElValueProvider (org.camunda.bpm.engine.impl.el.ElValueProvider)6