Validate Compatibility of Type

An opening ID is an entry point used to customize business logic. The Validate Compatibility of Type opening id is available in the Mechanical interface and functional surface design resources set and it is used to check if two product instances can be connected.

Note: For more information about customization by business rules, see Customization by Business Rules.

This page discusses:

General Information

  • This opening ID is invoked while connecting two product instances using mechanical interfaces.
  • There is one check per Template.
  • The validity status can be used in connection rule.
  • If there is no rule for a mechanical interface type , it is considered as valid.

Input Objects

Input objects must be of the following types:

  • ThisObject: VPMPort
  • Parameters corresponds to the context object. Contains attributes to write the rule.
  • Validation: True or False

Sample

The type of an instance can be displayed in and copied from the Parameters for Type Compatibility list in the Mechanical Interface Parameters panel.

The following sample is a rule to check the type compatibility with the MIId as a basis:

/* Parameter definition */
let ToPlaceMId(String)
let TargetMId(String)

let SICompatibility(Integer)

let Undefined = 0
let Compatible = 1
let NotCompatible = 2

/* Parameter get */
set ToPlaceMId = Parameters.GetAttributeString("ToPlace_MIId")
set TargetMId = Parameters.GetAttributeString("Target_MIId")

/* Parameter check */
set SICompatibility = NotCompatible
if ((ToPlaceMId == "T#Key Housing 1G#FemaleU#f4e9c831_1aa4_55c994d8_7f2b2") and (TargetMId == "T#Key 1G#MaleU#f4e9c831_1aa4_55c992f1_6bb64"))
{
  set SICompatibility = Compatible
  Parameters.SetAttributeString( "IntermediatePart", "Yes" )
}
if ((ToPlaceMId == "T#Key 1G#MaleU#f4e9c831_1aa4_55c992f1_6bb64") and (TargetMId == "T#Key Housing 1G#FemaleU#f4e9c831_1aa4_55c994d8_7f2b2"))
{
  set SICompatibility = Compatible 
}

if(SICompatibility == Compatible) 
{
  Validation = True
  Parameters.SetAttributeInteger("SICompatibility",SICompatibility)
  Parameters.Message = "OK" 
}
else if(SICompatibility == NotCompatible) 
{
  Validation = False
  Parameters.SetAttributeInteger("SICompatibility",SICompatibility)
  Parameters.Message = "KO" 
}