cancel
Showing results for 
Search instead for 
Did you mean: 

How to check the workflow initiator is a member of a specific group?

miraclesuki
Champ in-the-making
Champ in-the-making
Hi,

The objective was to find out the workflow starter does the member of a specific group.
First, I need to get the member list inside a group.

A simple javascript that get the list of member inside a group, but it failed:

<scriptTask id="scripttask1" name="Script Task" scriptFormat="javascript" activiti:autoStoreVariables="true">
      <script>var node = people.getGroup("GROUP_Marketing");
   
    if(node){
        logger.log("Marketing member list:        " + people.getMembers(node));        
    }</script>
    </scriptTask>


And I get this error:

SEVERE: Error while closing command context
org.activiti.engine.ActivitiException: problem evaluating script: sun.org.mozilla.javascript.EcmaError: ReferenceError: "people" is not defined. (<Unknown source>#1) in <Unknown source> at line number 1


So, may I know the correct method to determine the workflow starter does exist the member of a specific group?
Thanks all for your kindly help.

-Mandy
2 REPLIES 2

trademak
Star Contributor
Star Contributor
Why are you using 'people' in your script logic? Is that a variable you have defined?
You would need to use the IdentityService to get information about groups and members.

Best regards,

miraclesuki
Champ in-the-making
Champ in-the-making
oh you are right, because i am using alfresco workflow.
I need to change the script task to alfresco script task.