use of org.camunda.bpm.engine.rest.dto.runtime.TriggerVariableValueDto in project camunda-bpm-platform by camunda.
the class CaseExecutionResourceImpl method initializeCommandWithVariables.
protected void initializeCommandWithVariables(CaseExecutionCommandBuilder commandBuilder, Map<String, TriggerVariableValueDto> variables, String transition) {
for (String variableName : variables.keySet()) {
try {
TriggerVariableValueDto variableValue = variables.get(variableName);
TypedValue typedValue = variableValue.toTypedValue(engine, objectMapper);
if (variableValue.isLocal()) {
commandBuilder.setVariableLocal(variableName, typedValue);
} else {
commandBuilder.setVariable(variableName, typedValue);
}
} catch (RestException e) {
String errorMessage = String.format("Cannot %s case execution %s due to invalid variable %s: %s", transition, caseExecutionId, variableName, e.getMessage());
throw new RestException(e.getStatus(), e, errorMessage);
}
}
}
Aggregations