AnsweredAssumed Answered

bpm_package splitting

Question asked by tullo on Nov 5, 2013
Latest reply on Nov 14, 2013 by tullo
For two parallel tasks in the beginning of the workflow I need two different sets of documents visible to the users working with the tasks.

So, lets say the workflow is started with 5 documents to review, currently the users for both tasks "Approve Document Internal" and "Approve Document External" can see all the documents in the pbm_package.

But the external guys should only have to review the two documents with a specific metadata value set.

I tried to modify the pbm_package inside one of the tasks, but gives unexpected result as the users of the other task also see the modified package. 


    <userTask id="sid-30760A28-47EB-43F4-8D16-5ED177818767" name="Approve Document (External)" activiti:candidateGroups="${wf_managementGroup}">
      <extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>
              logger.log("EXTERNAL CREATE ########################################################################## " + bpm_package.children.length);
            </activiti:string>
          </activiti:field>
        </activiti:taskListener>
        <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>
              bpm_package.removeNode(bpm_package.children[0]);
              logger.log("EXTERNAL COMPLETE ########################################################################## " + bpm_package.children.length);
            </activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>


I was thinking about creating a new pbm_package for the task "Approve Document External" and copy over the children of the original pbm_package which have the metadata set? would that work?

Or is there a simpler/better solution to achieve the described scenario?

Outcomes