3 Replies Latest reply on Feb 28, 2013 10:04 PM by Frank.Hampshire-Oracle

    Reference data in rule

      Hi - I know the Rulebase Listener can read data from a CSV file to populate reference data for the rules. How about database table, can we pre-load reference data from database table instead? Anyone has any idea? Thanks
        • 1. Re: Reference data in rule
          You would have to write something custom here, but its possible to read from a database table.

          The best way would be to implement an event handler that fires when an session is created. Then its just a matter of writing the code to access the database, load the reference data and populate it in the session.
          • 2. Re: Reference data in rule
            do you have a sample how to write event handler? i'm new to OPA so details or snippet codes are appreciate.
            • 3. Re: Reference data in rule
              There is a perfect example for you.

              Have a look at "Example: Create a Rulebase Listener to preload reference data" in the "Oracle Policy Automation Developer's Guide" (http://docs.oracle.com/html/E38272_01/toc.htm).

              To get the source code for the examples you will have to download the OPA Runtime from "Oracle Software Delivery Cloud" (https://edelivery.oracle.com)

              Product Pack: Oracle Polcy Automation
              Platform: Microsoft Windows (32 bit)

              "Oracle Policy Automation for Java (v10.4.2) Media Pack", or
              "Oracle Policy Automation for .NET (v10.4.2) Media Pack for Microsoft Windows"

              The examples should be inside the media pack.