6 Replies Latest reply: Jun 27, 2012 5:58 PM by Jasmine Lee-Oracle RSS

    Shortcut rule

      Can any one please give me a complete example of shortcut rule? OPM help doesn't expalin completely. Basically , I want to understand how a shortcut rule works. That would help me write rules better.
        • 1. Re: Shortcut rule
          Matt Sevin
          Basically the only time you should use a shortcut rule is when you want to eliminate a redundant question from an interview. For example, if some policies have a condition checking if a person is over 18 years old and others check if a person is over 25 years old. In such cases, an interview may ask for both "Is the person over 18 years old?" and "Is the person over 25 years old?" - obviously if the person is > 25 years old they are also > 18 years old so a shortcut rule can eliminate the "Is the person > 18 years old?" question.

          The simple test is: If you have base level attributes that can be determined from another base level attribute AND you want to eliminate redundant questions from an interview, then use use a shortcut rule to determine one base level attribute from another. Also note, this does not imply that the redundant question will always be eliminated (screen flows, relvance of conditions in other rules, etc. may impact which questions are asked and in which order).

          Also see the the shortcut rule video on the OPA YouTube Channel: http://www.youtube.com/watch?v=2gjENYCcwWs&list=UUtUHPDCD1EFH_ftnhR_i-dQ&index=4&feature=plcp
          • 2. Re: Shortcut rule
            Jasmine Lee-Oracle
            It is very, very rare for a shortcut rule to be the best option.

            Matt's example above is logically correct, but a much better way to address that particular situation would be to collect 'the person's age' or 'the person's date of birth' (and infer the age from date of birth), and then feed the age into the various rules. This eliminates the need for shortcut rules to trim the interview.

            A more classic situation where you may need shortcut rules (but not necessarily depending on how you've structured your rules) is inferring that the person is not pregnant if the person is male, e.g.

            +(shortcut rule)+
            the person is not pregnant if
            the person is male

            The key difference between a regular rule and a shortcut rule is that shortcut rules do not participate in the question search and they only infer in one direction. At runtime this means:

            * If the person is male = true --> It will be inferred that ‘the person is not pregnant’.
            * If the person is male = false --> Nothing will be inferred, and “Is the person pregnant?” will be asked as a base level question.

            My general advice is that if you find yourself wanting to use a shortcut rule, then think again, and think hard about whether there’s a better approach for whatever you’re doing. Shortcut rules should be used sparingly and only when really, really needed.
            • 3. Re: Shortcut rule
              Hi Jasmine,
              In your above rule you mean that if I use shortcut rule then "Is the person pregnant?" will not be asked if "If the person is male = true "?
              Can you please explain what is meant by "question search"? When and How it is done?
              This will help me understand better.
              • 4. Re: Shortcut rule
                Matt Sevin
                To, hopefully, add some clarity to short cut rules and how to choose when to use them ...

                If you are not using interviews (i.e. Oracle Web Determinations or a custom interface built against the interview service) to interactively collect information, then shortcut rules are irrelevant. Without interactive data collection, the "base" data set is predefined and each transaction will pass the complete set of values to
                OPA (in general - omitting more advanced integration designs, etc.)

                If using interviews ...
                Requirements within a given project will impact your choices regarding shortcut rules. If you have complete freedom to collect information using any questions you choose, then you should almost never require shortcut rules as Jasmine indicated - i.e. ALWAYS collect base level information such as date of birth instead of age, dimensions instead of area, etc. ... in other words the most maintainable policy model and rulebase design over time will be to collect the most basic information from which other information can be deduced or computed. This approach helps to ensure stability in the policy model across rule changes (i.e. you don't have to change the model when "> 25 years old" changes to "born before 1990" in a policy)

                If however, your project REQUIRES that your interviews collect certain information in certain ways (e.g. the interface must match existing forms or ask for information readily available, shareable vs. private information, etc) AND the project requirements permit or require that you eliminate the potentially redundant questions when then can be deduced from earlier responses in interviews, then shortcut rules should be used to accomplish these objectives.
                • 5. Re: Shortcut rule
                  Matt Sevin
                  The dialog will be more productive (and less likely to get into overly complicated explanations) if it stays focused on when to use a feature rather than trying to understand how the feature works. Hopefully the responses have provided enough information on when shortcut rules may be relevant and when to use them.

                  If there is a requirement you are trying to address and for which you haven't determined how best to accomplish it, then please describe the requirement / objective and I am sure forum participants will be happy to provide guidance.

                  Thank you.
                  • 6. Re: Shortcut rule
                    Jasmine Lee-Oracle
                    In your above rule you mean that if I use shortcut rule then "Is the person pregnant?" will not be asked if "If the person is male = true "?
                    Can you please explain what is meant by "question search"?
                    What do I mean by "shortcut rules do not participate in the question search"? This means that only forward chaining is in play with a shortcut rule. With regular rules, both forward chaining and backward chaining are in play.

                    Have a look at these two articles:

                    Oracle Determinations Engine and the Inference Cycle:

                    Capture implicit logic in rules: http://docs.oracle.com/html/E27987_01/Content/Writing%20rules/Capture_implicit_logic_in_rules.htm

                    I don't think you should get too hung up about shortcut rules because most likely you shouldn't be using them anyway. If you focus on shortcut rules, then you're pretty much guaranteed to come up with a bad design for your rulebase.