User Tools

Site Tools


My Assigned Tasks


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">
                <property name="bpm:packageActionGroup">
                <property name="bpm:packageItemActionGroup">
  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">
    	            if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
    	            if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
    	      <event type="task-create">
                    <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                            <variable name="hmediawf_observer"/>
                            hmediawf_observer =["cm:userName"];
  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: 2022/06/20 23:36 (external edit)