use of org.camunda.bpm.engine.impl.cmmn.behavior.ProcessTaskActivityBehavior in project camunda-bpm-platform by camunda.
the class ProcessTaskPlanItemHandlerTest method testOutputSourceExpression.
@Test
public void testOutputSourceExpression() {
// given:
String source = "${a}";
ExtensionElements extensionElements = addExtensionElements(processTask);
CamundaOut sourceElement = createElement(extensionElements, null, CamundaOut.class);
sourceElement.setCamundaSourceExpression(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 sourceExpressionValueProvider = parameter.getSourceValueProvider();
assertNotNull(sourceExpressionValueProvider);
assertTrue(sourceExpressionValueProvider instanceof ElValueProvider);
ElValueProvider valueProvider = (ElValueProvider) sourceExpressionValueProvider;
assertEquals(source, valueProvider.getExpression().getExpressionText());
}
use of org.camunda.bpm.engine.impl.cmmn.behavior.ProcessTaskActivityBehavior in project camunda-bpm-platform by camunda.
the class ProcessTaskPlanItemHandlerTest method testInputSourceExpression.
@Test
public void testInputSourceExpression() {
// given:
String source = "${a}";
ExtensionElements extensionElements = addExtensionElements(processTask);
CamundaIn sourceElement = createElement(extensionElements, null, CamundaIn.class);
sourceElement.setCamundaSourceExpression(source);
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
ProcessTaskActivityBehavior behavior = (ProcessTaskActivityBehavior) activity.getActivityBehavior();
CallableElement callableElement = behavior.getCallableElement();
CallableElementParameter parameter = callableElement.getInputs().get(0);
assertNotNull(parameter);
assertFalse(parameter.isAllVariables());
ParameterValueProvider sourceExpressionValueProvider = parameter.getSourceValueProvider();
assertNotNull(sourceExpressionValueProvider);
assertTrue(sourceExpressionValueProvider instanceof ElValueProvider);
ElValueProvider valueProvider = (ElValueProvider) sourceExpressionValueProvider;
assertEquals(source, valueProvider.getExpression().getExpressionText());
}
use of org.camunda.bpm.engine.impl.cmmn.behavior.ProcessTaskActivityBehavior in project camunda-bpm-platform by camunda.
the class ProcessTaskPlanItemHandlerTest method testCallableElement.
@Test
public void testCallableElement() {
// given: a plan item
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
// there exists a callableElement
ProcessTaskActivityBehavior behavior = (ProcessTaskActivityBehavior) activity.getActivityBehavior();
assertNotNull(behavior.getCallableElement());
}
use of org.camunda.bpm.engine.impl.cmmn.behavior.ProcessTaskActivityBehavior in project camunda-bpm-platform by camunda.
the class ProcessTaskPlanItemHandlerTest method testInputTarget.
@Test
public void testInputTarget() {
// given:
String target = "b";
ExtensionElements extensionElements = addExtensionElements(processTask);
CamundaIn sourceElement = createElement(extensionElements, null, CamundaIn.class);
sourceElement.setCamundaTarget(target);
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
ProcessTaskActivityBehavior behavior = (ProcessTaskActivityBehavior) activity.getActivityBehavior();
CallableElement callableElement = behavior.getCallableElement();
CallableElementParameter parameter = callableElement.getInputs().get(0);
assertNotNull(parameter);
assertFalse(parameter.isAllVariables());
assertEquals(target, parameter.getTarget());
}
use of org.camunda.bpm.engine.impl.cmmn.behavior.ProcessTaskActivityBehavior 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);
}
Aggregations