AnsweredAssumed Answered

How reassign Actors in a Workflow (Activiti Issue) ?

Question asked by angello0571 on Dec 7, 2012
Latest reply on Feb 11, 2013 by muralidharand
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 :)

Outcomes