As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
When I call historyService.createHistoricProcessInstanceQuery().list() the process instance 'getStartUserId()' for each resulting instance always returns a null.
org.activiti.engine.impl.identity.Authentication.setAuthenticatedUser(…);
This is how we currently do it in the webapp: when a new request comes in, we set the authenticated user. When all is done, and the response is sent back, we set null.
public void onRequestStart(HttpServletRequest request, HttpServletResponse response) {<br> <br> // Authentication: check if user is found, otherwise send to login page<br> LoggedInUser user = (LoggedInUser) getUser();<br> if (user == null) {<br> …<br> } else {<br> // Set thread-local userid of logged in user (needed for Activiti user logic)<br> Authentication.setAuthenticatedUserId(user.getId());<br> }<br> }<br> <br> public void onRequestEnd(HttpServletRequest request, HttpServletResponse response) {<br> Authentication.setAuthenticatedUserId(null);<br> }
1) yup exactly the same. My bad for using the wrong method.2) And I indeed meant Filter, not listener !