Batching Tasks

  • 26 June 2007
  • 1 reply
  • 3 views

Badge

We have a process that involves moving a number of Invoices through a business process.  One activity in the workflow involves a task to update a day's worth of invoices as a batch process.


We want to have individual tasks for tracking purposes (and so each could escalate in the event of an individual invoice being missed).  However, we only want to see one task on the worklist for the batch and ideally have all tasks in the batch updated when the task is completed.


Any suggestions on how best to architect this?


Many thanks,


Steve


1 reply

Badge +9

Off the top of my head, I can think of a couple of options:


1.  If you have a custom worklist (implemented with the K2ROM) you can filter out all the occurences of this specific task when you are programatically populating the list of tasks and simply display just one task.  This would be done via some code that checks for the occurrence of the individual batched tasks, then if found programatically creates a "fake" task item in the list.  This fake task item could contain a URL to special consolidated action page that will surface the appropriate fields then when the user clicks "Submit" the page will programmatically retrieve all the worklist items assigned to this person for this specific client event and iterates all of them, applying the data and Finish() to each one.


2.  You could also modify the specific client event that is to be batched and give it a special platform.  You can do this by "Generating Code" within the Client Event in K2 Studio, then "Edit Code".  Within the AddWorklistItem call you will see a string called "ASP".  This is the default K2 platform.  A platform is simply a way to group worklist items, nothing more.  The out-of-box K2 worklists (in workspace and SharePoint webpart) only display worklist items with the default platform of "ASP", thus if you were to enter a new platform for this client event, say "BATCH", then it would not appear on the standard worklists.  You would then need to create some custom code that uses the K2ROM to OpenWorklist for this "BATCH" platform to retreive all these batch tasks assigned to him/her.  You would then need to create some sort of consolidated actioning page as described in suggestion # 1.


I think the important point here is that there will need to be some K2ROM coding for either scenario.  If you are not familiar with the K2ROM API it is documented within the Help.


I'm suspect there are other ways this can be accomplished.  I'd be interested in hearing any ideas that others may have.

Reply