cancel
Showing results for 
Search instead for 
Did you mean: 

Task properties

nowhere
Champ in-the-making
Champ in-the-making
Hi all,
I have a advanced workflow and a snip of model for it is the following:

 <type name="wfrup:assegnaLocaleState">
        <parent>bpm:workflowTask</parent>
          <properties>
      <property name="wfrup:idWorkflowRup">
              <type>d:text</type>             
           </property>              
        </properties>
    <mandatory-aspects>
      <aspect>bpm:assignee</aspect>
        </mandatory-aspects>
     </type>    

      <type name="wfrup:doSomethingState">
        <parent>bpm:workflowTask</parent>   
        <properties>               
        </properties>
   <mandatory-aspects>
      <aspect>bpm:assignee</aspect>
        </mandatory-aspects>
     </type>

I would "doDoSomethingState" automatically have "idWorkflowRup" properties set as it has been set in "assegnaLocaleState" before transition toke place.
To undertsand I have following code:

Map<QName, Serializable> workflowProps1 = new HashMap<QName, Serializable>();
       workflowProps1.put(FaseUnoModel.PROP_RUP_WORKFLOW_ID, idRup);
        workflowService.updateTask(wfTask, workflowProps1, null, null);
        this.workflowService.endTask(wfTask.id, "transition1");

that set idWorkflowRup in wfTask (assegnaLocaleState), update the task and end it. I would next task have same idWorkflowRup property set to idRup value also.
How can I get it? If I replicate the property in model I get a bootstrap error in workflow deployment Smiley Sad

Thanks for attention, I'm sure you can help me 🙂

Have a nice week end!
3 REPLIES 3

jayjayecl
Confirmed Champ
Confirmed Champ
make this property as part of an aspect, and put your aspect on both tasks.
Hope this helps

nowhere
Champ in-the-making
Champ in-the-making
Hi,
it helps! Thanks!
Initially I created I node between "doDoSomethingState" and "assegnaLocaleState" tasks and in this node I set the correct properties using script, but I used a different name for properties (idRup and idWorkflowRup) and it was noisy:

<node name="nodeUno">
        <transition name="" to="doSomething" >
      <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
              <script>
            <variable name="wfrup_idRup" access="read,write" />
            <variable name="wfrup_idWorkflowRup" access="read" />   
            
            <expression>
               wfrup_idRup =    wfrup_idWorkflowRup;
               
            </expression>
         </script>
      </action>
   </transition>
   </node>

Aspects solution is smarter, thanks again! 🙂

Greetings,
Nowhere

jayjayecl
Confirmed Champ
Confirmed Champ
No problem Smiley Happy