Question on Business Rules vs Process Rules and Performance

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
rbross
Posts: 441
Joined: Wed Nov 19, 2014 4:13 am
Location: Coventry, Connecticut USA

Question on Business Rules vs Process Rules and Performance

Post by rbross »

Hello,

I Need to SUM weeks qty's for a part No. I have it working now with this Business Rule on the BO.
BO Rule:
IF BO1 IS NEW

THEN BO1.week01Demand=SUM BO2.Week01 WHERE(BO2.StartWeek=SystemSettings.ThisWeek AND BO2.PartNo=BO1.PartNo)

This is repeats 45 times for weeks 1-25 and Months 1-17 for the current week Then repeats again for Lastweeks Weeks 1-25 and Months 1-17

My question is after I create the record for BO1 would it perform better if I did all the SUMS in the process?
Does it take longer to perform these steps when they are in a Business Rule?

Regards,
Roger
Roger Ross
AwareIM 8.7 (build 3025) ~ MS-SQL ~ Windows 10 ~
AwareIM 8.5 (build 2828) ~ MS-SQL ~ Windows 10 ~
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: Question on Business Rules vs Process Rules and Performa

Post by tford »

For many situations like this that are fairly easily modeled, I would simply test your the different approaches you are considering & determine which one is most effective for your scenario.
Tom - V8.8 build 3137 - MySql / PostGres
hpl123
Posts: 2594
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: Question on Business Rules vs Process Rules and Performa

Post by hpl123 »

Roger,
Don´t know how your solution works etc. but one thing to think about when working with BO rules is that rules are evaluated again and again when BO instances are changed etc. so sometimes it´s better to plan for that and use a single rule that starts a process and then does a lot of stuff i.e. minimize the total number of rules evaluated.

In your case it´s probably not needed but just wanted to share this thought because in more advanced scenarios it might be.
Henrik (V8 Developer Ed. - Windows)
Post Reply