Get users from the workflow
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2010 06:05 AM
Hi,
I am running the advanced workflow automatically from a space. I have the Java script that executes after a content is added to the space. My JS code is as below.
var workflow = actions.create("start-workflow");
workflow.parameters["bpm:assignee"] = person;
Here person stands per the current user. But my requirement is I have to send to a particular user. Consider I have a Group "DEVELOPER" with 5 members in the group.
So how can I get the value of this group("DEVELOPER"); instead of "person"
Thanks
PP
I am running the advanced workflow automatically from a space. I have the Java script that executes after a content is added to the space. My JS code is as below.
var workflow = actions.create("start-workflow");
workflow.parameters["bpm:assignee"] = person;
Here person stands per the current user. But my requirement is I have to send to a particular user. Consider I have a Group "DEVELOPER" with 5 members in the group.
So how can I get the value of this group("DEVELOPER"); instead of "person"
Thanks
PP
Labels:
- Labels:
-
Archive
15 REPLIES 15
![vinaxwater vinaxwater](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2010 11:51 PM
Hi friend,
please check hard code for view your workflow action normal with below code!
if it's work fine then change with this code:
goodluck
vinaxwater
please check hard code for view your workflow action normal with below code!
var workflow = actions.create("start-workflow");workflow.parameters.workflowName = "jbpm$wf:review";workflow.parameters["bpm:workflowDescription"] = document.name;workflow.parameters["bpm:assignee"] = "admin";var futureDate = new Date();futureDate.setDate(futureDate.getDate() + 7);workflow.parameters["bpm:workflowDueDate"] = futureDate;workflow.execute(document);
if it's work fine then change with this code:
var workflow = actions.create("start-workflow");workflow.parameters.workflowName = "jbpm$wf:review";workflow.parameters["bpm:workflowDescription"] = document.name;var members = people.getMembers(people.getGroup("GROUP_DEVELOPER"));for(int i = 0; i < members.length; i++) {logger.log(members.get(i)); //print out log in catalina.outworkflow.parameters["bpm:assignee"] = members.get(i);var futureDate = new Date();futureDate.setDate(futureDate.getDate() + 7);workflow.parameters["bpm:workflowDueDate"] = futureDate;workflow.execute(document);}
goodluck
vinaxwater
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2010 03:21 AM
Hi Vinaxwater,
Thanks a lot for yor reply.Below is what I got.
When I tried the fir set of code as a "admin" it is working fine. Workflow assigned to admin.But when admin will do "task done" he is getting A system error happened during the operation: 07060042 Failed to signal transition '' from workflow task 'jbpm$120' error.
And the log says
caused by: org.alfresco.error.AlfrescoRuntimeException: 07060040 ReferenceError: "bpm_aproveDestination" is not defined. (AlfrescoJS#1)
at org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:473)
at org.alfresco.repo.jscript.RhinoScriptProcessor.executeString(RhinoScriptProcessor.java:250)
… 118 more
Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "bpm_aproveDestination" is not defined. (AlfrescoJS#1)
at
………
………..
2:38,106 User
artha ERROR [ui.common.Utils] A system error happened during the operation: 07060038 Failed to execute script 'workspace://SpacesStore/0ac35339-64a4-4f39-8e63-9911cb89aa5b': identifier is a reserved word (workspace://SpacesStore/0ac35339-64a4-4f39-8e63-9911cb89aa5b#5)
org.alfresco.scripts.ScriptException: 07060038 Failed to execute script 'workspace://SpacesStore/0ac35339-64a4-4f39-8e63-9911cb89aa5b': identifier is a reserved word (workspace://SpacesStore/0ac35339-64a4-4f39-8e63-9911cb89aa5b#5)
Caused by: org.mozilla.javascript.EvaluatorException: identifier is a reserved word (workspace://SpacesStore/0ac35339-64a4-4f39-8e63-9911cb89aa5b#5)
at org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:109)
at org.mozilla.javascript.DefaultErrorReporter.error(DefaultErrorReporter.java:96)
…….
…..
…
Please provide me your inputs.
Thanking you in advance.
Regards
PP
Thanks a lot for yor reply.Below is what I got.
When I tried the fir set of code as a "admin" it is working fine. Workflow assigned to admin.But when admin will do "task done" he is getting A system error happened during the operation: 07060042 Failed to signal transition '' from workflow task 'jbpm$120' error.
And the log says
caused by: org.alfresco.error.AlfrescoRuntimeException: 07060040 ReferenceError: "bpm_aproveDestination" is not defined. (AlfrescoJS#1)
at org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:473)
at org.alfresco.repo.jscript.RhinoScriptProcessor.executeString(RhinoScriptProcessor.java:250)
… 118 more
Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "bpm_aproveDestination" is not defined. (AlfrescoJS#1)
at
………
………..
2:38,106 User
![Smiley Tongue Smiley Tongue](/i/smilies/16x16_smiley-tongue.png)
org.alfresco.scripts.ScriptException: 07060038 Failed to execute script 'workspace://SpacesStore/0ac35339-64a4-4f39-8e63-9911cb89aa5b': identifier is a reserved word (workspace://SpacesStore/0ac35339-64a4-4f39-8e63-9911cb89aa5b#5)
Caused by: org.mozilla.javascript.EvaluatorException: identifier is a reserved word (workspace://SpacesStore/0ac35339-64a4-4f39-8e63-9911cb89aa5b#5)
at org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:109)
at org.mozilla.javascript.DefaultErrorReporter.error(DefaultErrorReporter.java:96)
…….
…..
…
Please provide me your inputs.
Thanking you in advance.
Regards
PP
![vinaxwater vinaxwater](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2010 04:51 AM
Hi friend,
Please sure your workflow work fine with start from content!
Regard
vinaxwater
Please sure your workflow work fine with start from content!
Regard
vinaxwater
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2010 06:03 AM
Hi Vinaxwater,
I had problm in the first scenario.I am not getting the first error.It got resollved for the admin scenario.
Now the second prob is still present.
I mean to say for the second set of code If I use I am still getting error.
Thanks for your help once again.
Regards
PP
I had problm in the first scenario.I am not getting the first error.It got resollved for the admin scenario.
Now the second prob is still present.
I mean to say for the second set of code If I use I am still getting error.
Thanks for your help once again.
Regards
PP
![vinaxwater vinaxwater](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2010 10:45 PM
Hi friend,
You check again workfow started work fine with start with content. May be that workflow not work![Smiley Very Happy Smiley Very Happy](/i/smilies/16x16_smiley-very-happy.png)
File contain define all parameter in workflow:
File define file xml workflow:
File define file control workflow task:
Please define new workflow work fine. I don't use workflow default of alfresco so i not sure it work fine ^^
Here wiki for workflow script: http://wiki.alfresco.com/wiki/JavaScript_API_Cookbook
Regards
vinaxwater
You check again workfow started work fine with start with content. May be that workflow not work
![Smiley Very Happy Smiley Very Happy](/i/smilies/16x16_smiley-very-happy.png)
File contain define all parameter in workflow:
alfresco/projects/repository/config/alfresco/model/bpmModel.xml
File define file xml workflow:
alfresco/projects/repository/config/alfresco/bootstrap-content.xml
File define file control workflow task:
alfresco/projects/repository/config/alfresco/workflow/workflowModel.xml
Please define new workflow work fine. I don't use workflow default of alfresco so i not sure it work fine ^^
Here wiki for workflow script: http://wiki.alfresco.com/wiki/JavaScript_API_Cookbook
Regards
vinaxwater
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2010 08:39 AM
Hi,
Thanks for your reply. I checked, everything is fine.But when I use the below code I am still not able to finish my job. Again I have the same error as described above.
var workflow = actions.create("start-workflow");
workflow.parameters.workflowName = "jbpm$wf:review";
workflow.parameters["bpm:workflowDescription"] = document.name;
var members = people.getMembers(people.getGroup("GROUP_DEVELOPER"));
for(int i = 0; i < members.length; i++) {
logger.log(members.get(i)); //print out log in catalina.out
workflow.parameters["bpm:assignee"] = members.get(i);
var futureDate = new Date();
futureDate.setDate(futureDate.getDate() + 7);
workflow.parameters["bpm:workflowDueDate"] = futureDate;
workflow.execute(document);
}
Can you pls help.
Also in the Javascript API tutorial I saw a People API can you pls clarify how to use it.
Thanks again
Regards
PP
Thanks for your reply. I checked, everything is fine.But when I use the below code I am still not able to finish my job. Again I have the same error as described above.
var workflow = actions.create("start-workflow");
workflow.parameters.workflowName = "jbpm$wf:review";
workflow.parameters["bpm:workflowDescription"] = document.name;
var members = people.getMembers(people.getGroup("GROUP_DEVELOPER"));
for(int i = 0; i < members.length; i++) {
logger.log(members.get(i)); //print out log in catalina.out
workflow.parameters["bpm:assignee"] = members.get(i);
var futureDate = new Date();
futureDate.setDate(futureDate.getDate() + 7);
workflow.parameters["bpm:workflowDueDate"] = futureDate;
workflow.execute(document);
}
Can you pls help.
Also in the Javascript API tutorial I saw a People API can you pls clarify how to use it.
Thanks again
Regards
PP
![](/skins/images/3EA4296CAFBBFFCF1FE252BDE05FE3BC/responsive_peak/images/icon_anonymous_message.png)