My Assigned Tasks

Installation

Use the Module Management Tool to install the myassignedtasks.amp. Information about how to do this can be found at: Module Management Tool Guide The Module Management Tool can be downloaded here.

How it works

The My Assigned Tasks dashlet

The My Assigned Tasks dashlet shows in progress tasks that a user has assigned to others. After installation of the module the dashlet is available in the My Alfresco Dashboard. All it needs to display assigned tasks is an extra variable in the tasks that contains the name of the user who has assigned them. The My Assigned Tasks dashlet checks all in progress workflow tasks for this property. If there is a task that has the property set to the current user then the task is displayed in the dashlet. This property is named hmediawf:observer and is defined in the hmediawf:workflowmodel.

The hmediawf:workflowmodel

The module contains a workflow model with QName hmediawf:workflowmodel. This workflow model defines an aspect named hmediawf:observable that defines a property named hmediawf:observer. This aspect must be assigned to each task of your workflow model that should be able to appear in the My Assigned Tasks dashlet. In the process definition of your workflow the hmediawf_observer variable must be set to any of these tasks when they are created.

Example: Extending the Ad-hoc workflow

Alfresco already contains the Ad-hoc task workflow. If an Ad-Hoc task assigned by user A to someone else should appear in the My Assigned Tasks dashlet then the worklfow model and the process definition of the Ad-hoc task must be slightly customized.

  1. Open the Ad-hoc tasks workflow model located at alfresco/WEB-INF/classes/alfresco/workflow/workflowModel.xml
  2. Add the following line into the <imports> element
     <import uri="extension.workflows.hmedia" prefix="hmediawf"/> 
  3. Locate the definition of the wf:adhocTask and add the hmediawf:obervable aspect:
    <type name="wf:adhocTask">
             <parent>bpm:workflowTask</parent>
             <overrides>
                <property name="bpm:packageActionGroup">
                   <default>add_package_item_actions</default>
                </property>
                <property name="bpm:packageItemActionGroup">
                   <default>edit_package_item_actions</default>
                </property>
             </overrides>
             <mandatory-aspects>
                <aspect>hmediawf:observable</aspect>
             </mandatory-aspects>
          </type>
  4. Save the file and open the adhoc_processdefinition.xml in the same folder.
  5. Locate the wf:adhocTask task definition and add another task-create event:
    <task name="wf:adhocTask" swimlane="assignee">
    		<event type="task-create">
    	         <script>
    	            if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
    	            if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
    	         </script>
    	      </event>
    	      <event type="task-create">
                    <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                        <script>
                            <variable name="hmediawf_observer"/>
                            <expression>
                            hmediawf_observer = person.properties["cm:userName"];
                            hmediawf_observer;
                            </expression>
                        </script>
                    </action>
                </event>
          </task>
  6. Redeploy the Ad-hoc processdefinition by setting redeploy to true for the alfresco/workflow/adhoc_processdefinition.xml process definition in alfresco\WEB-INF\classes\alfresco\bootstrap-context.xml

If you restart Alfresco and create a new Ad-hoc Task for someone else you should see the created task in your My Assigned Tasks dashlet as long as the task is not completed.

products/myassignedtasks.txt · Last modified: 2019/03/30 12:59 (external edit)


All trademarks and registered trademarks used are the property of their respective owners.
 

Recent changes RSS feed Driven by DokuWiki