use of org.camunda.bpm.engine.variable.VariableMap in project camunda-bpm-platform by camunda.
the class AbstractVariablesResource method getVariables.
@Override
public Map<String, VariableValueDto> getVariables(boolean deserializeValues) {
VariableMap variables = getVariableEntities(deserializeValues);
Map<String, VariableValueDto> values = new HashMap<String, VariableValueDto>();
for (String variableName : variables.keySet()) {
VariableValueDto valueDto = VariableValueDto.fromTypedValue(variables.getValueTyped(variableName));
values.put(variableName, valueDto);
}
return values;
}
use of org.camunda.bpm.engine.variable.VariableMap in project camunda-bpm-platform by camunda.
the class ProcessDefinitionResourceImpl method getFormVariables.
public Map<String, VariableValueDto> getFormVariables(String variableNames, boolean deserializeValues) {
final FormService formService = engine.getFormService();
List<String> formVariables = null;
if (variableNames != null) {
StringListConverter stringListConverter = new StringListConverter();
formVariables = stringListConverter.convertQueryParameterToType(variableNames);
}
VariableMap startFormVariables = formService.getStartFormVariables(processDefinitionId, formVariables, deserializeValues);
return VariableValueDto.fromVariableMap(startFormVariables);
}
use of org.camunda.bpm.engine.variable.VariableMap in project camunda-bpm-platform by camunda.
the class TaskResourceImpl method resolve.
@Override
public void resolve(CompleteTaskDto dto) {
TaskService taskService = engine.getTaskService();
try {
VariableMap variables = VariableValueDto.toMap(dto.getVariables(), engine, objectMapper);
taskService.resolveTask(taskId, variables);
} catch (RestException e) {
String errorMessage = String.format("Cannot resolve task %s: %s", taskId, e.getMessage());
throw new InvalidRequestException(e.getStatus(), e, errorMessage);
}
}
use of org.camunda.bpm.engine.variable.VariableMap in project camunda-bpm-platform by camunda.
the class CallableElementActivityBehavior method passOutputVariables.
@Override
public void passOutputVariables(final ActivityExecution execution, final VariableScope subInstance) {
// only data. no control flow available on this execution.
VariableMap variables = filterVariables(getOutputVariables(subInstance));
VariableMap localVariables = getOutputVariablesLocal(subInstance);
execution.setVariables(variables);
execution.setVariablesLocal(localVariables);
final DelegateVariableMapping varMapping = resolveDelegation(execution);
if (varMapping != null) {
invokeVarMappingDelegation(new DelegateInvocation(execution, null) {
@Override
protected void invoke() throws Exception {
varMapping.mapOutputVariables(execution, subInstance);
}
});
}
}
use of org.camunda.bpm.engine.variable.VariableMap in project camunda-bpm-platform by camunda.
the class RestartProcessInstancesCmd method collectLastVariables.
protected VariableMap collectLastVariables(CommandContext commandContext, HistoricProcessInstance processInstance) {
HistoryService historyService = commandContext.getProcessEngineConfiguration().getHistoryService();
List<HistoricVariableInstance> historicVariables = historyService.createHistoricVariableInstanceQuery().executionIdIn(processInstance.getId()).list();
VariableMap variables = new VariableMapImpl();
for (HistoricVariableInstance variable : historicVariables) {
variables.putValueTyped(variable.getName(), variable.getTypedValue());
}
return variables;
}
Aggregations