Skip to main content








Normal
0




false
false
false

EN-US
X-NONE
X-NONE






































































































































































is there a native K2 feature that would allow us to monitor a database
and start a workflow once a line is added/modified on the database being
monitored?

I don't think there is that feature atm. But you could create a looping workflow which looks in that database for new entries and then starts a workflow problematically.


I'm kind of new to the Workflow/K2 Scene, how would you loop a workflow to look into a database?


thanks for the reply!


I would like to point out that there is some coding involved in this but its a simple as using the K2 API to start a workflow. You may be able to get away with not writing any code if there is a smartobject that starts workflows. Firstly, create a workflow with an activity which calls a smartobject method. This smartobject will do the job of reading the database table and then determining if there are new entries. If there are new entries this smartobject will return them in a XML format (for example). Then depending on if any results were returned, you call another smartobject method which will start the workflow. Or you are writing code to read data from the database you could even put the code in there to start the workflow. If you need to add any other activities you can do so. In then end of the workflow the line should loop back to start activity.


If you want to make it loop lets say roughly every 30 minutes, then create a data field with the current date and time at the start of the workflow and at the end of the workflow add 30 minutes to the data field, Then set the start rule of the start activity to the value of that data field.


Hope this helps


Reply