populate datafield or SO in destination rule code


Badge +1

Hello, 


I'm coding my own worklist. For each worklist item I want to know the destinations of the activity (as determined by the destination rule). I can't find a property in the K2 API, so now I'm trying to populate a datafield with the destinations in the destination rule code. Can I use an activity datafield? If not, I have to use a process datafield. However, if the workflow contains some activities parallel to each other, a process datafield doesn't seem to be a good option, because the destination rules of these activities will overwrite the datafield. Another option is to write to a SmartObject from within the destination rule. Has anyone comments on that?


 


3 replies

Badge +9
Typically the worklist would be containing information pertaining to the user accessing it.  i.e. himself.  The only place that you can see the full list of users would be in the Process Overview reports.  I suppose you *could* build a subquery to the Workflow Process SmartObjects to get the list of destinations based on the process and activity instance.  However, it would probably be quite intensive on the database unless it is a click-on-demand thing.
Badge +9

I agree with Johnny's points.  You should be careful about your approach here.  If your user base typically has lots of worklist items assigned to them, having to always execute a subquery for each one could slow down the page loading.  As Johnny mentions, in these types of high volume scenarios it is often advisable to provide a lookup button for each worklist that the user can click on and then go out an fetch the data for that specific one.


With these cautions in mind, should you wish to get this data, the out of box reporting SmartObject should provide you access.  The specific one I think you'll want to use is "Activity Instance Destination". 


I cover the out of box reporting smartobjects in some more details here:


  - http://k2underground.com/blogs/fromthebench/archive/2008/06/02/how-to-retrieve-process-instance-reporting-data.aspx


HTH.

Badge +1
Thank you!

Reply