cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow Definition Name

tonyfoo
Champ in-the-making
Champ in-the-making
Hi All,

I am currently trying to retrieve a list of workflow definitions for the appropriate instances. I can successfully retrieve the workflow instance ID (using instance.getId()) but am unable to pull the definition. I have tried the instance.definition.getName(); and several others. I have reviewed quite a few of the wiki and javadoc pages but everything I try seems to return 'undefined'.

Thanks for your help.
Tony
3 REPLIES 3

hyperation
Champ on-the-rise
Champ on-the-rise
Hi,

Can you tell me where you are running the code and perhaps post some code snippet?

Perhaps here are some info in relation to the topic: http://wiki.alfresco.com/wiki/Workflow_JavaScript_API#JscriptWorkflowInstance

Thanks
Smiley Happy

tonyfoo
Champ in-the-making
Champ in-the-making
Hello,

Yes, I am running the code in a .get.js file that will do the work for a freemarker template (.get.html.ftl) we are using for our interface. We are calling a function that returns a workflow instance:

the call:
model.Results =  jsWorkflowUtils.getWorkflowsForContent(model.courseNode, true);

the Result:
org.alfresco.repo.workflow.jscript.JscriptWorkflowInstance@36b11

I can then use the result to get the instance id:
model.Results[i].getId();

Which returns:
jbpm$44

However, whenever I try to get any further information (model.Results.getDescription() and model.Results.definition) it returns undefined.

Thanks for your help,
Kyle

hyperation
Champ on-the-rise
Champ on-the-rise
Hi

Silly question, but have you tried any other property besides description?

Thanks
Smiley Happy