Customized Attribute and Type Mapping

This task describes how customized attributes and customized types can be mapped to 3DEXPERIENCE.

This page discusses:

CAA Concepts Used for Mapping

Some concepts explained here require knowledge of the 3DEXPERIENCE platform architecture and how attributes and types must be declared.

These concepts are explained in the CAA documentation, Infrastructure: VPM Multi-Discipline Collaboration: PLM Concepts: Understanding PLM Attributes.

A knowledge of how to design CATRules and CATRuleExits is also required. These concepts are explained in the CAA documentation, Infrastructure: VPM Multi-Discipline Collaboration: PLM Concepts: PLM Customization by Rules.

To define the attributes mapping, you need to set up a PLMRules script. You need to deliver a default Business Rule script based on:

  • a CATRule file located under the directory intel_a/resources/knowledge/scripts and
  • CATRuleExit files in the same location. These files will contain the details of the definition of the customized types and customized attributes and the name of the script to call. To write the Rules scripts, a template script will be available.

Articles on the Rules and RuleExits to be created for Attribute and Type mapping can be found at:

  • Installation and Setup: Customize: Behavior: Data Setup: List of Resource Set IDs: Coexistence: Custo Type Mapping Business Logic (PLMCustoTypeMapping)
  • Installation and Setup: Customize: Behavior: Data Setup: List of Resource Set IDs: Coexistence: Attribute Mapping Business Logic (PLMAttributesMapping)
Important: Sample Rules and RuleExits are available in $installpath/win_b64/resources/samples .

Type Mapping

You first create a .CATRuleExit file to define the target customized type to map and the associated script to call this mapping.

The file will have the following syntax:

<Scripts>
 <Script OpeningID="PLMCustoTypeMapping" Type="VPMReference" ScriptName="NameOfTheCATRuleFileForCustoAMapping"/>
  <Condition Attribute="OperationId"   Value="Coexistence"/> 
  <Condition Attribute="Source" Value="XXX"/>
  <Condition Attribute="Target" Value="PLM1"/>
 </Script>
</Scripts>

where XXX is the Source Connector identifier.

It makes the relationship between an opening ID, a type of the input object, and the script that must be executed if the input object is of this given type. The Condition fields define the name of the project that uses the script, the source connector and the target connector. In our context, the line <Condition Attribute="OperationId" Value="Coexistence"/> context is frozen and will not be changed.

Then, you have to create a .CATRule file that will be executed when transferring an object having an input type as specified in the .CATRuleExit script.

The following example shows mapping from the XXXPartReference type to the VPMReference type:

Let SourceObject(DatabaseObjectType)
Let oCustoType(String)
oCustoType = ""
set SourceObject = Parameters->GetAttributeObject("SourceObject") 
if(Parameters->HasAttribute("TargetCustoName") == true)
{
  if(SourceObject->IsSupporting("XXXPartReference") == true)
    {
      oCustoType = "VPMReference"
    }
  Parameters->SetAttributeString("TargetCustoName", oCustoType)
}

where XXX is the Source Connector identifier.

Type Mapping Considerations

The following considerations should be taken into account for type mapping:

  • For the SourceObject, the available attribute values that can be used in the script to evaluate the target customization type are: "free", "user".
  • The PLMRule will only be called at object creation; it is not possible to update an object's customization type.

Attribute Mapping

The second .CATRuleExit file is used to define the associated script to call attribute mapping.

For the PLMProductDS type in the case of the previous example, where XXX is the source connector identifier:

<Scripts>
  <Script OpeningID="PLMAttributesMapping" Type="PLMProductDS" ScriptName=" NameOfTheCATRuleFileForCustoAttrMapping "/>
    <Condition Attribute="OperationId" Value="Coexistence"/> 
    <Condition Attribute="Source" Value="XXX"/>
    <Condition Attribute="Target" Value="PLM1"/>
  </Script>
</Scripts>

The user can then define his attributes mapping for the associated target type PLMProductDS. The following example shows a case of simple mapping (string to string):

Let SourceObject(DatabaseObjectType)
Let SourceObject_VDesc(String)
Let SourceObject_BA_matSpec(String)

set SourceObject = Parameters->GetAttributeObject("SourceObject")

if(SourceObject->IsSupporting("XXXPartReference") == true)
 {
   SourceObject_VDesc = SourceObject->GetAttributeString("V_description") SourceObject_BA_matSpec = 
   SourceObject->GetAttributeString("BA_material_spec")
   ThisObject.V_description = SourceObject_VDesc + SourceObject_BA_matSpec
 }

where XXX is the Source Connector identifier.

The following example shows a mapping of People and Organization information:

Let SourceObject(DatabaseObjectType)
Let SourceObjectPlantCode(String)
SourceObjectPlantCode=""
Let SourceObjectUser=""
Let SourceObjectProject=""
Let SourceObjectOrganization=""
Let ExchangeObject(TEBLExchangeObject)
set SourceObject = Parameters->GetAttributeObject("SourceObject")
if(SourceObject <> NULL)
{
				SourceObjectPlantCode = SourceObject->GetAttributeString("V_PlantCode")
				ThisObject.V_description = SourceObjectPlantCode
}
if(SourceObject <> NULL)
{
				SourceObjectUser = SourceObject->GetAttributeString("V_user")
				SourceObjectProject = SourceObject->GetAttributeString("V_project")
				SourceObjectOrganization = SourceObject->GetAttributeString("V_organization")
				if(SourceObjectUser=="OLD_USER")
						ExchangeObject.MappedUser = "NEW_USER"
				else
						ExchangeObject.MappedUser = SourceObjectUser
				ExchangeObject.MappedProject = SourceObjectProject
				ExchangeObject.MappedOrganization = SourceObjectOrganization
}

where XXX is the Source Connector identifier.

Attribute Mapping Considerations

The following considerations should be taken into account for attribute mapping:

  • For the SourceObject, the available attribute values that can be used in the script to evaluate the target customization type are: "free" and "user".
  • This mapping rule concerns only the "free" and "user" attributes on the target customization. These are the only attribute values that can be manipulated inside the Rule at object creation or update. For more information, see the dedicated PLMDictionary documentation.
  • All "free" and "user" attributes of the target customization type that are also present on the source object will be transferred automatically if there is no specific mapping on them.