cancel
Showing results for 
Search instead for 
Did you mean: 

Set jbpm_assignees from a ManageTaskDialog implementation?

nicolasraoul
Star Contributor
Star Contributor
Hello,

I have a two-reviews advanced workflow. Reviewer1 chooses reviewer2.

I extended ManageTaskDialog to back a JSF picker that allows reviewer1 to pick reviewer2.
So now in MyManageTaskDialog I have the name of the selected reviewer2, but I don't know how to set jbpm_assignees so that the workflow uses it.

How to set jbpm_assignees from a ManageTaskDialog implementation?

Thanks,
Nicolas
2 REPLIES 2

nicolasraoul
Star Contributor
Star Contributor
Here is a solution to my own question, feel free to propose other solutions.

String[] assignees = {"leon", pickedAssignee};
Map<QName, Serializable> params = WorkflowUtil.prepareTaskParams(this.taskNode);
params.put(QName.createQName("{http://www.alfresco.org/model/bpm/1.0}assignees"), assignees);
this.getWorkflowService().updateTask(this.getWorkflowTask().id, params, null, null);

Note: The first assignee is erased as a collateral damage. I guess we could use the right one by first requesting assignees with params.get.

Hope this helps someone  Smiley Very Happy
Nicolas

zaizi
Champ in-the-making
Champ in-the-making
You'll have to create a custom task model. The default task model supports a single assignee defined as an aspect.

See http://wiki.alfresco.com/wiki/WorkflowAdministration#Step_2:_Create_the_Task_Model for further details.

Aspect Assingee;

        <aspect name="bpm:assignee">
            <associations>

                <association name="bpm:assignee">
                    <source>
                        <mandatory>false</mandatory>
                        <many>false</many>
                    </source>
                    <target>
                        <class>cm:person</class>
                        <mandatory>true</mandatory>
                        <many>false</many>
                    </target>
                </association>

            </associations>
        </aspect>
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.