Hello everybody, I´m kind of new in the alfresco's world. i´m customizing a workflow and I need that when the workflow ends, an aspect is added to the documents in the current workflow, until now I have not reach that point, due to the script I´m using, it's giving me the following error message:
<blockcode>
org.activiti.engine.ActivitiException: Exception while invoking TaskListener: Exception while invoking TaskListener: 07100442 Failed to execute supplied script: missing ) after condition (AlfrescoJS#4)
</blockcode>
in the alfresco log there is no error, it just the error that shows in the pop up alert.
everything works fine until I put this code…specifically from the "if (${estwf_reviewOutcome} == 'Aprovado'){" part:
<blockcode>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
execution.setVariable('estwf_reviewOutcome', task.getVariable('estwf_reviewOutcome'));
execution.setVariable('bpm_comment', task.getVariable('bpm_comment'));
if (${estwf_reviewOutcome} == 'Aprovado'){
if ((bpm_package != null) && (bpm_package.children != null)) {
var i = 0;
for (i = 0; i < bpm_package.children.length; i++) {
var document = bpm_package.children;
document.addAspect("wf:workflowOutcomeAspect");
document.properties["wf:workflowOutcome"] = "approved";
document.save();
}
}
}
</activiti:string>
</activiti:field>
</activiti:taskListener>
</blockcode>
can anyone see what is wrong with this code? or how can I improve it?
Regards, Carolina