cancel
Showing results for 
Search instead for 
Did you mean: 

Setting initiator property to task metadata

jayjayecl
Confirmed Champ
Confirmed Champ
Hello,

I m still struggling with variables, properties, "process data" etc … in workflow scripts.

I'm just trying to set, in the second task of my workflow, a read-only displayed property showing the intiator's name.
How coud I do that ?

I've tried to provide an aspect to the first and second task,

<aspect name="GPGU:personAspect_General">
      <properties>
         <property name="GPGU:personAspect_initiator_name">
         <title>Inititator </title>
                  <type>d:text</type>
         </property>
      </properties>
     </aspect>

And then setting the property :
- in a the transition from task 1 to task 2,
- in a create-node event
- in a task-create event etc …

I could not achieve to do that
2 REPLIES 2

jayjayecl
Confirmed Champ
Confirmed Champ
1/ First try :


<start-state name="Initialisation">
      <task name="GPWF:init" swimlane="initiator" >
      </task>
      <transition name="tr_init_leave" to="choix_Brouillon">
               <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
               <runas>admin</runas>
                  <script>
                  GPGU_personAspect_initiator_name = initiator.properties.userName
            </script>
            </action>
      </transition>
   </start-state>

No error is raised, but the value of GPGU_personAspect_initiator_name is null (or void) in the form of the second task

jayjayecl
Confirmed Champ
Confirmed Champ
Ok, I managed to do it, using <expression> tag to access, read and write into properties.

I'm quite experienced with Alfresco development, but I just think there is a lack of Scripting documentation in Alfresco.