General InformationThis opening ID is invoked for any PLM component type. The table below provides you with information related to the definition of the opening ID.
Input ObjectsInput objects must be of the following types:
Context Object Parameters
SampleThe 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
}
}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||