Troubleshooting Scenarios

Entities with Multiple Parents

Description

In APM, when you attempt to access the Asset Hierarchy, a message with Entities with multiple parents exist appears and the hierarchy does not display.

Note that this issue is possible if you include a Many-to-Many relationship in the asset hierarchy configuration, which is not recommended, or if a relationship priority is not correctly configured in the asset hierarchy configuration. See Asset Hierarchy Configuration for more information.

Cause

An Asset in the hierarchy that you are attempting to access may have multiple parent relationships.

Solution

Perform the following steps:

  1. Run the following query and analyze the results.
    SELECT enty_key,fmly_key,enty_id
    from MIV_MI_AST_HRCY_MV
    
  2. If only one row appears with an error message Entities with multiple parents exist, run the following query.
    SELECT MIV_MI_AST_HRCY_MV_DUP.parent_enty_key
    , MIV_MI_AST_HRCY_MV_DUP.parent_fmly_key
    , MIV_MI_AST_HRCY_MV_DUP.enty_key
    , MIV_MI_AST_HRCY_MV_DUP.enty_id
    , mi_families.fmly_id
    FROM MIV_MI_AST_HRCY_MV_DUP 
     JOIN mi_families ON MIV_MI_AST_HRCY_MV_DUP.fmly_key = mi_families.FMLY_KEY
    ORDER BY MIV_MI_AST_HRCY_MV_DUP.enty_key Asc
  3. All the assets with multiple parents will be listed.
  4. Access the parent record in the Record Manager that has the duplicate relationship to be removed.
  5. Navigate to the child record and select > to view the child record datasheet.
  6. Select and select Unlink this record.
  7. Repeat steps 4-6 for each duplicate relationship.
  8. Rebuild the asset hierarchy.
  9. Repeat step 1 to validate that duplicate relationships no longer exist in the hierarchy.
    Note: If asset data is automatically synched from the EAM system, you may need to correct the asset hierarchy in the EAM system as well, otherwise the relationships that were deleted in step 6 may be recreated next time the sync runs.

Assets Not Found in Hierarchy Search

Description

In APM, when you attempt to search for an asset in the Asset Hierarchy, no matching results are displayed, even though the asset is found when using Global Search.

Assume you have the following three relationships configured in Asset Hierarchy Configuration:
  • Functional Location Has Functional Location as Root
  • Functional Location Has Equipment
  • Equipment Has Equipment
In the following scenario:
  • Functional Location FL1 is linked to another Functional Location FL2 using the Functional Location has Functional Location relationship, where FL1 is the predecessor and FL2 is the successor.
  • Functional Location FL2 is linked to another Functional Location FL3 using the Functional Location has Functional Location relationship, where FL2 is the predecessor and FL3 is the successor.
  • Functional Location FL1 is linked to Functional Location FL3 using the Functional Location has Functional Location relationship, where FL3 is the predecessor and FL1 is the successor.

This results in a circular relationship in the asset hierarchy. Functional Location FL3 and any child assets below FL3 in the hierarchy are discounted by the asset hierarchy build process and do not appear in the hierarchy or the hierarchy search results.

Cause

An asset that you are attempting to search for, or a predecessor to that asset, has a circular relationship in the hierarchy.

Solution

Note: You must be signed into APM as a super user to perform the following steps.
  1. In the Queries tool, run the following query to identify the relationship families used in the asset hierarchy:
    SELECT DISTINCT [MI_AST_HRCY].[MI_AST_HRCY_REL_FMLY_C] "Relationship Family"
    	   FROM [MI_AST_HRCY]
  2. Run the following query, replacing MIV_MIR_FLHSFL with the relevant view ID, for each relationship family identified in step 1, to identify any records with circular relationships:.
    WITH FindRoot (PRED_ENTY_KEY, SUCC_ENTY_KEY, Path, Distance) AS
    	(
    	SELECT P1.PRED_ENTY_KEY "PRED_ENTY_KEY"
    	, P1.SUCC_ENTY_KEY "SUCC_ENTY_KEY"
    	, CASTCHAR(P1.PRED_ENTY_KEY, 50) "Path"
    	, 0 "Distance"
    	FROM MIV_MIR_FLHSFL P1
    	UNION ALL
    	SELECT C.PRED_ENTY_KEY
    	, P.SUCC_ENTY_KEY
    	, CASTCHAR((C.Path & ' > ' & CASTCHAR(P.PRED_ENTY_KEY, 20)), 50) "Path"
    	, (C.Distance + 1) "Distance"
    	FROM MIV_MIR_FLHSFL P
    	JOIN FindRoot C
    	ON (C.SUCC_ENTY_KEY = P.PRED_ENTY_KEY AND P.SUCC_ENTY_KEY <> P.PRED_ENTY_KEY AND C.SUCC_ENTY_KEY <> C.PRED_ENTY_KEY)
    	)
    	SELECT R.PRED_ENTY_KEY
    	, R.SUCC_ENTY_KEY
    	, R.Path
    	, R.Distance
    	FROM FindRoot R
           WHERE (R.PRED_ENTY_KEY = R.SUCC_ENTY_KEY AND R.SUCC_ENTY_KEY <> 0 AND R.Distance > 0)
    
  3. Access the record of the parent asset of an asset identified as having a circular relationship in Record Manager.
  4. Navigate to the asset having the circular relationships and select > to view the datasheet.
  5. Select and select Unlink this record to remove the circular relationship.
  6. Rebuild the asset hierarchy.
  7. Repeat step 2 to validate that circular relationships no longer exist in the hierarchy.
  8. Validate that any previously missing assets are now visible in the asset hierarchy.
    Note: If asset data is automatically synched from the EAM system, you may need to correct the asset hierarchy in the EAM system as well, otherwise the relationships that were deleted in step 5 may be recreated next time the sync runs.