cancel
Showing results for 
Search instead for 
Did you mean: 

Deleted.

anon26949
Star Contributor
Star Contributor
1 ACCEPTED ANSWER

jearles
Star Contributor
Star Contributor

For future reference, for those who have the same question.

This was answered on StackOverflow earlier - that answer is as follows.

"Yes you can do it by using assignment event"

<userTask id="test" name="Assignb" activiti:assignee="userName" activiti:formKey="<<formKey>>">
   <extensionElements>
      <activiti:taskListener event="assignment" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
         <activiti:field name="script">
            <activiti:string><![CDATA[
               var currAssignee = task.assignee;
               //gives current task assignee
               logger.log(currAssignee );
               ]]></activiti:string>

            </activiti:field>

 </activiti:taskListener>
         <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
 <activiti:field name="script">
 <activiti:string><![CDATA[var currAssignee = task.assignee;]]></activiti:string>
 </activiti:field>
 </activiti:taskListener>
 </extensionElements>
</userTask>


Hope this helps other in the future,
-JEarles
bp3

View answer in original post

1 REPLY 1

jearles
Star Contributor
Star Contributor

For future reference, for those who have the same question.

This was answered on StackOverflow earlier - that answer is as follows.

"Yes you can do it by using assignment event"

<userTask id="test" name="Assignb" activiti:assignee="userName" activiti:formKey="<<formKey>>">
   <extensionElements>
      <activiti:taskListener event="assignment" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
         <activiti:field name="script">
            <activiti:string><![CDATA[
               var currAssignee = task.assignee;
               //gives current task assignee
               logger.log(currAssignee );
               ]]></activiti:string>

            </activiti:field>

 </activiti:taskListener>
         <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
 <activiti:field name="script">
 <activiti:string><![CDATA[var currAssignee = task.assignee;]]></activiti:string>
 </activiti:field>
 </activiti:taskListener>
 </extensionElements>
</userTask>


Hope this helps other in the future,
-JEarles
bp3