AnsweredAssumed Answered

Get workflow description by taskId

Question asked by emmy on Jan 30, 2009
Hi,
I use Alfresco 3.0 and I would create a webscript that show my assigned task.
I would insert the workflow description in assigned task list.

<table cellpadding="0" cellspacing="0" width="100%" border="0">
   <tr class="titleRow">
        <td width="1%"></td>
        <td nowrap>${msg("workflow")}</td>
        <td nowrap>${msg("id")}</td> 
          <td nowrap>${msg("description")}</td> 
          <td nowrap>${msg("type")}</td>
          <td nowrap>${msg("creationDate")}</td>
          <td nowrap>${msg("dueDate")}</td>
          <td nowrap>${msg("state")}</td>
          <td nowrap>${msg("comment")}</td>
          <td nowrap>${msg("doc")}</td>
    </tr>
    <#assign count=1>
   <#list workflow.assignedTasks as t>
   <#assign count=count+1>
   <tr class="row row${(count % 2 = 0)?string("Odd", "Even")}">
   <#assign hasDue = t.properties["bpm:dueDate"]?exists>
   <#if hasDue>
      <#assign due=t.properties["bpm:dueDate"]>
   </#if>
      <td>
   <#if hasDue>
      <#– items due today? –>
      <#if (dateCompare(date?date, due?date, 0, "==") == 1)>
         <img src="${url.context}/images/office/task_today.gif" alt="due today" />
      <#– items overdue? –>
      <#elseif (dateCompare(date?date, due?date) == 1)>
         <img src="${url.context}/images/office/task_overdue.gif" alt="overdue" />
      </#if>
   <#else>
          
   </#if>
   </td>
   <td>??????????????</td>
   <td>${t.properties["bpm:taskId"]}</td>
   <td>${t.description?html}</td>
   <td>${t.type?html}</td>
   <td>
         <#if t.properties["bpm:startDate"]?exists>
            ${t.properties["bpm:startDate"]?date?string("dd/MM/yyyy")}
         <#else>
            ${t.properties["cm:created"]?date?string("dd/MM/yyyy")}
         </#if>
   </td>
   <#if hasDue>
       <td>${due?date?string("dd/MM/yyyy")}</td>
   <#else>
         <td> </td>
   </#if>
   <td>${t.properties["bpm:status"]}</td>
   <td>
         <#if t.properties["bpm:comment"]?exists>
            ${t.properties["bpm:comment"]}
         <#else>
          
         </#if>
   </td>
   <td>
      <#list t.packageResources as res>
      <#if res.isDocument>
         <a href="${url.context}${res.url}" target="new"><img src="${url.context}${res.icon16}" alt="${res.name?html}"></a>
      </#if>
   </#list>
   </td>
   </tr>
</#list>
Any suggestion?

Thanks,
Emanuela

Outcomes