Aras Innovator Platform

Enabling Structure Resolution in a Query Definition

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 OOTB Example: BOM Structure Resolution, 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.

Figure 67.

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’

Note
Be sure to check the syntax of the Default Value for the Parameter. It is used to select a specific List Item as set in the Tree Grid View Definition and described below in Step 4.

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 Section Reference to Parameter in Join Condition in Query. 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’.

Note
Be sure to check the syntax of the Join Condition. It must be as specified above (without the outer quotes). This assumes the value StructureResolutionMode was used for the Query Parameter Name. If you named the Parameter differently, e.g. myParam, then you would naturally need to dereference it as $myParam in the expression.

The Structure Resolution Mode Query Parameter can only be inserted once in a Query Definition. It cannot be used/applied to more than one Query Item.

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..

Figure 68.

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.

Figure 69.

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.

Figure 70.

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:

Figure 71.

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:

Figure 72.

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:

Figure 73. 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