Workflow package
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2006 03:04 AM
Hi,
I'm new in Alfresco. I would like to setup a new workflow in which one of the task should move the package (i.e. document) from one folder to another. Could someone send me some tips or links to examples. FYI, I'm currently investigating implementation of the interface JBPMSpringActionHandler to see if I can do that there.
Thks,
Christophe
I'm new in Alfresco. I would like to setup a new workflow in which one of the task should move the package (i.e. document) from one folder to another. Could someone send me some tips or links to examples. FYI, I'm currently investigating implementation of the interface JBPMSpringActionHandler to see if I can do that there.
Thks,
Christophe
Labels:
- Labels:
-
Archive
8 REPLIES 8
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2006 05:54 AM
Sure its possible.
look here for more help:
http://wiki.alfresco.com/wiki/WorkflowAdministration
you need to define a script in your task which move document to another space.
If you do move you will have probably problem with rights because workflow use current user rights. So user who start workflow need enough right to delete in current space and write in destination space.
Another thing you will need to write in hard in your script destination space because at the moment there is no space selector available in workflow web client interface.
I hope this help
look here for more help:
http://wiki.alfresco.com/wiki/WorkflowAdministration
you need to define a script in your task which move document to another space.
If you do move you will have probably problem with rights because workflow use current user rights. So user who start workflow need enough right to delete in current space and write in destination space.
Another thing you will need to write in hard in your script destination space because at the moment there is no space selector available in workflow web client interface.
I hope this help

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2006 06:05 AM
Thanks for the answer.
If we put aside permission problems I still have the question of how do I do the move using a script? Is there any AlfrescoJavascript document reference somewhere? Should I use the bpm_package in this case? If so what kind of operation can I run on this object?
Can't I do that by calling an ActionHandler?
i.e. <action name="moveDocument" class="my.workflow.WorkflowMoveDocument"></action>
Thanks again.
Christophe
If we put aside permission problems I still have the question of how do I do the move using a script? Is there any AlfrescoJavascript document reference somewhere? Should I use the bpm_package in this case? If so what kind of operation can I run on this object?
Can't I do that by calling an ActionHandler?
i.e. <action name="moveDocument" class="my.workflow.WorkflowMoveDocument"></action>
Thanks again.
Christophe
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2006 08:46 AM
You can use that to do move
This code move package to current folder to children folder "DestFolder"
But that can working only for admin and coordinator users.
In other way you need to define dedicated permissions to do move !
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript"> <script> var dest = bpm_context.childByNamePath("DestFolder"); for (var i = 0; i < bpm_package.children.length; i++) { bpm_package.children[i].move(dest); } </script></action>
This code move package to current folder to children folder "DestFolder"
But that can working only for admin and coordinator users.
In other way you need to define dedicated permissions to do move !
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2007 09:52 AM
But that can working only for admin and coordinator users.
In other way you need to define dedicated permissions to do move !
Hello ribz33,
Hum I'm sorry but how do you define dedicated permissions? Is there any wiki on that? :roll:
Thanks a lot,
Yannick
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2007 10:14 AM
Just a hint,
if you check the code from SVN (here) you can read this:
if you check the code from SVN (here) you can read this:
public Node childByNamePath(String path){…}// TODO: find out why this doesn't work - the function defs do not seem to get found
I suggest you usepublic Node[] childrenByXPath(String xpath)
You just have to learn XPath syntax and JSR170 specification on repository navigation if you don't know them already.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2007 10:19 AM
Just a hint,
if you check the code from SVN (here) you can read this:.public Node childByNamePath(String path){…}// TODO: find out why this doesn't work - the function defs do not seem to get found
That code comment is unrelated to the function above - which does work. The comment is related to the fact that the Rhino JavaScript engine should pickup function definitions defined as methods with the jsFunction_ prefix - but it doesn't seem to so we fall back to use bean style method definitions instead.
Thanks,
Kevin
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2007 10:30 AM
I wronged something then, but I roughly used the code directly from the wiki, just with different folder names…but that's offtopic here, thanks anyway Kevin
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2007 04:07 AM
hum okay thank you :wink:
So the function "childrenByXPath" solve problem of permission or not? :?:
To sum-up, I have got this code to copy a document to "Alfresco/Espace1":
It works very well when I'm logged as admin, but I'm a simple guest or contributor, it seems that it doesn't work??!!
So I have to "learn XPath syntax and JSR170 specification on repository navigation" to make it working??" or just use the function "childrenByXPath"?
Thank very well for your assistance…
Yannick
So the function "childrenByXPath" solve problem of permission or not? :?:
To sum-up, I have got this code to copy a document to "Alfresco/Espace1":
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript"> <script> var myRoot=bpm_context.parent; var myUserhome=initiator.properties['cm:homeFolder']; var archiveFolder = myRoot.childByNamePath("Alfresco/Espace 1"); for (var i = 0; i < bpm_package.children.length; i++) { bpm_package.children[i].copy(archiveFolder); } </script> </action>
It works very well when I'm logged as admin, but I'm a simple guest or contributor, it seems that it doesn't work??!!
So I have to "learn XPath syntax and JSR170 specification on repository navigation" to make it working??" or just use the function "childrenByXPath"?
Thank very well for your assistance…
Yannick
