use of org.camunda.bpm.engine.impl.cmmn.behavior.CaseTaskActivityBehavior in project camunda-bpm-platform by camunda.
the class CaseTaskPlanItemHandlerTest method testBusinessKeyConstant.
@Test
public void testBusinessKeyConstant() {
// 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 ConstantValueProvider);
assertEquals(businessKey, businessKeyValueProvider.getValue(null));
}
use of org.camunda.bpm.engine.impl.cmmn.behavior.CaseTaskActivityBehavior in project camunda-bpm-platform by camunda.
the class CaseTaskPlanItemHandlerTest method testInputSourceExpression.
@Test
public void testInputSourceExpression() {
// given:
String source = "${a}";
ExtensionElements extensionElements = addExtensionElements(caseTask);
CamundaIn sourceElement = createElement(extensionElements, null, CamundaIn.class);
sourceElement.setCamundaSourceExpression(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 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.CaseTaskActivityBehavior in project camunda-bpm-platform by camunda.
the class CaseTaskPlanItemHandlerTest method testCallableElement.
@Test
public void testCallableElement() {
// given: a plan item
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
// there exists a callableElement
CaseTaskActivityBehavior behavior = (CaseTaskActivityBehavior) activity.getActivityBehavior();
assertNotNull(behavior.getCallableElement());
}
use of org.camunda.bpm.engine.impl.cmmn.behavior.CaseTaskActivityBehavior in project camunda-bpm-platform by camunda.
the class CaseTaskPlanItemHandlerTest method testVersionExpression.
@Test
public void testVersionExpression() {
// given:
String caseVersion = "${aVersion}";
caseTask.setCamundaCaseVersion(caseVersion);
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
CaseTaskActivityBehavior behavior = (CaseTaskActivityBehavior) activity.getActivityBehavior();
CallableElement callableElement = behavior.getCallableElement();
ParameterValueProvider caseVersionValueProvider = callableElement.getVersionValueProvider();
assertNotNull(caseVersionValueProvider);
assertTrue(caseVersionValueProvider instanceof ElValueProvider);
ElValueProvider valueProvider = (ElValueProvider) caseVersionValueProvider;
assertEquals(caseVersion, valueProvider.getExpression().getExpressionText());
}
use of org.camunda.bpm.engine.impl.cmmn.behavior.CaseTaskActivityBehavior in project camunda-bpm-platform by camunda.
the class CaseTaskPlanItemHandlerTest method testCaseRefExpression.
@Test
public void testCaseRefExpression() {
// given:
String caseRef = "${aCaseToCall}";
caseTask.setCase(caseRef);
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
CaseTaskActivityBehavior behavior = (CaseTaskActivityBehavior) activity.getActivityBehavior();
CallableElement callableElement = behavior.getCallableElement();
ParameterValueProvider caseRefValueProvider = callableElement.getDefinitionKeyValueProvider();
assertNotNull(caseRefValueProvider);
assertTrue(caseRefValueProvider instanceof ElValueProvider);
ElValueProvider valueProvider = (ElValueProvider) caseRefValueProvider;
assertEquals(caseRef, valueProvider.getExpression().getExpressionText());
}
Aggregations