User Tools

Site Tools


products:myassignedtasks

====== My Assigned Tasks ====== ===== Installation ===== Use the Module Management Tool to install the myassignedtasks.amp. Information about how to do this can be found at: [[http://wiki.alfresco.com/wiki/Module_Management_Tool|Module Management Tool Guide]] The Module Management Tool can be downloaded [[http://sourceforge.net/project/showfiles.php?group_id=143373&package_id=157460&release_id=524558|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. - Open the Ad-hoc tasks workflow model located at alfresco/WEB-INF/classes/alfresco/workflow/workflowModel.xml - Add the following line into the <imports> element <code> <import uri="extension.workflows.hmedia" prefix="hmediawf"/> </code> - Locate the definition of the wf:adhocTask and add the hmediawf:obervable aspect: <code><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></code> - Save the file and open the adhoc_processdefinition.xml in the same folder. - Locate the wf:adhocTask task definition and add another task-create event:<code><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></code> - 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: 2023/11/19 22:46 (external edit)