Rules Engine Design Questions

Rules Engine Questions:
1. Rules are processed in the order they are created in dictionary file if the priorities are the same. Is it true?
for eg: if the order you see on the screen in rules dictionary window is:
     rule1 --> set var1 = 10
     rule2 --> set var1 = 20
     rule3 --> set var1 = 30
     rule4 --> set var1 = 40
     rule5 --> set var1 = 50
     result would be 50
2. I want to use the rules engine for validations.
Eg: Can we check for the requiredness of xsd validations using rules engine? or this should be done else where?
eg:
If my xml is below, then can I use rules engine to check
<Firstname>
<LastName> and
<Address1>
for emptyness and pass back saying that the validation failed because <LastName> and <Address1> are empty.
<Customer>
     <Firstname>aaa<Firstname>
     <LastName> <LastName>
     <Email>ccc<Email>
     <Address>
          <Address1> </Address>
     </Address>
I have a response xml:
     <ValidationResult>
          <Result>Failed<Result>
          <Message>all required fields are not present<Message>
     <ValidationResult>
So my rules should be
     check for <Firstname>
          Assert new ValidationResult ('success', ..)
     check for <LastName>
          Assert new ValidationResult ('failed', ..)
     check for <Email>
          Assert new ValidationResult ('success', ..)
     check for <Address1>
          Assert new ValidationResult ('failed', ..)     
and since last rule is failed, will rules engine send back failed? or what is the strategy for order of rules that get fired?
For the above scenario what would be the best design solution?

This is a complicated question but I will try my best to give you the best solution:
#In answer to your question regarding the order that rules fire unless you use priority you cannot garantee the order that the rules fire. The Oracle rules engine uses the Rete algorithm to establish the order in which to fire the rules and this is generally based upon the data passed into the rules. Therefore if the result of rule 4 may effect rule 1 then the rules engine will run rule 4 before rule 1.
The scenario you have provided is slightly different however and I woudl suggest the following.
Instead of passing out a single result from your ruleset pass our an array of results meaning you could effectively run all your rules and pass out all rules that failed. Be wary of checking for nulls however because if nothing is passed into a field then the rules engine will not create that element in the rules fact and the rule will never fire.
To create a array of results you will need to create a function which creates the result fact for you and then addes each result in turn.
If you woudl like more information let me know and I will help out as much as I can.

Similar Messages

  • Rules Engine Question

    Hello All,
    I am trying to put together a very simple service that uses the Oracle Rules engine, but I can't seem to get anything to happen.
    I have set up a class called ScheduleValidity which has three attributes, hour, message, and isValid. The idea is that you pass an instance of this into the rule engine as a fact with the hour set, and then have the rules engine set isValid and the message. When I call the engine however, the object that I am asserting is not being changed. I am sure that I am doing something obviously incorrect, but I can't figure it out.
    The RL for the two rules that I have are:
    rule checkThatTimeisLateEnough
    priority = 0;
    if
    fact mil.navy.seawarrior.scheduler.ScheduleValidity v0_ScheduleValidity && (
    (v0_ScheduleValidity.hour < 9 )))
    v0_ScheduleValidity.isValid = false ;
    v0_ScheduleValidity.message = "The time is too early" ;
    v0_ScheduleValidity.setIsValid(false );
    v0_ScheduleValidity.setMessage("Time is too early" );
    assert(v0_ScheduleValidity);
    } //end rule checkThatTimeisLateEnough;
    rule timeIsOk
    priority = 0;
    if
    fact mil.navy.seawarrior.scheduler.ScheduleValidity v0_ScheduleValidity && (
    (v0_ScheduleValidity.hour >= 9 )))
    v0_ScheduleValidity.isValid = true ;
    v0_ScheduleValidity.message = "This time is OK" ;
    v0_ScheduleValidity.setIsValid(true );
    v0_ScheduleValidity.setMessage("this time is OK" );
    } //end rule timeIsOk;
    The Web Services code that I am using is:
    RuleRepository repository = RepositoryManager.getDefaultRepository("D:\\OC4J10.1.3\\j2ee\\home\\SchedulerRulesTest\\");
    String rules = (repository.loadDictionary("SchedulerRulesTest",null)).ruleSetRL("SchedulerRulesTestRS"); //.getRuleSet("SchedulerRulesTestRS").generateRL(null);
    String dm = (repository.loadDictionary("SchedulerRulesTest",null)).dataModelRL();
    RuleSession rs = new RuleSession();
    rs.executeRuleset(rules);
    rs.executeRuleset(dm);
    Calendar cal = new GregorianCalendar();
    cal.setTime(startDateTime);
    ScheduleValidity sv = new ScheduleValidity();
    sv.setHour(cal.get(Calendar.HOUR_OF_DAY));
    sv.setMessage("Default message");
    System.out.println("hour:" + sv.getHour());
    rs.callFunctionWithArgument("assert",sv);
    rs.callFunction("run");
    OperationStatus returnOs = new OperationStatus();
    returnOs.setMessage(sv.getMessage());
    returnOs.setSuccess(sv.isIsValid());
    Unfortunately, the sv object's attributes are never being set. Can anyone give me an idea what I am going incorrectly?
    Thanks

    It isn't required that the ruleset be called main. There are two ways to get your ruleset (as originally named) to be evaluated. The pushRuleset function can be used to push the ruleset onto the ruleset stack or the run function may be invoked with a ruleset name argument. In code either:
    rs.callFunctionWithArgument("pushRuleset", "SchedulerRulesTestRS");
    rs.callFunction("run");
    or
    rs.callFunctionWithArgument("run", "SchedulerRulesTestRS");
    The first approach is documented in the "Oracle Business Rules Users Guide" in section 2.7.4. For some more info on the ruleset stack, see section 1.4.3 in the "Oracle Business Rules Language Reference".

  • Rules related to rule engine

    I have initiated to design rule engine.
    Please help me to know how should i design rules. Rules should be designed on the basis of 3 parameters : country,gender,time.
    Please help me with an example.
    Thanks & Regards
    Gaurav K

    Very interesting search ...
    Do you think we can't use google?
    I still see a question in your posts. Just adding a '?' doesn't makes your post a question anybody can answer.
    So please take your time and give us a full use case, your jdev version.
    Timo

  • Rules Engine Environment in MDM

    Hi Everyone,
    I am evaluating the capability of SAP MDM to see if there is any kind of rules engine delivered that can create a material master (SKU) number.  I am not trying to create material master records yet - just the material number !
    Background:
    Defned rules, coupled with reference data should be able to generated the list of SKUs.
    Example:
    Reference Data contained in 3 tables:
    Product Line: LN1, LN2
    Release: 2009
    Language: EN, JA, FR, DE
    SKU mask: AA-BB-CC
    AA = Product Line
    BB = Release
    CC = Language
    The rules would be to create combinations of all the reference data values and output a list of SKUs according to the SKU mask/format.  In other words, by implmenting rules, I should be able to generate  2x1x4 = 8 SKUs in total (2 values for product line, mulitplied by 1 value for Release, multiplied by 4 values for Language).
    Questions:
    I know I can implment rules on the ABAP workbench in R/3 to create material master numbers, and then later create actual material master records with reference to other materials all within R/3.  However, I would like to create and manage the material master directly in MDM.
    1) Is a rules engine like drools provided as part of MDM?
    2) Since MDM is based on the Netweaver and sits on the web apps server, is there an ABAP workbench provided in MDM from where I can create the rules and create z tables for the reference data.
    3) Do I need to create a separate web service in Netweaver Developer Studio to create these rules.
    Thanks in advance
    -Rajiv

    Hi Rajiv,
      In some scenarios Material master is imported to SAP MDM from R/3 and all the logic is performed in R/3 itself. For such cases You can use the standrad MDM Material Repository provided by SAP.
    <i>How do people create specific part numbers (material numbers / SKUs) in SAP MDM based upon some specific business logic?</i>
    Let us say the Part number is an depandant on another field say Product ID.
    In MDM Console you can specify the business logic in the Calculation field.
    Also i would like to add that in SAP MDM most of this business logic are mere mathematical fuctions (part no = 1.5 * product ID). There is no provision to call external methods (like RFCs in R/3).
    I suggest you to get the Standard MDM Materials Repository and play around the Calculated fields\ Auto ID Fields in MDM Console.
    Get back for help,
    Vijay

  • What is the recommended data type (decimal, float, or real) for Engineering design data?

    Hi,
    I'm creating a database to store engineering design data.  I've created the table with fields using decimal.  In my searches, decimal is recommended for financial applications since it stores an exact representation of the number.  My question
    is would float or real be more recommended for engineering applications as it involves calculations and also the user cannot tell the exact precision of the data such as how many decimal places to the right?
    Thanks.

    Affirmative, float and real are probably better for engineering applications.
    Discuss the issue with the engineers.
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Haley Rules Engine - HaleyAuthority with respect to Oracle E Business Suite

    I am currently exploring on Haley Rules Engine which is recently aquired by Oracle.
    As per my investingation, i came to know that HaleyAuthority ruleEngine is available as plugin from the recent release of Siebel CRM 8.0 installation and onwards.
    Here goes my questions
    1) is this haleyAuthority rule engine available as third party tool? If so, How to integrate with Oracle E- Business Suite.
    2) Like Siebel 8.0, Is this HaleyAuthority plugged in any latest version of our oracle E- Business Suite?
    Please let me know your understanding and information on Haley Rules Engine with respect to Oracle E-Business Suite.
    Thanks in Advance.

    Praveen ,
    May be late for you (but for others looking similar information)
    haleyAuthority is different from Haley Determination Services (now Oracle Policy Automation)
    OPA (Haley's Determination Services) are available as Web Service which you can invoke from E-Business Suite or Use Fusion Middleware (SOA Suite / BPEL) as layer between OPA and E-Business Suite
    For overview of Haley Office Rules or Oracle Policy Automation check
    http://onlineappsdba.com/index.php/2009/04/27/oracle-policy-automation-modeling-earlier-haley-office-rules-determination/

  • Business Rule Error: Fact not found in the rule engine working memory, rule

    I am trying to create a simple decision table with an input(ValidateInput) and a output(ValidateOutput). The input and output schemas have unbounded and nested elements(Parent-child relationship). When I create a condition(specific condition on input) and in the action I am asserting the output object. But when I run using EM it throws the following exception. It would be helpful if somebody could tell me what could be the problem. Please note when I set the output as ValidateInput object then it runs fine. Also it executes fine with ValidateOutput if it doesn't have unbounded(List) element inside it.
    Error Message: {http://xmlns.oracle.com/OracleRules10/OracleRules10_DecisionService_1}operationErroredFault
    Fault ID     rules:211
    Fault Time     Jun 18, 2011 10:45:13 AM
    Non Recoverable Business Fault :
    Fact not found in the rule engine working memory, rule session execution failed. The rule session 270013 failed because an instance of the fact com.example.customer.ValidateResponse could not be found in the working memory of the rule session. This is most likely a rule modeling error. The decision service interaction expects the fact instance to exist in the working memory of the rule session. Check the rule actions in rule designer and make sure that a fact of the expected type is being asserted. If the error persists, contact Oracle Support Services. 270013
    Edited by: reachsky on 18 Jun, 2011 9:57 AM

    It's working now..I had to use Global variable to declare child element of the output variable and use the same during action.

  • Business Rules Engines?

    Hi,
    I have experience with embedding "CLIPS" which is a C rules engine as a
    Forte Service Object which was easily wrappered using standard Forte
    wrapper strategy.
    Also, we have a sales rep in ATL who used to work @ ILOG and therefore
    competed with Nueron Data, and from various conversations with mutual Forte
    / Rules Engine customers I've learned it would be a complimentary integration.
    They all have some C-callable API and so a Forte Service Object would be a
    good client to the rules engine api due to our support for multi-threading
    when API is thread safe and additional option of replicating for load-bal
    when API isn't thread safe. The later concept is analogous to our use of
    DBSession object for interface with DBMS client api's.
    Be aware, the experiences I hear about with the mentioned rules engines is
    that there are not always business analysts truly capable of using the
    Rules development interfaces provided by the tools.
    So maybe the use of Forte Conductor's dynamic Process automation
    capabilities may also be a fit. If you want to discuss how, let me know.
    -jim
    Return-Path: <[email protected]>
    X-Sender:
    Date: Fri, 23 Jan 1998 13:19:03 -0800
    To: [email protected]
    From: Vic Brown <[email protected]>
    Subject: Business Rules Engines?
    Sender: [email protected]
    Reply-To: Vic Brown <[email protected]>
    Has anyone on this list integrated a COTS business rules engine,
    or components, into a Forte application? Specific products
    of interest would be those from Neuron Data, ILOG, USoft
    or, possibly, Vision Software.
    If so, comments? Type of application? War stories?
    Thanks.
    Victor Brown
    TRW Data Services
    Oakland, CA
    Phone: 510.645.3240
    FAX: 510.465.4811Jim Rice mailto:[email protected]
    Forte Software, Inc. http://www.forte.com
    South Eastern Tech Sales Mgr.
    301-721-1910 Corp: 510-869-3400 x2316

    The following Business Rule Solution uses POJO's and XML and meets the following criteria!
    Business Rule Solutions should be:
    Non-Industry Specific
    Appropriate and Affordable for any size business
    Enterprise-class solution (scalable, optimized, extensible)
    Remember: All businesses have business rules, and all businesses need an efficient way of managing and executing these business rules.
    What Business Rule Solutions should provide:
    Input Validation & Data Integrity
    Integration & Data Transformation
    Analytics
    Interpret clients Business Policies & Behaviors and clients run-time
    data and execute the appropriate process related workflow efficiently.
    The Return on Investment:
    ROI continues every day, week, month and year into the future!
    Simplify all program development through component reuse.
    Lowers software maintenance by a magnitude.
    Manages & Protects a company assets (Business Rules) in one
    repository.
    Provide Business Agility and Competitive Advantage!
    Further, I believe Business Rule Solutions are a higher level of abstraction of services that all other applications should use to implement the Model-View-Controller design pattern!
    Use the Contact Us! page for quicker responses. http://www.agilebusinessrulecomponents.com

  • Fact not found in the rule engine working memory,rule session executionfail

    Hi
    I'm getting this error on my BRE, the instance Id shows 'faulted' but other consectuctive web services are 'completed' successfully.
    please advise how to fix it.
    Error Message: {http://xmlns.oracle.com/zz_ValidationRules/zz_ValidationRules_DecisionService_1}operationErroredFault
    Fault ID rules:417
    Fault Time Aug 25, 2011 4:59:39 PM
    Non Recoverable Business Fault :
    Fact not found in the rule engine working memory, rule session execution failed. The rule session 130287 failed because an instance of the fact Response could not be found in the working memory of the rule session. This is most likely a rule modeling error. The decision service interaction expects the fact instance to exist in the working memory of the rule session. Check the rule actions in rule designer and make sure that a fact of the expected type is being asserted. If the error persists, contact Oracle Support Services. 130287
    thanks,
    Umesh
    Edited by: user13664410 on Aug 25, 2011 2:19 PM

    When i had this issue i overcame it by opening the Rule Editor->Deleting all existing facts that are imported->Close JDeveloper -> Delete the contents of .rulesdesigner directory in your workspace -> Restart JDeveloper -> Reopen Rule designer and re import all facts.
    Also make sure that all the schemas that are used for Facts are valid ones.

  • Fact Not Found in Rule engine working memory

    I am using 11g, I have built a Business Rule, using RL facts, XML facts, Bucketsets and multiple Rulesets which internally has decision table and If-then rules. After deploying the same, Business rules runs successfully for some conditions and faults for some condition. The fault error for those failed conditions displays the following error:
    Fact not found in the rule engine working memory, rule session execution failed. The rule session bpel:<somenumber> failed because an instance of the fact <factname> could not be found in the working memory of the rule session. This is most likely a rule modeling error. The decision service interaction expects the fact instance to exist in the working memory of the rule session. Check the rule actions in rule designer and make sure that a fact of the expected type is being asserted. Contact oracle support if error is not fixable.
    It is wierd becuase if it is a fault with respect to working memory then I would imagine it has to fail for all the conditions as all the conditions assert the same Object. Has anyone faced the same issue or am I doing something wrong here.
    Venkat

    Ervan
    I deleted the RL facts that I had created and asserted the result to the Business Object, this seems to have taken care of this issue, but I am still not sure what was wrong in the way I build the rules using RL.Hope this helps.
    Venkat

  • How to pass any type of objects into Portal's rules engine?

    Is that possible to pass any type of objects into Portal's rules engine? Or BEA's Portal service rules engine can only allow to pass a limited number of objects?
    Are there any information about BEA's rules engine? and Can we use its rules engine without using its Portal service?
    Thank you.

    I worked on BEA rules engine 4 months back. I'm sure you can pass any JAVA object to it's working meomory. I am giving my sample rules here, hope it will be helpful for you.
    I just replace pcakage name, other than that everything is from wroking project. Open in xml spy, it should be clear from the desc. If you have any questions post back.
    <cr:rule-set is-complete="true" xmlns="http://www.bea.com/servers/p13n/xsd/expression/expressions/2.1.1" xmlns:cr="http://www.bea.com/servers/p13n/xsd/rules/core/2.1.1" xmlns:literal="http://www.bea.com/servers/p13n/xsd/expression/literal/1.0.1" xmlns:string="http://www.bea.com/servers/p13n/xsd/expression/string/1.0.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/servers/p13n/xsd/rules/core/2.1.1 rules-core-2_1_1.xsd">
         <cr:rule is-complete="true">
              <cr:name>TaxForm1040</cr:name>
              <cr:description>If salary is 70,000 then this rule makes 1040 as required form</cr:description>
              <cr:conditions>
                   <multi-and>
                        <multi-and>
                             <equal-to>
    <instance-method>
    <variable>
    <name>SalaryField</name>
    <type-alias>com.blah.field.REInputObject</type-alias>
    </variable>
    <name>getKey</name>
    </instance-method>
    <literal:string>Salary</literal:string>
    </equal-to>
    <equal-to>
    <instance-method>
    <variable>
    <name>SalaryField</name>
    <type-alias>com.blah.field.REInputObject</type-alias>
    </variable>
    <name>getValue</name>
    </instance-method>
    <literal:integer>70000</literal:integer>
    </equal-to>
                        </multi-and>
                   </multi-and>
              </cr:conditions>
              <cr:actions>
                   <new-instance>
                        <type-alias>com.blah.field.RequiredField</type-alias>
                        <arguments>
                             <literal:string>1040</literal:string>
                        </arguments>
                   </new-instance>
              </cr:actions>
         </cr:rule>
    </cr:rule-set>

  • To invoke bussiness rules engine from ADF

    hi all,
    To invoke the business rule engine running on the SOA server, from the application module. can you please any one help me in this.

    Murali,
    If the business rules are deployed to the SOA Suite as service-enabled rules, they are just web service calls, correct? You can create a web service proxy class in JDeveloper and then just invoke that class from your AM's java code. There's nothing special with respect to an AM in this case, so if you have detailed questions - probably best to ask in the SOA Suite forum - but no need to complicate the issue by bringing an AM into your question - you just want to invoke a business rule from Java.
    John

  • Using Rules Engines, & Batch jobs

    So, we're looking into the best method for storing our business rules. So far, we're investigating Rules Engines (Drools), using database Triggers, SOA, or coding those rules into the application itself.
    Currently, the bulk of our business rules are in table triggers. So, when our batch jobs execute, they pick up all of the business rules as they go.
    I like the concept of using a Rules Engine, though, especially if we could give some control over maintaining those rules to the customer.
    So here's my question, if we went to a Rules Engine approach, or chose one of the non-Trigger approaches, would our batch jobs now have to plug into those rules that applied to that particular process? I'm worried about losing those automatic business rule checks when the trigger executes for any interaction with the underlying table data. With a rules engine, it would seem, you'd have more planning b/c the batch job now has to call all rules that may apply.
    Am I missing the point of a Rules Engine, or is this the case?
    --=Chuck

    1) Oracle 10g includes a rules engine, so if you're going do that path, I'd consider strongly keeping everything in Oracle.
    2) What is the nature of the business rules? Are these validations? Calculations? Something else?
    3) Depending on the rules, and whether your batch process has to do anything to react to a rule (i.e. if you have a validation rule that indicates the batch job inserted an invalid entry, does the job need to do something? Or could a subsequent query alert the user to the problem), you can generally have the rules engine run all the rules at the end of the load (that's generally 1 command from the batch process to the rules engine). Or you could have the rules engine run everything periodically. With the internal Oracle rules engine, I believe you can also have things evaluate synchronously.
    Justin

  • Architecture for Rules Engine

    We are reengeneering our existing VB rule engine to Java based. Any input for the architecture is appreciated. Rule engine should fit into distributed arch (including clustering). Here is one suggestion I have.
    1. Stateless -Entity beans. No stateful
    Any other arch suggestion is appreciated.
    Thanks

    The following Business Rule Solution uses POJO's and XML and meets the following criteria!
    Business Rule Solutions should be:
    Non-Industry Specific
    Appropriate and Affordable for any size business
    Enterprise-class solution (scalable, optimized, extensible)
    Remember: All businesses have business rules, and all businesses need an efficient way of managing and executing these business rules.
    What Business Rule Solutions should provide:
    Input Validation & Data Integrity
    Integration & Data Transformation
    Analytics
    Interpret clients Business Policies & Behaviors and clients run-time
    data and execute the appropriate process related workflow efficiently.
    The Return on Investment:
    ROI continues every day, week, month and year into the future!
    Simplify all program development through component reuse.
    Lowers software maintenance by a magnitude.
    Manages & Protects a company assets (Business Rules) in one
    repository.
    Provide Business Agility and Competitive Advantage!
    Further, I believe Business Rule Solutions are a higher level of abstraction of services that all other applications should use to implement the Model-View-Controller design pattern!
    Use the Contact Us! page for quicker responses. http://www.agilebusinessrulecomponents.com

  • Rules Engine Methodology

    Any tips on a development methodology for creating a rules
    engine? That is, a system to execute a couple of hundred
    triggers & functions on tables & views that produce a table or
    materialized view containing the records that meet all the rules?

    This is a complicated question but I will try my best to give you the best solution:
    #In answer to your question regarding the order that rules fire unless you use priority you cannot garantee the order that the rules fire. The Oracle rules engine uses the Rete algorithm to establish the order in which to fire the rules and this is generally based upon the data passed into the rules. Therefore if the result of rule 4 may effect rule 1 then the rules engine will run rule 4 before rule 1.
    The scenario you have provided is slightly different however and I woudl suggest the following.
    Instead of passing out a single result from your ruleset pass our an array of results meaning you could effectively run all your rules and pass out all rules that failed. Be wary of checking for nulls however because if nothing is passed into a field then the rules engine will not create that element in the rules fact and the rule will never fire.
    To create a array of results you will need to create a function which creates the result fact for you and then addes each result in turn.
    If you woudl like more information let me know and I will help out as much as I can.

Maybe you are looking for

  • Resource Management

    Dear all I need to implement Resource Management KIndly share the documentation .... CHeers

  • Compiling mono under Solaris 10: workaround for __builtin_frame_address ?

    Hi, I'm trying to compile the current svn release of mono (free implementation of .NET framework) under Solaris 10/x86. After fixing some GCC specific code, I'm currently stuck with the GCC internal function __builtin_frame_address (and __builtin_ret

  • ISE Wired Central Web Authentication no url redirect

    We are setting up ISE for wired guest accest but are having trouble with the client being redirected.  The switch gets the download from ISE and shows that it should use the URL redirect with the correct ACL. ISEtest3560#show authentication sessions

  • Having trouble downloading the new version of itunes on Macbook, can you help me?

    Hi, I bought my computer MacBook about six years ago. I am trying to download the new version of itunes. It downloads to my computer, but then asks me for my name and installer password. The options to get that password back is to install the initial

  • Crystal parameter starts with x

    Hello, I have a report which is using multiple parameters, and 2 of them start with 'x': xReportType and  xxxxxroundingxx. I can't find a formula where these parameters are used, but the have a green check next to them and I can't delete them. How ca