I believe the object used to create the WorkflowData object (i.e. the workflow payload) must either be the path of a repository node, or the UUID of the node, or the serialized object of the node. You can't use the string value directly as you have done. See the Managing Workflow Instances section in http://dev.day.com/docs/en/cq/current/developing/developing_workflows.html
Thanks for the quick response Scott. I tried setting the Object to the path of a repository node:
WorkflowData wfData = wfSession.newWorkflowData("SKILL_DATA", pagepath);
but it still failed to set as the workflow's payload. I also tried starting the dialog from the Sidekick, which does work.Here are the log messages for the two runs (Sidekick run first, failing run second):
POST /etc/workflow/instances HTTP/1.1] com.day.cq.workflow.impl.CQWorkflowSession Workflow instance started with model: /etc/workflow/models/skill-request/jcr:content/model and ID: /etc/workflow/instances/2012-07-17/model_2352496948786228 for payload: /content/icubed_profile_site/index/resources/barmstrong
POST /apps/icubed/skill_request HTTP/1.1] com.day.cq.workflow.impl.CQWorkflowSession Workflow instance started with model: /etc/workflow/models/skill-request/jcr:content/model and ID: /etc/workflow/instances/2012-07-17/model_2352486082873661 for payload: /content/icubed_profile_site/index/resources/barmstrong
Yet the first run sets the payload just fine, while the second sends back the "No payload set" error.
1 person found this helpful
See if setting payload type to JCR_PATH helps
WorkflowData wfData = wfSession.newWorkflowData("JCR_PATH", pagepath);
Setting it to "JCR_PATH" worked like a charm, thanks a ton guys.
I feel like the API documentation ought to be updated to show that neither the String nor the Objectare arbitrary when building the WorkflowData object. Unless it is somewhere in there, and I missed it somehow.
I'm glad you got it working, Brian. I think you are right about the API docs. I'll log a bug so that they get fixed up.