Retrieve a list of tasks related to process a user initiates

  • 27 September 2010
  • 3 replies
  • 0 views

Badge +1

I think that I must be missing something here.  I need to be able to have a user log on to an intranet page and display a list of processes that they have initiated, and see the current list of tasks that have not been completed.  I don't see an easy way to do this, but it seems to me that it should be common to be able to see the status of the processes that a user has initilated. 


I looked at "WorkflowManagementServer.GetWorklistItems(...)" and it seems that I could write some code to perform a search to find the list of items that I need.  In fact, I wrote a quick POC and I see that if I know the folio that I can get the list of worklistitems. Then I see that there are API methods that allow me to find the open processes for a given user, and thoses processes contain the folio, so I can leverage that to get the list or workitems.  So that does work, but that is not the robust solution that I am looking for.  Using the Folio as a "key" is not a robust solution.


So what am I missing?  Sureley some of you have implemented this type of process in the past.  There has to be an API method that allows you to search for the list of open tasks associated to the list of processes that a person has initiated, right?


3 replies

Badge +6

Check Developer Reference for code samples http://help.k2.com/en/k2devref.aspx


For your requirement, check this-->http://help.k2.com/helppages/K2devref/Working_with_a_Process.html

Badge +1

Hmmm, that is interesting.  I see what this post is saying, but it seems like it is not exactly what I need.  What it seems like this post is suggesting is that if I impersonate "Mike", I will be able to see if "Mike" has any outstanding work to do.  The problem is I don't know that "Mike" is the one holding up the process.  There are many hundreds of people who could be holding up the process, and to know the list of all possible users that may be holding up the process is not possible.  Looks like if this is the only solution that I will have to write some custom code against the database.


To reiterate,  I am looking for a way for the person who initially started the workflow to know where we are in the process.  In my scenario, a manager kicks off a process, and then sits back and waits for everyone else to do the work.  From time to time the manager wants to know who has active tasks, and why they are not complete.  So how if the manager to know what tasks are open?

Badge +10

From what you describe above what if you use the following 2 OOTB SmartObjects to get the information you want, ProcessInstance filtering on the Originator (who would be your manager) and ActivityInstanceDestination .  You'll probably need to do some joins or create a composite Smartobject using the ProcessIDs to link the 2


This would then give you all the process instances that manager started and the activities and the current status and Final Action, dates and such.


Try running these SmartObjects using the SmartObject tester and see if it'll give you the information you want.


*** Note:  I currently have a confirmed bug with K2 and trying to filter the ActivityInstanceDestination SmartObject where it gives an error using the K2 blackpearl 4.5 1170 update.  This is slated to be fixed in a future update.  If you are using the 1170 update then this approach will probably not work for you because of this bug.

Reply