Computed columns for returning the latest revision of a document - HxGN SDx - Update 64 - Administration & Configuration

Administration and Configuration of HxGN SDx

Language
English
Product
HxGN SDx
Search by Category
Administration & Configuration
SmartPlant Foundation / SDx Version
10

Example

Scenario: The objective is to return the latest revision of a document using Data Validator functions in computed columns.

The following example considers only the working document or the current document (if no working document is available) as the latest revision. If you have created custom revision states for your documents, you must ensure that you modify the computed columns accordingly with the latest revision state information.

  • If a working document is available for a document master, it must be considered as the latest revision. If a working document is not available, the current document must be considered as the latest revision.

  • The computed column, COMP_GetDocumentLatestRevisionsFromTargetSystem, is used to find out if only a current document is available or if both current and working documents are available. If both documents are available, the working document is treated as the latest revision.

COMP_Document MasterUID - The column header that contains the Document Master UID for all revisions. This column can be a computed column which holds the UID of the document and can be computed using the Concat function. For example, for the computed column, COMP_DocumentMasterUID:

Input: func.Concat({"FDWM_", [COMP_CONFIG1], "_", [DOC_NAME]})

Output: FDWM_2020_D2020-FO1-C-YE-00001-01

GetDocumentLatestRevisionsFromTargetSystem - The actual mapping must be performed on this computed column as the other column, COMP_DocumentMasterUID, is needed for computation purposes only. This computed column checks to see if there is a current document, and then it will check to see if a working document also exists. If no working document exists, it will return the current document as the latest revision. It uses these parameters:

  • IgnoreConfiguration - When loading the data to the project configuration, if the Ignore Configuration value is set to False, the latest revision UID is retrieved from the plant configuration. When set to True, the latest revision UID is retrieved from the project configuration.

  • Class Definition - The class definition of the document master.

  • DocumentMasterUID - The column header that contains the Document Master UID for all revisions.

For example, func.GetDocumentLatestRevisionsFromTargetSystem("False", "FDWDocumentMaster", [COMP_DocumentMasterUID]).