cancel
Showing results for 
Search instead for 
Did you mean: 

Swimlanes

suleyman
Champ in-the-making
Champ in-the-making
Hi,

I'm trying to make a script for selecting the actors automaticly and assigning them to the swimlanes.
Is het possible to write the usernames to variables and use the varibles at the swimlane assignment.

Like this:

<?xml version="1.0" encoding="UTF-8"?>

<process-definition xmlns="urn:jbpm.org:jpdl-3.1"  name="ovs:ovaanvraag">

   <swimlane name="initiator" />
        
   <start-state name="start">
        <task name="ovs:startaanvraag" swimlane="initiator">
      <event type="node-leave">
            <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
               <script>                          
                  <expression>
                     
                     CoordinatorUser = "Bouw1";
                     
                     BouwUser = "Bouw1";
                     ReclameUser = "Reclame1";
                     InuitritUser = "Inuitrit1";
                     KapUser = "Kap1";
                     SloopUser = "Sloop1";                     
                  </expression>   
                  <variable name="CoordinatorUser" access="write" />
                  <variable name="BouwUser" access="write" />
                  <variable name="ReclameUser" access="write" />
                  <variable name="InuitritUser" access="write" />
                  <variable name="KapUser" access="write" />
                  <variable name="SloopUser" access="write" />                                    
               </script>
            </action>
         </event>       
        </task>
      <transition name="" to="ControleerAanvraag"></transition>
   </start-state>

  <swimlane name="coordinator">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
          <actor>#{people.getPerson(CoordinatorUser).properties["cm:userName"]}</actor>
      </assignment>
   </swimlane>
  
  <swimlane name="bouwadv">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
          <actor>#{BouwUser}</actor>
      </assignment>
   </swimlane>

………..

I'm getting the error message: org.mozilla.javascript.EcmaError: ReferenceError: "CoordinatorUser" is not defined. (AlfrescoScript#1)

Can anyone tell me why i'm getting this error.

Thanks in advance
20 REPLIES 20

suleyman
Champ in-the-making
Champ in-the-making
Come on people. Please help me. Alfresco is driving me crazy.
This shouldn't be so hard (i think). Did I misread something. Or did I something wrong. I'm trying every possible thing but nothing is working.

Please write some ideas or suggestions.

davidc
Star Contributor
Star Contributor
Hey, be patient - I was actually taking a look at your process definition.

davidc
Star Contributor
Star Contributor
There seems to be an issue assigning variables within the leave event of the start task - I'm not sure if this is an issue with Alfresco or jBPM.

A workaround is to assign the values in other event handlers (e.g. on process start, or within a node defined explicitly for assigning the values).  Here's an example of assigning in process start…

<?xml version="1.0" encoding="UTF-8"?>

<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wf:test">

  <swimlane name="initiator" />

   <event type="process-start">
     <script>
      <expression>
        CoordinatorUser = "admin";
      </expression>   
      <variable name="CoordinatorUser" access="write" />
     </script>
   </event>

   <start-state name="start">
        <task name="bpm:startTask" swimlane="initiator">
        </task>
      <transition name="" to="next"></transition>
   </start-state>

   <swimlane name="coordinator">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
          <actor>#{people.getPerson(CoordinatorUser).properties["cm:userName"]}</actor>
      </assignment>
   </swimlane>

   <task-node name="next">
        <task name="wf:workflowTask" swimlane="coordinator">
        </task>
      <transition name="" to="end"></transition>
   </task-node>
   
   <node name="end">
   </node>
      
</process-definition>

suleyman
Champ in-the-making
Champ in-the-making
Thanks for your help.
I will try with an extra node after the start-state. I need to read some metadata from the resource document to figure out which users to assign to the tasks. The bpm_package is after the start-state available.

suleyman
Champ in-the-making
Champ in-the-making
Hi,

I have placed the script in an extra node but i get a strange error message.

Processdefinition:

<?xml version="1.0" encoding="UTF-8"?>

<process-definition xmlns="urn:jbpm.org:jpdl-3.1"  name="ovs:ovaanvraag">

   <swimlane name="initiator" />
        
   <start-state name="start">
        <task name="ovs:startaanvraag" swimlane="initiator"></task>
      <transition name="SelectCoordinator" to="CoordinatorSelecteren"></transition>
   </start-state>

   <node name="CoordinatorSelecteren">
        <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
           <script>
              <expression>
              <!–
            var Aanvrager=new Array("Achternaam1","Achternaam2","Achternaam3","Achternaam4","Achternaam5","Achternaam6","Achternaam7","Achternaam8");
                 var Coordinator=new Array("Coordinator1","Coordinator1","Coordinator1","Coordinator1","Coordinator1","Coordinator1","Coordinator1","Coordinator1");                  
                 
                 var wf_Document = bpm_package.children[0];
                 var wf_Aanvrager = wf_Document.properties["omgevingsvergunning:aanvragertype"];
                 var wf_Achternaam="Achternaam1";
                 if (wf_Aanvrager=="Particulier"){
                    wf_Achternaam = wf_Document.properties["omgevingsvergunning:achternaam"];
                 }else if(wf_Aanvrager=="Bedrijf"){
                    wf_Achternaam = wf_Document.properties["omgevingsvergunning:contact_achternaam"];
                 }                     

                 var CoordinatorToAdviseurs=new Array(8);
                 CoordinatorToAdviseurs[0]="Bouw1|Reclame1|Inuitrit1|Kap1|Sloop1";
                 CoordinatorToAdviseurs[1]="Bouw1|Reclame1|Inuitrit1|Kap1|Sloop1";
                 CoordinatorToAdviseurs[2]="Bouw1|Reclame1|Inuitrit1|Kap1|Sloop1";
                 CoordinatorToAdviseurs[3]="Bouw1|Reclame1|Inuitrit1|Kap1|Sloop1";
                 CoordinatorToAdviseurs[4]="Bouw1|Reclame1|Inuitrit1|Kap1|Sloop1";
                 CoordinatorToAdviseurs[5]="Bouw1|Reclame1|Inuitrit1|Kap1|Sloop1";
                 CoordinatorToAdviseurs[6]="Bouw1|Reclame1|Inuitrit1|Kap1|Sloop1";
                 CoordinatorToAdviseurs[7]="Bouw1|Reclame1|Inuitrit1|Kap1|Sloop1";

                 wf_Document.properties["omgevingsvergunning:adres"]=wf_Achternaam;
                 for (x in Aanvrager){
                    if (Aanvrager[x]==wf_Achternaam){
                       var wf_Coordinator = Coordinator[x];
                       var wf_Adviseurs = CoordinatorToAdviseurs[x];
                       break;
                    }
                 }
                 
                 var wf_AdvArr = wf_Adviseurs.split("|");
                 
                 BouwUser = people.getPerson("Bouw1");
                 ReclameUser = people.getPerson("Reclame1");
                 InuitritUser = people.getPerson("Inuitrit1");
                 KapUser = people.getPerson("Kap1");
                 SloopUser = people.getPerson("Sloop1");
                 
                 CoordinatorUser = people.getPerson("Coordinator1");
             –>
            
            CoordinatorUser = "Coordinator1";
                 BouwUser = "Bouw1";
                 ReclameUser = "Reclame1";
                 InuitritUser = "Inuitrit1";
                 KapUser = "Kap1";
                 SloopUser = "Sloop1";
                             
              </expression>
              <variable name="CoordinatorUser" access="write" />
              <variable name="BouwUser" access="write" />
              <variable name="ReclameUser" access="write" />
              <variable name="InuitritUser" access="write" />
              <variable name="KapUser" access="write" />
              <variable name="SloopUser" access="write" />
           </script>
        </action>
      <transition name="" to="ControleerAanvraag"></transition>
   </node>

  <swimlane name="coordinator">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
          <actor>#{people.getPerson(CoordinatorUser).properties["cm:userName"]}</actor>
      </assignment>
   </swimlane>

   <task-node name="ControleerAanvraag">
        <task name="ovs:AanvraagControleren" swimlane="coordinator">
            
        </task>   
      <transition name="" to="fork1"></transition>
   </task-node>

  
  <swimlane name="bouwadv">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
          <actor>#{people.getPerson(BouwUser).properties["cm:userName"]}</actor>
      </assignment>
   </swimlane>
   <swimlane name="reclameadv">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
          <actor>#{people.getPerson(ReclameUser).properties["cm:userName"]}</actor>
      </assignment>
   </swimlane>
   <swimlane name="inuitritadv">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
          <actor>#{people.getPerson(InuitritUser).properties["cm:userName"]}</actor>
      </assignment>
   </swimlane>
   <swimlane name="kapadv">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
          <actor>#{people.getPerson(KapUser).properties["cm:userName"]}</actor>
      </assignment>
   </swimlane>
    <swimlane name="sloopadv">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
          <actor>#{people.getPerson(SloopUser).properties["cm:userName"]}</actor>
      </assignment>
   </swimlane>       
    <swimlane name="externadv">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
          <actor>#{ovs_externadviseur.properties['cm:userName']}</actor>
      </assignment>
   </swimlane>  

  
      <fork name="fork1">
      <transition name="tr1" to="testBouw"></transition>
      <transition name="tr2" to="testReclame"></transition>
      <transition name="tr3" to="testInuitrit"></transition>
      <transition name="tr4" to="testKap"></transition>
      <transition name="tr5" to="testSloop"></transition>
      <transition name="tr6" to="testExtern"></transition>
   </fork>  
   
   <decision name="testBouw">
      <event type="node-enter">
          <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
           <script>
             <expression>
              var wf_Document1 = bpm_package.children[0];
              var wf_Variabele1 = wf_Document1.properties["omgevingsvergunning:bouwvergunning"];
              if (wf_Variabele1==true){
               wfBouwAan="1";
              }else {
               wfBouwAan="2";
              }
             </expression>
             <variable name="wfBouwAan" access="write" />
           </script>
         </action>   
      </event>   
     <transition name="GeenBouw" to="join1" />      
      <transition name="WelBouw" to="DoBouw">
        <condition>#{wfBouwAan=="1"}</condition>
      </transition>    
   </decision>    
  
   <decision name="testReclame">
      <event type="node-enter">
          <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
           <script>
             <expression>
              var wf_Document2 = bpm_package.children[0];
              var wf_Variabele2 = wf_Document2.properties["omgevingsvergunning:reclamevergunning"];
              if (wf_Variabele2==true){
               wfReclameAan="1";
              }else {
               wfReclameAan="2";
              }
             </expression>
             <variable name="wfReclameAan" access="write" />
           </script>
         </action>   
      </event>
     <transition name="Geenreclame" to="join1"></transition>   
      <transition name="WelReclame" to="DoReclame">
      <condition>#{wfReclameAan=="1"}</condition>
      </transition>
   </decision>
  
   <decision name="testInuitrit">
      <event type="node-enter">
          <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
           <script>
             <expression>
              var wf_Document3 = bpm_package.children[0];
              var wf_Variabele3 = wf_Document3.properties["omgevingsvergunning:inuitritvergunning"];
              if (wf_Variabele3==true){
               wfInuitritAan="1";
              }else {
               wfInuitritAan="2";
              }
             </expression>
             <variable name="wfInuitritAan" access="write" />
           </script>
         </action>   
      </event>
     <transition name="GeenInrit" to="join1"></transition>        
      <transition name="WelInrit" to="DoInuitrit">
         <condition>#{wfInuitritAan=="1"}</condition>
      </transition>
   </decision>
  
   <decision name="testKap">
      <event type="node-enter">
          <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
           <script>
             <expression>
              var wf_Document4 = bpm_package.children[0];
              var wf_Variabele4 = wf_Document4.properties["omgevingsvergunning:kapvergunning"];
              if (wf_Variabele4==true){
               wfKapAan="1";
              }else {
               wfKapAan="2";
              }
             </expression>
             <variable name="wfKapAan" access="write" />
           </script>
         </action>   
      </event>     
      <transition name="GeenKap" to="join1"></transition>
      <transition name="WelKap" to="DoKap">
      <condition>#{wfKapAan=="1"}</condition>
      </transition>
   </decision>
  
   <decision name="testSloop">
      <event type="node-enter">
          <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
           <script>
             <expression>
              var wf_Document5 = bpm_package.children[0];
              var wf_Variabele5 = wf_Document5.properties["omgevingsvergunning:sloopvergunning"];
              if (wf_Variabele5==true){
               wfSloopAan="1";
              }else {
               wfSloopAan="2";
              }
             </expression>
             <variable name="wfSloopAan" access="write" />
           </script>
         </action>   
      </event>     
      <transition name="GeenSloop" to="join1"></transition>
      <transition name="WelSloop" to="DoSloop">
      <condition>#{wfSloopAan=="1"}</condition>
      </transition>
   </decision>
  
   <decision name="testExtern">
      <transition name="GeenExtern" to="join1"></transition>
      <transition name="WelExtern" to="DoExtern">
         <condition>#{ovs_externadviseur != void}</condition>
      </transition>
   </decision>
  
   <task-node name="DoBouw">
      <task name="ovs:DoBouw" swimlane="bouwadv">
         <event type="task-create">
            <script>
               if (bpm_workflowDescription != void) taskInstance.description = bpm_workflowDescription;
               if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
               if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
            </script>  
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               <!– Bouw aspect toevoegen  –>
               var wf_Document = bpm_package.children[0];
               wf_Document.addAspect("omgevingsvergunning:bouwvergunning", null);
               wf_Document.properties["omgevingsvergunning:bouw_adviseur"] = people.getPerson(BouwUser);
               wf_Document.save();
            </script>
         </action>                     
         </event>
      </task>
      <event type="node-leave">
      <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
         <script>
            <!– Bouw advies invullen –>
            var wf_Document = bpm_package.children[0];
            wf_Document.properties["omgevingsvergunning:bouwvergunning_status"] = ovs_bouw_oordeel;
            wf_Document.properties["omgevingsvergunning:bouwvergunning_toelichting"] = ovs_bouw_toelichting;
            wf_Document.save();
         </script>         
      </action>
      </event>
      <transition name="Advies verzenden" to="join1"></transition>
   </task-node>    
   <task-node name="DoReclame">
         <task name="ovs:DoReclame" swimlane="reclameadv">
         <event type="task-create">
            <script>
               if (bpm_workflowDescription != void) taskInstance.description = bpm_workflowDescription;
               if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
               if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
            </script> 
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               <!– Reclame aspect toevoegen  –>
               var wf_Document = bpm_package.children[0];
               wf_Document.addAspect("omgevingsvergunning:reclameaanvraag", null);
               wf_Document.properties["omgevingsvergunning:reclame_adviseur"] = people.getPerson(ReclameUser);
               wf_Document.save();
            </script>
         </action>                    
         </event>         
         </task>
      <transition name="Advies verzenden" to="join1"></transition>
   </task-node>  
   <task-node name="DoInuitrit">
      <task name="ovs:DoInuitrit" swimlane="inuitritadv">
         <event type="task-create">
            <script>
               if (bpm_workflowDescription != void) taskInstance.description = bpm_workflowDescription;
               if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
               if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
            </script>   
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               <!– Inuitrit aspect toevoegen  –>
               var wf_Document = bpm_package.children[0];
               wf_Document.addAspect("omgevingsvergunning:inuitritaanvraag", null);
               wf_Document.properties["omgevingsvergunning:inuitrit_adviseur"] = people.getPerson(InuitritUser);
               wf_Document.save();
            </script>
         </action>     
         </event>      
      </task>
      <transition name="Advies verzenden" to="join1"></transition>
   </task-node>
   <task-node name="DoKap">
      <task name="ovs:DoKap" swimlane="kapadv">
         <event type="task-create">
            <script>
               if (bpm_workflowDescription != void) taskInstance.description = bpm_workflowDescription;
               if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
               if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
            </script>    
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               <!– Kap aspect toevoegen  –>
               var wf_Document = bpm_package.children[0];
               wf_Document.addAspect("omgevingsvergunning:kapaanvraag", null);
               wf_Document.properties["omgevingsvergunning:kap_adviseur"] = people.getPerson(KapUser);
               wf_Document.save();
            </script>
         </action>                   
         </event>      
      </task>
      <transition name="Advies verzenden" to="join1"></transition>
   </task-node>
   <task-node name="DoSloop">
      <task name="ovs:DoSloop" swimlane="sloopadv">
         <event type="task-create">
            <script>
               if (bpm_workflowDescription != void) taskInstance.description = bpm_workflowDescription;
               if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
               if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
            </script> 
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               <!– Sloop aspect toevoegen  –>
               var wf_Document = bpm_package.children[0];
               wf_Document.addAspect("omgevingsvergunning:sloopaanvraag", null);
               wf_Document.properties["omgevingsvergunning:sloop_adviseur"] = people.getPerson(SloopUser);
               wf_Document.save();
            </script>
         </action>                      
         </event>      
      </task>
      <transition name="Advies verzenden" to="join1"></transition>
   </task-node>
   <task-node name="DoExtern">
        <task name="ovs:DoExtern" swimlane="externadv">
         <event type="task-create">
            <script>
               if (bpm_workflowDescription != void) taskInstance.description = bpm_workflowDescription;
               if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
               if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
            </script>
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               <!– Extern aspect toevoegen  –>
               var wf_Document = bpm_package.children[0];
               wf_Document.addAspect("omgevingsvergunning:externadvies", null);
               wf_Document.properties["omgevingsvergunning:extern_adviseur"] = ovs_externadviseur;
               wf_Document.save();
            </script>
         </action>           
         </event>        
        </task>   
      <transition name="Advies verzenden" to="join1"></transition>
   </task-node>  
  
   <join name="join1">
      <transition name="AdviezenVerzamelen" to="EindOordeel">
      </transition>
   </join>

   <task-node name="EindOordeel">
      <task name="ovs:DoEinde" swimlane="initiator">
         <event type="node-enter">
          <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
           <script>
                <expression>
                   var wf_Document = bpm_package.children[0];
                   var bouwvergunning_status = wf_Document.properties["omgevingsvergunning:bouwvergunning_status"];
                   bouwvergunningadvies = bouwvergunning_status;
                   </expression>
                </script>
            </action>
         </event>
         <controller>
             <!– read only variabelen –>
             <variable name="bouwvergunningadvies" access="read" mapped-name="ovs:bouwvergunningadvies"/>
           </controller>
      </task>
      <transition name="Aanvraag afkeuren" to="AanvraagAfgekeurd"></transition>
      <transition name="Aanvraag goedkeuren" to="AanvraagGoedgekeurd"></transition>
   </task-node>   
  
   <node name="AanvraagAfgekeurd">
      <transition name="" to="end1"></transition>
   </node>
   <node name="AanvraagGoedgekeurd">
      <transition name="" to="end1"></transition>
   </node>  
<end-state name="end1"></end-state>
</process-definition>

error log:

15:46:40,411 DEBUG [alfresco.repo.workflow] Attached JBPM Context to transaction 23f416bf-3923-11dc-bdbc-3d60c7f2865b
15:46:40,550 DEBUG [alfresco.repo.workflow] Workflow definition 'ovs:ovaanvraag' problem: [WARNING] swimlane 'initiator' does
not have an assignment
15:46:40,705 DEBUG [alfresco.repo.workflow] Detached (commit) JBPM Context from transaction 23f416bf-3923-11dc-bdbc-3d60c7f28
65b
15:46:50,467 DEBUG [alfresco.repo.workflow] Attached JBPM Context to transaction 29f28357-3923-11dc-bdbc-3d60c7f2865b
15:46:50,467 DEBUG [alfresco.repo.workflow] Detached (commit) JBPM Context from transaction 29f28357-3923-11dc-bdbc-3d60c7f28
65b
15:46:51,937 DEBUG [alfresco.repo.workflow] Attached JBPM Context to transaction 2ad2d13b-3923-11dc-bdbc-3d60c7f2865b
15:46:51,968 DEBUG [alfresco.repo.workflow] Detached (commit) JBPM Context from transaction 2ad2d13b-3923-11dc-bdbc-3d60c7f28
65b
15:46:58,806 DEBUG [alfresco.repo.workflow] Attached JBPM Context to transaction 2eeaf206-3923-11dc-bdbc-3d60c7f2865b
15:46:58,822 DEBUG [alfresco.repo.workflow] Detached (commit) JBPM Context from transaction 2eeaf206-3923-11dc-bdbc-3d60c7f28
65b
15:46:58,822 DEBUG [alfresco.repo.workflow] Attached JBPM Context to transaction 2eed6307-3923-11dc-bdbc-3d60c7f2865b
15:46:58,822 DEBUG [alfresco.repo.workflow] Detached (commit) JBPM Context from transaction 2eed6307-3923-11dc-bdbc-3d60c7f28
65b
15:46:58,822 DEBUG [alfresco.repo.workflow] Attached JBPM Context to transaction 2eed6308-3923-11dc-bdbc-3d60c7f2865b
15:46:58,837 DEBUG [alfresco.repo.workflow] Detached (commit) JBPM Context from transaction 2eed6308-3923-11dc-bdbc-3d60c7f28
65b
15:46:58,837 DEBUG [alfresco.repo.workflow] Attached JBPM Context to transaction 2eefacf9-3923-11dc-bdbc-3d60c7f2865b
15:46:58,853 DEBUG [alfresco.repo.workflow] Detached (commit) JBPM Context from transaction 2eefacf9-3923-11dc-bdbc-3d60c7f28
65b
15:46:58,853 DEBUG [alfresco.repo.workflow] Attached JBPM Context to transaction 2ef21dfa-3923-11dc-bdbc-3d60c7f2865b
15:46:58,853 DEBUG [alfresco.repo.workflow] Detached (commit) JBPM Context from transaction 2ef21dfa-3923-11dc-bdbc-3d60c7f28
65b
15:46:58,853 DEBUG [alfresco.repo.workflow] Attached JBPM Context to transaction 2ef21dfb-3923-11dc-bdbc-3d60c7f2865b
15:46:58,868 DEBUG [alfresco.repo.workflow] Detached (commit) JBPM Context from transaction 2ef21dfb-3923-11dc-bdbc-3d60c7f28
65b
15:47:01,761 DEBUG [alfresco.repo.workflow] Attached JBPM Context to transaction 30add7be-3923-11dc-bdbc-3d60c7f2865b
15:47:01,761 DEBUG [alfresco.repo.workflow] Detached (commit) JBPM Context from transaction 30add7be-3923-11dc-bdbc-3d60c7f28
65b
15:47:01,777 DEBUG [alfresco.repo.workflow] Attached JBPM Context to transaction 30b048bf-3923-11dc-bdbc-3d60c7f2865b
15:47:01,777 DEBUG [alfresco.repo.workflow] Detached (commit) JBPM Context from transaction 30b048bf-3923-11dc-bdbc-3d60c7f28
65b
15:47:01,777 DEBUG [alfresco.repo.workflow] Attached JBPM Context to transaction 30b048c1-3923-11dc-bdbc-3d60c7f2865b
15:47:01,792 DEBUG [alfresco.repo.workflow] Detached (commit) JBPM Context from transaction 30b048c1-3923-11dc-bdbc-3d60c7f28
65b
15:47:01,792 DEBUG [alfresco.repo.workflow] Attached JBPM Context to transaction 30b292b2-3923-11dc-bdbc-3d60c7f2865b
15:47:01,808 DEBUG [alfresco.repo.workflow] Detached (commit) JBPM Context from transaction 30b292b2-3923-11dc-bdbc-3d60c7f28
65b
15:47:01,808 DEBUG [alfresco.repo.workflow] Attached JBPM Context to transaction 30b503b3-3923-11dc-bdbc-3d60c7f2865b
15:47:01,808 DEBUG [alfresco.repo.workflow] Detached (commit) JBPM Context from transaction 30b503b3-3923-11dc-bdbc-3d60c7f28
65b
15:47:01,808 DEBUG [alfresco.repo.workflow] Attached JBPM Context to transaction 30b503b5-3923-11dc-bdbc-3d60c7f2865b
15:47:01,808 DEBUG [alfresco.repo.workflow] Detached (commit) JBPM Context from transaction 30b503b5-3923-11dc-bdbc-3d60c7f28
65b
15:47:01,823 DEBUG [alfresco.repo.workflow] Attached JBPM Context to transaction 30b74da6-3923-11dc-bdbc-3d60c7f2865b
15:47:01,823 DEBUG [alfresco.repo.workflow] Detached (commit) JBPM Context from transaction 30b74da6-3923-11dc-bdbc-3d60c7f28
65b
15:47:06,418 DEBUG [alfresco.repo.workflow] Attached JBPM Context to transaction 3368b21a-3923-11dc-bdbc-3d60c7f2865b
15:47:07,253 DEBUG [repo.jscript.RhinoScriptService] Executing script:
CoordinatorUser = "Coordinator1"; BouwUser = "Bouw1"; ReclameUser = "Reclame1"; InuitritUser = "Inuitrit1"; KapUser = "Kap1";
SloopUser = "Sloop1";
15:47:07,269 DEBUG [repo.jscript.RhinoScriptService] Time to execute script: 16ms
15:47:07,315 DEBUG [alfresco.repo.workflow] Detached (rollback) JBPM Context from transaction 3368b21a-3923-11dc-bdbc-3d60c7f
2865b
15:47:07,315 ERROR [ui.common.Utils] A system error happened during the operation: Failed to signal transition 'null' from wo
rkflow task 'jbpm$11'
org.alfresco.service.cmr.workflow.WorkflowException: Failed to signal transition 'null' from workflow task 'jbpm$11'
        at org.alfresco.repo.workflow.jbpm.JBPMEngine.endTask(JBPMEngine.java:1064)
        at org.alfresco.repo.workflow.WorkflowServiceImpl.endTask(WorkflowServiceImpl.java:347)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
        at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:11
6)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.j
ava:40)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodI
nterceptor.java:49)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.alfresco.repo.audit.AuditComponentImpl.auditImpl(AuditComponentImpl.java:219)
        at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:165)
        at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
        at $Proxy22.endTask(Unknown Source)
        at org.alfresco.web.bean.workflow.StartWorkflowWizard.finishImpl(StartWorkflowWizard.java:194)
        at org.alfresco.web.bean.dialog.BaseDialogBean.finish(BaseDialogBean.java:115)
        at org.alfresco.web.bean.wizard.WizardManager.finish(WizardManager.java:521)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
        at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
        at javax.faces.component.UICommand.broadcast(UICommand.java:106)
        at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
        at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:316)
        at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:105)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)

        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:595)
Caused by: org.jbpm.graph.def.DelegationException
        at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:352)
        at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:346)
        at org.jbpm.graph.def.Node.execute(Node.java:333)
        at org.jbpm.graph.def.Node.enter(Node.java:316)
        at org.jbpm.graph.def.Node$$FastClassByCGLIB$$d187eeda.invoke(<generated>)
        at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:163)
        at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:161)
        at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$772ac8ca.enter(<generated>)
        at org.jbpm.graph.def.Transition.take(Transition.java:119)
        at org.jbpm.graph.def.Node.leave(Node.java:383)
        at org.jbpm.graph.node.StartState.leave(StartState.java:70)
        at org.jbpm.graph.def.Node$$FastClassByCGLIB$$d187eeda.invoke(<generated>)
        at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:163)
        at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:161)
        at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$772ac8ca.leave(<generated>)
        at org.jbpm.graph.exe.Token.signal(Token.java:174)
        at org.jbpm.graph.exe.Token.signal(Token.java:123)
        at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:441)
        at org.alfresco.repo.workflow.jbpm.WorkflowTaskInstance.end(WorkflowTaskInstance.java:126)
        at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:355)
        at org.alfresco.repo.workflow.jbpm.JBPMEngine$19.doInJbpm(JBPMEngine.java:1040)
        at org.springmodules.workflow.jbpm31.JbpmTemplate$1.doInHibernate(JbpmTemplate.java:87)
        at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:365)
        at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:333)
        at org.springmodules.workflow.jbpm31.JbpmTemplate.execute(JbpmTemplate.java:80)
        at org.alfresco.repo.workflow.jbpm.JBPMEngine.endTask(JBPMEngine.java:1017)
        … 54 more
Caused by: org.alfresco.service.cmr.workflow.WorkflowException: AlfrescoJavaScript supports only one writable variable
        at org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript.getWritableVariable(AlfrescoJavaScript.java:280)
        at org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript.execute(AlfrescoJavaScript.java:134)
        at org.jbpm.graph.def.Action.execute(Action.java:123)
        at org.jbpm.graph.def.Action$$FastClassByCGLIB$$7876e90e.invoke(<generated>)
        at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:163)
        at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:161)
        at org.jbpm.graph.def.Action$$EnhancerByCGLIB$$f30503fe.execute(<generated>)
        at org.jbpm.graph.def.Node.execute(Node.java:328)
        … 77 more

What does this mean: "AlfrescoJavaScript supports only one writable variable"?
I'm just trying to put some string values in variables. I had tried to put an person object in the variables that gave the same error. So I changed everything but still the same error.

Any ideas?

suleyman
Champ in-the-making
Champ in-the-making
Any ideas on this David?

suleyman
Champ in-the-making
Champ in-the-making
Never mind. Below this is mijn working processdefinition.
The problem: the action tag can only have 1 writeable variable.

I'am not sure if it really helped but i think that putting the variables in the process-start event made them available in other parts of the processdefinition.

<?xml version="1.0" encoding="UTF-8"?>

<process-definition xmlns="urn:jbpm.org:jpdl-3.1"  name="ovs:ovaanvraag">

   <swimlane name="initiator" />
        
   <start-state name="start">
        <task name="ovs:startaanvraag" swimlane="initiator"></task>
      <transition name="SelectCoordinator" to="ControleerAanvraag">
             <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>             
            <expression>       
                 var wf_Document = bpm_package.children[0];   
                 var Aanvrager=new Array("Achternaam1","Achternaam2","Achternaam3","Achternaam4","Achternaam5","Achternaam6","Achternaam7","Achternaam8");
                 var Coordinator=new Array("Coordinator1","Coordinator1","Coordinator1","Coordinator1","Coordinator1","Coordinator1","Coordinator1","Coordinator1");                  
                 
                 var wf_Aanvrager = wf_Document.properties["omgevingsvergunning:aanvragertype"];
                 var wf_Achternaam="Achternaam1";
                 if (wf_Aanvrager=="Particulier"){
                    wf_Achternaam = wf_Document.properties["omgevingsvergunning:achternaam"];
                 }else if(wf_Aanvrager=="Bedrijf"){
                    wf_Achternaam = wf_Document.properties["omgevingsvergunning:contact_achternaam"];
                 }

                 for (x in Aanvrager){
                    if (Aanvrager[x]==wf_Achternaam){
                       var wf_Coordinator = Coordinator[x];
                       break;
                    }
                 }
                 TempCoordinatorUser = wf_Coordinator;
                </expression>
                <variable name="TempCoordinatorUser" access="write" />
              </script>
             </action>
      <script>
         <expression>            
           CoordinatorUser = TempCoordinatorUser;     
         </expression>   
         <variable name="TempCoordinatorUser" access="read" />
         <variable name="CoordinatorUser" access="write" />
        </script>                   
      </transition>
   </start-state>   
  
   <event type="process-start">              
     <script>
      <expression>            
        CoordinatorUser = ""; 
         BouwUser = "";
         ReclameUser = "";
         InuitritUser = "";
         KapUser = "";
         SloopUser = "";
         tempVar="";          
      </expression>   
      <variable name="CoordinatorUser" access="write" />
      <variable name="BouwUser" access="write" />
      <variable name="ReclameUser" access="write" />
      <variable name="InuitritUser" access="write" />
      <variable name="KapUser" access="write" />
      <variable name="SloopUser" access="write" />
      <variable name="tempVar" access="write" />
     </script>
   </event>

  <swimlane name="coordinator">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
          <actor>#{people.getPerson(CoordinatorUser).properties["cm:userName"]}</actor>
      </assignment>
   </swimlane>
   <task-node name="ControleerAanvraag">
        <task name="ovs:AanvraagControleren" swimlane="coordinator">
           <event type="task-create">
             <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>             
            <expression>
               var Coordinator=new Array("Coordinator1","Coordinator1","Coordinator1","Coordinator1","Coordinator1","Coordinator1","Coordinator1","Coordinator1");
            var CoordinatorToAdviseurs=new Array(8);
                 CoordinatorToAdviseurs[0]="Bouw1|Reclame1|Inuitrit1|Kap1|Sloop1";
                 CoordinatorToAdviseurs[1]="Bouw1|Reclame1|Inuitrit1|Kap1|Sloop1";
                 CoordinatorToAdviseurs[2]="Bouw1|Reclame1|Inuitrit1|Kap1|Sloop1";
                 CoordinatorToAdviseurs[3]="Bouw1|Reclame1|Inuitrit1|Kap1|Sloop1";
                 CoordinatorToAdviseurs[4]="Bouw1|Reclame1|Inuitrit1|Kap1|Sloop1";
                 CoordinatorToAdviseurs[5]="Bouw1|Reclame1|Inuitrit1|Kap1|Sloop1";
                 CoordinatorToAdviseurs[6]="Bouw1|Reclame1|Inuitrit1|Kap1|Sloop1";
                 CoordinatorToAdviseurs[7]="Bouw1|Reclame1|Inuitrit1|Kap1|Sloop1";
                                
            for (x in Coordinator){
                    if (Coordinator[x]==CoordinatorUser){
                       var wf_Adviseurs = CoordinatorToAdviseurs[x];
                       break;
                    }
                 }                           
             tempVar = wf_Adviseurs;
             
            </expression>
            <variable name="CoordinatorUser" access="read" /> 
            <variable name="tempVar" access="write" />
            </script>
         </action>           
             <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>             
            <expression>               
               var AdvUsers = tempVar;
                   var wf_AdvArr = AdvUsers.split("|"); 
                   BouwTemp = wf_AdvArr[0];
            </expression>
            <variable name="tempVar" access="read" />
            <variable name="BouwTemp" access="write" />
            </script>
         </action>
             <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>             
            <expression>               
               var AdvUsers = tempVar;
                   var wf_AdvArr = AdvUsers.split("|"); 
                   ReclameTemp = wf_AdvArr[1]; 
            </expression>
            <variable name="tempVar" access="read" />
            <variable name="ReclameTemp" access="write" />
            </script>
         </action>
             <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>             
            <expression>               
               var AdvUsers = tempVar;
                   var wf_AdvArr = AdvUsers.split("|"); 
                   InuitTemp = wf_AdvArr[2];
            </expression>
            <variable name="tempVar" access="read" /> 
            <variable name="InuitTemp" access="write" />
            </script>
         </action>
             <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>             
            <expression>               
               var AdvUsers = tempVar;
                   var wf_AdvArr = AdvUsers.split("|"); 
                   KapTemp = wf_AdvArr[3];  
            </expression>
            <variable name="tempVar" access="read" /> 
            <variable name="KapTemp" access="write" />
            </script>
         </action>   
             <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>             
            <expression>               
               var AdvUsers = tempVar;
                   var wf_AdvArr = AdvUsers.split("|"); 
                   SloopTemp = wf_AdvArr[4];  
            </expression>
            <variable name="tempVar" access="read" /> 
            <variable name="SloopTemp" access="write" />
            </script>
         </action>                                        
         <script>
            <expression>               
                 BouwUser = BouwTemp;
                 ReclameUser = ReclameTemp;
                 InuitritUser = InuitTemp;
                 KapUser = KapTemp;
                 SloopUser = SloopTemp;
           </expression>
           <variable name="BouwTemp" access="read" />
           <variable name="ReclameTemp" access="read" />
           <variable name="InuitTemp" access="read" />
           <variable name="KapTemp" access="read" />
           <variable name="SloopTemp" access="read" />    
           <variable name="BouwUser" access="write" />
           <variable name="ReclameUser" access="write" />
           <variable name="InuitritUser" access="write" />
           <variable name="KapUser" access="write" />
           <variable name="SloopUser" access="write" />               
          </script>
       </event>                   
        </task>
      <transition name="StartBehandeling" to="fork1"></transition>
      <transition name="NietCompleet" to="AanvraagNietCompleet"></transition>
   </task-node>

  
  <swimlane name="bouwadv">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
          <actor>#{people.getPerson(BouwUser).properties["cm:userName"]}</actor>
      </assignment>
   </swimlane>
   <swimlane name="reclameadv">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
          <actor>#{people.getPerson(ReclameUser).properties["cm:userName"]}</actor>
      </assignment>
   </swimlane>
   <swimlane name="inuitritadv">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
          <actor>#{people.getPerson(InuitritUser).properties["cm:userName"]}</actor>
      </assignment>
   </swimlane>
   <swimlane name="kapadv">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
          <actor>#{people.getPerson(KapUser).properties["cm:userName"]}</actor>
      </assignment>
   </swimlane>
    <swimlane name="sloopadv">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
          <actor>#{people.getPerson(SloopUser).properties["cm:userName"]}</actor>
      </assignment>
   </swimlane>       
    <swimlane name="externadv">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
          <actor>#{ovs_externadviseur.properties['cm:userName']}</actor>
      </assignment>
   </swimlane>  

  
      <fork name="fork1">
      <transition name="tr1" to="testBouw"></transition>
      <transition name="tr2" to="testReclame"></transition>
      <transition name="tr3" to="testInuitrit"></transition>
      <transition name="tr4" to="testKap"></transition>
      <transition name="tr5" to="testSloop"></transition>
      <transition name="tr6" to="testExtern"></transition>
   </fork>  
………..

pobe
Champ in-the-making
Champ in-the-making
Do you know if its possible to use this to make pre-selected but changable swimlanes?

/ Pontus

davidc
Star Contributor
Star Contributor
Not sure I understand your question?
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.