Thursday 14 June 2012

webMethods 8 notification trigger and MS sql "Output Variable"

If you try to mix old and new "Output Variable"s with webMethods 8 and TSQL, you will run into this hurdle.

Adapter Runtime (Notification): Error in Notification Callback:enableCallback notification someComponent.notifications:someJDBCNotification.

For MS SQL, the Output Value Type for all Expressions must be the same. Selecting both Old and New for the Output Value Type field in the same notification is not allowed. Select only Old or only New.  
To resolve it, firstly do you actually need the old and new values? If you're only checking for a change this is automatically done by setting Yes on "Notify On Update". If you really, really need the old value however, you will need to manually change the stored procedure.

ALTER TRIGGER WMT_someJDBCNotification_asdfa ON dbo.MyTable
for update as if update (MyTableKey)
begin
INSERT INTO dbo.WMB_someJDBCNotification_asdfa (MyTableKey, SomeValue, SomeValueOld) 
SELECT inserted.MyTableKey, inserted.SomeValue, deleted.SomeValue
FROM inserted, deleted     WHERE inserted.MyTableKey = deleted.MyTableKey  END 

No comments:

Post a Comment