Skip to main content

I have requirement whereby a prcoess instance's state needs to be evaluated. For example: if a process is running I need to display a stop button on a smartform, if it is not I need to display a start button.  How would one go about that? Thanks in advance guys.

 

 

If you are on K2 version 4.7, you may be able to use the [System > Management > Workflows > SmartObjects > Process Instance Info] SmartObject to check if a process instance is Running (List method); it also have the 'Stop' method.


 


If not on version 4.7, perhaps the [Workflow Reports > Workflow General > Process Instance] SmartObject will return the Status.  Then you would likely need a custom service broker or extending one of the community service broker that interacts with the Workflow Management API to stop a process instance.


 


However, a process instance should usually not remain in a 'Running' state for long; as a running process instance will consume a worker thread and as such you will likely need to consider performance and scaling out the servers/resources if you are using a workflow for intense processing:


https://help.k2.com/kb001446


 


Usually a process intance should do some work (Running) and go into an 'Active' state (client event, server event), Completed state or Error state. 


Reply