Child BO Rules being run when Parent is being updated.

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jhstephenson
Posts: 297
Joined: Wed Apr 22, 2015 11:44 pm

Child BO Rules being run when Parent is being updated.

Post by Jhstephenson »

I hope I can explain this well enough for someone to get an idea about what is happening….

I have 3 Business Objects: CaseMaster, Case Documents, and MediaFiles. CaseDocuments and MediaFiles are children of CaseMaster.

On my CaseMaster Main Form I have tabs that will let me go to the list of Documents or Media Files for each Case.

I can add a case and everything gets added the way it should and goes back to the case list query like I want it to.

The problem I have is that if I update a Case record, without ever looking at the Documents or Media Files, when I click ‘Save’, after the Rules for the CaseMaster are executed, it starts going through the Rules for both CaseDocuments and MediaFiles even though nothing has been done to either of those BO’s. The odd part here to is that it is going through not just the records associated with the one case I was working on, but all Media and Document records. Which basically results in an endless loop that ultimately causes the system to time out.

I guess the main question is why is an update in the parent causing rules to be executed in the children?

The secondary, but maybe more important question is, why is it executing those rules for every record in the CaseDocuments and MediaFiles tables?

I don’t know if that is enough of an explanation but hopefully it will spark an idea in somebody.

Thanks,
Jim
PointsWell
Posts: 1457
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Child BO Rules being run when Parent is being updated.

Post by PointsWell »

Do you have “Don’t check referred” (can’t remember the exact term) checked for your child and parent rules?
Jhstephenson
Posts: 297
Joined: Wed Apr 22, 2015 11:44 pm

Re: Child BO Rules being run when Parent is being updated.

Post by Jhstephenson »

Does the "Don't check referred" indicator go on the Parent or Child rules?

If it goes on the parent I checked every rule on the CaseMaster with that and it still did the same thing
PointsWell
Posts: 1457
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Child BO Rules being run when Parent is being updated.

Post by PointsWell »

Jhstephenson wrote:Does the "Don't check referred" indicator go on the Parent or Child rules?

If it goes on the parent I checked every rule on the CaseMaster with that and it still did the same thing
Checking it on the parent will prevent he rules running on the parent when the child is updated.
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: Child BO Rules being run when Parent is being updated.

Post by tford »

While checking referred BO's with rules can cause inefficiency and a BSV to slow WAY down, I haven't experienced it creating an endless loop and time out situation.

My gut feeling is that you have some other issue with your rules. One way to narrow down offending rules is to temporarily put a 1=0 condition in rules to disable them and leave one rule without the condition. By testing one rule at a time, some light may shine on your problem.
Tom - V8.8 build 3137 - MySql / PostGres
PointsWell
Posts: 1457
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Child BO Rules being run when Parent is being updated.

Post by PointsWell »

tford wrote:My gut feeling is that you have some other issue with your rules.
Potentially something along lines of

If parent.attribute affected then update child.attribute with a subsequent if child.attribute changed then update parent.attribute. This will obviously not show up if you are testing each rule in isolation but will show up if you switch each rule on one at a time.

Also check that Parent is not doing something to Parent.peerChild attribute as obviously that is running on your parent but updating your child. Likewise any rules on Child.obParent.
Post Reply