cancel
Showing results for 
Search instead for 
Did you mean: 

how to find out the starter id from groovy script

jachu
Champ in-the-making
Champ in-the-making
my goal is to find out if a person who started process, is a member of particular group or not. I tried to do it by groovy script task with command
execution.getEngineServices().getTaskService().getIdentityLinksForTask(execution.getCurrentActivityId())
(and process the result to find an owner) but I got 'NullPointerException' error in that line.
I have no idea what is wrong or is it proper way to solve the problem.
Can anybody advice me what to do?

Jacek
3 REPLIES 3

frederikherema1
Star Contributor
Star Contributor
See http://activiti.org/userguide/index.html#bpmnStartEvents, you can use the initiator variable later on in the process, using e.g. an expression of runtimeService.getVariable(…):


<startEvent id="request" activiti:initiator="initiator" />

jachu
Champ in-the-making
Champ in-the-making
thx for answer.
I tried to use the method you adviced me, and it works perfectly - but only if I prepare process in Activiti Designer. It fails when prepared in Modeler. In that case I got an error:
SEVERE: Terminal error:
com.vaadin.event.ListenerMethod$MethodException
Cause: com.vaadin.event.ListenerMethod$MethodException
Cause: java.lang.VerifyError: (class: Script4, method: run signature: ()Ljava/lang/ObjectSmiley Wink Stack size too large
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)
        ….

in bpmn:
<startEvent id="start1" name="Start 1" activiti:initiator="initman"/>

in groovy script:
outSmiley Tonguerintln initman;

but the same script/process deployed from designer works ok. I used Activiti 5.11.

regards

frederikherema1
Star Contributor
Star Contributor
Can you compare the BPMN2.0 xml-files (the one coming out of the designer and the other from modeler) with each other? So we know what the actual difference…