Forum Stats

  • 3,824,779 Users
  • 2,260,417 Discussions
  • 7,896,310 Comments

Discussions

Rules execution in business rules

User_R0EA7
User_R0EA7 Member Posts: 31 Red Ribbon
edited Jul 28, 2020 9:27AM in SOA Suite Discusssions

hi ,

I have a requirement to set up business rules and need to determine how many rules executed and how many did not.

Scenario : I have 10 rules set up in if then rules ti R1,R2...R10,i have to determine which rule executed(conditions satisfied) and which rule did not.

Is it possbile in rules engine ?

My oracle version : 12.2.1.2

Thanks,

Amith

Best Answer

«1

Answers

  • Martien van den Akker
    Martien van den Akker Member Posts: 2,776 Bronze Crown
    edited Jun 6, 2020 7:32AM Answer ✓

    Hi,

    You can do Business Rule Tracing in EM: https://docs.oracle.com/middleware/12212/soasuite/administer/GUID-ADDB698E-8A8D-4AB9-B2CB-76165F5C8D20.htm#SOAAG97543

    But I'm not aware of a service that provides these details for an execution. I think that the essence of BRE and the underlying algorithm that it desides itself which rules and in which order they are executed.  See also: https://docs.oracle.com/middleware/12212/bpm/rules-user/GUID-FE770341-5FC9-40B6-9D9B-87BC62480BC4.htm#ASRUG99990

    Kind regards,
    Martien

  • User_R0EA7
    User_R0EA7 Member Posts: 31 Red Ribbon
    edited Jun 8, 2020 3:28AM

    Hi Martien,

    Thanks for the reply.

    Wanted to know about the rule throughput and message throttling in the rules i.e to restrict number of requests going to rules at same time.

    Rules firing limit will help in this case ? Whats the unit(time unit and number of invocations) to set that ?

    Please share your views.

    Thanks,

    Amith

  • Martien van den Akker
    Martien van den Akker Member Posts: 2,776 Bronze Crown
    edited Jun 8, 2020 5:05AM

    Hi Amith,

    I don't think that is the place to do throttling. Reaad also  https://docs.oracle.com/cd/E17904_01/user.1111/e10228/descfunc.htm#ASRUG644

    Message throttling must be done in front of the composite.  Rule Firing Limit is meant to help in debugging the  rules firing if you have a lot of rules that my apply at the same time. I think that if that may be a problem, you first need to review and redesign your rules.

    The doc also says to  use this incase of Out-of-memory problems. But in those cases first review and redesign your rules, but certainly also the your composite and the message sizes. Also then first implement throtthling upfront, using a database table and the DB Adapter for instance. Also check the memory settings of the server. Only in last instance check this as a fall-back scenario.

    Kind regards,
    Martien

  • User_R0EA7
    User_R0EA7 Member Posts: 31 Red Ribbon
    edited Jun 9, 2020 2:51AM

    Hi Martien,

    Thanks for the reply.

    Scenario : I have 20 if then rules configured as of now with 20 input fields, what are the performance considerations to be followed for smooth/optimum execution ?

    The volume of records will be thousands of records coming to oracle rule engine per day say 10000 records per day.

    Thanks,

    Amith

  • Martien van den Akker
    Martien van den Akker Member Posts: 2,776 Bronze Crown
    edited Jun 9, 2020 4:19AM

    Hi,

    BRE is quite fast. I don't have any benchmarks. But I'm not surprised with 20 if-then rules. And if 10000 records are spread out over the day, then you would talk about let say 1.500 msg/day. I'd say that with a 2node soa cluster with enough memory, lets say a heap of 4GB, you should be able to do the job.

    Kind regards,
    Martien

  • User_R0EA7
    User_R0EA7 Member Posts: 31 Red Ribbon
    edited Jun 22, 2020 2:48AM

    Hi Martien,

    Thanks for the reply.

    I found out that i will write negative rules to check which rules is failing as i have 10-20 rules to be set up.

    so if i have to evaluate 10 rules for positive scenario similarly 10 rules for negative scenario.

    Please let me know how to append the sting values to a variable inside the rules.

    Requirement is to inform the consumer that these rules failed.

    <processResponse>

    <rulesFailed>R1,R3,R4,R5<rulesFailed>

    <processResponse>

    Thanks,

    AMith

  • Martien van den Akker
    Martien van den Akker Member Posts: 2,776 Bronze Crown
    edited Jun 22, 2020 8:43AM

    I would make list:

    <processResponse>

    <rulesFailed>

    <rule>R1</rule>

    <rule>R3</rule>

    <rule>R4</rule>

    <rule>R5</rule>

    <rulesFailed>

    <processResponse>

    Then you can just assert a <rule>.


    Kind regards,
    Martien

  • User_R0EA7
    User_R0EA7 Member Posts: 31 Red Ribbon
    edited Jun 23, 2020 12:51AM

    hi Martien,

    I have a schema like this :

      <element name="processResponse">

        <complexType>

          <sequence>

            <element name="claim" type="string"/>

            <element name="type" type="string"/>

            <element name="rulesFailed">

              <complexType>

                <sequence>

                  <element name="rule" type="string" maxOccurs="unbounded"/>

                </sequence>

              </complexType>

            </element>

          </sequence>

        </complexType>

      </element>

    Should i use assert or assert new : can you give me the expression

    pastedImage_0.png

  • Martien van den Akker
    Martien van den Akker Member Posts: 2,776 Bronze Crown
    edited Jun 23, 2020 3:19AM

    Hi,

    I'd use a schema more like this:

    <?xml version="1.0" encoding="UTF-8"?>

    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"

                xmlns:rl="http://xmlns.darwin-it.nl/xsd/demo/Rule"

                targetNamespace="http://xmlns.darwin-it.nl/xsd/demo/Rule"

                elementFormDefault="qualified">

      <xsd:element name="processResponse"

                   type="rl:ProcessResponseType"/>

      <xsd:complexType name="ProcessResponseType">

        <xsd:sequence>

          <xsd:element name="claim"

                       type="string"/>

          <xsd:element name="type"

                       type="string"/>

          <xsd:element name="rulesFailed"

                       type="rl:RulesFailedType"/>

        </xsd:sequence>

      </xsd:complexType>

      <xsd:complexType name="RulesFailedType">

        <xsd:sequence>

          <xsd:element name="rule"

                       type="rf:RuleType"

                       maxOccurs="unbounded"/>

        </xsd:sequence>

      </xsd:complexType>

      <xs:simpleType name="RuleType">

        <xs:restriction base="xsd:string"/>

      </xs:simpleType>

    </xsd:schema>

    (I'm not fond of implicit complex types, I allways use named ones. And also I would create an root-element definition for every named complexType).

    But in your case I think you should assert a new rule. Maybe you should name the detail element of the RulesFailed list also a RuleFailed (or FailedRule).

    Then assert a new FailedRule. Because you don't assert a new list, but a new child of the list. The Rules Engine will add it to the list for you.

    Kind regards,
    Martien

  • User_R0EA7
    User_R0EA7 Member Posts: 31 Red Ribbon
    edited Jun 23, 2020 4:01AM

    hi martien,

    Modified XSD as given by you.

    cannot able to add rule in assert new.

    pastedImage_0.png