Extract from SubmitStartFormCmd:
protected Object execute(CommandContext commandContext, TaskEntity task) {
commandContext.getHistoryManager()
.reportFormPropertiesSubmitted(task.getExecution(), properties, taskId);
TaskFormHandler taskFormHandler = task.getTaskDefinition().getTaskFormHandler();
taskFormHandler.submitFormProperties(properties, task.getExecution());
task.complete();
return null;
}
The 'history record' is done using the RAW properties-map, as it is passed in. Since the record happens before the "TaskFormHandler" is called, it's also not an option to use a custom TaskFormHandler that alters the values in the properties-map.
The only way I see this working is either we move the "record" of history to after the TaskFormHandler has been executed, although there is no explicit use case for this, as the form-properties are intended to be stored in history as String's, unaffected by the property-type itself. Another way is to do the encryption in the layer above Activiti, if possible.
A solution that can be done without having to modify existing activiti-sourcecode is to create a subclass of the HistoryManager and provide your own factory for this to the processEngineConfiguration. You can override the "reportFormPropertiesSubmitted" method and alter the string-values before you call the super.reportFormPropertiesSubmitted(…).