customize lifecycle-workflow !!!! help
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2008 12:09 PM
hi all.
when I deploy lifecycle-workflow then it's ok
but if I add some code for transition
<transition name="reject" to="rejected" >
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
var dest = bpm_context.childByNamePath("Rejected");
for (var i = 0; i < bpm_package.children.length; i++)
{
bpm_package.children.move(dest);
}
</script>
</action>
</transition>
then it can't move content to Rejected space
.
where is wrong?
thanks
when I deploy lifecycle-workflow then it's ok
but if I add some code for transition
<transition name="reject" to="rejected" >
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
var dest = bpm_context.childByNamePath("Rejected");
for (var i = 0; i < bpm_package.children.length; i++)
{
bpm_package.children.move(dest);
}
</script>
</action>
</transition>
then it can't move content to Rejected space

where is wrong?
thanks
Labels:
- Labels:
-
Archive
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2008 03:39 AM
probably something wrong with your code, debug it.
1. are you assigned dest node
2. use logger.log to print the debug messages.
3. print the dest node name –> dest.name
try to turn on the javascript debugger and debug it.
<script>
var dest = bpm_context.childByNamePath("Rejected");
logger.log(bpm_package.children.length); //find out how many children are coming.
//if only one children access that one like bpm_package.children[0]
for (var i = 0; i < bpm_package.children.length; i++)
{
bpm_package.children.move(dest);
}
</script>
1. are you assigned dest node
2. use logger.log to print the debug messages.
3. print the dest node name –> dest.name
try to turn on the javascript debugger and debug it.
<script>
var dest = bpm_context.childByNamePath("Rejected");
logger.log(bpm_package.children.length); //find out how many children are coming.
//if only one children access that one like bpm_package.children[0]
for (var i = 0; i < bpm_package.children.length; i++)
{
bpm_package.children.move(dest);
}
</script>

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2008 06:54 AM
What might be possible is that the "dest"-path is not filled correctly.
Try first something like:
If this works then you know that the remainder of the code is OK. When this does not work, you have to check further in your code to find the "errors".
Hope this helps, Rob
Try first something like:
var dest = companyhome.childByNamePath("Path toplevel/Rejected");if (dest == null) dest = companyhome.childByNamePath("Path toplevel").createFolder("Rejected");
The "Path toplevel" consists of all levels you have to travel to get to the space with name "Rejected".If this works then you know that the remainder of the code is OK. When this does not work, you have to check further in your code to find the "errors".
Hope this helps, Rob
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2008 01:10 PM
thanks for reply
and so silly when I have new question :
1. how to assign dest node ?
2. and how to debug script : example: use logger.log to print the debug messages.
thanks
and thank rob: I have do it. but it don't work.
and I have problem that is
when I deploy publish-whitepaper in project: advandce -workflow-article by JBPM plug in eclipse
it have error :an exception happened during the deployment of the process reason : an unexpected exception caused by the deployment fail

and when define 1 simple workflow and deploy it then It display on the advance workflow but I don't work ?? what is wrong?
thanks again
and so silly when I have new question :
1. how to assign dest node ?
2. and how to debug script : example: use logger.log to print the debug messages.
thanks
and thank rob: I have do it. but it don't work.

and I have problem that is
when I deploy publish-whitepaper in project: advandce -workflow-article by JBPM plug in eclipse
it have error :an exception happened during the deployment of the process reason : an unexpected exception caused by the deployment fail

and when define 1 simple workflow and deploy it then It display on the advance workflow but I don't work ?? what is wrong?
thanks again

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2008 02:44 AM
Sorry it did not work. To answer your first question: "var dest=" does the assignment to dest. You still have to make sure that the path to "Rejected" exists or is created on the fly…
The second question someone else have to answer, I did not use the debug script options to debug my code!
I have a question to you: did you create all the supporting files as well and made them known in Alfresco by modifying the appropriate context files? I am talking about the process model (needed), the messages file (optional), web client config file (needed). Just deploying from eclipse is not enough!
It would help if you show snippets from your process model and workflow definition files.
Rgrds, Rob
The second question someone else have to answer, I did not use the debug script options to debug my code!
I have a question to you: did you create all the supporting files as well and made them known in Alfresco by modifying the appropriate context files? I am talking about the process model (needed), the messages file (optional), web client config file (needed). Just deploying from eclipse is not enough!
It would help if you show snippets from your process model and workflow definition files.
Rgrds, Rob
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2008 05:35 AM
Sorry it did not work. To answer your first question: "var dest=" does the assignment to dest. You still have to make sure that the path to "Rejected" exists or is created on the fly…hi thanks your reply.
The second question someone else have to answer, I did not use the debug script options to debug my code!
I have a question to you: did you create all the supporting files as well and made them known in Alfresco by modifying the appropriate context files? I am talking about the process model (needed), the messages file (optional), web client config file (needed). Just deploying from eclipse is not enough!
It would help if you show snippets from your process model and workflow definition files.
Rgrds, Rob
and "Rejected" space is created and I only change the lifecycle_processdefinition.xml
and now I can deploy the advandce -workflow-article project (when I remove prefix scwf).It display on the advandce workflow list
but It don't work .


