06-08-2009 06:42 AM
<task-node name="Riscrittura">
<task name="wfEnteP:Riscrittura" swimlane="riscrittura"/>
<transition to="Redazione" name="ChiediRedazione">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<runas>admin</runas>
<variable name="bpm_package" access="read"></variable>
<variable name="initiatorhome" access="read,write"></variable>
<expression>
var destRedazione = initiatorhome.childByNamePath("/5) Ufficio redazione/Da redare");
for (i = 0; i < bpm_package.children.length; i++){
bpm_package.children[i].move(destRedazione);
}
</expression>
</script>
</action>
</transition>
</task-node>
06-08-2009 09:56 AM
<start-state name="Inizio">
<task name="wfEnteP:inizia" swimlane="initiator"></task>
<transition to="ControlloCorrettezza" name="ChiediCorrettezza">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<runas>admin</runas>
<variable name="bpm_package" access="read"></variable>
<variable name="companyhome" access="read,write"></variable>
<!– Il seguente script mi fa la copy nella cartella "Ufficio Correttezza"
e la move nella cartella "Ufficio lettura" dei documenti interessati
nel workflow –>
<expression>
var destCorrettezza = companyhome.childByNamePath("Ente Pubblico/3) Ufficio correttezza");
var destLettura = companyhome.childByNamePath("/Ente Pubblico/2) Ufficio lettura");
/*Ciclo per copiare e muovere i TUTTI i doc del wf se presenti più di uno*/
for (i = 0; i < bpm_package.children.length; i++){
bpm_package.children[i].copy(destLettura);
bpm_package.children[i].move(destCorrettezza);
}
</expression>
</script>
</action>
</transition>
</start-state>
2) ControlloCorrettezza –> Riscrittura: I move the document in a folder (OK) in this step companyhome result INDEFINED, so I use initiatorhome<task-node name="ControlloCorrettezza">
<task name="wfEnteP:ControlloCorrettezza" swimlane="correttezza"></task>
<transition to="Riscrittura" name="ChiediRiscrittura">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<runas>admin</runas>
<variable name="bpm_package" access="read"></variable>
<variable name="initiatorhome" access="read,write"></variable>
<expression>
var destCorretto = initiatorhome.childByNamePath("/4) Ufficio riscrittura");
for (i = 0;i < bpm_package.children.length; i++){
bpm_package.children[i].move(destCorretto);
}
</expression>
</script>
</action>
</transition>
<transition to="Rifiuto" name="Rifiutato">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<runas>admin</runas>
<variable name="bpm_package" access="read"></variable>
<variable name="initiatorhome" access="read,write"></variable>
<expression>
var destRifiutati = initiatorhome.childByNamePath("/1) Ufficio protocollo/Respinti");
for (i = 0;i < bpm_package.children.length; i++){
bpm_package.children[i].move(destRifiutati);
}
</expression>
</script>
</action>
</transition>
</task-node>
<task-node name="Riscrittura">
<task name="wfEnteP:Riscrittura" swimlane="riscrittura"/>
<transition to="Redazione" name="ChiediRedazione">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<runas>admin</runas>
<variable name="bpm_package" access="read"></variable>
<variable name="companyhome" access="read,write"></variable>
<variable name="initiator" access="read"></variable>
<expression>
logger.log(initiator.name);
var destRedazione = companyhome.childByNamePath("/Ente Pubblico/5) Ufficio redazione/Da redare");
for (i = 0; i < bpm_package.children.length; i++){
bpm_package.children[i].move(destRedazione);
}
</expression>
</script>
</action>
</transition>
06-08-2009 10:40 AM
<start-state name="Inizio">
<task name="wfEnteP:inizia" swimlane="initiator"></task>
<transition to="ControlloCorrettezza" name="ChiediCorrettezza">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
var destCorrettezza = companyhome.childByNamePath("Ente Pubblico/3) Ufficio correttezza");
var destLettura = companyhome.childByNamePath("/Ente Pubblico/2) Ufficio lettura");
/*Ciclo per copiare e muovere i TUTTI i doc del wf se presenti più di uno*/
for (i = 0; i < bpm_package.children.length; i++){
bpm_package.children[i].copy(destLettura);
bpm_package.children[i].move(destCorrettezza);
}
</script>
</action>
</transition>
</start-state>
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.