AnsweredAssumed Answered

MultiInstancesBehavior can't be started when changing document properties in serial workflow

Question asked by nathanm on Jul 9, 2015
Latest reply on Jul 9, 2015 by nathanm
Hello,

I need to change some document properties in my serial workflow, but when the first person approved the review task i've submitted the multi instanced behavior failed to start (org.activiti.engine.ActivitiException: Could not execute inner activiti behavior of multi instance behavior
). But if I comment the document change properties, the workflow is running as usual. below is my code :


<userTask id="reviewTask" name="Review Task" activiti:assignee="${reviewAssignee.properties.userName}" activiti:formKey="wf:activitiReviewTask">
      <extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string><![CDATA[if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
                      if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
                  bpm_package.children[0].properties["ct:assigned"] = reviewAssignee.properties.userName;;
                  bpm_package.children[0].save();
                  ]]></activiti:string>
                      
          </activiti:field>
        </activiti:taskListener>
        <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string><![CDATA[if(task.getVariableLocal('wf_reviewOutcome') == 'Approve') {
                             var newApprovedCount = wf_approveCount + 1;
                            var newApprovedPercentage = (newApprovedCount / wf_reviewerCount) * 100;
                           
                            execution.setVariable('wf_approveCount', newApprovedCount);
                            execution.setVariable('wf_actualPercent', newApprovedPercentage);
                        }else{
                      execution.setVariable('wf_actualPercent', wf_requiredApprovePercent);
                  }]]></activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
      <multiInstanceLoopCharacteristics isSequential="true" activiti:collection="bpm_assignees" activiti:elementVariable="reviewAssignee">
        <completionCondition>${wf_actualPercent &gt;= wf_requiredApprovePercent}</completionCondition>
      </multiInstanceLoopCharacteristics>
    </userTask>


I'm using alfresco share version 5.1 enterprise edition.

Thanks and regards,
Nathan.

Outcomes