use of eu.bcvsolutions.idm.core.workflow.model.dto.FormDataDto in project CzechIdMng by bcvsolutions.
the class DefaultWorkflowTaskInstanceService method toResource.
private FormDataDto toResource(FormProperty property, Map<String, String> additionalInformations) {
FormDataDto dto = new FormDataDto();
dto.setId(property.getId());
dto.setName(property.getName());
dto.setValue(property.getValue());
dto.setType(property.getType().getName());
dto.setReadable(property.isReadable());
dto.setRequired(property.isRequired());
dto.setWritable(property.isWritable());
// values)
if (additionalInformations != null) {
// extra add tooltip to dto
if (additionalInformations.containsKey(WorkflowTaskInstanceService.FORM_PROPERTY_TOOLTIP_KEY)) {
dto.setTooltip(additionalInformations.get(WorkflowTaskInstanceService.FORM_PROPERTY_TOOLTIP_KEY));
}
// extra add placeholder to dto
if (additionalInformations.containsKey(WorkflowTaskInstanceService.FORM_PROPERTY_PLACEHOLDER_KEY)) {
dto.setPlaceholder(additionalInformations.get(WorkflowTaskInstanceService.FORM_PROPERTY_PLACEHOLDER_KEY));
}
dto.getAdditionalInformations().putAll(additionalInformations);
}
return dto;
}
use of eu.bcvsolutions.idm.core.workflow.model.dto.FormDataDto in project CzechIdMng by bcvsolutions.
the class DefaultWorkflowTaskInstanceService method historyToResource.
private FormDataDto historyToResource(FormProperty property, List<WorkflowHistoricTaskInstanceDto> history) {
FormDataDto dto = new FormDataDto();
dto.setId(property.getId());
dto.setName(property.getName());
String value;
try {
value = new ObjectMapper().writeValueAsString(history);
} catch (JsonProcessingException e) {
throw new CoreException(e);
}
dto.setValue(value);
dto.setType(property.getType().getName());
dto.setReadable(property.isReadable());
dto.setRequired(property.isRequired());
dto.setWritable(property.isWritable());
return dto;
}
Aggregations