About Business Logic

Below is some information about the use of Business Logic.

This page discusses:

About Customized Types Mapping

Below is some information about types mapping.

The customized types for VPMReference and VPMRepReference specified by a Business Logic are taken into account at import.

  • The Business Logic defines the customized type for VPMReference and VPMRepReference for the operation DataExchangeImport.
  • The customized types are registered in the dictionary of valid types.
  • You cannot specify applicative types by a Business Logic

Example:

  • CATRuleExit
    <Scripts>
    	<Script OpeningID="PLMCustoTypeMapping" Type="VPMReference" ScriptName="Tst_TypesMapping_NT">
    		<Condition Attribute="OperationId" Value="DataExchangeImport"/>
    	</Script>
    	<Script OpeningID="PLMCustoTypeMapping" Type="VPMRepReference" ScriptName="Tst_TypesMapping_Part_NT">
    		<Condition Attribute="OperationId" Value="DataExchangeImport"/>
    	</Script>
    </Scripts>
  • TST_TypesMapping_NT
    Let SourceObject(PLMEntity)
    Let oCustoName(String)
    
    set SourceObject = Parameters->GetAttributeObject("SourceObject")
    
    if(Parameters->HasAttribute("TargetCustoName") == true)
    {
    	oCustoName = "custoRefType"
    	
    	Parameters->SetAttributeString("TargetCustoName", oCustoName)
    }
  • TST_TypesMapping_Part_NT
    Let SourceObject(PLMEntity)
    Let oCustoName(String)
    
    set SourceObject = Parameters->GetAttributeObject("SourceObject")
    
    if(Parameters->HasAttribute("TargetCustoName") == true)
    {
    	oCustoName = "custoRepRefType"
    	
    	Parameters->SetAttributeString("TargetCustoName", oCustoName)
    }

About V_Usage

Below is some information about V_Usage.

V_usage is exposed in the Business Logic proxy during DataExchangeImport operation on VPMReference objects. The value is “” for basic Product Reference and “3DPart” for 3DParts. You can find an example for the use of this value below.

Example

  • V_usage_example.CATRuleExit
    <Scripts>
    	<Script OpeningID="PLMCustoTypeMapping" Type="VPMReference"
    ScriptName="V_usage_example">
    		<Condition Attribute="OperationId" Value="DataExchangeImport"/>
    	</Script>
    </Sripts>
  • V_usage_exampleCATRule
    Let oCustoName(String)
    Let Usage(String)
    
    Usage = ""
    
    if(Parameters->HasAttribute("TargetCustoName") == true
    {
    	oCustoName = "DICTestReference"
    	
    	if ( ThisObject->HasAttribute("V_usage") == true
    	{
    		Usage = ThisObject.V_usage
    	}
    	if(Usage == "3DPart")
    	{
    	oCustoName = "DICTestReference2"
    	}
    	Parameters->SetAttributesString("TargetCustoName", oCustoName)
    	}