Server Event & REST Calls


Hi Mates,

 

In our K2 4.7 workflow we are make use of server event to halt the activity using below code.

K2.Synchronous = false;

Once the backed process has been done we call REST service from our internal tool and make activity complete by using below code in REST service.

 

ServerItem svrItem = K2Conn.OpenServerItem("[serialNo]");
svrItem.Finish();

 

Since server event is not supported by K2 FIVE, how we can we achieve this? This should be done in real time when our internal activity done by our other system.

 

Thanks in Advance


3 replies

Userlevel 6
Badge +16

Hi,


 


Perhaps you can use the Workflow Rest API (Finish) server event.


https://help.k2.com/onlinehelp/k2five/userguide/5.2/default.htm#K2-Management-Site/Integration/Workflow-REST-API.htm%3FTocPath%3DAdminister%7CK2%2520Management%7CIntegration%7CAPI%2520Configuration%7C_____1


 


 

Hi,

Yes using REST API we can finish the actiivty. But how we can have hold the acitivty like server event in  K2 FIVE?

Badge +8

The SmartObject step has the ability to be configured to be asynchronous using the "Wait for external system" checkbox in the options section. Here is the help documentation on that feature: https://help.k2.com/onlinehelp-staging/k2cloud/userguide/update_8/default.htm#K2-Workflow-Designer/Use/Toolbox/SmartObjects/Overview/SmartObjects-Overview.htm#Wait_for_external_system

 

And a quick screenshot: 

I hope this helps.

Reply