cancel
Showing results for 
Search instead for 
Did you mean: 

customize lifecycle-workflow !!!! help

linhnh
Champ in-the-making
Champ in-the-making
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 &lt; bpm_package.children.length; i++)
            {
               bpm_package.children.move(dest);
            }
         </script>
         </action>
      </transition>
then it can't move content to Rejected space Smiley Sad.
where is wrong?
thanks
5 REPLIES 5

tejkumar_a
Champ in-the-making
Champ in-the-making
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 &lt; bpm_package.children.length; i++)
{
bpm_package.children.move(dest);
}
</script>

rob562435
Champ in-the-making
Champ in-the-making
What might be possible is that the "dest"-path is not filled correctly.
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

linhnh
Champ in-the-making
Champ in-the-making
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. Smiley Sad
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
Smiley Sad
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

rob562435
Champ in-the-making
Champ in-the-making
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

linhnh
Champ in-the-making
Champ in-the-making
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
hi thanks your reply.
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 . Smiley Sad(. when I choose it for my document. It can't display on my task to do List. :
Smiley Sad.