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

572 views Asked by At

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?

1

There are 1 answers

0
user5028655 On

The clean way would be to add an interceptor on the WorkflowService. Intercept the result of the methods you need. At the very least "getDefinitions()". Possibly others too.

Complete post available here : https://forums.alfresco.com/comment/155580#comment-155580