Skip to main content
Nintex Community Menu Bar

So I'm trying to combine worklist items with SmartObjects. To do so I'm looking at `server.WorklistHeader` table. Am I right thinking that this table contains all active and only active worklist items?

 

This table contains a very nice column `https://our-k2.com/Runtime/Runtime/Form/Form+Name/?SerialNo=48_80&_state=State` that I will definately use. What I'm trying to figure out is this part of the url `SerialNo=48_80`.

 

48 - obviously is ProcInstID.

80 - seems to be ActInstDestID, according to column value

 

To find a current assignee i'm looking at  table `ServerLog.ActInstDest` where 

  • ServerLog.ActInstDest.ID = server.WorklistHeader.ActInstDestID
  • ServerLog.ActInstDest.ProcInstID = server.WorklistHeader.ProcInstID

Is this correct?

See if this helps:

 

SELECT wlh.[Data] AS [Task URL]
, pi.[Folio] AS [Request ID]
, ps.[DisplayName] AS [Process Name]
, a.[DisplayName] AS [Activity Name]
, e.[DisplayName] AS [Task Name]
, aid.[User] AS [Assigned To] -- Use tk.[Display Name] when our accounts exist in there
, wls.[Status] AS [Task Status] -- 1 = open, 0 = allocated or available
, CAST(pi.[ID] AS NVARCHAR) + '_' + CAST(aid.[ID] AS NVARCHAR) AS [SerialNo]
, pi.[ID] AS [ProcInstID]
FROM [K2].[Server].[WorklistHeader] wlh WITH (NOLOCK)
JOIN [K2].[Server].[WorklistSlot] wls WITH (NOLOCK) ON wls.ActInstID = wlh.ActInstID AND wls.EventInstID = wlh.EventInstID AND wls.ProcInstID = wlh.ProcInstID
JOIN [K2].[Server].[ProcInst] pi WITH (NOLOCK) ON pi.ID = wlh.ProcInstID
JOIN [K2].[Server].[Proc] p WITH (NOLOCK) ON p.ID = pi.ProcID
JOIN [K2].[Server].[ProcSet] ps WITH (NOLOCK) ON ps.ID = p.ProcSetID
JOIN [K2].[Server].[Act] a WITH (NOLOCK) ON a.ID = wlh.ActID
JOIN [K2].[Server].[Event] e WITH (NOLOCK) ON e.ID = wlh.EventID
JOIN [K2].[ServerLog].[ActInst] ai WITH (NOLOCK) ON ai.ID = wlh.ActInstID AND ai.ProcInstID = wlh.ProcInstID
JOIN [K2].[ServerLog].[ActInstDest] aid WITH (NOLOCK) ON aid.ID = wlh.ActInstDestID AND aid.ProcInstID = wlh.ProcInstID AND aid.ActInstID = wlh.ActInstID