OOTB Example: BOM Structure Resolution
Copy
Structure Resolution comes pre-configured for Part BOM Structures OOTB. If you wish to enable Structure Resolution for your own Query Definition its useful to examine the OOTB configuration used in Query Definition PE_BomStructure for reference. Other than naming conventions and base query structure you will follow the same procedure as used for the OOTB implementation when adding Structure Resolution to your Query.
Display Hidden Tabs Under Query Definition
By default, Tabs under the Query Definition itemtype are hidden. Query Definition Itemtype have Relationships to Parameters and Event handlers. We will need them displayed to examine and configure Structure Resolution.
As administrator, edit the Itemtype qry_QueryDefinition and change the Default Structure View to “Tabs On” as shown on right. If the tabs do not appear for Query Definition form, then you may need to exit the Query Definition and re-open to refresh the form.
Figure 63.
Check Parameter Tab
Once displayed, you will have access to relationships under the Query Definition as Tabs. Recall from Section Adding/Editing Query Parameters that Parameters are essentially runtime variables configured in the Query Builder to provide runtime variables (i.e. search criteria) to the underlying query.
Under qry_QueryParameter tab, you will see all Query Parameters defined for this query. For Bom Structure OOTB, Parameter “StructureResolutionMode” is pre-configured with the default value “Aras.Resolution.EntryPoint.Default” as shown below.
If adding Structure Resolution to your custom query, you will need to add a Parameter and assign the Default Value “Aras.Resolution.EntryPoint.Default” as shown below. This procedure is detailed in Section 7.2.
Figure 64.
Query Definition Events Tab
Beside the Parameters tab in the Query Definition form is the qry_QueryDefinitionEvent tab. In the OOTB Bom Structure Query Definition you will see an Event Handler that tells the query to run a method named “qry_ResolveStructureEntryPoint” before query execution (event “OnBeforeExecute”). This method is provided OOTB, providing the logic to resolve structures according to the selected Parameter value (Latest, Latest Released, Latest Released or Latest).
When adding Structure Resolution to your custom query, you will need to add this event handler and define the method and event name exactly as set in the BOM Structure query definition.
Figure 65.
In Summary, the Parameter and Event Handler tells the Query Definition to (a) allow runtime entry of Latest/Released criteria and (b) specifies method logic to execute to enforce Structure Resolution behavior on execution of a query.
Reference to Parameter in Join Condition in Query
Once the Parameter is added to the Query Definition and the Event Handler set, the Parameter can be dereferenced in the Join Condition of the query item to be resolved using the $Name syntax below. In the BOM Structure example, the resolved query item is the Part node, therefore the Join condition is edited to use ‘$StructureResolutionMode.parent.related_id’ = Part.id.
Figure 66.
Sections 7.1.1 – 7.1.4 describe the same configuration settings you would use to enable Structure Resolution on your custom query, or another Query Definition applied to a structure of related versionable items such as CAD Structures. The next section covers this procedure in detail.