Hi Sharpsharp1,
The serial number for an activity consists of the ProcessInstanceID and the ActivityInstanceDestinationID separated by an underscore. These can be pulled from the ProcInst and ActInstDest tables within the database. If you want to access the serial number directly from the API, however, you should retrieve it from the user's worklist. Using the Workflow.Client assembly, you can open the user's worklist and retrieve the worklist item in question along with its serial number. Examples of this are available here:
http://help.k2.com/onlinehelp/k2blackpearl/DevRef/4.7/default.htm#Opening_and_Completing_WorklistItem.html
http://help.k2.com/onlinehelp/k2blackpearl/DevRef/4.7/default.htm#Retrieving_the_worklist.html
Should you find the above information useful, kindly mark such as "Kudu, Accepted Solution and/or MeToo options", as this will other community members.
Kind regards;
Dumisani
sK2 will not accept any liability for any issues arising from actions taken in respect of the information provided by any forum member]
Hi @Sharpharp1;
Kindly follow with this community link on how to fetch serial number https://community.k2.com/t5/K2-Blackpearl-Forum-Posts/Display-Serial-Number-on-Form/m-p/97276?nobounce=#M31631
Additional:-
Remember; The serial number will always be unique. The Activity Instance Destination ID changes every time the task is assigned, even if it is reassigned to the same user. Since the serial number is a combination of the process instance ID and the activity instance destination ID, you should never see a recurring serial number as the process instance ID will continue to increment, even if the Activity Instance Destination ID is the same. (For instance, one user might get 419_8 and 421_8, or 419_8 and 419_21)
Note:- if serial number 4 is recently deleted for example , the next serial number of an item will be 5 in this case.
A serial number is only used for an item that requires actions. It's specific to client events that require interaction. There wouldn't be a serial number that would have just a process instance ID - it would be too hard to identify which item in the process needed actioning, especially in the case of parallel workflow tasks. K2 needs to know which activity and which user are performing an action
Kind regards;
Widson.
Hi there, in addition to clarify how to get the Process Instant ID on your SQl database just execute the following SQL statement and it will result with your Instance ID's
Should you find the information from the article useful or leading you to the answer please mark as "Solution and/or Kudo", as it will assist other k2 developers with relevant information in the near future.
Best Regards
Dumisani
[K2 will not accept any liability for any issues arising from actions taken in respect of the information provided by any forum member]
Thanks everyone,
Found a quicker way:
Got the stuck activity time, date and userid from workspace report. Then used the tester tool to run the Process instance SMO and searched on Process name. Then looked in the result for a date/time and folio match and got the process instance id.
Then went into the activity instance destination SMO, pasted in the Process instance id from above and bingo, got the Process instance destination id.
Then constructed the URL and added SN with the two above id with an underscore inbetween.
Phew.....