Validate Segment-Support Combination at Source (EHI_ValidateSegmentSupportAtSourceAndTargetForCopyArrangement)

An opening ID is an entry point used to customize business logic. The Validate segment-support combination at source opening ID validates the segment support pair at the target and source support for the while using the Copy Arrangement command.

This opening ID is available in the Electrical physical system design resources resource set.

Note: For more information about customization by business rules, see Installation and Setup: Customize: Behavior: Data Setup: Customization by Business Rules.

This page discusses:

General Information

This opening ID is invoked when using the Copy Arrangement command. For more information, see Electrical 3D Design: Arranging Segments: Copying Arrangement between Supports.

To verify if Copy Arrangement is allowed on the current segment - support at source and segment - support at target, the business rule validates if the arrangement is to be copied or not. It can either:

  • Validate the copying of arrangement on the target support (severity = 0)
  • Validate the copying of arrangement on the target support with a warning message computed from the rules context (severity = 1)
  • Forbid copy arrangement on the target support with a warning message computed from the rules context (severity = 2)

The table below provides you with information related to the definition of the Opening ID.

PLM Opening ID: EHI_ValidateSegmentSupportAtSourceAndTargetForCopyArrangement
Customization intent: Validation
Execution context:Client

Input Objects

Input objects must be of the following types:

  • ThisObject: Source support selected
  • Parameters corresponds to the context object.
  • Validation
  • Severity messages:
    • Severity= 0 the treatment is to be continued (no message)
    • Severity= 1 the treatment is to be continued and only a warning raised)
    • Severity= 2 the treatment is supposed to be undone
Note: This notion is not mandatory but it is used by the electrical command.

Context Object Parameters

Parameter NameTypeRead/WriteComments
SourceSupportInstanceVPMInstance ReadSelected source support

Its reference has a SharedSupportPart type.

SegmentAtSourceSegmentReadSegment at source support
TargetSupportInstanceVPMInstance ReadSelected target support
SegmentAtTargetSegment ReadSegment at target support

Sample

The following sample illustrates the syntax of the business rule.

 /* CATRule signature (do not edit) : (ThisObject : #In Support, 
Parameters : #In RuleContext, Validation : #Out Boolean) : #Void */

let SrcSpt(Support)
let SrcSeg(Segment)
let TgtSpt(Support)
let TgtSeg(Segment)
let SrcName(STRING)
let TgtName(STRING)
let SubType(STRING)
set SrcSpt = Parameters.GetAttributeObject("SourceSupportInstance")
set SrcSeg = Parameters.GetAttributeObject("SegmentAtSource")
set TgtSpt = Parameters.GetAttributeObject("TargetSupportInstance")
set TgtSeg = Parameters.GetAttributeObject("SegmentAtTarget")


if((NULL == SrcSpt) or (NULL == TgtSpt) or (NULL == SrcSeg) 
   or (NULL == TgtSeg))
{
   Validation = false
   Parameters.Severity = 2
   Parameters.Message = "Param NULL"
}
else
{
   set SrcName = SrcSpt.Name
   set TgtName = TgtSpt.Name
}
{
if (SrcName == TgtName)
{
   Validation = false
   Parameters.Severity = 2
   Parameters.Message = "Not allowed"
}
else
{
   if(SrcSeg.Elec_SubType == TgtSeg.Elec_SubType)
   {
      Validation = true
      Parameters.Severity = 0
      Parameters.Message = "Copy Allowed - Both segments have same Subtype"
}
else
{
      Validation = true
      Parameters.Severity = 1
      Parameters.Message = "Copy Allowed with warning- Subtypes of the 
      segments does not match"
   }
}