Search in sources :

Example 6 with CamundaOut

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

the class ProcessTaskPlanItemHandlerTest method testOutputVariables.

@Test
public void testOutputVariables() {
    // given:
    ExtensionElements extensionElements = addExtensionElements(processTask);
    CamundaOut variablesElement = createElement(extensionElements, null, CamundaOut.class);
    variablesElement.setCamundaVariables("all");
    // when
    CmmnActivity activity = handler.handleElement(planItem, context);
    // then
    ProcessTaskActivityBehavior behavior = (ProcessTaskActivityBehavior) activity.getActivityBehavior();
    CallableElement callableElement = behavior.getCallableElement();
    CallableElementParameter parameter = callableElement.getOutputs().get(0);
    assertNotNull(parameter);
    assertTrue(parameter.isAllVariables());
}
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) ProcessTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.ProcessTaskActivityBehavior) CamundaOut(org.camunda.bpm.model.cmmn.instance.camunda.CamundaOut) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) Test(org.junit.Test)

Example 7 with CamundaOut

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

the class ProcessTaskPlanItemHandlerTest method testOutputTarget.

@Test
public void testOutputTarget() {
    // given:
    String target = "b";
    ExtensionElements extensionElements = addExtensionElements(processTask);
    CamundaOut sourceElement = createElement(extensionElements, null, CamundaOut.class);
    sourceElement.setCamundaTarget(target);
    // when
    CmmnActivity activity = handler.handleElement(planItem, context);
    // then
    ProcessTaskActivityBehavior behavior = (ProcessTaskActivityBehavior) 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) ProcessTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.ProcessTaskActivityBehavior) CamundaOut(org.camunda.bpm.model.cmmn.instance.camunda.CamundaOut) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) Test(org.junit.Test)

Example 8 with CamundaOut

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

the class ProcessTaskPlanItemHandlerTest method testOutputs.

@Test
public void testOutputs() {
    // given:
    ExtensionElements extensionElements = addExtensionElements(processTask);
    CamundaOut variablesElement = createElement(extensionElements, null, CamundaOut.class);
    variablesElement.setCamundaVariables("all");
    CamundaOut sourceElement = createElement(extensionElements, null, CamundaOut.class);
    sourceElement.setCamundaSource("a");
    CamundaOut sourceExpressionElement = createElement(extensionElements, null, CamundaOut.class);
    sourceExpressionElement.setCamundaSourceExpression("${b}");
    // when
    CmmnActivity activity = handler.handleElement(planItem, context);
    // then
    ProcessTaskActivityBehavior behavior = (ProcessTaskActivityBehavior) activity.getActivityBehavior();
    CallableElement callableElement = behavior.getCallableElement();
    List<CallableElementParameter> outputs = callableElement.getOutputs();
    assertNotNull(outputs);
    assertFalse(outputs.isEmpty());
    assertEquals(3, outputs.size());
}
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) ProcessTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.ProcessTaskActivityBehavior) CamundaOut(org.camunda.bpm.model.cmmn.instance.camunda.CamundaOut) CmmnActivity(org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity) Test(org.junit.Test)

Example 9 with CamundaOut

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

the class ProcessTaskPlanItemHandlerTest method testOutputSource.

@Test
public void testOutputSource() {
    // given:
    String source = "a";
    ExtensionElements extensionElements = addExtensionElements(processTask);
    CamundaOut sourceElement = createElement(extensionElements, null, CamundaOut.class);
    sourceElement.setCamundaSource(source);
    // when
    CmmnActivity activity = handler.handleElement(planItem, context);
    // then
    ProcessTaskActivityBehavior behavior = (ProcessTaskActivityBehavior) 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) ProcessTaskActivityBehavior(org.camunda.bpm.engine.impl.cmmn.behavior.ProcessTaskActivityBehavior) 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) Test(org.junit.Test)

Example 10 with CamundaOut

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

the class CaseTaskPlanItemHandlerTest method testOutputs.

@Test
public void testOutputs() {
    // given:
    ExtensionElements extensionElements = addExtensionElements(caseTask);
    CamundaOut variablesElement = createElement(extensionElements, null, CamundaOut.class);
    variablesElement.setCamundaVariables("all");
    CamundaOut sourceElement = createElement(extensionElements, null, CamundaOut.class);
    sourceElement.setCamundaSource("a");
    CamundaOut sourceExpressionElement = createElement(extensionElements, null, CamundaOut.class);
    sourceExpressionElement.setCamundaSourceExpression("${b}");
    // when
    CmmnActivity activity = handler.handleElement(planItem, context);
    // then
    CaseTaskActivityBehavior behavior = (CaseTaskActivityBehavior) activity.getActivityBehavior();
    CallableElement callableElement = behavior.getCallableElement();
    List<CallableElementParameter> outputs = callableElement.getOutputs();
    assertNotNull(outputs);
    assertFalse(outputs.isEmpty());
    assertEquals(3, outputs.size());
}
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

CamundaOut (org.camunda.bpm.model.cmmn.instance.camunda.CamundaOut)12 CallableElementParameter (org.camunda.bpm.engine.impl.core.model.CallableElementParameter)11 CmmnActivity (org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity)10 CallableElement (org.camunda.bpm.engine.impl.core.model.CallableElement)10 ExtensionElements (org.camunda.bpm.model.cmmn.instance.ExtensionElements)10 Test (org.junit.Test)10 CaseTaskActivityBehavior (org.camunda.bpm.engine.impl.cmmn.behavior.CaseTaskActivityBehavior)5 ProcessTaskActivityBehavior (org.camunda.bpm.engine.impl.cmmn.behavior.ProcessTaskActivityBehavior)5 ParameterValueProvider (org.camunda.bpm.engine.impl.core.variable.mapping.value.ParameterValueProvider)5 ConstantValueProvider (org.camunda.bpm.engine.impl.core.variable.mapping.value.ConstantValueProvider)2 ElValueProvider (org.camunda.bpm.engine.impl.el.ElValueProvider)2 ExpressionManager (org.camunda.bpm.engine.impl.el.ExpressionManager)1 ModelTypeInstanceContext (org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)1 ModelElementTypeBuilder (org.camunda.bpm.model.xml.type.ModelElementTypeBuilder)1