Skip to main content

Hi,

 

I an working with a workflow which require infomation from Sql database. I am using Smart Object and want to kow if i can monitor(Insert,Update,Delete) changes in Sql Database with the help of SmartObject. Is this possible?

 

Kindly help!!!

 

Thanks in advance.

Hi,


Take a look at this link: http://help.k2.com/onlinehelp/k2blackpearl/userguide/current/webframe.html#WS_SQL_01.html

 

It details how you can create and manage tables with  within SQL by creating a SmartObject using the SQL Server Service. 

 

 


hi Peter,

 

Thank you for the reply, but actually I do not want to create any row  in sql using smartobject. but i want to monitor that if there are any changes that are made in the SQL database Table. I Should be able to find out with the help of smart object that any of the row is edited or updated

(for example: if i have one row, having values ABC and somebody has update it to XYZ. The Smartobject should be able to fetch the value directly from the database at run time and the workflow shold carry on with the updated values and the samrtobject should also return me the satus that the values are updated ie ABC to XYZ)


Hi Rahul

 

Out of the box you cannot get a smartobject to tell you if a row has changed. You will need to implement this logic yourself. For example, you could create a bit column in your SQL table called "Updated" which is set to false when a record is created. You can then create a update trigger on this table to set the "Updated" value to true if the row is updated (up to you how you do this but you could use something like Checksum function). 

 

If you want to get more detailed on what and when things were changed you could create an audit or history table and copy data into this table when data in the source table is changed. You can then create a smartobject for this table to use to check for any changes.


Hi,

 

I agree with Andrew, but to add to that.

On SQL you can call web services as part of a trigger which you could leverage to interact with K2.

It will need some custom coding, but is possible.

 

Other alternative is to write a custom Windows Service that will monitor the tables and interact with K2 when a change is detected.

 

Hope this helps!

JohanL


Reply