LFS_ValidateAllocationLogicalInstanceToEquipmentCenterThis validation rule will be triggered each time a Logical Instance is added or removed from the association to the selected Equipment Center.
LFS_ValidateAllocationLogicalPortToPCPThis validation rule will be triggered each time a Logical Port is added or removed from the association to the selected PCP.
LSRRouting_ValidateMultiRoutableObjectsThis business rule is triggered at the start of the Manual Route command when more than one logical connection is selected for routing to check that selected connections are valid.
LSRRouting_ValidatePathwaySegmentThis business rule is triggered during routing each time a pathway segment is selected to check that the selected segment is valid.
ExampleThe following example checks whether or not the pathway segment belongs to the electrical discipline. If not, routing is interrupted and a message issued. if (ThisObject.Discipline == "Electrical") Validation=true else { Validation=false Parameters.Severity=2 } if (Validation <> true) Parameters.Message="The pathway segment must belong to the electrical discipline." LSRRouting_ValidateRouteThis business rule is triggered at the end of the Manual Route command to validate all the pathway segments selected for the route.
ExampleThe following example calculates the total route length and issues a warning message if the length exceeds 6000mm. let Length(LENGTH) let PS(PathwaySegment) let ListPS(List) Length = ThisObject.Length set ListPS = Parameters.GetAttributeObject("ListOfPathwaySegments") For PS inside ListPS Length = Length + PS.Length if (Length < 6000mm) Validation=true else Validation=false if (Validation <> true) Parameters.Message = "The total route length should be less than 6000mm. Here it is " + Length LSR_ValidateRouteComponentThis business rule is triggered each time the user tries to select a component other than a Pathway during the Manual Route command.
ExampleThe following example checks whether the selected component is valid as a Route Component depending on the value of the V_Description attribute of its Instance or related reference. Let listChildren(list) Let logRef (RFLVPMLogicalReference) Validation=false if(ThisObject.V_description == "RouteComponent") { Validation=true } else { listChildren= ThisObject.Children logRef= listChildren->GetItem(1) if ( logRef.V_description == "RouteComponent") { Validation=true } else { Validation=false } } LSR_GetLengthOfRouteComponentThis business rule is triggered each time the user tries to select another component than a Pathway during the Manual Route command.
ExampleThe following example returns a default Routed Length for the selected Route component. /* CATRule SIGNATURE BEGIN (do not edit) ------------------------------------ */ Let RouteLength_attr = "RouteLength" Let RouteLength_val (Length) /* In Meters */ /* CATRule SIGNATURE END ---------------------------------------------------- */ /* LOCAL VARIABLES BEGIN ---------------------------------------------------- */ Let Attr_Length = "Length" /* LOCAL VARIABLES END ------------------------------------------------------ */ /* USER ATTRIBUTE VALUES BEGIN ---------------------------------------------- */ /* New Route Component Length */ RouteLength_val = 0.111m /* USER ATTRIBUTE VALUES END ------------------------------------------------ */ /* SET VALUES BEGIN --------------------------------------------------------- */ Parameters -> SetAttributeDimension( RouteLength_attr, RouteLength_val, Attr_Length ) /* SET VALUES END ----------------------------------------------------------- */ LSRRouting_ComputePathwAttribThis business rule is triggered at the end of the Auto Pathway Routing command to set the pathway attributes. The user will be asked to select a proposed value for the pathway attributes.
ExampleThe following example gives you the list of the Pathway attributes that can be set when Routing them automatically. Let PathwaySetName_attr = "PathwaySetName" Let PathwaySetName_val (String) Let SectionType_attr = "SectionType" Let SectionType_val (Integer) Let Dimension1_attr = "Dimension1" Let Dimension1_val (Length) /* In Meters */ Let Dimension2_attr = "Dimension2 Let Dimension2_val (Length) /* In Meters */ Let BendRadiusRatio_attr = "BendRadiusRatio" Let BendRadiusRatio_val (Real) Let Discipline_attr = "Discipline" Let Discipline_val (String) Let Segregation_attr = "Segregation" Let Segregation_val (String) /* CATRule SIGNATURE END ---------------------------------------------------- */ /* LOCAL VARIABLES BEGIN ---------------------------------------------------- */ Let Attr_Length = "Length" let Severity_val (Integer) /* 0 = OK, 1 = Warning, 2 = Error */ let Message_val (String) /* Output user defined message */ /* LOCAL VARIABLES END ------------------------------------------------------ */ /*============================================================================*/ /* BUSINESS RULE BEGIN /*============================================================================*/ /* USER ATTRIBUTE VALUES BEGIN ---------------------------------------------- */ /* PathwaySetName_val = "Pathway100" /* Pathway Set Name */ /* SectionType_val = 1 /* 1 = Round, 2 = Rectangular */ /* Dimension1_val = .111m /* Diameter if Round, Height if Rectangular */ /* Dimension2_val = .222m /* Ignored if Round, Width if Rectangular */ /* BendRadiusRatio_val = .333 /* Bend radius value */ /* Discipline_val = "Discipline100" /* Discipline Value */ /* Segregation_val = "Segregation100" /* Segregation Value */ /* USER ATTRIBUTE VALUES END ------------------------------------------------ */ /*============================================================================*/ /* BUSINESS RULE CRITERIA /*============================================================================*/ /* USER BUSINESS RULE CRITERIA START (no message display for Severity = 0)------------*/ Severity_val = 0 Message_val = "" /* if( Dimension1_val == 0m ) { Severity_val = 2 Message_val = "Dimension Value should not be zero" } if( Dimension2_val == 0m ) { Severity_val = 2 Message_val = "Dimension Value should not be zero" } if( BendRadiusRatio_val == 0 ) { Severity_val = 2 Message_val = "Dimension Value should not be zero" } */ /* USER BUSINESS RULE CRITERIA END (no message display for Severity = 0)------------*/ /* SET VALUES BEGIN --------------------------------------------------------- */ /* Parameters -> SetAttributeString ( PathwaySetName_attr, PathwaySetName_val ) Parameters -> SetAttributeInteger ( SectionType_attr, SectionType_val ) Parameters -> SetAttributeDimension( Dimension1_attr, Dimension1_val, Attr_Length ) Parameters -> SetAttributeDimension( Dimension2_attr, Dimension2_val, Attr_Length ) Parameters -> SetAttributeReal ( BendRadiusRatio_attr, BendRadiusRatio_val ) Parameters -> SetAttributeString ( Discipline_attr, Discipline_val ) Parameters -> SetAttributeString ( Segregation_attr, Segregation_val ) */ /* SET VALUES END ----------------------------------------------------------- */ /* SET OUTPUT BEGIN --------------------------------------------------------- */ Parameters.Severity = Severity_val Parameters.Message = Message_val /* SET OUTPUT END ----------------------------------------------------------- */ L3m_BR_ValidatePositionThis validation rule will be triggered each time a 3d Space reservation is added to a logical Instance or moved.
L3m_BR_ValidatePathwayConnectThe validation rule will be triggered each time a Pathway is trying to get connected or disconnected from either another Pathway or a Logical Extremity.
L3m_BR_ComputePathwayAttrThis validation rule is triggered each time you create a pathway using the Create Pathway command or the Auto Pathway Routing command. The values in this rule define the default parameters of the new pathways.
PLMBusinessLogic_Logical_BLInstanceInitialization.CATRuleThis rule is triggered during the creation of an object. The values in this rule define the default names of the new object.
ExampleNote: You can modify and copy relevant segments of this example to your own rules, as required. /* CATRule signature (do not edit) : (ThisObject : #In RFLVPMLogicalInstance, Parameters : #In RuleContext) : #Void */ Let CustoType="" Let UniqueKey="" Let strTypediscipline="" Let TName="" Let Reference(PLMEntity) Let AggReference(PLMEntity) Let Operation(string) Let OperationDetail(string) Let CoupledRefId(string) Let CoupledRef(PLMProductDS) Let OriDesc(string) Let CopyFrom(PLMProductDS) Let CopyFromId(string) Let CloningString(string) Let PrimaryType(Type) Let RepInstance(RFLVPMLogicalRepInstance) Let Instance(RFLVPMLogicalInstance) /*--------------------------------------------------------------------------*/ Operation=Parameters->GetAttributeString("OperationId") OperationDetail = Parameters->GetAttributeString("OperationDetail") CustoType = Parameters->GetAttributeString("CustoType") If(Operation=="New" or Operation=="Implicit" or Operation=="Default") { Trace(1,"CATRule_Sample_for:Operation==New or Operation==Implicit or Operation==Default") UniqueKey = GetUniqueKey(CustoType) set Reference = Parameters->GetAttributeObject("Reference") set strTypediscipline = Reference.V_discipline /* Creation of Rep instances as V_discipline is empty */ if( strTypediscipline == "" ) { If (Parameters->HasAttribute("CoupledRef") == true) { if (OperationDetail == "Create") { set AggReference = Parameters->GetAttributeObject("AggregatingReference") set strTypediscipline = AggReference.V_discipline if(strTypediscipline == "EquipmentCenter") { /*Customized naming*/ ThisObject.PLM_ExternalID = "EC3_EquipmentCenter_Representation_instance_" + UniqueKey } else if(strTypediscipline == "RequirementVolume") { /* Customized naming */ ThisObject.PLM_ExternalID = "EC3_Zone_Representation_instance_" + UniqueKey } else if(strTypediscipline == "PathwaySet") { /* Customized naming */ ThisObject.PLM_ExternalID = "EC3_Pathway_Representation_instance_" + UniqueKey } else if(strTypediscipline == "Space_Allocation") { /* Customized naming */ ThisObject.PLM_ExternalID = "EC3_Space_Allocation_Representation_instance_" + UniqueKey } else { set PrimaryType = ThisObject.PrimaryType TName = PrimaryType.Name if ( "RFLVPMLogicalInstance" == TName ) { ThisObject.PLM_ExternalID = "EC3_Equipment_instance_" + UniqueKey } else if ( "RFLVPMLogicalRepInstance" == TName ) { ThisObject.PLM_ExternalID = "EC3_Equipment_Representation_instance_" + UniqueKey } } } } } else { /* Creation of instances */ if (OperationDetail == "Create") { if(strTypediscipline == "EquipmentCenter") { /*Customized naming*/ ThisObject.PLM_ExternalID = "EC3_EquipmentCenter_instance_" + UniqueKey } else if(strTypediscipline == "RequirementVolume") { /* Customized naming */ ThisObject.PLM_ExternalID = "EC3_Zone_instance" + UniqueKey } else if(strTypediscipline == "PathwaySet") { /* Customized naming */ ThisObject.PLM_ExternalID = "EC3_Pathway_instance" + UniqueKey } else if(strTypediscipline == "Space_Allocation") { /* Customized naming */ ThisObject.PLM_ExternalID = "EC3_Space_Allocation_instance" + UniqueKey } else { /* Customized naming */ ThisObject.PLM_ExternalID = "EC3_Equipment_instance" + UniqueKey } } } } /*-------------------------------------------------------------------------- if (OperationDetail == "CopyPaste") { /// Case of cloning if ((Operation=="Implicit") or (Operation=="Cloning")) { UniqueKey = GetUniqueKey(CustoType) set Reference = Parameters->GetAttributeObject("Reference") ThisObject.PLM_ExternalID = Reference.PLM_ExternalID + "." + UniqueKey } } /////Management of coupling between Representation Reference Naming and Part Reference naming If (Parameters->HasAttribute("CoupledRef") == true) { set CoupledRef = Parameters->GetAttributeObject("CoupledRef") /// Test if a coupled Part Reference exists if(CoupledRef <> NULL) { /// Retrieve the Attributes on the couple Part Reference CoupledRefId = CoupledRef->GetAttributeString("PLM_ExternalID") ThisObject.PLM_ExternalID = "3DRep of "+CoupledRefId ThisObject.V_description = "Representation for part "+CoupledRefId } else { /// Default naming based on a customized numbering Prefix = Parameters->GetAttributeString("IdString") ThisObject.PLM_ExternalID = Prefix +"Representation" } } --------------------------------------------------------------------------*/ |