Target system computed columns - 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

The following computed columns use information from the target system so that the computed columns match the target system.

GetDocumentRevisionsCountFromTargetSystem

This computed column retrieves the number of revisions available for a document from the target system using these parameters:

QueryDef – Used to uniquely identify the document master in the target system. You can specify the class definition of the document master and the document name.

IgnoreConfiguration - Used to include all configurations in the query.

  • This QueryDef searches for class definitions that realize the interface ISPFDocumentMaster.

  • If more than one document is identified by the QueryDef, then a cumulative count of all the revisions available for the identified documents is returned.

Example

In this example, the first parameter finds the object with the class definition SPFDesignDocMaster and name Document1. The second parameter searches in all configurations.

func.GetDocumentRevisionCountFromTargetSystem(“#SPFDesignDocMaster,.Name=’Document1’”,"true")

Scenario

To configure a rule that would result in a validation failure message for a document having more than one version, do the following:

  • Create an integer rule with minimum value set as zero and maximum value set as one. The Allow Blank Values option should be set to True.

  • Create a computed column with the following function:

    func.TrimStart(func.GetDocumentRevisionsCountFromTargetSystem("#SPFDesignDocMaster,.Name=[DOCUMENT_NUMBER]","True"),"0")

GetVersionNumberForRevision

This computed column retrieves the latest version of a document revision from the target system using these parameters:

QueryDef – Used to uniquely identify the document version in the target system. You can specify the class definition of the document revision, document name, and the external revision.

IgnoreConfiguration - Used to include all configurations in the query.

  • This QueryDef searches for class definitions that realize the ISPFDocumentRevision interface.

  • If the Allow Version Creation flag is turned on in the job definition, when the same revision is being loaded, a new version is created. To identify the newly created version object in the subsequent export process, this computed column returns the version number by incrementing the count by 1. If the flag is turned off, the computed column returns the latest target system version number for that revision.

Example

In this example, the first parameter finds the object with the class definition FDWDocumentRevision, the document name, and the external revision. The second parameter searches in all configurations.

func.GetVersionNumberForRevision("#FDWDocumentRevision,.Name=[Document Number],.SPFExternalRevision=[Revision]", "true")

Scenario

When you are processing a document with attached files, and the document is loaded for a second time, ensure the Allow version creation flag is turned on to get the updated file objects attached to the latest version.

For example:

  • When the Allow version creation flag on the job definition is set to True:

    • When Document1 with File1 attached to it is loaded for the first time, it creates Document1 with Revision1A and Version1. In the next load, when the file content is updated, and the same revision is being loaded again, this computed column returns the version number as Version2 so that the updated file is attached to the appropriate version number, Version2.

  • When the Allow version creation flag is set to False:

    • The computed column returns the version number as 1, which is the target system version number. The file content is not updated when the same revision is loaded again.

GetMajorRevisionCodeFromTargetSystem

Given a revision scheme and a revision code, the computed column retrieves the details for the revision scheme from the target system, then splits the major revision code and validates that it conforms to the criteria for the revision code.

For example,

func.GetMinorRevisionCodeFromTargetSystem([REVISION_SCHEME], [REVISION_CODE])

func.GetMajorRevisionCodeFromTargetSystem([REVISION_SCHEME], [REVISION_CODE])

GetMinorRevisionCodeFromTargetSystem

Given a revision scheme and a revision code, the computed column retrieves the details for the revision scheme from the target system, then splits the minor revision code and validates that it conforms to the criteria for the revision code.

Errors

If an error occurs in either computed columns, the system displays the following error message:

ERROR resolving MINOR/MAJOR revision code REV_CODE using revision scheme REV_SCHEME

This error is not used for any .Net exceptions. This error occurs when either the computed column produces an empty value, both the minor and sequences are numeric, or both the sequences are alphabetic.

For example:

func.GetMajorRevisionCodeFromTargetSystem("RS_REV01", "A1") = A

func.GetMinorRevisionCodeFromTargetSystem("RS_REV01", "A1") = 1

GetTargetSystemValueIfEmptyReturnDefault

This computed column retrieves the value of a property from the target system, and if the object specified by the QueryDef is not found in the target system, returns the default value specified in the input string. It uses the following parameters:

IncludeHigherConfiguration – Used to specify whether to include a higher configuration in the query or not.

Default value – Used to specify the default value if the object specified by the QueryDef is not found in the target system.

QueryDef – Used to find an object in the target system. You can specify the class definition of the object and any property values found on that object or a related object. Any number of criteria can be added by separating them with a comma. This parameter must be a constant string, but it can reference other columns within the string if you enclose each of those columns in brackets [ ]. For example, func.Concat({[TestColumn1], [TestColumn2], [TestColumn3]}).

ReturnDef - Used to describe the property to be returned from the target system. You can specify the relationships to which to navigate, followed by the property you want to retrieve. Any number of relationships can be navigated. This parameter must be a constant string.

  • You must use the target system schema in the QueryDef and ReturnDef.

  • If multiple objects are found, either by the QueryDef or by navigating to the relationships, then multiple values are returned, each separated by a comma.

Example 1

In this example, the first parameter specifies whether to include items from a higher configuration or not. The second parameter specifies the default value to be returned if the object specified by the QueryDef is not found in the target system. The third parameter is specified to find the object with the class definition SPFDesignDocMaster and the UID Document1. The fourth parameter specifies to return the description of that object.

func.GetTargetSystemValueIfEmptyReturnDefault("false","This is default document master description","#SPFDesignDocMaster,.UID='Document1'", ".Description")

Example 2

In this example, the same object is navigated using the SPFPrimaryClassification relationship from end 2 to end 1 to find the required UID property. If the object specified by the QueryDef is not found in the target system, then the default string, "Object is not found", is returned.

func.GetTargetSystemValueIfEmptyReturnDefault("false","Object is not found","#SPFDesignDocMaster,.UID='Document1'","-SPFPrimaryClassification.UID")

Example 3

In this example, a match on the name is used to find the object, instead of the UID. The name DOCMASTER_NAME is used to match on from the column, instead of entering it manually. If the object is not found, then the default string, "Object is not found", is returned.

func.GetTargetSystemValueIfEmptyReturnDefault("false","Object is not found","#SPFDesignDocMaster,.Name=[DOCMASTER_NAME]","-SPFPrimaryClassification.UID")

Example 4

This example shows how multiple relationships can be navigated. -RelDef1+RelDef2.Name navigates RelDef1 from end2 to end1, and RelDef2 from end 1 to end 2. This returns the object name from the end of those relationships. If the object is not found, then the specified default string value is returned.

func.GetTargetSystemValueIfEmptyReturnDefault("false","Folder1 is not found","#SPFFolder,.Name='Folder1'","-SPFFolderDocumentVersion+SPFFolderSupportItem.Name")

GetValueFromTargetSystem

This computed column retrieves the value of a property from the target system. It uses the following parameters:

IncludeHigherConfiguration – Used to specify whether to include a higher configuration in the query or not.

QueryDef – Used to find an object in the target system. You can specify the class definition of the object and any property values found on that object or a related object. Any number of criteria can be added by separating them with a comma. This parameter must be a constant string, but it can reference other columns within the string if you enclose each of those columns in brackets [ ]. For example, func.Concat({[TestColumn1], [TestColumn2], [TestColumn3]}). If the object is not found in the target system, then "NULL" value is returned.

ReturnDef - Used to describe the property to be returned from the target system. You can specify the relationships to navigate to, followed by the property you want to retrieve. Any number of relationships can be navigated. This parameter must be a constant string.

  • You must use the target system schema in the QueryDef and ReturnDef.

  • If multiple objects are found either by the QueryDef or by navigating to the relationships, then multiple values are returned, each separated by a comma.

Example 1

In this example, the first parameter specifies items at a higher configuration or not. The second parameter is specified to find the object with the class definition SPFDesignDocMaster and the UID Document1. The third parameter specifies to return the Name of that object.

func.GetValueFromTargetSystem("false", "#SPFDesignDocMaster,.UID='Document1'", ".Name")

Example 2

In this example, the same object is navigated using the SPFPrimaryClassification relationship from end 2 to end 1 to find the required UID property.

func.GetValueFromTargetSystem("false","#SPFDesignDocMaster,.UID='Document1'","-SPFPrimaryClassification.UID")

Example 3

In this example, a match on the name is used to find the object, instead of the UID. The name DOCMASTER_NAME is used to match on from the column, instead of entering it manually.

func.GetValueFromTargetSystem("false", "#SPFDesignDocMaster,.Name=[DOCMASTER_NAME]", "-SPFPrimaryClassification.UID")

Example 4

This example shows how multiple relationships can be navigated. -RelDef1+RelDef2.Name navigates RelDef1 from end2 to end1, and RelDef2 from end 1 to end 2. This returns the object name from the end of those relationships. If the object is not found, then the value, "NULL" is returned.

func.GetValueFromTargetSystem("false", "#SPFFolder,.Name='Folder1'", "-SPFFolderDocumentVersion+SPFFolderSupportItem.Name")