This content has been marked as final.
Show 4 replies
-
1. Re: Availability of 'initiating participant' as variable?
tom.baeyens Aug 10, 2009 4:58 PM (in response to kukeltje)for now, you can create a static thread local somewhere in the bpmn code for this.
public static ThreadLocal authenticatedUserId = new ThreadLocal();
try { authenticatedUserId.set("johndoe"); executionService.startProcessInstanceByKey("ICL"); } finally { authenticatedUserId.set(null); }
then in the start event you can access that thread local directly. i'll integrate functionality like that in the pvm, but it is not yet there. -
2. Re: Availability of 'initiating participant' as variable?
kukeltje Aug 10, 2009 7:47 PM (in response to kukeltje)I know this 'trick', but I think the issue is that the server side part of the console should do something like this. It does not help if I do it in the bpmn part. Sure, for the testcases etc it helps. I'll definately do this.
But the method:public ProcessInstanceRef newInstance(String definitionId, Map<String, Object> processVars) { Environment env = ((EnvironmentFactory)processEngine).openEnvironment(); try { ExecutionService execService = this.processEngine.getExecutionService(); Execution exec = execService.startProcessInstanceById(definitionId); execService.setVariables(exec.getId(), processVars); return ModelAdaptor.adoptExecution((ExecutionImpl)exec); } finally{ env.close(); } }
in ProcessManagementImpl in the console-integration project should get this as a argument from the calling class which is in the bpm-console. So it needs an adaption in there to (soag) , which should be done in sync. -
3. Re: Availability of 'initiating participant' as variable?
tom.baeyens Aug 12, 2009 3:53 AM (in response to kukeltje)yes. good point. console currently doesn't pass the authenticated userId to the engine operations.
https://jira.jboss.org/jira/browse/JBPM-2482 -
4. Re: Availability of 'initiating participant' as variable?
kukeltje Aug 12, 2009 5:08 AM (in response to kukeltje)It does pass them on for task related calls from what I've seen. But the other operations need them to, certainly if you want to have the actor for auditing reasons.