03-02-2010 02:37 AM
id: jbpm$4 , name: jbpm$wcmwf:changerequest , title: Change Request , version: 1
id: jbpm$2 , name: jbpm$wf:adhoc , title: Adhoc Task , version: 1
id: jbpm$6 , name: jbpm$inwf:invitation-nominated , title: Invitation - Nominated , version: 1
id: jbpm$1 , name: jbpm$wf:review , title: Review & Approve , version: 1
id: jbpm$7 , name: jbpm$imwf:invitation-moderated , title: Invitation - Moderated , version: 1
id: jbpm$3 , name: jbpm$wcmwf:submit , title: Web Site Submission , version: 1
id: jbpm$5 , name: jbpm$wcmwf:submitdirect , title: Web Site Submission (Direct) , version: 1
All active workflows:
<table cellspacing=0 cellpadding=2>
<tr>
<th>ID</th>
<th>Name</th>
<th>Description</th>
<th>Title</th>
<th>Version</th>
<th># active</th>
</tr>
<tr>
<td colspan="6"><hr/></td>
</tr>
<#list workflow.latestDefinitions as def>
<tr>
<td>${def.id}</td>
<td>${def.description}</td>
<td>${def.name}</td>
<td>${def.title}</td>
<td>${def.version}</td>
<td>${def.activeInstances}</td>
</tr>
</#list>
</table>
05-07-2010 06:16 PM
05-18-2010 02:00 AM
Take a look at http://wiki.alfresco.com/wiki/Workflow_JavaScript_API
try workflow.getLatestDefinitions().
You are close but just trying to use latestDefinitions as a property of the workflow object (workflow.latestDefinitions) rather than as a function of it (workflow.getLatestDefinitions() ).
Here I am talking about the JavaScript API and not the Freemarker (template API).
Look at http://wiki.alfresco.com/wiki/Template_Guide#Workflow for Freemarker. You don't get the same functions - in particular you can't see the definitions, just the tasks.
You could just do the work in the .js file of the web script. Make the call above, then put the results into json or some form that can be displayed on the client side. Maybe just a simple string that includes the <td> tags. then just output that in Freemarker.
var outputRows = "";
for each (var def in workflow.latestDefinitions)
{
outputRows += "<tr>";
outputRows += " <td>" + def.id + "</td>";
outputRows += " <td>" + def.description + "</td>";
outputRows += " <td>" + def.name + "</td>";
outputRows += " <td>" + def.title + "</td>";
outputRows += " <td>" + def.version + "</td>";
outputRows += " <td>" + def.activeInstances + "</td>";
outputRows += "</tr>"
}
model.outputRows = outputRows;
All active workflows:
<table cellspacing=0 cellpadding=2>
<tr>
<th>ID</th>
<th>Name</th>
<th>Description</th>
<th>Title</th>
<th>Version</th>
<th># active</th>
</tr>
<tr>
<td colspan="6"><hr/></td>
</tr>
${outputRows}
</table>
model.workflowLatestDefinitions = workflow.latestDefinitions;
<#list workflowLatestDefinitions as def>
<tr>
<td>${def.id}</td>
<td>${def.description}</td>
<td>${def.name}</td>
<td>${def.title}</td>
<td>${def.version}</td>
<td>${def.activeInstances}</td>
</tr>
</#list>
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.