Issue with defining a Dynamic Participant Step with an ECMA Script
Hi,
I am trying to provide an implementation for dynamic participant step
using an ECMA script. The script basically returns a participant user
based on the path of the payload.Here is the script -
function getParticipant() {
var workflowData = workItem.getWorkflowData();
if (workflowData.getPayloadType() == "JCR_PATH") {
var path = workflowData.getPayload().
log.debug("this is the payload path : " + path);
if (path.indexOf("/content/test/
return new String("user-a");
}
else if (path.indexOf("/content/test/
return new String("user-b");
}
else if (path.indexOf("/content/test/
return new String("user-c");
}
else if (path.indexOf("/content/test/
return new String("user-d");
}
else if (path.indexOf("/content/test/
return new String("user-e");
}
}
}
But running this script gives below exception -
25.01.2012 16:41:26.139 *WARN* [127.0.0.1 [1327527685905] POST /etc/
workflow/instances HTTP/1.1]
com.day.cq.workflow.impl.
to get the java object java.lang.
org.mozilla.javascript.
at java.lang.Class.
at
com.day.cq.workflow.impl.
202)
at
com.day.cq.workflow.impl.
156)
at
com.day.cq.workflow.impl.
124)
Any pointers would be greatly appriciated.
Thanks in advance.