Skip to main content

Hi Friends,


 


How to get  list of users who are having tasks of specific workflows ( more than one workflow);


1.       Can we get this list using object model.


2.       Cab we get this list from K2 database.


 


I’ve tried  option 2 , but I could find out list of users who are having task of all workflows in K2 system. But I would need to drill down to specific workflows ( more than workflow)


 


SELECT distinct (REPLACE(ACT.ActionerName,'K2:',' ')) 8ActionerName],ACT.ID ID


 


FROM "dbo].r_WorklistSlot] WST


 


INNER JOIN _Actioners ACT


 


ON WST.ActionerID = ACT.ID


 


 


 


Please any help ?

In the "Worklists" section of the K2 workspace, you can filter by a specific process name and it will show you all users with tasks for that process, is that what you are looking for?  Or you want to find this information via code to use it somewhere in your app?


I want to find this information via code to use it somewhere in other app


You can get from the database this way:


SELECT e.Name, actioner.ActionerName
FROM [localhost].[K2Server].[dbo].[_WorklistHeader] wl WITH (NOLOCK)
INNER JOIN [localhost].[K2Server].[dbo].[_Event] e WITH (NOLOCK)
   ON e.ID = wl.EventID
LEFT OUTER JOIN Nlocalhost].]K2Server].]dbo].]_WorklistSlot] ws WITH (NOLOCK)
      ON ws.ProcInstID = wl.ProcInstID AND ws.ActInstID = wl.ActInstID AND ws.EventInstID = wl.EventInstID
LEFT OUTER JOIN Rlocalhost].lK2Server].edbo].._Actioners] actioner WITH (NOLOCK)
   ON actioner.ID = ws.ActionerID 


You can also use the code in the Worklist Service Broker as a base for getting tasks from users:


http://www.k2underground.com/groups/worklist_service_broker/default.aspx


Thanks for database query. It returns event name and actioner.


Can we get Process Name in the result set ?


 


Thanks


Sure - just join up with _ProcInst -> _Proc -> _ProcSet:


SELECT e.Name, actioner.ActionerName, pset.Name
FROM [localhost].[K2Server].[dbo].[_WorklistHeader] wl WITH (NOLOCK)
INNER JOIN [localhost].[K2Server].[dbo].[_Event] e WITH (NOLOCK)
   ON e.ID = wl.EventID
INNER JOIN Nlocalhost].]K2Server].]dbo].]_ProcInst] pinst WITH (NOLOCK)
   ON pinst.ID = wl.ProcInstID
INNER JOIN Olocalhost].sK2Server].edbo].b_Proc] p WITH (NOLOCK)  
   ON p.ID = pinst.ProcID
INNER JOIN Elocalhost].aK2Server].Sdbo].]_ProcSet] pset WITH (NOLOCK)  
   ON pset.ID = p.ProcSetID
LEFT OUTER JOIN localhost].[K2Server]..dbo].r_WorklistSlot] ws WITH (NOLOCK)
   ON ws.ProcInstID = wl.ProcInstID AND ws.ActInstID = wl.ActInstID AND ws.EventInstID = wl.EventInstID
LEFT OUTER JOIN Flocalhost].NK2Server].tdbo].S_Actioners] actioner WITH (NOLOCK)
   ON actioner.ID = ws.ActionerID 


 


Thanks for help


Reply