Machine participants?

  • 10 August 2009
  • 1 reply
  • 0 views

Badge +4

Hey guys.

I was wondering if there's a way to easily leverage K2 in an application we need developed.  It's basically a workflow that needs to happen automatically... but the participants are all mostly computers and software.

Specifically, a user submits a request via an online form to go get data.  We don't house the data on-site (it's proprietary).  We have a software program running on another server that runs a web service which can be called with parameters to request the data from the off-site location.

What we need is for when the user submits the request, the parameters get passed to the web service on the other server.  The data could take a long time come back... and sometimes might fail.  It'd really be good to have an escalation after, say, 1 hour that issues a retry or notifies the user that it failed, etc.

After the data does come back, we need an ETL process to run that moves the data into our on-site data environment.  We then need the user to get notified that the data is available, and they can then go to our business intelligence reporting dashboard, and the reports they want will now be available for the data they requested.

The business also wants reporting to be available on the whole process... like how long activities in it are taking, how often diffferent aspects fail or have to be retried, etc... things that the OOB reports of K2 already can show.

Do I have options to try and leverage K2 here, and what's the best way to proceed?


1 reply

Badge +10

Hi,


This is absolutely possible with K2.


You will make use of Asynchronous Server Events to accomplish the integration. Asynchronous server events create a "Task Item" that can be finished by external systems. To create one you only have to set the K2.Synchronous property to false in your server event code. This will create a task which another system (web service in your case) can use to finish the item and then let the workflow continue. Please note that you will need to store the associated Serial Number so that the web service can finish the item. This you can get from the K2.SerialNumber property. Pass this serial number to your web service and store this so that the web service can call connection.OpenServerItem(serialNo) and then finish the item.


Thus on a high level I think you will call the web services from Asynchronous server events, passing in the associated serial numbers. These will probably need to be Asynchronous web service calls as well so that control can be passed back to K2 server. The web services will then do what they need and at the end open the server item and finish it. The workflow will then continue. Escalations can still be set on the activities and you will get the full report functionality offered by K2.


I hope the above is clear and that it helps you.


Regards,

Reply