cancel
Showing results for 
Search instead for 
Did you mean: 

getTaskById function in template

fuad_gafarov
Champ in-the-making
Champ in-the-making
Hi.
I create .ftl template file. and store in /Data Dictionary/Presentation Templates.


   <#list workflow.getTaskById("jbpm$584") as t>
         ${t.id}
   </#list>

I need retrieve single task by - getTaskById function
But I not know true syntax.
Above code about - workflow.assignedTask as t - is wrong.
I need syntax how I can type getTaskById()  function correctly on FreeMarker Template

Sorry for bad english.

Thanks
14 REPLIES 14

amandaluniz_z
Champ on-the-rise
Champ on-the-rise
It is working then?

fuad_gafarov
Champ in-the-making
Champ in-the-making
Yes. It is working

fuad_gafarov
Champ in-the-making
Champ in-the-making
It called name, description normally.

<tr>
         <td>${t.id}</td>
         <td>${t.type}</td>
         <td>${t.name}</td>
         <td>${t.description}</td>
         <td>${t.properties["cm:created"]?datetime}</td>
         <td><#if t.properties["bpm:startDate"]?exists>${t.properties["bpm:startDate"]?datetime}<#else><i>None</i></#if></td>
         <td><#if t.properties["bpm:dueDate"]?exists>${t.properties["bpm:dueDate"]?datetime}<#else><i>None</i></#if></td>
         <td>${t.properties["bpm:priority"]}</td>
         <td>${t.properties["bpm:percentComplete"]}</td>
         <td>${t.properties["bpm:status"]}</td>
         <td>${t.isCompleted?string("Yes", "No")}</td>
      </tr>

But how I can call someone's comment?
And how I can call my custom aspects whick I use in workflows (t.properties["tc:customType"] or t.properties["bpm:customType"]- not working)?

amandaluniz_z
Champ on-the-rise
Champ on-the-rise
In reference to custom types you should use the prefix you defined when creating the model. I guess the type is applied to the node, right?

For that you'll need to go through the nodes in the workflow (bpm_package)


<#list t.packageResources as p>
     ${p.properties["myPrefix:myProperty"]}
</#list>

or


<#list t.properties[bpm:package"].children as p>
     ${p.properties["myPrefix:myProperty"]}
</#list>

I remember retrieving the comment is more complex…. but there was a way

fuad_gafarov
Champ in-the-making
Champ in-the-making
I retrieve bpm:startDate but cannot retrieve my custom type and comments.
I saw template wiki - there are haven't retrieve comment in templates.
I change my page from template to simple page.


Topic closed.
Thank you