Business Rules Control Order

Contains tips for configurators working with Aware IM
Post Reply
PointsWell
Posts: 1476
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Business Rules Control Order

Post by PointsWell »

I meant to add this a while ago but forgot.

Business rule execution is completely arbitrary and random, so you have no way to force certain rules to execute in order.

There is a work around though if you add an attribute to act as a flag, e.g. BO.StepFlag. Can either be a numeric or a text attribute with options.

eg StepFlag

Code: Select all

Choice     Value
Start        S
Step1 done   1
Step2 done   2
Complete.    C
Next have your business rules trigger as

Code: Select all

IF BO IS NEW THEN BO.StepFlag='S'

Code: Select all

IF BO.StepFlag WAS CHANGED TO 'S' THEN DO SOME THINGS
BO.StepFlag='1'

Code: Select all

IF BO.StepFlag WAS CHANGED TO '1' THEN DO SOME MORE THINGS
BO.StepFlag='2'

Code: Select all

IF BO.StepFlag WAS CHANGED TO '2' THEN DO THE LAST THINGS
BO.StepFlag='C'
You've now imposed order onto randomly executing business rules.
customaware
Posts: 2432
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Business Rules Control Order

Post by customaware »

You can also set the Priority for each Rule to get something important to execute prior to some other Rule.

In on particular BO I ordered the Rules the way I wanted then Set Priority starting at 100 and progressing down in steps of 5 (just in case I wanted to
add a new Rule in between later)

Failing that..... Take all the Rules out and put them in a Process.... This is MUCH faster also as there is no iterative evaluation of the Rules going on.
Just all sequential.
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
Post Reply