cancel
Showing results for 
Search instead for 
Did you mean: 

bpm_package splitting

tullo
Champ in-the-making
Champ in-the-making
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?
2 REPLIES 2

afaust
Legendary Innovator
Legendary Innovator
Hello,

my approach in these use cases is to define separate properties in the workflow / task model for the different views (if predefined set of users), or by using a form filter to dynamically calculate the views (if involved user set is flexible at runtime) as transient property fields. I have found no other sensible way of achieving a requirement such as this yet.

Regards
Axel

tullo
Champ in-the-making
Champ in-the-making
Thanks for your input, Axel!

Using a form filter is a rally good idea, did not come to my mind at all. My current approach with a task local package has the side effect that the indicator for whether a document is part of a workflow or not no longer shows up for the documents moved over to the task local bpm_packages.

Regards