Scripting a start-workflow
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2007 12:24 PM
Hi,
I'm posting to know if there's a way to browse the users (and not only those) with the API in order to start a workflow through a script.
To be more clear, let's take a look at the example code found in the wiki:
If I understand correctly, it is possible with the Enterprise edition with the API "Node getPerson(string username)"; is there anything similar in the standart edition?
Thanks in advance for your help!
I'm posting to know if there's a way to browse the users (and not only those) with the API in order to start a workflow through a script.
To be more clear, let's take a look at the example code found in the wiki:
var workflow = actions.create("start-workflow");workflow.parameters.workflowName = "jbpm$wf:review";workflow.parameters["bpm:workflowDescription"] = document.name;workflow.parameters["bpm:assignee"] = person;var futureDate = new Date();futureDate.setDate(futureDate.getDate() + 7);workflow.parameters["bpm:workflowDueDate"] = futureDate; workflow.execute(document);
What I'd like to do is to change the lineworkflow.parameters["bpm:assignee"] = person;
so that I can reassign the review step to another user (or group of users) automatically.If I understand correctly, it is possible with the Enterprise edition with the API "Node getPerson(string username)"; is there anything similar in the standart edition?
Thanks in advance for your help!
Labels:
- Labels:
-
Archive
6 REPLIES 6

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2007 05:19 AM
Node getPerson(string username)
The above javascript function is now available in HEAD.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2007 06:33 AM
Perfect! I'll take it right the way.
Thanks again
Thanks again

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2007 09:08 AM
Is it also possible to do this ?
So in other words provide custom variables into the bpm processdefinition.
Provided of course if you have have assigned bpm_dispatcher and bpm_finisher to a swimlane.
Also I would like to know if you can change those parameters from inside the workflow later on. (As to reassign to different people)
workflow.parameters["bpm:assignee"] = getPerson("mike"); workflow.parameters["bpm:dispatcher"] = getPerson("john"); workflow.parameters["bpm:finisher"] = getPerson("david");
So in other words provide custom variables into the bpm processdefinition.
Provided of course if you have have assigned bpm_dispatcher and bpm_finisher to a swimlane.
Also I would like to know if you can change those parameters from inside the workflow later on. (As to reassign to different people)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2007 06:47 AM
I'm reading now new pages about the 2.0 version of Alfresco on the wiki, it has much richer JavaScript API to manage system users, check here http://wiki.alfresco.com/wiki/JavaScript_API#People_API and http://wiki.alfresco.com/wiki/WorkflowAdministration#Task_assignment .
Anyway, does the pages update mean that those APIs are disposable on SVN?
Anyway, does the pages update mean that those APIs are disposable on SVN?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2007 07:06 AM
red15:
Yes, it is.
You can change the values in Task Dialogs, as long as the associated task definition includes the properties (and you've configured the task dialog UI). You may want to use an aspect to model your assignees, then it's possible to associate it with many task definitions.
You can also make changes via script in the process definition. So, you could do something like (it needs to be tested, the use of <variable> tags within the script may be required)…
Is it also possible to do this ?
Code:
workflow.parameters["bpm:assignee"] = getPerson("mike");
workflow.parameters["bpm:dispatcher"] = getPerson("john");
workflow.parameters["bpm:finisher"] = getPerson("david");
So in other words provide custom variables into the bpm processdefinition.
Provided of course if you have have assigned bpm_dispatcher and bpm_finisher to a swimlane.
Also I would like to know if you can change those parameters from inside the workflow later on. (As to reassign to different people)
Yes, it is.
You can change the values in Task Dialogs, as long as the associated task definition includes the properties (and you've configured the task dialog UI). You may want to use an aspect to model your assignees, then it's possible to associate it with many task definitions.
You can also make changes via script in the process definition. So, you could do something like (it needs to be tested, the use of <variable> tags within the script may be required)…
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript"> <script> bpm_dispatcher = people.get("fred"); </script></action>

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2007 07:08 AM
Blackout:
They are, but the implementation is under development - so you may find issues.
Anyway, does the pages update mean that those APIs are disposable on SVN?
They are, but the implementation is under development - so you may find issues.
