Structure Resolution Parameters
Copy
We mentioned Structure Resolution briefly in the Parameters section above. The Structure Resolution parameter sets query criteria to return a specific configuration of items with respect to Released state and version (generation).
Structure Resolution Modes:
- Default: a structure as physically stored in the database. Technically speaking, results will contain Items with ID values in
related_idProperty of Relationships in the structure without interpretation of LifeCycle State or availability of new versions (generations). - Latest: uses the generation of the Item with the highest value.
- Latest Released: uses the generation of the Item with the highest value which is also Released.
- Latest Released or Latest: uses the generation of the Item with the highest value which is also Released; otherwise, the Latest if there are no Released generations.
By default, the structure is only displayed as stored in the database. Without dynamic view parameters users would need to spend more time examining work-in-progress changes to components in a structure. Dynamic structure resolution is important feature for BOM structure, Effectivity, 3D Visualization, and other Aras Innovator features.
In this section we describe in detail how Structure Resolution can be configured for a Query Definition using the Query Builder.
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.
Check Parameter Tab
Once displayed, you will have access to relationships under the Query Definition as Tabs. Recall from Section 2.4 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.
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.
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.
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.
Structure Resolution can be applied to any Item Relationship structure of Versionable items that follows the same rules as Part BOM structures – Life Cycle State “Released” (is_released Boolean), incremental Revisions with interim versioned generations, etc.
CAD Structure is an example of such a structure, and Structure Resolution can be applied to Query Definitions against this data model in the same manner as Part BOM structures. We use CAD Structure as an example of this procedure which is documented in greater detail in the Aras 3D Visualization - Administrator Guide document.
Per the Part BOM Query Definition we examined in Section 7.1, Structure Resolution requires a Parameter with the Resolution Entrypoint, an Event Handler must be added to the Query, and the Parameter must be referenced in the Join Condition for the resolved itemtype.
Adding the Structure Resolution configuration to a CAD Structure Query will involve all of these steps as well.
Step 1: Create Structure Resolution Mode Parameter
Applying a specific Structure Resolution Mode (‘Default’, ‘Latest’, etc.) is done using a Query Parameter. Using the Query Parameters Dialog, add a Parameter to be used for Structure Resolution Mode. For example ‘StructureResolutionMode’ and assign the default value ‘Aras.Resolution.EntryPoint;Default’
Step 2: Incorporate the Query Parameter in Join Condition
The added Query Parameter must be incorporated into the Query Definition in order for it to be used/exposed to the end-user. Add it as part of the Join Condition of the Child CAD Query Item as shown in 7.1.4. Replace the default Join Condition – e.g. ‘[Part BOM].related_id = Part.id’ with the following – ‘'$StructureResolutionMode;parent.related_id’ = Part.id’
Part BOM and Part are used for this example, but it could just as well be ‘[myLinkage].related_id = myNode.id’ being replaced by ‘'$StructureResolutionMode;parent.related_id’ = myNode.id’.
Step 3: Add Structure Resolution Method to Query Event Handler
Show the Relationship Tabs for the Query Definition in the Form View if they are not shown. Tabs On/Off is set in the Query Definition itemtype (qry_QueryDefinition).
Select the qry_QueryDefinitionEvent Relationship Tab. A Method needs to be added to the OnBeforeExecute event. To do this, select the Select Items Icon to create a Relationship and select the qry_ResolveStructureEntryPoint Method and assign it to the OnBeforeExecute event as shown in Error! Reference source not found..
Step 4: Map the Query Parameter in the Tree Grid View Definition
In order for the Query Parameter to be used in a Tree Grid View, it must be enabled (made visible) in the Tree Grid View Definition.
Open the Map Parameters Dialog in the Tree Grid View Definition within the Editor View. All Parameters defined in the Query Definition used by the Tree Grid View will be listed.
Select the Visible check box for the StructureResolutionMode row. The Data Type is a List and the Data Source is the List qry_StructureResolution.
With this Configuration in place, users will be able to select specific Resolution Modes by opening the Query Parameters Dialog in the Tree Grid View used within the 3D Viewer.
Applying a Where Condition Against Resolved Items
In Aras Innovator 12.0 SP4 and later releases it is possible to add a Where Condition to a Query Item that is used for Structure Resolution (e.g., CAD in this example). Doing so allows the Administrator to apply an additional condition (filter) when resolving the Structure of Items with fixed Relationships (such as CAD / CAD Structure). For example, assuming the CAD Structure in the following diagram:
If the Administrator would like to use Structure Resolution of ‘Latest’ and apply an additional condition to only include CAD Items that were In Review (that is, with a CAD.State = ‘In Review’) then Where and Join conditions like the following could be added to the Query Item:
Note the addition of the left-side of the Join Condition:
‘$StructureResolutionMode;parent.related_id;ApplyChildWhereMode=ResolutionTargetResolved’ = CAD.id] Executing this Query Definition, with Structure Resolution of ‘Latest Released’ with return:
Structure Resolution Logic with Condition Result In this example, only the CAD Item – CS3, version 5 is returned because of the added Where Condition of ‘CAD.State = ‘In Review’ applied to the resolved results of the Structure Resolution Join Condition using the selected Mode parameter. For more details and extensive examples of how Resolution Modes are applied in BOM Structures, Effectivity, and 3D Visualization please refer to the following documents: Aras 3D Visualization - Administrator Guide Aras Innovator Product Engineering - User’s Guide