cancel
Showing results for 
Search instead for 
Did you mean: 

return values from action.execute()

cszamudio
Champ on-the-rise
Champ on-the-rise
Hi,
Does the action.execute() function ever return a value?  For example, if I'm creating a workflow on a document I call workflow.execute(docNode) after setting up the parameters, works fine. But it would be nice to retrieve the workflow Id of the newly started workflow and return this in a JSON formatted result.  I've tried looking in the workflow object, but I don't see it there (after execution).  All of the examples I've found never look at a returned value.  (The SOAP interface, however, returns the newly created workflow instance data). Any hints someone could part with?
Thanks,
Carlos S. Zamudio
1 REPLY 1

smicyk
Champ in-the-making
Champ in-the-making
Hi,

you can check this wiki page http://wiki.alfresco.com/wiki/Returning_Values_From_Actions.

In general if you want to return a value from action you should add extra parameter definition to your action and set value for this parameter in executeImpl method. After executing action you should get that value from Action object passed to execute method (check out ScriptActionExecuter class in Alfresco SDK for some example).

Thanks