This discussion is archived
3 Replies Latest reply: Feb 28, 2013 2:04 PM by frank.hampshire RSS

Reference data in rule

989803 Newbie
Currently Being Moderated
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
    frank.hampshire Expert
    Currently Being Moderated
    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
    989803 Newbie
    Currently Being Moderated
    do you have a sample how to write event handler? i'm new to OPA so details or snippet codes are appreciate.
    Thanks
  • 3. Re: Reference data in rule
    frank.hampshire Expert
    Currently Being Moderated
    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.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points