AnsweredAssumed Answered

script in workflow review...addAspect()

Question asked by alpha on Mar 1, 2007
Latest reply on Mar 6, 2007 by alpha
hi guys!

i have created a new aspect
<aspect name="my:toggled">
in workflow review definition file, i put a script that apply this aspect to the package. here is the code :
<?xml version="1.0" encoding="UTF-8"?>

<process-definition xmlns="" name="wf:review">

    <swimlane name="initiator" />

    <start-state name="start">
        <task name="wf:submitReviewTask" swimlane="initiator" />
        <transition name="" to="review" />

    <swimlane name="reviewer">
        <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">

    <task-node name="review">
        <task name="wf:reviewTask" swimlane="reviewer">
            <event type="task-create">
                    if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
                    if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
        <transition name="reject" to="rejected"/>
        <transition name="approve" to="approved">
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                    for (var i = 0; i &lt; bpm_package.children.length; i++) {
                  logger.log("count bpm_package : "+bpm_package.children.length);

    <task-node name="rejected">
        <task name="wf:rejectedTask" swimlane="initiator" />
        <transition name="" to="end" />

    <task-node name="approved">
        <task name="wf:approvedTask" swimlane="initiator" />   
        <transition name="" to="end" />

    <end-state name="end" />


When i press button approve on a review workflow, the aspect is not applied as i expected it (i have checked with the node navigator).
And nothing is displayed in log file (nor console)?

am i missing something?

PS/ : I need this, to set an evaluator (action evaluator) whether or not to display an action for the bpm_package children.