AnsweredAssumed Answered

Execute action agains multiple documents

Question asked by zkiss77 on Aug 31, 2009
Latest reply on Sep 1, 2009 by zkiss77
I'm trying to develop a webscript, which receive one or more document id, and a username (and some toher data) and register an ad-hoc workflow (task) with the documents to the given user.

I have the next sample working code. It creates the task, and assign it to the user. But only with 1 document.


var workflow = actions.create("start-workflow");
var mydoc = search.findNode("workspace://SpacesStore/66232487-5846-4960-a865-1463c89fe6ca");
var mydoc2 = search.findNode("workspace://SpacesStore/bf848871-ffa3-48dc-b089-b208ca44c3ff");
workflow.parameters.workflowName = "jbpm$wf:adhoc";
workflow.parameters["bpm:workflowDescription"] = "Test ad-hoc task";
workflow.parameters["bpm:assignee"] = people.getPerson("test_user");
var futureDate = new Date();
futureDate.setDate(futureDate.getDate() + 21);
workflow.parameters["bpm:workflowDueDate"] = futureDate;
workflow.parameters["bpm:workflowPriority"] = 1;
workflow.execute(mydoc);

How is possible to associate multiple documents in one task? I'm not insist on script solution. Java based soultion is also a good one for me.
Can anybody help with it?

Outcomes