I thought the On Page Leave expression on the last page of a product configurator would always run before the method rules. And it usually does. But I have one particular configurator where the method rules consistently run before the On Page Leave expression. Why would this be?
I originally noticed this when a method rule threw an exception on invalid input that should have been caught by On Page Leave. I instrumented some of my other configurators by adding message dialogs to On Page Leave and rules that just throw exceptions. I tested subassembly configurators stand-alone and as part of their parent assembly, and the behavior followed the configurator, not its use as subassembly or its position in the sequence of subassemblies. I created a new test part and configurator and tried but failed to reproduce the issue. Everything points to there being some magical characteristic of my one specific configurator that’s making the rules run prematurely. No matter where this one configurator appears, its method rules always run before On Page Leave.
I found where I got the idea that On Page Leave should run before method rules. On Complete runs after the last page’s On Page Leave, and the tech ref says of On Complete:
This event is useful for a multi-level configurator where you are leave the last available page of
the current configurator and you want to validate the existing data on the configurator that you are
leaving.
There are some tantalizing clues on page 33 of the tech ref, but some of the concepts aren’t defined.
At the input control level, the Configurator determines if Method rules are defined for the control you are
operating. Method rules determine what specific raw materials, subassemblies, and operations are required to generate unique Method of Manufacture records for a specific configuration when creating quote or job details.
I understand “method rules” to mean the rules on operations and materials that you define in Configurator Rule Entry. The rule that’s running unexpectedly before On Page Leave is a Rule Action on a material. I don’t know what it means for a method rule to be “defined for a control.” Whatever it means, I wonder if I did it accidentally.
Other types of rules perform computations, such as material “quantity per” or operation run time durations. For detailed information, refer to Use of Rules Types in Rules Processing.
“Use of Rules Types in Rules Processing” is typeset like a section name, but there is no such section. The only other occurrence of “Rules Types” is another reference to that non-existent section. The only occurrence of “Rule Types” is in a brief section that refers to the non-existent section.