CATDWC Attribute Mapping and Part Number Configuration (PLMAttributesMappingAndPN)

An opening ID is an entry point used to customize business logic.This section describes how to define and integrate the customer Business Logic for PLM attribute mapping based on the Enterprise Knowledge scripting technology.

Note: For more information about customization by business rules, see Installation and Setup: Customize: Behavior: Data Setup: Customization by Business Rules.

This page discusses:

General Information

This opening ID is invoked for any PLM component type.

The table below provides you with information related to the definition of the opening ID.

PLM Opening ID: DWCPLMAttributesMappingAndPN
Customization intent: Computation
Execution context: Client

Input Objects

Input objects must be of the following types:

  • ThisObject
  • Parameters which corresponds to the context object.

Context Object Parameters

Parameter NamesTypesRead/WriteComments
iOperationIdstringReadParameter used to identify the mapping context. The following value is available:
  • "CATDWCAttrMapAndPN" for any DWC scenario
iSourcePLMComponentReference CATIInstance_varReadIn a DWC scenario, this corresponds to the proxy of the Reference PLM entity for which the attribute mapping is computed. This can be NULL when processing a single representation.
iSourcePLMComponentRepresentation CATIInstance_varReadIn a DWC scenario, this corresponds to the proxy of the Representation PLM entity for which the attribute mapping is computed.
iContextNamestring Read Name of the current transfer context. It is NULL when running the conversion in a non-associative mode.
iSourceTypestringRead Position of the PLM component in the Product Structure to be converted. The values should be selected from the following: "Terminal Reference", "NonTerminal Reference", "Representation Reference".
iV5ObjectExtensionstring Read Type of the converted V5 object, whether CATPart, CATProduct, CATShape, CATDrawing
oEnterpriseItemNumber string Read The value of this attribute corresponds to the value of the V_PartNumber attribute on the EnterpriseExtension on the 3DEXPERIENCE side.
oPartNumberstring Write Parameter containing the customized Part Number when the converted CATPart is to be used in Part Number Configuration, set by the Rule script during computation.
oListOfTargetPropertiesName list Write Parameter containing the attribute names. Set by the Rule script during computation.
oListOfTargetPropertiesType list WriteParameter containing the attribute types. Set by the Rule script during computation.
oListOfTargetPropertiesValue list WriteParameter containing the attribute values. Set by the Rule script during computation.

Sample

The following script samples illustrate how to execute the mapping in order to set the PartNumber attribute value of a PLMProductDS reference from the "PLM_ExternalID" and "Resp" attribute values of the source object and to process the mapping of customer attribute information. To achieve this particular Business Logic implementation you must associate a script (e.g. "MyAttributesMappingScript") with the pair <OpeningID, Type> in a CATRuleExit file:

<Scripts>
       <Script OpeningID="PLMAttributesMappingAndPN"  Type="PLMProductDS"   ScriptName="AttributeMapping">
       <Condition Attribute="OperationId" Value="CATDWCAttrMapAndPN"/>
       </Script>
       <Script OpeningID="PLMAttributesMappingAndPN"  Type="PLMRepresentationDS"   ScriptName="AttributeMapping">
       <Condition Attribute="OperationId" Value="CATDWCAttrMapAndPN"/>
       </Script>
       <Script OpeningID="DWCPartNumber"  Type="PLMProductDS"   ScriptName="AttributeMapping">
       <Condition Attribute="OperationId" Value="CATDWCPN"/>
       </Script>
       <Script OpeningID="DWCPartNumber"  Type="PLMRepresentationDS"   ScriptName="AttributeMapping">
       <Condition Attribute="OperationId" Value="CATDWCPN"/>
       </Script>
</Scripts>

Then you must create a CATRule file (e.g. MyAttributesTypeMappingScript.CATRule) to define your Business Logic:

Let iSourceType(String)
Let iSourcePLMComponentReference(PLMProductDS)
Let iSourcePLMComponentRepresentation(PLMRepresentationDS)
Let AttrName(String)
Let AttrType(String)
Let AttrValue(Date)
Let RepAttrValue(String)
Let CurrentContext(String)
Let ListOfTargetAttrName  (list)
Let ListOfTargetAttrType  (list)
Let ListOfTargetAttrValue (list)
Let AttrForPartNaming (String)
Let index (Integer)
Let RepName(String)
Let Resp(String)
index=1
/*Check if Part Number is to be retrieved*/
if(Parameters->HasAttribute("PartNumber")==true)
{
                  if( ThisObject.HasAttribute("PLM_ExternalID") )
                  set RepName = ThisObject.GetAttributeString("PLM_ExternalID") 
                  if( ThisObject.HasAttribute("V_user") )
                  set Resp = ThisObject.GetAttributeString("V_user")

             AttrForPartNaming = RepName + Resp + "MyPartNumber"
             /* set PartNumber */
             Parameters->SetAttributeString("PartNumber", AttrForPartNaming)

/* Add a non-existing Attribute */
       ListOfTargetAttrName.SetItem("DataMasterSite",index)
       ListOfTargetAttrType.SetItem("String",index)
       ListOfTargetAttrValue.SetItem("V6",index)

       Parameters->SetAttributeObject("ListOfTargetAttrName",  ListOfTargetAttrName) 
       Parameters->SetAttributeObject("ListOfTargetAttrType",  ListOfTargetAttrType) 
Parameters->SetAttributeObject("ListOfTargetAttrValue",  ListOfTargetAttrValue)

/* Add oEnterpriseItemNumber to any non-existing Attribute */
if(ThisObject.HasAttribute("oEnterpriseItemNumber")==true)
{
         ListOfTargetAttrName.SetItem("MyDescription",index)
         ListOfTargetAttrType.SetItem("String",index)

         RepAttrValue=ThisObject.GetAttributeString("oEnterpriseItemNumber")
         ListOfTargetAttrValue.SetItem(RepAttrValue,index)
         Parameters->SetAttributeObject("ListOfTargetAttrName",ListOfTargetAttrName)
         Parameters->SetAttributeObject("ListOfTargetAttrType",ListOfTargetAttrType)
         Parameters->SetAttributeObject("ListOfTargetAttrValue",ListOfTargetAttrValue)
         index=index+1
}

}