Context Object Parameters
Parameter Name | Type | Read/Write | Comments |
---|
SupportInstance (input) | VPMInstance |
Read | Support instance in which the branch section is arranged. |
SupportSection (input) | Integer | Read | Support section number. |
ListOfSegments (input) | List | Read | List of already routed segments in the support section. |
ListOfSegmentsU (input) | List | Read | List of already routed segments Position (U) with regards to support entry point and plane. |
ListOfSegmentsV (input) | List | Read | List of already routed segments Position (V) with regards to support entry point and plane. |
SegmentU (input) | Real | Read | Current U value of “ThisObject” to be validated. |
SegmentV (input) | Real | Read | Current V value of “ThisObject” to be validated. |
Sample
The following sample illustrates the business rule syntax.
/* CATRule signature (do not edit) : (ThisObject : #In Segment, Parameters : #In RuleContext, Validation : #Out Boolean) : #Void */
Let SegmentU (Real)
Let SegmentV (Real)
Let SegmentDiameter (Real)
Let SptSectionRadius (Real)
Let NewDistanceFromCenter (Real)
Let SegDistanceFromSptSection (Real)
/* Parameters available in the business rule, which will not be taken into account for acceptance test scenario as given below */
set SptSectionRadius = 30.0 /* We know the section radius of the support */
set SegmentU = Parameters.GetAttributeReal("SegmentU")
set SegmentV = Parameters.GetAttributeReal("SegmentV")
set SegmentDiameter = ThisObject.Elec_Diameter
/* This rule will validate that after modifying the segment U & V the segment should not collapse in the support */
set NewDistanceFromCenter = sqrt( SegmentU*SegmentU + SegmentV*SegmentV ) /* Center U and V = 0.0*/
set SegDistanceFromSptSection = NewDistanceFromCenter + SegmentDiameter - SptSectionRadius
if( SegDistanceFromSptSection > 0.0001) /* if this value is more than tolerance, the segment will clash with the support section so forbid the action */
{
Parameters.Severity = 2
Parameters.Message = "After this modification segment will clash with the support, hence business rule forbids this arrangement."
Validation = false
}
else if( ( SegDistanceFromSptSection < 0.0001) and ( SegDistanceFromSptSection >= 0.01) )
{
/* if this value is in the range tolerance to 0.01, the segment will be too close the the support, so allow this modification BUT with warning*/
Parameters.Severity = 1
Parameters.Message = "After this modification segment will be too close to the support, hence business rule allows this arrangement with warning."
Validation = true
}
else
{
/* This modification is OK*/
Parameters.Severity = 0
Parameters.Message = "This modification is OK."
Validation = true
}