AnsweredAssumed Answered

User audit on process variable change

Question asked by wdefik on Oct 22, 2013
Latest reply on Oct 24, 2013 by martin.grofcik
Hi everybody. Thanks the activiti developer team for their great job!
My question is: I want to know what user have changed my process's variable. How it can be done?

For example (activiti-engine v5.13):
1) in activiti.cfg.xml - <property name="history" value="full" />

2) Java code

RuntimeService runtimeSvc = activitiRule.getRuntimeService();
TaskService taskSvc = activitiRule.getTaskService();
HistoryService historySvc = activitiRule.getHistoryService();

Map<String, String> vars = new HashMap<String, String>();
vars.put("myVar", "Test");

ProcessInstance processInstance = runtimeSvc.startProcessInstanceByKey("myprocess", vars)

vars.put("myVar", "new value");
taskSvc.complete(taskSvc.createTaskQuery().singleResult().getId(), vars);

Then i can retrieve all variable changes by
historySvc.createHistoricDetailQuery().variableUpdates().processInstanceId(processInstance.getProcessInstanceId()).list()


But an HistoricDetailVariableInstanceUpdateEntity does not have a user id property. Could you tell me any approach how i can get an actor user?
Thanks in advance.



Outcomes