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());
}
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());
}
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());
}
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));
}
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());
}
Aggregations