use of org.camunda.bpm.engine.rest.dto.VariableValueDto in project camunda-bpm-platform by camunda.
the class HistoricVariableUpdateDto method fromHistoricVariableUpdate.
public static HistoricVariableUpdateDto fromHistoricVariableUpdate(HistoricVariableUpdate historicVariableUpdate) {
HistoricVariableUpdateDto dto = new HistoricVariableUpdateDto();
dto.revision = historicVariableUpdate.getRevision();
dto.variableName = historicVariableUpdate.getVariableName();
dto.variableInstanceId = historicVariableUpdate.getVariableInstanceId();
if (historicVariableUpdate.getErrorMessage() == null) {
VariableValueDto variableValueDto = VariableValueDto.fromTypedValue(historicVariableUpdate.getTypedValue());
dto.value = variableValueDto.getValue();
dto.variableType = variableValueDto.getType();
dto.valueInfo = variableValueDto.getValueInfo();
} else {
dto.errorMessage = historicVariableUpdate.getErrorMessage();
dto.variableType = VariableValueDto.toRestApiTypeName(historicVariableUpdate.getTypeName());
}
return dto;
}
use of org.camunda.bpm.engine.rest.dto.VariableValueDto in project camunda-bpm-platform by camunda.
the class ProcessInstanceWithVariablesDto method fromProcessInstance.
public static ProcessInstanceDto fromProcessInstance(ProcessInstanceWithVariables instance) {
ProcessInstanceWithVariablesDto result = new ProcessInstanceWithVariablesDto(instance);
VariableMap variables = instance.getVariables();
Map<String, VariableValueDto> values = new HashMap<String, VariableValueDto>();
for (String variableName : variables.keySet()) {
VariableValueDto valueDto = VariableValueDto.fromTypedValue(variables.getValueTyped(variableName), true);
values.put(variableName, valueDto);
}
result.variables = values;
return result;
}
use of org.camunda.bpm.engine.rest.dto.VariableValueDto in project camunda-bpm-platform by camunda.
the class SignalRestServiceImpl method createSignalEventReceivedBuilder.
protected SignalEventReceivedBuilder createSignalEventReceivedBuilder(SignalDto dto) {
RuntimeService runtimeService = processEngine.getRuntimeService();
String name = dto.getName();
SignalEventReceivedBuilder signalEvent = runtimeService.createSignalEvent(name);
String executionId = dto.getExecutionId();
if (executionId != null) {
signalEvent.executionId(executionId);
}
Map<String, VariableValueDto> variablesDto = dto.getVariables();
if (variablesDto != null) {
Map<String, Object> variables = VariableValueDto.toMap(variablesDto, processEngine, objectMapper);
signalEvent.setVariables(variables);
}
String tenantId = dto.getTenantId();
if (tenantId != null) {
signalEvent.tenantId(tenantId);
}
boolean isWithoutTenantId = dto.isWithoutTenantId();
if (isWithoutTenantId) {
signalEvent.withoutTenantId();
}
return signalEvent;
}
use of org.camunda.bpm.engine.rest.dto.VariableValueDto 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.rest.dto.VariableValueDto in project camunda-bpm-platform by camunda.
the class DecisionDefinitionResourceImpl method createDecisionResultDto.
protected List<Map<String, VariableValueDto>> createDecisionResultDto(DmnDecisionResult decisionResult) {
List<Map<String, VariableValueDto>> dto = new ArrayList<Map<String, VariableValueDto>>();
for (DmnDecisionResultEntries entries : decisionResult) {
Map<String, VariableValueDto> resultEntriesDto = createResultEntriesDto(entries);
dto.add(resultEntriesDto);
}
return dto;
}
Aggregations