this is probably a very basic question, but I cannot find the information in the documentation:
I am starting CDI-injected processes by org.camunda.bpm.engine.cdi.BusinessProcess.startProcessByKey(String).
Later in my application I would like to query running instances by org.camunda.bpm.engine.history.HistoricProcessInstanceQuery.startedBy(String).
Until now I have not found a way to associate a fresh instance with the starting user, thus my query does not work.
Please let me know how to do this.
Thanks,
Philipp
@Inject
private BusinessProcess businessProcess;
@Inject
private IdentityService identityService;
public startProcess(...) {
try {
identityService.setAuthenticatedUserId("jonny");
businessProcess.startProcessByKey(...)
}
finally{
identityService.clearAuthentication();
}
}
Cheers,
Philipp
IdentityService identityService = ProcessEngines.getDefaultProcessEngine().getIdentityService();
public class SecurityFilter implements Filter {
@Inject
private IdentityService identityService;
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
identityService.setAuthenticatedUserId("jonny");
try {
chain.doFilter(request, response);
}
finally {
identityService.clearAuthentication();
}
}
}
--
You received this message because you are subscribed to a topic in the Google Groups "camunda BPM users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/camunda-bpm-users/R9yo6X945yo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/camunda-bpm-users/17e9efb1-37dc-4ac8-ba61-d7e37aaa3431%40googlegroups.com.