<swimlane name="approvers">
<assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
<pooledactors>#{people.getGroup('GROUP_ProjectManager')}
</pooledactors>
</assignment>
</swimlane>
…<task-node name="Validazione">
<event type="node-enter">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<runas>admin</runas>
<script>
for (var i = 0; i < bpm_package.children.length; i++)
{
bpm_package.children[i].properties["wfpm:status"] = "Verificato";
bpm_package.children[i].save();
}
</script>
</action>
</event>
<event type="node-leave">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<runas>admin</runas>
<script>
for (var i = 0; i < bpm_package.children.length; i++)
{
if (!bpm_package.children[i].hasAspect("wfpm:utente"))
{
bpm_package.children[i].addAspect("wfpm:utente");
}
}
</script>
</action>
</event>
<transition to="Rifiutato" name="Rifiuta"></transition>
<transition to="Validato" name="Valida"></transition>
<task name="wfpm:validazioneTask" swimlane="approvers" />
</task-node>
<task-node name="Validato">
<event type="node-enter">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<runas>admin</runas>
<script>
//prima prova effettuata
//var utente=people.getPerson(people.getGroup('GROUP_ProjectManager'))).properties.userName;
//seconda prova
var utente=people.getPerson(approvers).properties.userName;
for (var i = 0; i < bpm_package.children.length; i++)
{
bpm_package.children[i].properties["wfpm:utente"] = utente;
bpm_package.children[i].properties["wfpm:status"] = "Validato";
bpm_package.children[i].save();
}
</script>
</action>
</event>
<task name="wfpm:ValidatoTask" swimlane="initiator" />
<transition to="End" name="termina"></transition>
</task-node>
Quando clicco, durante il tak di validazione, il bottone "Valida",<task-node name="Validazione" >
<task name="wfpm:validazioneTask" swimlane="approvers" >
<event type="task-end">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
<variable name="bpm_assignee" access="write"/>
<expression>
if (taskInstance.actorId != null)
people.getPerson(taskInstance.actorId);
else
person;
</expression>
</script>
</action>
</event>
</task>
<event type="node-enter">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<runas>admin</runas>
<script>
for (var i = 0; i < bpm_package.children.length; i++)
{
bpm_package.children[i].properties["wfpm:status"] = "Verificato";
bpm_package.children[i].save();
}
</script>
</action>
</event>
<transition to="Rifiutato" name="Rifiuta"></transition>
<transition to="Validato" name="Valida">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<runas>admin</runas>
<script>
for (var i = 0; i < bpm_package.children.length; i++)
{
var nome= bpm_assignee.properties["cm:firstName"];
var cognome= bpm_assignee.properties["cm:lastName"];
var utente= nome + ' ' + cognome;
bpm_package.children[i].properties["wfpm:utente"] = utente;
bpm_package.children[i].save();
}
</script>
</action></transition>
</task-node>
Archive content from product discussions in Italian.
This group is now closed and content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.