cancel
Showing results for 
Search instead for 
Did you mean: 

How reassign Actors in a Workflow (Activiti Issue) ?

angello0571
Champ on-the-rise
Champ on-the-rise
Hello,

I have a workflow with 3 actors. One of them is the initiator (Person A) of the workflow and the rest (Person B and Person C) are selected from the initial form. I create two aspects (similar to bpm:assigne aspect) in my custom model in this way:

<aspect name="scwf:assigneeReviewer">
         <associations>
                <association name="scwf:assigneeReviewer">
                    <source>
                        <mandatory>false</mandatory>
                        <many>false</many>
                    </source>
                    <target>
                        <class>cm:person</class>
                        <mandatory>true</mandatory>
                        <many>false</many>
                    </target>
                </association>
            </associations>
        </aspect>
        <aspect name="scwf:assigneeTIC">
         <associations>
                <association name="scwf:assigneeTIC">
                    <source>
                        <mandatory>false</mandatory>
                        <many>false</many>
                    </source>
                    <target>
                        <class>cm:person</class>
                        <mandatory>true</mandatory>
                        <many>false</many>
                    </target>
                </association>
            </associations>
        </aspect>

The configuration in the model for the initial task is:

<type name="scwf:submitElabReqTask">
         <parent>scwf:genericSesaTask</parent>
         <mandatory-aspects>
               <aspect>scwf:assigneeReviewer</aspect>
               <aspect>scwf:assigneeTIC</aspect>
            </mandatory-aspects>
        </type>

When i run the workflow it runs perfect. but if i want to change some aspect (a workflow's actor, for example, person F instead personB) in some of the next tasks (those tasks extend from the scwf:submitElabReqTask type) , I get an exception: java.lang.ClassCastException: org.alfresco.service.cmr.repository.NodeRef cannot be cast to java.util.List

I am not sure if is possible to change the Actors (Aspects) of the workflow in this way or I have to change them in java getting the NodeRef of the Person F,  using something like:

params.put(WorkflowModel.ASSOC_ASSIGNEE, assignee);

I wish to change them in the tasks forms because the initiator have to change to another actors if necessary.

Does anybody could help me?

Thanks in advance Smiley Happy
2 REPLIES 2

mstein
Champ in-the-making
Champ in-the-making
Can you provide more of your configurations/code. Reassign has nothing to do with aspects. The aspects supply properties that are used by the form engine to display the correct fields to on the form. If the task has already been assigned you'll want to use the workflow api to reassign the task.

muralidharand
Star Contributor
Star Contributor
Can you please debug this WorkflowServiceImpl.updateTask()  method which is used to reassign the workflow task ?
If possible, please post the stacktrace.