use of org.camunda.bpm.engine.impl.core.model.CallableElementParameter in project camunda-bpm-platform by camunda.
the class CaseTaskPlanItemHandlerTest method testOutputVariables.
@Test
public void testOutputVariables() {
// given:
ExtensionElements extensionElements = addExtensionElements(caseTask);
CamundaOut variablesElement = createElement(extensionElements, null, CamundaOut.class);
variablesElement.setCamundaVariables("all");
// 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);
assertTrue(parameter.isAllVariables());
}
use of org.camunda.bpm.engine.impl.core.model.CallableElementParameter in project camunda-bpm-platform by camunda.
the class ProcessOrCaseTaskItemHandler method initializeInputParameter.
protected void initializeInputParameter(CmmnElement element, CmmnActivity activity, CmmnHandlerContext context, CallableElement callableElement) {
ExpressionManager expressionManager = context.getExpressionManager();
List<CamundaIn> inputs = getInputs(element);
for (CamundaIn input : inputs) {
// businessKey
String businessKey = input.getCamundaBusinessKey();
if (businessKey != null && !businessKey.isEmpty()) {
ParameterValueProvider businessKeyValueProvider = createParameterValueProvider(businessKey, expressionManager);
callableElement.setBusinessKeyValueProvider(businessKeyValueProvider);
} else {
// create new parameter
CallableElementParameter parameter = new CallableElementParameter();
callableElement.addInput(parameter);
if (input.getCamundaLocal()) {
parameter.setReadLocal(true);
}
// all variables
String variables = input.getCamundaVariables();
if ("all".equals(variables)) {
parameter.setAllVariables(true);
continue;
}
// source/sourceExpression
String source = input.getCamundaSource();
if (source == null || source.isEmpty()) {
source = input.getCamundaSourceExpression();
}
ParameterValueProvider sourceValueProvider = createParameterValueProvider(source, expressionManager);
parameter.setSourceValueProvider(sourceValueProvider);
// target
String target = input.getCamundaTarget();
parameter.setTarget(target);
}
}
}
Aggregations