Re: Business Rules applying for multiple nodes

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi,

Are you trying to update the total score in the each customer node per
rule or the conditions depend on the entire schema?

You will need to pass in the entire customer (not customers) node while
evaluating the condition(.Net method to do the condition evaluation)
and pass in the Node again for the Action. You will have to use the
UPDATE command as well as you are trying to update the TotalScore which
was updated by a previous rule firing.

I hope the above was not confusing.

Thanks,
Sandeep

sai wrote:
My requirement is like I need to increment TotalScore using business rules
engine
based on KM,daysofpurchase,serviceCharge

Please help me how to implement this. Using .Net componet I tried to update
the totalscore it
works fine but when I am trying to send multiple Customer nodes I finding
worng resules.
Please help me how to resolve this issue.

if Km is between 0 to 10000 then
TotalScore=4

if Km is between 10000 to 20000 then

TotalScore=3

if Km is between 20000 to 30000 then

TotalScore=2

if daysofpurchase is between 0 to 365 then

TotalScore=TotalScore+4


if daysofpurchase is between 365 to 730 then

TotalScore=TotalScore+3

if daysofpurchase is between 730 to 1460 then

TotalScore=TotalScore+2

if serviceCharge is between 0 to 500 then

TotalScore=TotalScore+4

if serviceCharge is between 500 to 1000 then

TotalScore=TotalScore+3

if serviceCharge is between 1000 to 1500 then

TotalScore=TotalScore+2

Here is the schema.for single customer node

<Customers>
<Customer>
<Name>3</Name>
<KM>5000</KM>
<daysofpurchase>800</daysofpurchase>
<NumberofVisits>1</NumberofVisits>
<serviceCharge>100</serviceCharge>
<location>20</location>
<TotalScore>0</TotalScore>
</Customer>
<Customers>

output is

<Customers>
<Customer>
<Name>3</Name>
<KM>5000</KM>
<daysofpurchase>800</daysofpurchase>
<NumberofVisits>1</NumberofVisits>
<serviceCharge>100</serviceCharge>
<location>20</location>
<TotalScore>11</TotalScore>
</Customer>
<Customers>


<Customers>
<Customer>
<Name>3</Name>
<KM>5000</KM>
<daysofpurchase>800</daysofpurchase>
<NumberofVisits>1</NumberofVisits>
<serviceCharge>100</serviceCharge>
<location>20</location>
<TotalScore>0</TotalScore>
</Customer>
<Customer>
<Name>2</Name>
<KM>15000</KM>
<daysofpurchase>200</daysofpurchase>
<NumberofVisits>12</NumberofVisits>
<serviceCharge>1000</serviceCharge>
<location>40</location>
<TotalScore>0</TotalScore>
</Customer>
<Customers>

for the above xml instace I am getting wrong results.
Please help me how to resolve this

.



Relevant Pages

  • Re: Business Rules applying for multiple nodes
    ... 1>I am trying to update the total socre for each customer node. ... if serviceCharge is between 500 to 1000 then ...
    (microsoft.public.biztalk.general)
  • Business Rules applying for multiple nodes
    ... My requirement is like I need to increment TotalScore using business rules ... if daysofpurchase is between 365 to 730 then ... if serviceCharge is between 500 to 1000 then ... Here is the schema.for single customer node ...
    (microsoft.public.biztalk.general)