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 IntentComputation
Execution ContentClient

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 NameTypeRead/WriteComments
OperationIdStringReadParameter used to identify the mapping context. The following values are available:
  • "Coexistence" for any Coexistence scenario
  • "BriefcaseImport" for any V6 data exchange scenario
SourceStringReadParameter 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".
TargetStringReadParameter 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".
SourceTypeNameStringRead Customized type of the source PLM entity to be exchanged
ThisObjectPLMEntityNoneThis is an empty PLM proxy object with the Top Modeler abstract type. It is not to be used in the rule.
SourceObjectPLMEntityRead

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.

TargetCustoNameStringWriteOutput parameter returning the name of the customization for the target PLM Entity after rule computation.
CustoDisciplineStringWriteOutput parameter returning the value for the V_CustoDiscipline attribute of the target PLM entity after rule computation.
PolicyNameStringWriteOutput 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

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->IsSupporting("ENOSAM2_Part") == true)
         {
                  oCustoName = "PLMProductDS"
         }
          
         Parameters->SetAttributeString("TargetCustoName", oCustoName)   
    }
  if(Parameters->HasAttribute("PolicyName") == true)
  {
         Parameters->SetAttributeString("PolicyName", "CustomizedPolicy") 
  }

}

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)
{
...