set the initiator for a workflow via script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2010 10:11 AM
var workflow = actions.create("start-workflow");
workflow.parameters.workflowName = "jbpm$wf:adhoc";
workflow.parameters["bpm:workflowDescription"] = "The attached document has been uploaded to Alfresco. Please review within 3 days.";
workflow.parameters["bpm:assignee"] = "admin";
var futureDate = new Date();
futureDate.setDate(futureDate.getDate() + 3);
workflow.parameters["bpm:workflowDueDate"] = futureDate;
workflow.execute(document);
using the above as a basis, is there a way to assign the initiator?
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2010 02:32 PM
var workflow = actions.create("start-workflow");workflow.parameters.workflowName = "jbpm$wf:adhoc";workflow.parameters["bpm:workflowDescription"] = "The attached document has been uploaded to Alfresco. Please review within 3 days.";workflow.parameters["bpm:assignee"] = people.getPerson("admin");workflow.parameters["initiator"] = people.getPerson("someone");var futureDate = new Date();futureDate.setDate(futureDate.getDate() + 3);workflow.parameters["bpm:workflowDueDate"] = futureDate;workflow.execute(document);
Hope it works
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2011 04:58 AM
Have you tried this one ?var workflow = actions.create("start-workflow");workflow.parameters.workflowName = "jbpm$wf:adhoc";workflow.parameters["bpm:workflowDescription"] = "The attached document has been uploaded to Alfresco. Please review within 3 days.";workflow.parameters["bpm:assignee"] = people.getPerson("admin");workflow.parameters["initiator"] = people.getPerson("someone");var futureDate = new Date();futureDate.setDate(futureDate.getDate() + 3);workflow.parameters["bpm:workflowDueDate"] = futureDate;workflow.execute(document);
Hope it works
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2011 03:44 PM
I need to set the initiator or the owner of the workflow to a group, so that people in that group can see the workflows in their "Workflows I've started" list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2018 10:21 AM
For restricting workflow to particular group you need to customize the start-workflow.get.js.
This is the file which is responsible for retrieving the workflow definitions.In this file you need call repository webscript which will identify whether the current logged in user is in particular group or not and based on the result show/hide the workflow.
