cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to update task associations

azivotic
Champ in-the-making
Champ in-the-making
Hi,

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>
</aspect>

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

<types>
   <!–type for start form–>
   <type name="mcwm:submitStart">
      <parent>bpm:startTask</parent>
           ….some properties…….
          <mandatory-aspects>
         <aspect>bpm:assignee</aspect>
         <aspect>mcwm:projectCharter</aspect>
      </mandatory-aspects>
   </type>
</types>

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
6 REPLIES 6

mitpatoliya
Star Collaborator
Star Collaborator
make mcwm:submitStart as parent of your other tasks in the workflow model.
Also, I don't understand is this a group workflow?

azivotic
Champ in-the-making
Champ in-the-making
Hi Mits,

Thanks for your answer, i will try your suggestion.

About your question. I have on every task new assignee. On Task 1 assignee is one person, then he assign Task 2 to some other person, then on Task 3 assignee is group of people and so on. I can put workflow definition if i didn't explained very well. I use my mcwm:teamWithDoc association as model property in which i keep members of some team (in my workflow one of the properties is that user can pick up team members)

Also about your suggestion, my other tasks (that are different from start task) for parent have <parent>bpm:workflowTask</parent>. If i put on my other task as you suggested parent mcwm:submitStart (which for parent has bpm:startTask) technical all my tasks would have now for parent bpm:startTask am i wright? Is this going to happened and if it does is this bad modeling or maybe i am wrong, there is no transient inheritance? This is maybe dumb question Smiley Surprisedops: , sorry for that, but i'm still learning alfresco

Regards,
Aleksandar

mitpatoliya
Star Collaborator
Star Collaborator
If you look in to the bpm conetent model bpm:startTask has bpm:workflowTask as parent so ultimately you will be able to access properties related to both the tasks. and its good approach only nothing to worry.

azivotic
Champ in-the-making
Champ in-the-making
Hi,

I try to set mcwm:submitStart as parent of my other tasks in the workflow model but this didn't fix my problem. My model is:
<?xml version="1.0" encoding="UTF-8"?>
      <!– Definition of a Workflow –>
   <model name="mcwm:CustomWorkflowModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>
   <description>Custom Workflow Model</description>
   <author>Custom</author>
   <version>1.0</version>

   <!–Imports are required to allow references to definitions in other models–>
   <imports>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
      <import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm" />
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
   </imports>

   <!– Introduction of new namespaces defined by this model –>
   <namespaces>
      <namespace uri="http://www.custom.ch/model/workflow/1.0" prefix="mcwm" />
   </namespaces>

   <constraints>
      <constraint name="mcwm:scmChoices" type="LIST">
         <parameter name="allowedValues">
            <list>
               <value>no</value>
               <value>yes</value>
            </list>
         </parameter>
      </constraint>
      <constraint name="mcwm:transitionChoices" type="LIST">
            <parameter name="allowedValues">
                <list>
                    <value>Pošalji na prihvat</value>
                    <value>Vrati u pripremu</value>
                </list>
            </parameter>
        </constraint>
      <constraint name="mcwm:transitionChoicesPMO" type="LIST">
            <parameter name="allowedValues">
                <list>
                    <value>Prihvati</value>
                    <value>Vrati</value>
                </list>
            </parameter>
        </constraint>
   </constraints>

   <types>
      <!–type for start form–>
      <type name="mcwm:submitStart">
         <parent>bpm:startTask</parent>
         <overrides>
                <property name="bpm:reassignable">
                   <default>false</default>
                </property>
            <property name="bpm:workflowDescription">
                   <default>Proces otvaranja novog projekta</default>
                </property>
            </overrides>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
            <aspect>mcwm:projectCharter</aspect>
         </mandatory-aspects>
      </type>
      <!–type for preparation of project charter form–>
      <type name="mcwm:preparationOfProjectCharter">
         <parent>mcwm:submitStart</parent>
         <properties>
            <property name="mcwm:scmResources">
               <title>SCM resources needed?</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
               <constraints>
                  <constraint ref="mcwm:scmChoices"/>
               </constraints>
            </property>
            <property name="mcwm:scmRationalTeam">
               <title>Rational Team Concert Source Control?</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
               <constraints>
                  <constraint ref="mcwm:scmChoices"/>
               </constraints>
            </property>
            <property name="mcwm:scmRationalTeamWork">
               <title>Rational Team Concert Work Items (issue tracker)?</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
               <constraints>
                  <constraint ref="mcwm:scmChoices"/>
               </constraints>
            </property>
            <property name="mcwm:scmSubversion">
               <title>Subversion (source control)?</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
               <constraints>
                  <constraint ref="mcwm:scmChoices"/>
               </constraints>
            </property>
            <property name="mcwm:scmTrack">
               <title>Trac (issue tracker)?</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
               <constraints>
                  <constraint ref="mcwm:scmChoices"/>
               </constraints>
            </property>
            <property name="mcwm:scmTrackRequire">
               <title>Require Trac issue # in Subversion commit comment?</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
               <default>yes</default>
               <constraints>
                  <constraint ref="mcwm:scmChoices"/>
               </constraints>
            </property>
            <property name="mcwm:scmJenkins">
               <title>Jenkins (continuous integration)?</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
               <constraints>
                  <constraint ref="mcwm:scmChoices"/>
               </constraints>
            </property>
            <property name="mcwm:scmSonar">
               <title>Sonar (project metrics)?</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
               <constraints>
                  <constraint ref="mcwm:scmChoices"/>
               </constraints>
            </property>
            <property name="mcwm:scmNotes">
               <title>Additional SCM notes</title>
               <type>d:text</type>
            </property>
         </properties>
         <associations>
                <association name="mcwm:scmResourcesPeopleList">
                    <source>
                        <mandatory>false</mandatory>
                        <many>false</many>
                    </source>
                    <target>
                        <class>cm:person</class>
                        <mandatory>false</mandatory>
                        <many>true</many>
                    </target>
                </association>
                <association name="mcwm:scmResourcesPeopleListAdmin">
                    <source>
                        <mandatory>false</mandatory>
                        <many>false</many>
                    </source>
                    <target>
                        <class>cm:person</class>
                        <mandatory>false</mandatory>
                        <many>true</many>
                    </target>
                </association>
            </associations> 
         <overrides>
                <property name="bpm:reassignable">
                   <default>false</default>
                </property>
            </overrides>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
            <aspect>mcwm:projectCharter</aspect>
         </mandatory-aspects>
      </type>
      <!–type for validation of project charter form–>
      <type name="mcwm:validationOfProjectCharters">
         <parent>mcwm:submitStart</parent>
         <properties>
            <property name="mcwm:reviewOutcome">
                    <type>d:text</type>
                    <default>Reject</default>
                    <constraints>
                  <constraint ref="mcwm:transitionChoices"/>
               </constraints>
                </property>
         </properties>
         <overrides>
                <property name="bpm:reassignable">
                   <default>false</default>
                </property>
            </overrides> 
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
            <aspect>mcwm:projectCharter</aspect>
         </mandatory-aspects>
      </type>
      <!–type for acceptance of project charter form–>
      <type name="mcwm:acceptanceOfProjectCharter">
         <parent>mcwm:submitStart</parent>
         <properties>
            <property name="mcwm:reviewAcceptanceOutcome">
                    <type>d:text</type>
                    <default>Reject</default>
                    <constraints>
                  <constraint ref="mcwm:transitionChoicesPMO"/>
               </constraints>
                </property>
         </properties>
         <overrides>
                <property name="bpm:reassignable">
                   <default>false</default>
                </property>
            </overrides> 
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
            <aspect>mcwm:projectCharter</aspect>
         </mandatory-aspects>
      </type>
   </types>
   <!–aspect definition for data which are common for all forms-tasks–>
   <aspects>
        <aspect name="mcwm:projectCharter">
         <title>Projektna povelja</title>
             <properties>
            <property name="mcwm:projectName">
               <title>Naziv projekta</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            <property name="mcwm:shortProjectName">
               <title>Skraceni naziv projekta</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            <property name="mcwm:projectOrderer">
               <title>Narucitelj projekta</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            <property name="mcwm:shortProjectOrderer">
               <title>Skraceni naziv narucitelja projekta</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            <property name="mcwm:isoProcess">
               <title>ISO 9000 proces</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
               <constraints>
                  <constraint name="mcwm:isoProcessChoices" type="LIST">
                     <parameter name="allowedValues">
                        <list>
                           <value> </value>
                           <value>održavanje - aplikativno</value>
                           <value>održavanje - sistemsko</value>
                           <value>konzalting</value>
                           <value>razvoj - sa odobrenjem arhitekture</value>
                           <value>razvoj - bez odobrenja arhitekture</value>
                           <value>mali razvoj</value>
                           <value>implementacija</value>
                        </list>
                     </parameter>
                  </constraint>
               </constraints>
            </property>
            <property name="mcwm:reporting">
               <title>Ucestalost izveštavanja</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
               <constraints>
                  <constraint name="mcwm:reportingChoices" type="LIST">
                     <parameter name="allowedValues">
                        <list>
                           <value>mesecno</value>
                           <value>kvartalno</value>
                           <value>po okoncanju</value>
                        </list>
                     </parameter>
                  </constraint>
               </constraints>
            </property>
            <property name="mcwm:projectGoals">
               <title>Ciljevi projekta</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            
            <property name="mcwm:beginDate">
               <title>Datum pocetka projekta</title>
               <type>d:date</type>
               <mandatory>false</mandatory>
            </property>
            
            <property name="mcwm:endDate">
               <title>Datum okoncanja projekta</title>
               <type>d:date</type>
               <mandatory>false</mandatory>
            </property>
            <property name="mcwm:teamResource">
               <title>Predvideni utrošak ljudskih resursa</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            
            <property name="mcwm:teamComent">
               <title>Komentar na predvideni utrošak ljudskih resursa</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            
            <property name="mcwm:changeComent">
               <title>Komentar izmene</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            <property name="mcwm:commentsHistory">
               <title>Istorija komentara</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </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>
                <association name="mcwm:teamWithoutDoc">
                    <source>
                        <mandatory>false</mandatory>
                        <many>false</many>
                    </source>
                    <target>
                        <class>cm:person</class>
                        <mandatory>false</mandatory>
                        <many>true</many>
                    </target>
                </association>
            </associations>
      </aspect>
   </aspects>
  
</model>
What i am doing wrong, any idea? Smiley Sad

Regards,
Aleksadnar

azivotic
Champ in-the-making
Champ in-the-making
I have try to create some workaround(isn't best solution i guess Smiley Surprisedops: )

I create some global process variable which will kept value of association during process and serve for transfer this value over tasks (every task has own association, on every task create i set local task association to the value of global task association, so that user can see what was entered on previous step, and on task complete push local variable to global association variable).

Result is:
I put association value from first task to global value. On my second task i have completely different association (different variable). On second task create i set this second variable to the value of global value just to user can what was typed on previous task. On second task complete i want to pick value of second task association to put her on global variable, but second task association value is not updated even user pick something during task, her value is the same as i set on task create. Looks like the value of association can be set only once?

Regards,
Aleksandar

pero
Champ in-the-making
Champ in-the-making
I think this is a bug in Alfresco or Activiti. I have created Jira ticket with steps to reproduce the problem.

https://issues.alfresco.com/jira/browse/ALF-13640