cancel
Showing results for 
Search instead for 
Did you mean: 

Show assignee's users on 'My Task to do' in Alfres

ejml
Champ in-the-making
Champ in-the-making
Hello Folks!

Will Could I see the user that's performed the last step on my Workflow on "my task to do" in Alfresco 2.0?.

Thanks.
7 REPLIES 7

davidc
Star Contributor
Star Contributor

ejml
Champ in-the-making
Champ in-the-making
Yes, but you told me:

I've added a JIRA enhancement to automatically track who assigned a
task

Do you remember it?, for this reason I ask again.

Greetings!!

davidc
Star Contributor
Star Contributor
I see.

It's reported under http://issues.alfresco.com/browse/AR-1127

It hasn't been implemented in v2.0.

ejml
Champ in-the-making
Champ in-the-making
Thanks David. Then I will try to implement it with your instruction, but Could You help me with:

I have problems when I modify the review_processdefinition.xml and workflowModel.xml directly. Is there other way to do this.

For Example, I don't see the change done since the moment.

greetings!!

ejml
Champ in-the-making
Champ in-the-making
Hi David, I have tried to implement the workflow with your instruction but it doesn't work, the field appear empty. I like Alfreso as Document Management and I want implement this system on my enterprise but this question is great importance for my chiefs and they want this funtionality. After I want to pressure to buy a enterprise licence because I believe that it's necessary but I need some to convice.

Please Help me to implement Alfresco on my enterprise

These are the files that I have modified following the David's instruction:

WofkFlowModel.xml


<?xml version="1.0" encoding="UTF-8"?>

<model name="wf:workflowmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <imports>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm"/>
   </imports>

   <namespaces>
      <namespace uri="http://www.alfresco.org/model/workflow/1.0" prefix="wf"/>
   </namespaces>
     
   <types>

      <!–                               –>
      <!–  Basic Review & Approve Tasks –>              
      <!–                               –>
     
      <type name="wf:submitReviewTask">
         <parent>bpm:startTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>

      <type name="wf:reviewTask">
          <parent>bpm:workflowTask</parent>
         <overrides>
            <property name="bpm:packageItemActionGroup">
               <default>edit_package_item_actions</default>
            </property>
         </overrides>
         <mandatory-aspects>
            <aspect>wf:from</aspect>
         </mandatory-aspects>
      </type>

         <type name="wf:approvedTask">
         <parent>bpm:workflowTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
            <aspect>wf:from</aspect>
         </mandatory-aspects>
      </type>
     
      <type name="wf:rejectedTask">
         <parent>bpm:workflowTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
            <aspect>wf:from</aspect>
         </mandatory-aspects>
      </type>
     
      <!–                               –>
      <!–  Adhoc Tasks –>              
      <!–                               –>
     
      <type name="wf:submitAdhocTask">
         <parent>bpm:startTask</parent>
         <properties>
            <property name="wf:notifyMe">
               <type>d:boolean</type>
               <default>false</default>
            </property>
         </properties>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>

      <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>
      </type>

      <type name="wf:completedAdhocTask">
         <parent>bpm:workflowTask</parent>
      </type>

   </types>
  
   <aspects>
      <aspect name="wf:from">
            <properties>
               <property name="wf:from">
                  <type>d:noderef</type>
               </property>
            </properties>
     </aspect>
  </aspects>

</model>

review_processdefinitio.xml

<?xml version="1.0" encoding="UTF-8"?>

<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wf:review">

    <swimlane name="initiator" />
   
   
    <start-state name="start">
        <task name="wf:submitReviewTask" swimlane="initiator" >
            <event type="task-end">
                  <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                      <script>
                          <expression>wf_from = initiator.properties['cm:userName'];</expression>
                          <variable name="wf_from" access="write"/>
                      </script>
                </action>
            </event>
        </task>
        <transition name="" to="review" />
    </start-state>
   
    <swimlane name="reviewer">
        <assignment actor-id="#{bpm_assignee.properties['cm:userName']}" />
    </swimlane>
   
    <task-node name="review">
        <task name="wf:reviewTask" swimlane="reviewer">
            <event type="task-create">
                  <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                   <script>
                       if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
                       if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
                   </script>
                </action>
            </event>
            <event type="task-end">
                  <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                      <script>
                          <expression>wf_from = bpm_assignee.properties['cm:userName'];</expression>
                          <variable name="wf_from" access="write"/>
                      </script>
                </action>
            </event>
        </task>
        <transition name="reject" to="rejected" />
        <transition name="approve" to="approved" />
    </task-node>
   
    <task-node name="rejected">
        <task name="wf:rejectedTask" swimlane="initiator" />
        <transition name="" to="end" />
    </task-node>

    <task-node name="approved">
        <task name="wf:approvedTask" swimlane="initiator" />
        <transition name="" to="end" />
    </task-node>

    <end-state name="end" />

</process-definition>

task-todo-dashlet.jsp

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>

<h:outputText value="#{msg.no_tasks}" rendered="#{empty WorkflowBean.tasksToDo}" />

<a:richList id="tasks-todo-list" viewMode="details" value="#{WorkflowBean.tasksToDo}" var="r"
styleClass="recordSet" headerStyleClass="recordSetHeader" rowStyleClass="recordSetRow"
altRowStyleClass="recordSetRowAlt" width="100%" pageSize="10"
initialSortColumn="created" initialSortDescending="true"
rendered="#{not empty WorkflowBean.tasksToDo}">

<%– Primary column for details view mode –%>
<a:column id="col1" primary="true" width="200" style="padding:2px;text-align:left">
<f:facet name="header">
<a:sortLink id="col1-sort" label="#{msg.description}" value="name" mode="case-insensitive" styleClass="header"/>
</f:facet>
<f:facet name="small-icon">
<a:actionLink id="col1-act1" value="#{r['bpm:description']}" image="/images/icons/workflow_task.gif" showLink="false"
actionListener="#{DialogManager.setupParameters}" action="dialog:manageTask">
<f:param name="id" value="#{r.id}" />
</a:actionLink>
</f:facet>
<a:actionLink id="col1-act2" value="#{r['bpm:description']}" actionListener="#{DialogManager.setupParameters}"
action="dialog:manageTask">
<f:param name="id" value="#{r.id}" />
</a:actionLink>
</a:column>

<%– Task type –%>
<a:column id="col2" style="padding:2px;text-align:left">
<f:facet name="header">
<a:sortLink id="col2-sort" label="#{msg.type}" value="name" mode="case-insensitive" styleClass="header"/>
</f:facet>
<h:outputText id="col2-txt" value="#{r.name}" />
</a:column>

<%– Task id column –%>
<a:column id="col3" style="padding:2px;text-align:left">
<f:facet name="header">
<a:sortLink id="col3-sort" label="#{msg.id}" value="bpm:taskId" styleClass="header"/>
</f:facet>
<h:outputText id="col3-txt" value="#{r['bpm:taskId']}" />
</a:column>

<%– Created Date column –%>
<a:column id="col4" style="padding:2px;text-align:left">
<f:facet name="header">
<a:sortLink id="col4-sort" label="#{msg.created}" value="created" styleClass="header"/>
</f:facet>
<h:outputText id="col4-txt" value="#{r.created}">
<a:convertXMLDate type="both" pattern="#{msg.date_time_pattern}" />
</h:outputText>
</a:column>

<%– Due date column –%>
<a:column id="col5" style="padding:2px;text-align:left">
<f:facet name="header">
<a:sortLink id="col5-sort" label="#{msg.due_date}" value="bpm:dueDate" styleClass="header"/>
</f:facet>
<h:outputText id="col5-txt" value="#{r['bpm:dueDate']}">
<a:convertXMLDate type="both" pattern="#{msg.date_pattern}" />
</h:outputText>
</a:column>

<%– Status column –%>
<a:column id="col6" style="padding:2px;text-align:left">
<f:facet name="header">
<a:sortLink id="col6-sort" label="#{msg.status}" value="bpm:status" styleClass="header"/>
</f:facet>
<h:outputText id="col6-txt" value="#{r['bpm:status']}" />
</a:column>

<%– Priority column –%>
<a:column id="col7" style="padding:2px;text-align:left">
<f:facet name="header">
<a:sortLink id="col7-sort" label="#{msg.priority}" value="bpm:priority" styleClass="header"/>
</f:facet>
<h:outputText id="col7-txt" value="#{r['bpm:priority']}" />
</a:column>

<%– Actions column –%>
<a:column id="col8" actions="true" style="padding:2px;text-align:left">
<f:facet name="header">
<h:outputText id="col8-txt" value="#{msg.actions}"/>
</f:facet>
<r:actions id="col8-actions" value="dashlet_todo_actions" context="#{r}" showLink="false"
styleClass="inlineAction" />
</a:column>

<%– From column –%>
<a:column id="col2_test" style="padding:2px;text-align:left">
<f:facet name="header">
<a:sortLink id="col2_test-sort" label="#{msg.type}" value="name" mode="case-insensitive" styleClass="header"/>
</f:facet>
<h:outputText id="col2_test-txt" value="#{r['wf:from']}" />
</a:column>

<a:dataPager id="pager" styleClass="pager" />
</a:richList>

Thanks in advance!!

davidc
Star Contributor
Star Contributor
I've done as much as I can on this forum.  I've given a complete example.

ejml
Champ in-the-making
Champ in-the-making
Hi David.

I can that you are doing very much for me. The problem is that I'm novice in Alfresco, but step by step I will learn about this system. I have been consulting the Alfresco documentation and I haven't redeploy the modifications on processreview and the workflowmodel, I think that this is the problem.

Can I redeploy a workflow out-of-box like "Review & approval" using the workflowdeployer bean, with the property redeploy set true.

Thanks