Rules
Rules are essentially named or unnamed boolean expressions. When a rule is evaluated, the expression is evaluated, and the rule returns the result. For a named rule, the cost engine assigns the result to the name, and, if the result is false, the message with a matching name is displayed in the aPriori message pane. If a rule fails, and there is no message with an exactly matching name, a blank message is issued.
Here is an example from the injection molding feasibility module for aPriori’s plastic molding starting point cost model:
 
Rule CompatibleMaterial: material.canIM_SFM
Message CompatibleMaterial: _
'Failed because you cannot Injection Mold this type of material'
 
This rule uses the standard input material, which has one field for each attribute of the current material (as listed in the Material Composition table of aPriori’s Material Selection dialog). The attribute canIM_SFM is set to true for thermoplastics and false for thermosetting materials. When the rule returns false, the cost engine issues the failure message.
As with formulas, rules can refer to other rules and formulas, and the cost engine evaluates the referenced rules or formulas in the course of evaluating the rule that refers to them.
For modules, such as feasibility modules, that return true or false, the cost engine evaluates the module’s rules in order (except for rules that are evaluated sooner in order to evaluate another rule or formula that refers to them). If a rule evaluates to false, module evaluation terminates and the module returns false. If all the rules in a module return true, the module returns true.
Each rule and each message must end with a line break.