use of org.camunda.bpm.engine.impl.cmmn.behavior.ProcessTaskActivityBehavior 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.engine.impl.cmmn.behavior.ProcessTaskActivityBehavior in project camunda-bpm-platform by camunda.
the class ProcessTaskPlanItemHandlerTest method testVersionExpression.
@Test
public void testVersionExpression() {
// given:
String processVersion = "${aVersion}";
processTask.setCamundaProcessVersion(processVersion);
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
ProcessTaskActivityBehavior behavior = (ProcessTaskActivityBehavior) activity.getActivityBehavior();
CallableElement callableElement = behavior.getCallableElement();
ParameterValueProvider processVersionValueProvider = callableElement.getVersionValueProvider();
assertNotNull(processVersionValueProvider);
assertTrue(processVersionValueProvider instanceof ElValueProvider);
ElValueProvider valueProvider = (ElValueProvider) processVersionValueProvider;
assertEquals(processVersion, valueProvider.getExpression().getExpressionText());
}
use of org.camunda.bpm.engine.impl.cmmn.behavior.ProcessTaskActivityBehavior in project camunda-bpm-platform by camunda.
the class ProcessTaskPlanItemHandlerTest method testBusinessKeyExpression.
@Test
public void testBusinessKeyExpression() {
// given:
String businessKey = "${myBusinessKey}";
ExtensionElements extensionElements = addExtensionElements(processTask);
CamundaIn businessKeyElement = createElement(extensionElements, null, CamundaIn.class);
businessKeyElement.setCamundaBusinessKey(businessKey);
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
ProcessTaskActivityBehavior behavior = (ProcessTaskActivityBehavior) 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());
}
use of org.camunda.bpm.engine.impl.cmmn.behavior.ProcessTaskActivityBehavior in project camunda-bpm-platform by camunda.
the class ProcessTaskPlanItemHandlerTest method testVersionConstant.
@Test
public void testVersionConstant() {
// given:
String processVersion = "2";
processTask.setCamundaProcessVersion(processVersion);
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
ProcessTaskActivityBehavior behavior = (ProcessTaskActivityBehavior) activity.getActivityBehavior();
CallableElement callableElement = behavior.getCallableElement();
ParameterValueProvider processVersionValueProvider = callableElement.getVersionValueProvider();
assertNotNull(processVersionValueProvider);
assertTrue(processVersionValueProvider instanceof ConstantValueProvider);
assertEquals(processVersion, processVersionValueProvider.getValue(null));
}
Aggregations