Skip to main content

Hi Guys,

 

I been reading a bit thorugh the K2 blackpearl developer reference guide. Ive managed to get and edit datafields by opening a ProcessInstance using the processinstanceId. Is it possible that given only the processinstanceId, Can you get all activities for that process. What activity is currently the active one and make the process go to a different activity.

 

Thanks for your help

 

You can use the Activity Instance SmartObject to get all activities that have all ready occurred for a given process, but not activities that have yet to occur in the process.

 

The Activity Instance Destination SmartObject will get you the outcome of a particular activity instance and who took the action.

 

Activities that have yet to occur is more complicated.  You can get the list of all activities in a process using the Process Activities SmartObject, but you have to know the Process ID.  This is not the same as the process instance ID.  Unfortunately, this isn't something you can get to via SmartObjects.  Within a workflow, you can create a Server Code Event that gets a paramater K2 with lots of information about the running process, including the ProcessID (see K2.ProcessInstance.Process.ID).


Thanks for your reply, would you happen to know which table/s in the K2 database the process information is stored. Process Information as in the process metadata such as active activities etc. I know you said use the smartobject but I'm curious.

 


Reply