It's been a while since my last post. First, I want to thank you for your previous help in all my posts.
I have a new problem now:
1.- We are developing a new application and we have some decision points where we want to implement the Rules Manager approach.
2.- As I successfully did it in 10g, I took the scripts I have to generate all I need in order to start configuring the rules.
3.- Everything compile ok in 11g, but when I start testing the app with a simple rule, I saw that it was throwing an exception "User defined exception: Error when formula" at the moment I call the DBMS_RLMGR.ADD_EVENT function. I'm using this function and the results view because I want to implement the action in other tier.
4.- I changed the line calling the ADD_EVENT function, and I used the PROCESS_RULES. I also added a DBMS_OUTPUT.PUT_LINE to the call_back function. The error is not throwed in this way, and the DBMS_OUTPUT.PUT_LINE is writing the message to console, proving the rule is evaluated successfully and the call_back is executed.
I need to use the ADD_EVENT method because I need to implement the action in the multiple tier approach.
I was not properly handling exceptions. After implementing exception hanlding I found the error was that the function using rules evaluation was doing some DML (inside the rules engine), and because I'm using this function in a sql sentence (SELECT * FROM TABLE(MY_RULES_FUNCTION)) I need to use PRAGMA AUTONOMUS_TRANSACCION.