Getting the updated Serial No


Badge +1

Hi,

 

How to get the updated serial no after actiong an item. I calling the action on execute on a work item.

 

var worklistItem = conn.OpenWorklistItem(serialNo);

if (worklistItem.ActivityInstanceDestination.Name == "New")

{

worklistItem.Actions[0].Execute();

}

var updatedworklistItem = conn.OpenWorklistItem(serialNo);

 

Since the serial no gets changed after the actioning, how can I get the updated serial no. I want to open the workitem again after it's actioned.

 

Thanks

 


5 replies

Userlevel 1
Badge +8

Hi HariWells

 

I'm not sure your statement "the serial number gets changed after the actioning" is correct. Once a worklist item is actioned its status will change, but the serial number (which is the the process instance ID and the Activity Instance Destination ID) remains the same.

 

If you try and open a worklist item that has been actioned K2 will report an error.

Badge +1

Yes. It does throw an error. How can I open the item immediately after it is actioned.

 

Also the serial no is getting changed. When I call the whole list again I can see it. First time the serial no was 13792_25 and when I called the OpenWorklist again the serial no of the item begins 13792_35. I think this is because of the new ActInstDestID.

 

My aim is to open the worklist item again after it is actioned. How can I do that?

 

Thanks

Badge +5

Hi,

 

must the user have permissions to edit the Items again? If not, you could open a view form?

 

 

Badge +1

I want to do by code. I have a link from where I call this method to perform the action implicitly. Once its actioned a custom form will be present to the user where the user can select next actions to perform. For this I need to get the updated item after its actioned. Also the user has permissions to open the item.

 

Thanks

Userlevel 1
Badge +8

It sounds like you are completing a workflow activity and moving to the next activity. If this is the case then a new worklist item will be created and it will have a new serial number. I don't think there is a property you can access through the API that will give you this serial number, as there is potentially any number of worklist items created (i.e. multiple activities, multiple slots per activity). You could use the Worklist API or SmartObjects to search for the new worklist item.

Reply