cancel
Showing results for 
Search instead for 
Did you mean: 

Share, BPM Package, Copy, etc.

varsenault
Champ in-the-making
Champ in-the-making
Hi,

I'm trying to migrate a JBPM workflow from 3.2r to 4.2c (both on Ubuntu 12.10).

The workflow definition now needs to be adapted from a version that used to be started on spaces/directories of the repository in the Alfresco Explorer UI. We now want to use Share and there is no built-in way of starting a workflow on a space/directory. So we must work with adding all the children files from the space manually in the workflow start "task" UI". Then in the transition from that task, we want all the files in the BPM package to be copied to a "working space". And replace the references in the BPM package with references to the copied files.

My problem is that the two last loops (while, for) don't get executed. I get a new space created, but nothing is in it. And the BPM package still contains the references to the "template" documents that were supposed to get copied in the working space.

And, I'm unable to make use of the javascript logger due to a bug in Share (share won't start if the Javascript debugger/logger is enabled in the log4j configuration).

The last executed code seems to be the "createFolder" call. Please refer to code below. Thanks for your help!

Regards,

Vincent

<transition name="normal" to="Capture" >  
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               <variable name="girproxyvoting2_companyName" access="read"/>
               <variable name="girproxyvoting2_meetingDate" access="read"/>
               <variable name="bpm_package" access="read,write" />
               <expression>
                  executionContext.setVariable("coordinator", person.properties.email.toString());
                  var coordinatorName = person.properties.firstName.toString() + " " + person.properties.lastName.toString();
                  executionContext.setVariable("coordinatorName",coordinatorName);
                  var monthString = new String((girproxyvoting2_meetingDate.getMonth() + 1));

                  if(girproxyvoting2_meetingDate.getMonth() &lt; 9) monthString = '-0' + monthString;
                  else monthString = '-' + monthString;

                  var spaceName = girproxyvoting2_companyName + " (" + (girproxyvoting2_meetingDate.getYear() + 1900) + monthString + "-" + girproxyvoting2_meetingDate.getDate() + ")";
                  var parentNode = companyhome.childByNamePath("GDV/Open");
                  var workingCopySpace = parentNode.createFolder(spaceName);


                  // Copy
                  while(bpm_package.children.length &gt; 0) {
                     var document = bpm_package.children[0];
                     document.copy(workingCopySpace);
                     document.remove();
                  }
                  // Add copied files to BPM package
                  for(var i = 0; i &lt; workingCopySpace.children.length; i++) {
                     bpm_package.addNode(workingCopySpace.children[i]);
                  }
                   </expression>
                 </script>
         </action>
1 REPLY 1

nalaka
Champ in-the-making
Champ in-the-making
Hay friend I'm locking for great site of finish you task. Yes friend Bizagi sit has much information for JBPM work. You can register and finish your task. OK friend go this site and enjoy