use of org.camunda.bpm.engine.impl.core.variable.mapping.value.ParameterValueProvider in project camunda-bpm-platform by camunda.
the class DecisionTaskPlanItemHandlerTest method testVersionExpression.
@Test
public void testVersionExpression() {
// given:
String caseVersion = "${aVersion}";
decisionTask.setCamundaDecisionVersion(caseVersion);
// when
CmmnActivity activity = handler.handleElement(planItem, context);
// then
DecisionTaskActivityBehavior behavior = (DecisionTaskActivityBehavior) activity.getActivityBehavior();
BaseCallableElement 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.core.variable.mapping.value.ParameterValueProvider in project camunda-bpm-platform by camunda.
the class BpmnParse method parseTenantId.
protected void parseTenantId(Element callingActivityElement, ActivityImpl activity, BaseCallableElement callableElement, String attrName) {
ParameterValueProvider tenantIdValueProvider;
String tenantId = callingActivityElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, attrName);
if (tenantId != null && tenantId.length() > 0) {
tenantIdValueProvider = createParameterValueProvider(tenantId, expressionManager);
} else {
tenantIdValueProvider = new DefaultCallableElementTenantIdProvider();
}
callableElement.setTenantIdProvider(tenantIdValueProvider);
}
use of org.camunda.bpm.engine.impl.core.variable.mapping.value.ParameterValueProvider 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);
}
}
}
use of org.camunda.bpm.engine.impl.core.variable.mapping.value.ParameterValueProvider in project camunda-bpm-platform by camunda.
the class CallingTaskItemHandler method initializeVersion.
protected void initializeVersion(CmmnElement element, CmmnActivity activity, CmmnHandlerContext context, BaseCallableElement callableElement) {
ExpressionManager expressionManager = context.getExpressionManager();
String version = getVersion(element, activity, context);
ParameterValueProvider versionProvider = createParameterValueProvider(version, expressionManager);
callableElement.setVersionValueProvider(versionProvider);
}
use of org.camunda.bpm.engine.impl.core.variable.mapping.value.ParameterValueProvider in project camunda-bpm-platform by camunda.
the class CallingTaskItemHandler method initializeTenantId.
protected void initializeTenantId(CmmnElement element, CmmnActivity activity, CmmnHandlerContext context, BaseCallableElement callableElement) {
ParameterValueProvider tenantIdProvider;
ExpressionManager expressionManager = context.getExpressionManager();
String tenantId = getTenantId(element, activity, context);
if (tenantId != null && tenantId.length() > 0) {
tenantIdProvider = createParameterValueProvider(tenantId, expressionManager);
} else {
tenantIdProvider = new DefaultCallableElementTenantIdProvider();
}
callableElement.setTenantIdProvider(tenantIdProvider);
}
Aggregations