Implementing complex buiness rules

Home Page Forums BizTalk 2004 – BizTalk 2010 Implementing complex buiness rules

Viewing 2 reply threads
  • Author
    Posts
    • #15848

      I am very new to buisness rule engine. I am trying to do this using biztalk
      rules engine. Can you please help me how to do this.

       RULE1

      if age is range between 50 to 100 then
       Action Score=4
      if age is range between 40 to 50 then
       Action Score=3
      if age is range between 30 to 40 then
       Action Score=2
      if age is range between 20 to 30 then
       Action Score=1

       RULE2


      if AnnualIncome is range between 500000 to 1000000 then
       Action Score=Score+4
      if AnnualIncome is range between 400000 to 500000 then
       Action Score=Score+3
      if AnnualIncome is range between 300000 to 400000 then
       Action Score=Score+2
      if AnnualIncome is range between 200000 to 300000 then
       Action Score=Score+1

       RULE3


      if NumTimesBankrup is range between 0 to 1 then
       Action Score=Score+4
      if NumTimesBankrup is range between 1 to 2 then
       Action Score=Score+3
      if NumTimesBankrup is range between 3 to 4 then
       Action Score=Score+2
      if NumTimesBankrup is range between 5 to 6 then
       Action Score=Score+1

      XML instance of the schmea

      <ns0:ApplicantDetails>
        <ns0:ApplicationID>10</ns0:ApplicationID>
         <ns0:Name>John Dangerlover</ns0:Name>
          <ns0:Age>99</ns0:Age>
          <ns0:CurrentHealth>Poor</ns0:CurrentHealth>
          <ns0:NumTimesBankrupt>0</ns0:NumTimesBankrupt>
          <ns0:AnnualIncome>1000</ns0:AnnualIncome>
          <ns0:AnnualExpenditure>10000</ns0:AnnualExpenditure>
          <ns0:OwnProperty>false</ns0:OwnProperty>
          <ns0:Score></Score>
        </ns0:FinancialDetails>
      </ns0:ApplicantDetails>

       

       

    • #15870

      First you will need to introduce the ApplicationDetails schema as a fact to the business rules composer.  In the Business Rules Composer under Facts Explorer/XML Schemas/right click/Browse and browse to your .xsd file.

      Next Create a policy with a rule.  For this rule go to Facts Explorer/Vocabularies/Predicates and select the range vocabulary and drag it to the "IF" pane on the right.

      Click on XML Schemas and drag ApplicationDetails.Age to the first value of the range routine.  Put 50 to 100 for second two values.  In the "THEN" pane set ApplicationDetails.ActionScore = 1

       Repeat these steps for the rest of your range values.

      You will need to use the Call Rules Shape in your orchestration.  Set the Policy of the Call Rules shape to whatever you called the above policy and put the Schema instance as a parameter.  Let me know if you encounter any problems.

    • #15880

      Be careful though.  You're incrementing a value.  You can't just do that on the XML doc.  I always use a stateful component with a member variable holding the "score", and methods to increment the value.  See the "risk scoring" example on MSDN … http://msdn.microsoft.com/library/default.asp?url=/library/en-us/BTS_2004WP/html/87e1b104-c39c-4b0d-a74e-494d672e9779.asp.

Viewing 2 reply threads
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.