Mapping Attribute Values - Intergraph Smart P&ID - Help

Intergraph Smart P&ID Design Validation Help

Language
English
Product
Intergraph Smart P&ID
Search by Category
Help

In addition to mapping attribute names, you can also map attribute values. To map an attribute value, insert an XML element under the hierarchy level where the attribute value needs to be mapped.

The follwoing example illustrates the syntax for this XML element:

<NameOfAttribute - value-map ReplaceEntireString= X ReplaceSubString = Y>

X and Y represent a set of assignment expressions separated with a semi-colon.

For example, to change the PSPE attribute value \C150 to 1C0025 and \C300 to 2C0032, you can define the following XML Element:

The other available mapping options are listed below:

  • ReplaceEntireString - Replaces the entire attribute value with the given string.

    Syntax: <Attribute-value-map ReplaceEntireString=”OldValue1=NewValue1; OldValue2=NewValue2” />

    Example: <PSPE-value-map ReplaceEntireString=”/C150=1C0025; /C300=2C0032” />

    Explanation: The PSPE attribute value /C150 is replaced with 1C0025, and /C300 is replaced with 2C0032.

  • ReplaceSubString - Replaces all occurrences of the given string in the attribute value.

    Syntax: <Attribute-value-map ReplaceSubString=”OldValue1=NewValue1; OldValue2=NewValue2” />

    Example: <PSPE-value-map ReplaceSubString =”/=; C150=1C0025; C300=2C0032” />

    Explanation: The / is removed, C150 is replaced with 1C0025, and C300 is replaced with 2C0032.

  • DeleteSubString - Deletes all occurrences of the given string in the attribute value.

    Syntax: <Attribute-value-map DeleteSubString =”value1;value2” />

    Example: <PIPELINE-REFERENCE-value-map DeleteSubString ="-M4;-M5;-PP;-MSFS;-MSFD" />

    Explanation: If the pipeline reference attribute value is 150-WC-69137-11430X-M4, then it is modified to 150-WC-69137-11430X.

  • InsertStringAtEnd - Inserts the given string at the end of the attribute value.

    Syntax: <Attribute-value-map InsertStringAtEnd=”string to be inserted” >

    Example: <LSTU-value-map NPD="/*/*: ExtractValue" InsertStringAtEnd=” mm” />

    Explanation: Appends mm at the end of the NPD attribute value.

  • InsertStringAtNthPosition - Inserts given string at the given position in the attribute value.

    Syntax: <Attribute-value-map InsertStringAtNthPosition=”string to be inserted, inserted position” >

    Example: <ItemTag-value-map InsertStringAtNthPosition =”-IC,9" />

    Explanation: Inserts the -IC value to the item tag attribute value at 9th position. If the item tag value is 050-01002-A300, then it is modified to 050-01002-IC-A300.

  • DeleteNCharsFromEnd - Deletes the last given number of characters from the attribute value.

    Syntax: <Attribute-value-map DeleteNCharsFromEnd=”No of characters to be deleted from end” >

    Example: <Pipeline-Reference-value-map DeleteNCharsFromEnd =”5” />

    Explanation: Removes the last five characters from the pipeline reference attribute value. If the pipeline reference attribute value is 150-SV-21016-A300, then it is modified to 150-SV-21016.

  • DeleteNCharsFromNthPosition - Deletes the given number of characters from the given position in the attribute value.

    Syntax: <Attribute-value-map DeleteNCharsFromNthPosition =”No of characters to be deleted, position from which deletion should start” >

    Example: <Pipeline-Reference-value-map DeleteNCharsFromNthPosition =”6,1” />

    Explanation: Removes the first six characters of the pipeline reference attribute. If the pipeline reference attribute value is 050-L-01002-A300, then it is modified to 01002-A300.

Pattern matching options

Use the following syntax to extract only a part of the attribute value, and then map.

<NameofAttribute-value-map MappedAttributeName=X/>

X is a pattern expression used to extract the required part of the attribute value. X can have one or more set of patterns. The software uses the pattern that matches first. Each pattern in the X expressions is separated with a semi-colon (;).

  • ExtractValue - Extracts the required value from the attribute value using pattern matching.

    Syntax: <Attribute-value-map MappedAttributeName="*/*/*:ExtractValue" />

    Example 1: <SPRE-value-map NPD="*/*/*:ExtractValue"/>

    Explanation: The SPRE value is /C150/WNRFS:100, and SPRE is mapped as an attribute named NPD. Using the pattern matching Extract Value, 100 is extracted as the NPD value.

    In the above mentioned example, if the SPRE value for a component is /A1A/GC200, the SPRE value does not follow the syntax, so the NPD value is not extracted. To satisfy both the values, use multiple pattern mapping.

    Example 2: <SPRE-value-map NPD="*/*/*:ExtractValue;/*/GCExtractValue"/>

    Explanation: The first SPRE value follows the first pattern, and the second SPRE value follows the second pattern. If you use pattern matching to extract patterns matching ExtractValue and GCExtractValue from SPRE values /C150/WNRFS:100 and /A1A/GC200, the extracted NPD values are 100 and 200.

Use the following syntax to delete only a part of the attribute value, and then map the remaining value.

<NameofAttribute-value-map MappedAttributeName=X/>

X is a pattern expressions used to delete the required part of the attribute value. X can have one or more set of patterns. The software uses the pattern that matches first. X expressions are separated with a semi-colon (;).

  • DeleteValue - Deletes the required value from the attribute value using pattern matching.

    Syntax: <Attribute-value-map MappedAttributeName="*-*-*-DeleteValue-*” />

    Example 1: <PIPELINE-REFERENCE-value-map ItemTag="*-*-*-DeleteValue-*” />

    Explanation: Deletes part of the attribute value from the string where DeleteValue is specified.

  • Example 1: If the pipeline reference attribute is VH-63130-1-13450X-M4, then it is modified to VH-63130-1--M4.

  • Example 2: If the pipeline reference attribute is VH/63130/1/VH13450X/M4, the SPRE value does not follow the syntax, and the NPD value is not extracted. To satisfy both the values, use multiple pattern mapping.

    Example 2: <PIPELINE-REFERENCE-value-map ItemTag="*-*-*-DeleteValue-*;*/*/*/VHDeleteValue/*;" />

    Explanation: The first SPRE value follows the first pattern, and the second SPRE value follows the second pattern. If you use pattern matching to delete entire value after VH, the SPRE value VH/63130/1/VH13450X/M4, the extracted NPD values would be VH-63130-1--M4 and VH/63130/1/VH/M4.

You can also use the combination of attribute and pattern matching mapping options.

Example: <LSTU-value-map NPD="/*/*:ExtractValue" InsertStringAtEnd=” mm”/>

Explanation: The value after the colon (:) is extracted as the NPD, and mm is appended at the end.

Generic value mapping

In addition to mapping values of a specific attribute, generic values can also be mapped. To add generic value mapping, insert an XML element under the hierarchy level where the generic value needs to be mapped. The syntax for this XML element is as shown:

<GENERIC-value-map GenericValue1=MappedValue1 GenericValue2=MappedValue2>

For example, if any attribute has the value EQUI, it can be replaced with Equipment using the following XML element: