Custo Type Mapping Business Logic (PLMCustoTypeMapping)

This article describes how to define and integrate the customer Business Logic for PLM customization type mapping based on the Enterprise Knowledge scripting technology.

This page discusses:

Business Logic Intent

This Business Logic Opening allows the integration of customer policy for the mapping of customized types when exchanging PLMEntities. In a Coexistence scenario, it will allow you to determine the target custo name of each PLM entity from the source custo type and source attribute values.

PLM Opening Definition

This section describes the objects defining the PLM opening: its global information, its input object type, its context object parameters.

General Information

PLM Opening ID

PLMCustoTypeMapping

Customization Intent Computation
Execution Content Client

Input Objects

The Business Logic can be invoked for any PLM component type. This means that your implementation can safely use the PLM public attributes of the PLM component.

Context Object Parameters

Parameter Name Type Read/Write Comments
OperationId String Read Parameter used to identify the mapping context. The following values are available:
  • "Coexistence" for any Coexistence scenario
  • "BriefcaseImport" for any V6 data exchange scenario
Source String Read Parameter used to specify the mapping context with the source of the data. In the "Coexistence" operation, it matches the name of the source provider. In a V6 data exchange scenario, the value is necessarily "PLM1".
Target String Read Parameter used to specify the mapping context with the target of the data. In the "Coexistence" operation, it matches the name of the target provider. In a V6 data exchange scenario, the value is necessarily "PLM1".
SourceTypeName String Read Customized type of the source PLM entity to be exchanged
ThisObject PLMEntity None This is an empty PLM proxy object with the Top Modeler abstract type. It is not to be used in the rule.
SourceObject PLMEntity Read

This is a PLM proxy object with the same top modeler type and custo type as the source PLM entity to be exchanged. Reading this PLM entity, the BL can retrieve source attribute values.

TargetCustoName String Write Output parameter returning the name of the customization for the target PLM Entity after rule computation.
CustoDiscipline String Write Output parameter returning the value for the V_CustoDiscipline attribute of the target PLM entity after rule computation.
PolicyName String Write Output parameter returning the value for the policy attribute of the target PLM entity after rule computation. This valuation is optional.
Note: Depending on the context, some parameters may be unset. Attribute validity must therefore be checked before reading.

The policy attribute of the target PLM entity is read first on the source object. If it is null, it can be valuated during CustoTypeMapping Business Logic computation through the PolicyName attribute of Parameters as described above.

If the policy is still not set after Business Logic computation, it is set by default.

Once the policy is defined, it will be set on the target PLM Entity and will be available on the Parameters objects of other Business Logic Opennesses such as Attributes Mapping and Identification Initialization.

Implementation Sample for FBDI

The following script samples illustrate how to compute PLMProductDS customization for an ENOSAM2 PLMCoreReference object. To achieve this particular Business Logic implementation you must associate a script (for example "MyCustoTypeMappingScript") with the <OpeningID, Type> pair in a CATRuleExit file:

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

You must then create a CATRule file (for example MyCustoTypeMappingScript.CATRule) to define your Business Logic:

Let SourceObject(PLMEntity)
Let oCustoName(String)
oCustoName = ""

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

if(SourceObject <> NULL)
{
    if(Parameters->HasAttribute("TargetCustoName") == true)
     {
         if(SourceObject->IsASortOf("ENOSAM2_Part") == true)
         {
                  oCustoName = "PLMProductDS"
         }
          
         Parameters->SetAttributeString("TargetCustoName", oCustoName)   
    }
  if(Parameters->HasAttribute("PolicyName") == true)
  {
         Parameters->SetAttributeString("PolicyName", "CustomizedPolicy") 
  }

}

Implementation Samples for CAD Transition

The following script samples illustrate how to customize type mapping for 3DEXPERIENCE content with CATIA V5 format and 3DEXPERIENCE parts with other CAD format:

Sample 1: CustoTypeMappingRuleFBDI.CATRuleExit

<Scripts>
  <Script OpeningID="PLMCustoTypeMapping" Type="myCustoType1" ScriptName="CustoTypeMappingRuleFBDI">
    <Condition Attribute="OperationId" Value="Coexistence"/>
    <Condition Attribute="Source" Value="FILE"/>
    <Condition Attribute="Target" Value="PLM1"/>
  </Script>
</Scripts>

Sample 2: CustoTypeMappingRuleFBDI.CATRule

Let ConcreteType(String)
Let TargetPolicy(String)

ConcreteType =" myCustoType2"
Parameters->SetAttributeString("TargetCustoName", ConcreteType)

The following script samples illustrate how to customize type mapping for 3DEXPERIENCE assemblies with other CAD format:

Sample 1: CustoTypeMappingRuleCADTransition.CATRuleExit

<Scripts>
   <Script OpeningID="PLMCustoTypeMapping" Type=" myCustoType1" ScriptName="CustoTypeMappingRuleCADTransition">
    <Condition Attribute="OperationId" Value="Coexistence"/>
    <Condition Attribute="Source" Value="PLM1"/>
    <Condition Attribute="Target" Value="PLM1"/>
  </Script>
</Scripts>

Sample 2: CustoTypeMappingRuleCADTransition.CATRule

Let ConcreteType(String)
Let TargetPolicy(String)

ConcreteType =" myCustoType2"
Parameters->SetAttributeString("TargetCustoName", ConcreteType)

Recommendations

Before using an optional input parameter, you must check its value. For instance, to check if the SourceObject parameter is valuated or not, use the following code sequence:

...
GetAttributeObject("SourceObject")
if(SourceObject <> NULL)
{
...