Rule Base Engine

Folks,
In an enterprise system, the rules are variable in a year and they may change. The rules and data are somehow dynamic. The dynamic data exists in a RDBMS but about the rules, I want to put them in a Rule Base Engine. If they are hard coded, the system is not flexible again the changes. One solution is to use the rules behine an interface and after any changes, we can implement the related interface to get the goal. but I have a question! Is there any other way to abstract the rules in an engine or some thing like that ?
Any comment is welcome,
Amin Emami

You can implement a rules engine using the Interpreter Pattern in Java from scratch in a few days.
Checkout the GOF Design Patterns book for the pure pattern, or the Applied Java Patterns for a more practical example.
You can use this pattern to Interpret your rules file from a free form text document but then you need to implement a tokeniser & parser, which takes time. So a good alternative is to use XML.
You can use your projects existing DAO to access the database.

Similar Messages

  • Oracle ODBC Driver 10.02.00.04 sqora32.dll with /*+ RULE */ base hints

    Hi Everybody,
    I have a problem with SQL queries with /*+ RULE */ base hints being posted to an Oracle database. I have reason to believe that these queries are generated by the Oracle ODBC Driver itself. Although I don't have a performance problem per se, I need to reduce these hints to a minimum so we can fine-tune the database as a whole.
    * The views that are hit are always the same: All_Objects, All_Arguments, All_Synonyms,
    * We are using Oracle ODBC driver 10.02.00.04 for Windows, the database server is a RS6000 with AIX and Oracle 10g,
    * Aside Oracle Development tools, there are no applications, reports or similar gadgets that query the tables described above.
    I would really appreciate any help about this issue.
    Here is an example of the type of queries that I'm writing about:
    SELECT /*+ RULE */ '', b.owner, decode (b.object_type, 'PACKAGE', CONCAT( CONCAT (b.object_name, '.'), a.object_name), b.object_name), NULL, NULL, NULL, NULL, decode (b.object_type, 'PACKAGE', decode(a.position, 0, 2, 1, 1, 0), decode(b.object_type, 'PROCEDURE', 1, 'FUNCTION', 2, 0))
    FROM ALL_ARGUMENTS a, ALL_OBJECTS b
    WHERE ( b.object_type = 'PROCEDURE' OR b.object_type = 'FUNCTION' ) AND b.object_id = a.object_id AND (a.sequence=1 OR a.sequence=0) AND b.OBJECT_NAME = 'MYTABLE' AND b.OWNER = 'MYSCHEMA' UNION
    SELECT /*+ RULE */ '', b.owner,b.object_name,NULL, NULL, NULL, NULL,decode(b.object_type, 'PROCEDURE', 1, 'FUNCTION', 2, 0)
    FROM ALL_OBJECTS b
    WHERE (b.object_type = 'PROCEDURE' OR b.object_type = 'FUNCTION') AND b.OBJECT_NAME = 'MYTABLE' AND b.OWNER = 'MYSCHEMA' UNION
    SELECT /*+ RULE */ distinct '', a.owner,CONCAT(CONCAT (a.package_name, '.'), a.object_name),NULL, NULL, NULL, NULL,decode(a.position, 0, 2, 1, 1, 0)
    FROM ALL_ARGUMENTS a
    WHERE (a.sequence=1 OR a.sequence=0) AND a.OBJECT_NAME = 'MYTABLE' AND a.OWNER = 'MYSCHEMA' ORDER BY 2,3
    Best Regards,
    Manuel
    Edited by: user10165637 on Jul 28, 2009 1:29 PM

    Hi Greg,
    Thank you for your answer. One of the things that we did when we migrated to Oracle 10g was to ensure that the "Disable Rule Base Hints" flag, located in the "Work-arounds" tab in the ODBC DSN window is checked. We previously refreshed all Microsoft's Access databases to use this new DSN connection. Still, the hints are there.
    However... we may have been able to link these calls to these Oracle System Catalog views, with a custom application that launces Crystal Reports.
    Although we all know that Crystal Reports also caches ODBC DSN configuration settings, I must say that these same Crystal Reports do not generate hints when called from their InfoView server.
    We will proceed to modify the custom application, overridding the dissable rule-base hint work-around with the string "DRH=T" on the connection string. Next week we will know if this works.
    Best Regards,
    Manuel

  • Partitioning on Oracle 8.0.6 (rule base vs. cost base)

    At my current engagement, we are using Oracle Financials 11.0.3 on Oracle 8.0.5 which uses rule-based optimizer. However, it is been planned to upgrade the database from Oracle 8.0.5 to Oracle 8.0.6 as well as implement Oracle partitioning. With this in mind, we are concerned about possible performance issues that the implementation of partitioning may cause since RBO does not recognize it.
    We agree that the RBO will see a non-partitioned table the same as a partitioned. In this scenario where you gain the most is with backup/recoverability and general maintenance of the partitioned table.
    Nevertheless, we have a few questions:
    When implementing partitions, will the optimizer choose to go with Cost base vs. Rule base for these partitioned tables?
    Is it possible that the optimizer might get confused with this?
    If this change form RBO to CBO does occur, the application could potential perform poorly because of the way it has been written.
    Please provide any feedback.
    thanks in advance.

    If the CBO is invoked when accessing these tables, you may run into problems.
    - You'll have to analyze your tables & ensure that the statistics are kept up to date.
    - It's possible that any SQL statements which invoke the CBO rather than the RBO will have different performance characteristics. The SYSTEM data dictionary tables, for example, must use the RBO or their performance suffers dramatically. Most of the time, the CBO beats the RBO, but applications which have been heavily tuned with the RBO may have problems with the CBO.
    - Check your init.ora to see what optimizer mode you're in. If you're set to CHOOSE, the CBO will be invoked whenever statistics are available on the table(s) involved. If you choose RULE, you'll only invoke the CBO when the RBO encounters situations it doesn't have rules for.
    Justin

  • Can we access two different Siebel BO in Same OPA Rule Base

    Hi all,
    can we access two different BO's from same rule base.
    what i means is,can we pass siebel data to OPA Rule Base from two different BO's .
    Thank you for your help in advance.

    There are two approaches to do this and they both involve making some small changes on the Siebel side.
    You can create an Integration Object which contains all the business components that you want to send to OPA if you are using an Integration Object mapping.
    If you would prefer to use a Business Object mapping then you will have to create a new Business Object which combines the BCs of all the Business Objects that you want to send to OPA.
    As you can see, although one approach involves Integration Objects and one involves Business Objects they both work by creating a single object which is an amalgamation of the information that you want to send to OPA.
    Cheers
    Frank

  • Rule based engine

    I know that this is not a strictly related xml matter.
    I would like to know if anyone can help me in finding a business rule based engine to be used inside a campaign management application

    You raise a very important and interesting question regarding whether there is any framework for narrowing down the domain of a Business Process Expert.
    There are many frameworks out there:
    http://www.bpmg.org/8omega.php
    http://www.prosci.com/tutorial-design-mod1.htm
    http://www.intel.com/technology/itj/2004/volume08issue04/art11_collaboration/p01_abstract.htm
    From my experience, it is beneficial to focus on a critical "life support" process for the corporation.  Many times this can be started at the top level COO for instance, asking what is the # 1 thing which causes issues with customers, collections, services, etc..  One such item is "contract to cash" and specific sub-components of this process such as "unbilled hours" which if corrected prior to billing issuance will result in more accurate Invoices, and collections. An improvement of this nature shortens the cycle time of billing to collection, or hour entry to billing calculation, and with improved accuracy increases cash flow and lowers cost per transaction.
    What you are suggesting in terms of Media expert, etc.. is more associated with Roles which are aligned with Solution Scenarios within SAP.  Business Processes may span many roles, and are critical to the application being developed.
    I believe this is the purpose of BPM, but would welcome any further comments from colleagues regarding framework.
    Please take a look at the following BLOG as well as Lakshmikanth does a very good job explaning the landscape:
    /people/lakshmikanth.adiraju/blog/2006/09/19/soa-bpm-business-applications-netweaver-happy-customer
    Message was edited by: Fermin Iduate

  • Rule base issue

    Hi there,
    I've been building a rule base and when I test the following rules and select "Aggregate Format" as the preferred family of format, it concludes that the product does not meet the preference requirements for Standard, Horizontal, or Linear formats since the preferred family of format is Aggregate. Clearly, it should meet the preference requirements but there must be an issue with my rules. Any ideas on how to solve this issue? what tests to run?
    the product meets the preference requirements for Standard, Horizontal, or Linear formats if
        (1) the product’s first choice is the Standard, Horizontal, and Linear formats or
            (2) the manufacturer's product = “able to use multiple format styles” and
            (2) the preferred family of format = “Standard, Horizontal or Linear”
        (1) the product’s first choice is the Aggregate Format – Different Kinds of Foods and does not meet the requirements
           (2) the manufacturer's product = “able to use multiple format styles” and
           (2) the preferred family of format = “Aggregate Format” and
    (2)the most suitable NFT format figure is not Figure 10.1 and
    (2)the most suitable NFT format figure is not Figure 10.2 and
    (2)the most suitable NFT format figure is not Figure 10.3 and
    (2)the most suitable NFT format figure is not Figure 10.4 and
    (2)the most suitable NFT format figure is not Figure 10.5 and
    (2)the most suitable NFT format figure is not Figure 10.6 and
    (2)the most suitable NFT format figure is not Figure 11.1 and
    (2)the most suitable NFT format figure is not Figure 11.2 and
    (2)the most suitable NFT format figure is not Figure 11.3 and
    (2)the most suitable NFT format figure is not Figure 11.4 and
    (2)the most suitable NFT format figure is not Figure 11.5 and
    (2)the most suitable NFT format figure is not Figure 11.6

    Since the rule contains both AND and OR clauses, OPA needs to know how they are combined.
    By default, there are the grouping operators ALL (or BOTH) to group premises joined by AND, and ANY (or EITHER), to group premises joined by OR.
    However, it is also possible to replace the grouping attributes with new attributes. This seems to be what has been misleading you.
    When applying grouping operators to your rule, you would get:
    the product meets the preference requirements for Standard, Horizontal, or Linear formats if
        (1) the product’s first choice is the Standard, Horizontal, and Linear formats or
            all
            (2) the manufacturer's product = “able to use multiple format styles” and
            (2) the preferred family of format = “Standard, Horizontal or Linear”
        (1) the product’s first choice is the Aggregate Format – Different Kinds of Foods and does not meet the requirements
            all
            (2)the manufacturer's product = “able to use multiple format styles” and
            (2)the preferred family of format = “Aggregate Format” and
    (2)the most suitable NFT format figure is not Figure 10.1 and
    (2)the most suitable NFT format figure is not Figure 10.2 and
    (2)the most suitable NFT format figure is not Figure 10.3 and
    (2)the most suitable NFT format figure is not Figure 10.4 and
    (2)the most suitable NFT format figure is not Figure 10.5 and
    (2)the most suitable NFT format figure is not Figure 10.6 and
    (2)the most suitable NFT format figure is not Figure 11.1 and
    (2)the most suitable NFT format figure is not Figure 11.2 and
    (2)the most suitable NFT format figure is not Figure 11.3 and
    (2)the most suitable NFT format figure is not Figure 11.4 and
    (2)the most suitable NFT format figure is not Figure 11.5 and
    (2)the most suitable NFT format figure is not Figure 11.6
    but since you have omitted the grouping operators, OPA would have interpreted the level (1) clauses as intermediate attributes. This could be misleading.
    Try to split the rule in multiple rules. This is likely to help you debug this rule.

  • Error compiling Rule base in 10.4.4

    Hi ,
    I am facing an error while compiling (using Build and Debug option) OPA rule base in OPM 10.4.4 version.
    The rule base was originally built in 10.4.2 and it gets successfully complied in 10.4.2 version.
    Error code: OPA - E00088 ( Unknown attribute)
    Could you please help me with this.
    Let me know if you need additional details.
    Thank you
    Chetan Jain

    Where are you seeing "Error code: OPA - E00088 ( Unknown attribute)"? Is it the 'Error List' in OPM? Often the errors there are clickable and will take you to what's causing the error, e.g. when there's an interview screen causing an error, clicking the error in the Error List usually opens the problem interview screen (in your case it sounds like an attribute not a screen though).
    The other thing I'd try is narrowing down the cause of the problem. For example, is there a particular rule document which won't compile?
    Cheers,
    Jasmine

  • Converting to ASA rules base

    I am just about to start on a project where we are moving from Old Cyberguard firewalls to ASA 5520 firewalls, I was wondering if anyone has a rule base converstion tool that would be able to do a lot of the basic work? And so of the NAT conversions?

    Hello Glenn
    To be honest with you I do not think there is a convertion tool from that firewall to our ASA.
    I would recommend to read and analize the configuration guides for the ASA or if you have any question related to the ASA setup let us know.
    We will be more than glad to help!!
    Regards,
    Do rate all the helpful posts
    Julio

  • Rule base optimizer in 9i and 10g

    Hi
    All,
    I just upgraded databses from oracle 9.2.0.6 to 10.2.0.3.
    I think as i know oracle 10g no more support rule based optimzer ( correct me if i am wrong)
    but some of the script have rule optimizer hint over there. If i keep as it is will it give me error or I need to change something.
    Thanks,
    Vishal

    what should i do? should i keep as it is?
    RBO is obsoleted in 10g , but hint RULE still work i.e it will not error out.
    Check execution plan with and without hint , if execution plan look better without hint,
    go for it. Keeping as it is , will not harm , but data increase/change drastically in underlying table of query , in that case CBO might give you better execution plan then with rule hint.

  • Rule Bases Check and CTP Settings

    Dear Experts,
       I want to run Rule based ATP and CTP together in the system. As far as i know the system of each of these are typicAl and i am not able to run both together. Please guide me for any settings to be maintained to run the same.
    Thanks

    Prashant,
    First, make sure RBA works, and CTP works, independently.  I won't go into setup for each of these, which are pretty extensive all on their own.
    I don't know what you are using for rules, so I will give you some general ideas.  You will have to decide how you want it to work.  For RBA & CTP, it usually makes most sense to run RBA immediately, and when none of the RBA proposals give a solution, then you execute production (CTP).  If you were to invoke production first, you will typically find a solution immediately and never get to the RBA step.  The trick is to have RBA call production on the last step of the last rule.
    So, in IMG>APO>GATP>General Settings>Maintain Check instructions do product check first (well, unless you are doing allocation, but that is another story).  Tick Activate RBA, start immediately.  This gets RBA running first.  It will do all the product checks you have configured in your RBA.  Set the Production part as 'Availability check only, no production'.  A bit counter-intuitive sounding, thanks SAP!
    Logically, the final rule you determine (after failure of all previous rules) will be a location determination rule,  where the system decides where you are going to manufacture the parts. (you should already have determined product and version).  On the final location determination rule, you assign a location determination activity (which you defined in /SAPAPO/RBA04>Profiles and Parameters>Location determination activities).  Within the Location determination activity, you invoke production. Within the activity, you define Start Production as  'Availability check first, then production', on the assumption that you haven't checked this location yet for standard product check.
    This is one way to use both RBA and CTP.  There are probably others, but I have used this successfully.
    Rgds,
    DB49

  • Rule base optimezer

    Hello,
    Do you guys have any idea about this issue.
    I am wondering!....In our new server (10g on AIX) the Rule Based optimizer mode shows the cost.
    Is it possible..? Today only I found that one... few days back its not shown the cost.
    Actually... it is not suppose to show the cost when you use the Rule based optimizer. Am I correct?

    Hi,
    >>the Rule Based optimizer mode shows the cost.
    Where did you get this information from? I think that it wouldn't happen ... unless you actually have been using the cost-based optimization mode (CBO)
    SQL> alter session set optimizer_mode=RULE;
    Session altered.
    SQL> explain plan for select 1 from dual;
    Explained.
    SQL> set linesize 130
    SQL> set pagesize 0
    SQL> select * from table(dbms_xplan.display);
    Plan hash value: 1550022268
    | Id  | Operation        | Name | Rows  | Bytes | Cost  |
    |   0 | SELECT STATEMENT |      |       |       |       |
    |   1 |  FAST DUAL       |      |       |       |       |
    Note
       - rule based optimizer used (consider using cbo)
    12 rows selected.
    SQL> alter session set optimizer_mode=ALL_ROWS;
    Session altered.
    SQL> explain plan for select 1 from dual;
    Explained.
    SQL> select * from table(dbms_xplan.display);
    Plan hash value: 1550022268
    | Id  | Operation        | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT |      |     1 |       |     2 (0)| 00:00:01 |
    |   1 |  FAST DUAL       |      |     1 |       |     2 (0)| 00:00:01 |
    8 rows selected.Cheers
    Legatti

  • Batch processor design

    Hi my question is there a good resource to see how batch-processing design ( e.g. existing app, case-study...etc)
    So how we can implemented a rule-based implementation in set-logic?
    I work at this company that the main processing is batch-data-processing in nature.
    It receives some file feed, and than some business logic processing and then pass it to another company's program to do the fulfillment.
    When the main app is designed 8 years ago, the architect sees what kind of features it needs.
    It is implemented in oracle. It uses a rule base engine to do this processing row-by-row.
    It uses a set of dynamic-sql to implement every business rule. So if there are 10 rules, than every record will call a PL/SQL 10 times for that set of dynamic-sql
    It is also heavy triggers for business logic so there is some-kind of locking package got implemented so when the batch processing is done. It will not got dead-locked.
    So when I have the interview my boss says it is a OLTP machine and in a way it is true as it is designed work in a way row-by-row like OLTP even it is batch-processing in nature
    My other co-worker and I both agree that it is a very sub-optimal design as it is not set-based operation even by nature it is.
    I can see some good-things about have mulitiple-sql is similar to the object-design of extending. If one SQL-RULE is good than to build on top of that, we can just insert new dynamic-sql into the table and do the processing. The draw back is the performance is pretty sub-optimal.
    Would you all share some experience in this topic?

    >
    Hi my question is there a good resource to see how batch-processing design ( e.g. existing app, case-study...etc)
    >
    Not that I am aware of.
    >
    So how we can implemented a rule-based implementation in set-logic?
    >
    Too general a question to be able to provide much of an answer. Especially given that you may have a very specialized custom implementation of the process being used now.
    Custom implementations usually present several issues for conversion projects (such as replacement with new technologies or functionalities)
    1. The original author/developer is no longer availlable.
    2. The system lacks sufficient documentation.
    3. The business rules being implemented are either not documented at all, poorly documented or the documentation is out of date and no longer matches the code that is actually being used.
    Rule #1 is "if it ain't broke don't fix it'. If you so much at even touch the system you run the risk of breaking it completely, introducing new errors or making things worse.
    {quote}
    The draw back is the performance is pretty sub-optimal.
    {quote}
    So what? See rule #1. Does the current system meet the required service level agreements? Is there functionality needed that isn't currently available?
    1. Determine if change is actually needed - In other words, what is the business reason for even thinking about changing things?
    2. Determine the scope of the change that is needed - are we talking about minor changes or mods? Or major new modules and functionality? Are the current business rules getting the job done and we only need a couple more?
    3. Determine if the required changes can be implemented by modifying the current system. You said 'It receives some file feed, and than some business logic processing and then pass it to another company's program to do the fulfillment'. So if you now need to add another feed for another company and you need pretty much what you have now why switch technologies? Well maybe the volume is 10 times what you have now and the current system can't handle it.
    This would be a good case for doing the new feed as a separate project and use new functionality to do it. You can run it in parallel to get the kinks worked out and, ultimately, convert the existing feed to the new code later.
    4. Determine the level of functionality that the business rules apply to. Data cleansing is often primarily done at the row level so this type of processing is very amenable to 'set' processing. Apply cleansing rule #1 to the entire table, then rule #2 and so on. A serialized 'batch' process rather than apply 10 rules to each row one at a time. Checks for dirty data (invalid nulls, data too long for column, invalid datatypes, etc) can be done in bulk.
    Other functionality requires data from multiple tables: parent/child validation, lookup table validation, lookup code conversions from source values to target values.
    In short you need to have a clear business objective and goals.
    A. Project justification
    B. Functional Requirements document
    C. Technical Requirements document
    B. And then define the project

  • How to access the user-id property which is available in VM engine in the rulebase

    Hi Experts,
    The interview engine exposes various application constants and one of them is the user-id which gives the user-id of the current interview session. This is basically taken from the url for the web-determinations. We would want to use this property in the rule bases to take the user-id of the current interview session. Is there any function available in the Rulebase which will return this value? Or is there any other way to get this value in the rulebase?
    Thanks,
    KK

    The demo app is only available when at apple stores it's not actually a downloadable app.

  • PI Alert configuration rule definition

    Hello,
    On my PI production system I want to cretae a rule base on the adapter type (RWB  - Alert configuration),
    unfortunately i can olly choose between * and MessagingSystem. On my test and dev systems I have all the adapters in the "combo box" : *, AS2, CIDX, RFC, OFT_X31, SOAP ....
    Does someone Know what I have to do to see all the adapters type ?
    Thank you
    Fabrice

    Do you have any other interfaces running in production?
    if this is the first then i guess Post installation steps might have some problem like registration of Adapter Engine in SLD...
    Check with basis...
    HTH
    Rajesh

  • Rule Based System

    Hi all,
    I am currently working on a project which required to Implemented 500-600 rules in the System. Some of them are global Rules and some are just module level rules.
    Is there any pattern exist for Rule Based System?
    Thanks in Advance
    Rashmikant

    Just 1 pattern?
    The short answer: No.
    The longer (though still short answer):
    A rules engine is not the easiest thing to implement, just 2 or 3 classes don't hack it if you're working with a dynamic rule base that is steered based on input/ouput and states.
    There are rules engines for sale and there also a few opensource, look on the internet, use your best best friend.

Maybe you are looking for

  • My motor receives data via a serial connection, but it won't move. What am I doing wrong?

    Hello everyone, as the title says, I am trying to use a motor called "MP285" by Sutter Instruments via LabView. The control unit of this motor only has a RS232-output, but I use a Serial-to-Usb-Adapter to connect the device to the PC. My problem is t

  • Cannot run zpool (zfs feature) command in Solaris 10 6/06

    Hi, I couldnt run ZPOOL command in Solaris 10 6/06. It said command not found. May I know what should I do? My Solaris 10 version provide Solaris zoning features, but no ZFS feature provided. How?

  • Sync New Music Libr

    Hi, I created a new music library located in a directory in a partitition that is not on the system disk (for space opportunity), when i tried to sync with my Zen Micro the only Music Library in the menu is the default one. Why I can't see the new on

  • How to get system date through forms 6i?

    Sir, I am trying to get system date in forms but i am getting some problem with it. My code is like this: I am using 6i forms with 10g database. SELECT SYSDATE INTO :VAR FROM DUAL; At the compilation it is giving error like ORA-00600 internal error a

  • One profile runs very slowly

    I have a 2008 iMac running Lion.  There are 2 active profiles on the computer.  One of them runs extremely slowly and the other is fine. I have moved all of the large files (iPhoto and iTunes) to an external drive.  There is plenty of hard disk space