0
votes

I defined my custom workflow with alfresco/activiti. In my model i defined custom aspect which beside some properties has associations which will represent members of some team

<aspects>
    <aspect name="mcwm:projectCharter">
         <properties>
                  ........
                <property name="cm:userName">
                 ..........
                </property>
          </properties>
          <associations>
                <association name="mcwm:teamWithDoc">
                        <source>
                              <mandatory>false</mandatory>
                              <many>false</many>
                       </source>
                       <target>
                               <class>cm:person</class>
                               <mandatory>false</mandatory>
                               <many>true</many>
                         </target>
                </association>
      </associations>

Now, in my workflow i have 5 tasks, and on every task i set mandatory aspect which i described above.

<type name="mcwm:submitStart">
  <parent>bpm:startTask</parent>
  <mandatory-aspects>
     <aspect>bpm:assignee</aspect>
     <aspect>mcwm:projectCharter</aspect>
  </mandatory-aspects>

The problem is that if some user for example on beginning of process on task 1 set association mcwm:teamWithDoc (pick members of team from alfresco repository), property is nice passed to task 2. But if some other user which is assigned to task 2 change mcwm:teamWithDoc (e.g. add some more team members or delete some team members) on task 3 these changes are not seen. On task 3 mcwm:teamWithDoc has value which is set on start task. The same case is with other task, whatever other users done with mcwm:teamWithDoc on task 2, task 3 or task 4, mcwm:teamWithDoc always has value which is set on beginning?

Any idea how to update this association?

P.S. I update my regular properties between task using execution.setVariable('propertName', task.getVariable('propertName')); but for association this isn't functioning.

Regards, Aleksandar

2

2 Answers

1
votes

Instead of using that method, you could better use the task controller with the use of the task controller you can easily get the association. Check the wiki for more info on how to get the association.

E.g. it will look like the following:

<controller>
    <variable name="prop" access="read,write" mapped-name="mcwm_projectCharter"/>
</controller>

so then you have the mcwm_projectCharter mapped to prop. So with that you can do a prop.assocs["mcwm:teamWithDoc"][0] to get the first or iterate through it.

1
votes

I think that you problems is relative to this bug https://issues.alfresco.com/jira/browse/ALF-13640.

Once you have set the value of an associtaiton you con not change it!!!