I am in need of execute a workflow in an action and retrieve an output parameter which contains a list of string.
It will be of great help if some one could throw some light
Thanks in advance
Reghu
It will look like this:
var workflowToLaunch = Server.getWorkflowWithId("608080808080808080808080808080804C828080013141141566711a974a8fef8");
if (workflowToLaunch == null) {
throw "Workflow not found";
}
var workflowParameters = new Properties();
workflowParameters.put("inputParameter1Name", inputParameter1Value);
workflowParameters.put("inputParameter2Name", inputParameter2Value);
var wfToken = workflowToLaunch.execute(workflowParameters);
while (wfToken.state == "running" || wfToken.state == "waiting" && wfToken.state == "waiting-signal") {
System.sleep(5000);
}
if (wfToken.state == "failed") throw wfToken.exception;
var outputParameters = wfToken.getOutputParameters();
var outputParameter = outputParameters.get("outputPutParameter1Name");
You can get a workflow ID soing a System.log(wf.id); (using a wf attribute)
BTW running a workflow and getting its output from an action is quite unusual. It is a lot easier to do it from a workflow.
Christophe.