use of org.camunda.bpm.engine.impl.core.model.CallableElement in project camunda-bpm-platform by camunda.
the class CaseTaskPlanItemHandlerTest method testOutputSource.
@Test
public void testOutputSource() {
// given:
String source = "a";
ExtensionElements extensionElements = addExtensionElements(caseTask);
CamundaOut sourceElement = createElement(extensionElements, null, CamundaOut.class);
sourceElement.setCamundaSource(source);
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
CaseTaskActivityBehavior behavior = (CaseTaskActivityBehavior) 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.core.model.CallableElement in project camunda-bpm-platform by camunda.
the class CaseTaskPlanItemHandlerTest method testInputTarget.
@Test
public void testInputTarget() {
// given:
String target = "b";
ExtensionElements extensionElements = addExtensionElements(caseTask);
CamundaIn sourceElement = createElement(extensionElements, null, CamundaIn.class);
sourceElement.setCamundaTarget(target);
// 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());
assertEquals(target, parameter.getTarget());
}
use of org.camunda.bpm.engine.impl.core.model.CallableElement in project camunda-bpm-platform by camunda.
the class CaseTaskPlanItemHandlerTest method testCaseRefConstant.
@Test
public void testCaseRefConstant() {
// 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 ConstantValueProvider);
ConstantValueProvider valueProvider = (ConstantValueProvider) caseRefValueProvider;
assertEquals(caseRef, valueProvider.getValue(null));
}
use of org.camunda.bpm.engine.impl.core.model.CallableElement in project camunda-bpm-platform by camunda.
the class CaseTaskPlanItemHandlerTest method testBinding.
@Test
public void testBinding() {
// given:
CallableElementBinding caseBinding = CallableElementBinding.LATEST;
caseTask.setCamundaCaseBinding(caseBinding.getValue());
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
CaseTaskActivityBehavior behavior = (CaseTaskActivityBehavior) activity.getActivityBehavior();
CallableElement callableElement = behavior.getCallableElement();
CallableElementBinding binding = callableElement.getBinding();
assertNotNull(binding);
assertEquals(caseBinding, binding);
}
use of org.camunda.bpm.engine.impl.core.model.CallableElement in project camunda-bpm-platform by camunda.
the class CaseTaskPlanItemHandlerTest method testInputSource.
@Test
public void testInputSource() {
// given:
String source = "a";
ExtensionElements extensionElements = addExtensionElements(caseTask);
CamundaIn sourceElement = createElement(extensionElements, null, CamundaIn.class);
sourceElement.setCamundaSource(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 sourceValueProvider = parameter.getSourceValueProvider();
assertNotNull(sourceValueProvider);
assertTrue(sourceValueProvider instanceof ConstantValueProvider);
assertEquals(source, sourceValueProvider.getValue(null));
}
Aggregations