[SOLVED]How to create and attach resource to workflow?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2009 10:26 AM
I need to make a new document and attach it to currently running workflow. So far i made a file and placed it to Some Folder. In next step of workflow i don't see that this file is attached to workflow. I've been trying to attach this file to wf, but with no success. The code is shown bellow
<transition to="" name="test">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
var dest = companyhome.childByNamePath("User Homes");
var file = dest.createFile("file_name");
file.save();
</script>
</action>
</transition>
I've searched this forum but with no succes. Does anyone knows how to implement this?
<transition to="" name="test">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
var dest = companyhome.childByNamePath("User Homes");
var file = dest.createFile("file_name");
file.save();
</script>
</action>
</transition>
I've searched this forum but with no succes. Does anyone knows how to implement this?
Labels:
- Labels:
-
Archive
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2009 10:47 AM
You could take a look at the implementation of this page -> http://wiki.alfresco.com/w/images/7/77/Bpm_start_workflow.jpg
In rough terms you will need to add the node-ref of your new document to the "workflow package"
In rough terms you will need to add the node-ref of your new document to the "workflow package"
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2009 08:57 AM
I found solution for my problem. The solution is in script bellow
<script>
var dest = companyhome.childByNamePath("User Homes");
var file = dest.createFile("file_name.txt");
file.content="test content";
file.save();
bpm_package.addNode(file);
</script>
<script>
var dest = companyhome.childByNamePath("User Homes");
var file = dest.createFile("file_name.txt");
file.content="test content";
file.save();
bpm_package.addNode(file);
</script>

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2009 03:40 AM
Hi i have a similar problem,workflow is working fine,except the person who was assiged to approve the document,can't see the document and metadata.
When i assigned person to approve document,they always get under resource the name of file and path where the file is saved.
Now for some reason i am getting No resource found?
Some one with the same issue?
When i assigned person to approve document,they always get under resource the name of file and path where the file is saved.
Now for some reason i am getting No resource found?
Some one with the same issue?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2009 04:23 AM
Sounds like a RIGHTS problem. Documents,you have no rights to, are not found, "document" or "space" root object for instance may be void/null, when you do not have the rights.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2009 07:42 AM
Yes,it is right.
Me stupid how could i missed that. :shock:
Thank.
Me stupid how could i missed that. :shock:
Thank.
