Advice Rules
An advice rule, like a rule, specifies a boolean expression. Each advice rule has the following form:
AdviceRule <rule-name> : <boolean-expression>
While a rule specifies a feasibility requirement, an advice rule specifies an inadvisable—but not fatal—circumstance pertaining to the current process or operation. If the expression specified by a rule evaluates to false, the current process or operation is deemed infeasible, a message is issued to the message tree, and evaluation of the current module ceases. In contrast, if the expression specified by an advice rule evaluates to true, advice is issued to the Design-to-Cost (DTC) interface, and evaluation of the current module continues. (See the aPriori Professional User Guide for information about Design to Cost.)
Each advice rule has an associated Advice construct, which specifies the content of the advice to be issued to the DTC interface. Here is an example of an advice rule together with its associated Advice construct:
 
AdviceRule maxWallThicknessAdviceCheck:_
safeEval(maxPartThicknessAllowedRelevant, null) != null and _
(partMaxThickness > maxPartThicknessAllowedRelevant)
Advice maxWallThicknessAdviceCheck: dtcMessage(
'attributeId', 'Maximum Wall Thickness',
'messageId', 'Part thickness is out of recommended range.',
'current', partMaxThickness,
'suggestedMax', maxPartThicknessAllowedRelevant,
'unitType', 'Length',
'custom.panelOutput', 'castingIssue')
 
This advice rule is a simplified version of an advice rule in the die casting cost model. It issues advice when the part's maximum thickness exceeds the maximum recommended thickness for the current material. The content of the issued advice is specified by a call to the predefined function dtcMessage. The arguments to this function consist of field-name/field-value pairs, where each field is set to one component of the advice:
attributeId: the first pair of arguments sets the field attributeId to the string 'Maximum Wall Thickness'. This specifies the menu item to select in order to view the category of advice that includes the current advice.
messageId: the next pair of arguments sets messageId to the string 'Part thickness is out of recommended range'. This specifies the message that appears below the table when the relevant table row is selected.
current: the next argument pair sets the field current to the part's thickness, the value that violates the advice rule's associated recommendation. This value appears in the table column labeled Current.
suggestedMax: the next argument pair sets suggestedMax to the maximum recommended thickness, the value exceeded by the part's actual thickness. This value appears in the table column labeled Suggested.
unitType: the next argument pair sets unitType to the string 'Length'. This is the type of units to use when displaying the values of current and suggestedMax. The display uses the default units for the specified type (millimeters in this case).
custom.panelOutput: the last pair of arguments sets the field custom.panelOutput to the string 'castingIssue'. This specifies that the destination of the advice is the Casting Issues dialog of the DTC interface.
See the following sections for detailed information on advice rules:
Rules
Advice
dtcMessage in Miscellaneous Functions
Note: in this release, advice rules can issue advice to the DTC interface for Casting—Die, Casting—Sand, Plastic Molding, and Sheet Metal. Support for other process groups will be added in future releases.