cancel
Showing results for 
Search instead for 
Did you mean: 

Getting a custom property

raptus
Champ in-the-making
Champ in-the-making
Hi,
I have problems getting a custom-workflow property by a Freemarker template (html-based web script).

I have done an advanced workflow with a custom property called "my:note" -type:string. The workflow is similar to the classic "review-approve" and the note is similar to the default bpm:comment property but how can I get this property?

Here is my template:

<table cellspacing=0 cellpadding=2>
   <tr>
      <th>ID</th>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
      <th>Created Date</th>
      <th>Start Date</th>
      <th>Due Date</th>
      <th>Priority</th>
      <th>% Complete</th>
      <th>Status</th>
      <th>Completed</th>
   <tr>
   <#list workflow.assignedTasks as t>
      <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>
   <td>${t.properties["my:note"]?string}  </td>                           
      </tr>
   </#list>

  <#list workflow.pooledTasks as t>
      <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>

<div class="task-transitions">
      <#list t.transitions as transition>
            <span class="${t.id} ${transition.id}"><a href="#" class="task-transition theme-color-1">${transition.label?html}</a></span>
         <#if transition_has_next><span class="separator">|</span></#if>
      </#list>
         </div>
   </#list>
</table>


This returns "operation t.properties["my:note"]?string is undefined……. Why???
Without <td>${t.properties["my:note"]?string}  </td>     works well.

Thanks in advance,

raptus
1 REPLY 1

lucille_arkenst
Champ in-the-making
Champ in-the-making
I'm not an FTL expert, but do you need a parameter after ?string –?  Like you do here: ${t.isCompleted?string("Yes", "No")}

If that doesn't work, I would try deleting the whitespace between the end of your expression and the </td> and see what happens.  I've noticed that FTL doesn't "like" certain things.  Whitespace may be one of them.  Not sure.
<td>${t.properties["my:note"]?string}  </td>