This discussion is archived
3 Replies Latest reply: Jun 28, 2006 9:48 AM by 442199 RSS

Questions about Expression Filters

322074 Newbie
Currently Being Moderated
Hi.

I've read several times the excellent article "Filter Data Before you Get it" and am seriously considering as number one option for implementing an "Event and Notification Module" for an application. The flexibility and advantages addressed at the end of the article are good enough reason. However i have the following questions:

- Can I add or delete and attribute to an existing attribute set?. The idea would be to provide users with the ability to add or delete attributes of interest through the use of some metadata. If not, what would be the implications of recreating the attributtes, since there are several objects related to an attribute set(types, triggers, etc.).

- Can i evaluate expressions on a one by one basis?. The example showed always evaluate all expressions at the same time. My idea here, would be give the users the possibility of specifying the frequency of evaluating a particular expression, since all might not be equally important.

- Can i use the result of a pl/sql function and use it in an expression set. Again, sometimes things might be more complicated than evaluating columms of a table on a expression.

Thanks in advance .... Regards, Luis ...!
  • 1. Re: Questions about Expression Filters
    442199 Explorer
    Currently Being Moderated
    Luis,

    Please find my responses below.
    - Can I add or delete and attribute to an existing attribute set?. The idea would be to provide users with the ability to add or delete attributes of interest through the use of some metadata. If not, what would be the implications of recreating the attributes, since there are several objects related to an attribute set(types, triggers, etc.).
    At this time, an attribute set associated with an expression column cannot be edited (adding new attributes or deleting some attributes). The index and the trigger created to maintain the expression column are closely tied with the attribute set. So, you will have to drop the Expression Filter index and unassign the attribute set in order to recreate the attributes.
    - Can i evaluate expressions on a one by one basis?. The example showed always evaluate all expressions at the same time. My idea here, would be give the users the possibility of specifying the frequency of evaluating a particular expression, since all might not be equally important.
    Yes, this can be done by specifying additional predicates in the query with EVALUATE operator. For example, the following query only evaluates the expression associated with a specific customer.

    SELECT * FROM Customers
    WHERE CustId = 1234 and
    EVALUATE (Interest, :data) = 1

    But, what is the logic behind "all might not be equally important" ? Often, rules are associated with a priority and the matching rules are ordered based on their priority. In this case, all the expressions are evaluated. But the application ignores the rules with low priority when there a matching rule with high priority.
    - Can i use the result of a pl/sql function and use it in an expression set. Again, sometimes things might be more complicated than evaluating columns of a table on a expression.
    Yes, you can use user-defined functions in the stored expressions. See Example 10.3 in the Application Developer's Guide - Rules Manager and Expression Filter (10g Release 2) for a sample.

    If you have 10g Release 2, you may also want to look at the Rules Manager feature. This feature allows declarative specification of complex Event-Condition-Action rules in the database and it is built on Expression Filter feature. With the Rules Manager, the ORDERING and CONSUMPTION event management policies can be used to control the execution of specific rules (may relate to your second question).

    Please let us know if you have additional questions.

    Thanks,
    -Aravind.
  • 2. Re: Questions about Expression Filters
    322074 Newbie
    Currently Being Moderated
    Excellent ...! Satisfied .... However, on final question:

    - Is Rule Manager and Expression Filters available with Express Edition?

    Regards, Luis ...!
  • 3. Re: Questions about Expression Filters
    442199 Explorer
    Currently Being Moderated
    Luis,

    No, the Rules Manager and Expression Filter features are not available Express edition.

    Regards,
    -Aravind.