Skip to main content

Hi all K2 users, wish you and your familly a merry Xmas.


Today, I discover a strange behavior on our k2 firm. The process creation was always ok till today. It seems that from the workspace, everything Ok, a newly created process is in active state , and from worklist, every user in the destination rules receives their tasks. But the matter is when querying via SmartObject API (GetSmartObject('Actitivy_Instance_.....') with filtering by the activityInstanceId and ProcInstanceId, it always return an empty result.
When querying the K2Serverlog database with the following queries :


select * from dbo._Worklist where ProcInstID = 8047;


select * from dbo._ActInstDest where ProcInstId = 8047;


select * from dbo._ActInst where ProcInstId = 8047;


select * from dbo._ActInstData where ProcInstId = 8047;


select * from dbo._ActInstDataAudit where ProcInstId = 8047;


select * from dbo._ActInstDestData where ProcInstId = 8047;


select * from dbo._ProcInst where ID = 8047;


It returns empty result on each query ( 8047 is the ProcId impacted )


For each process created before today, the same query with the right process Id always returns at least an entry ...


For the moment, I think that there's an unexcpected behavior on the server at the launching time and relaunching a new process is the quick solution. However, I need to do some more analysis



Any ideas on that issue?


Thanks in advance

Hi again,


After reading some more post relating the K2ServerLog database, it seems that during the lifecycle of a process, some threads copy datas from the K2Server to K2ServerLog. This last is used for reporting, viewflow and SmartObject Query.


My case becomes more precise now : I use SmartObject for querying some informations, but the fact is that any datas exist for the correponding ProcId. That's why it return empty list.


When querying directly with method GetWorklistItems of an object type of WorkflowManagementServer, I can get all infos about the process because this one, I think, query directly on K2Server.


Unfortunately, for performance issues, I've switched to Smo methods rather than a WofflowManagementServer, at this time, I need to implement a dispatcher/proxy to query first with the use of Smo and if no result then query with the use of WofflowManagementServer object


h.ralitera


This is expected behaviour and by design. The Logging thread will always be a couple of seconds (sometimes minutes depending on load) behind, purely because transactions should take precedence over logging.


If you need real-time data, you should use methods in the API that query the server directly. Alternatively, you can create a custom SmartObject (or database table and create a SmO for that) which will hold the relevant flags or statuses that you need for your application.


Hi, thanks for your reply.


In my case, i have manualy relaunch the sync to have the data available in the K2 ServerLog.


I've used the API WorkflowManagementServer for querying the server. but after several years, the datas grows and I was facing with a performance pbm. So I've switched to Smo which has solved this issue.


What do you mean by "manually relaunch the sync"?


Is your log thread set to normal priority?


How many seconds does the API take currently if it has to fall back to that?


Reply