General InformationThis opening ID is invoked:
The table below provides you with information related to the definition of the Opening ID.
Input ObjectsThe Business Logic can be invoked for at least the listed Component Type. It means that your implementation can safely use the attributes of the default Component. Several possible uses of the BL are possible depending on their purpose:
Context Object Parameters (in addition to standard message and Severity parameters for validation BL)For Materials
For Documents Attached to Objects
For Implement Links
Sample For MaterialsThe following BL samples show how to check the material's maturity, the maturity of the support, the project and the kind of object on which the material is applied. /* The following rule is an example of what can be done/* /* ----------------- */ /* Declare */ /* ----------------- */ Let Reference (CATMatReference)/*The material reference*/ Let SupportFeat (Feature) /*The support of the material */ Let ProductContext (PLMEntity) /*The product context in which the material is applied*/ Let RepInstance (PLMEntity) /*The RepInstance in which the material is applied*/ Let s="" Let maturity="" Let matProject="" /* ------------------ */ /* Affectations */ /* ------------------ */ if ( true == Parameters -> HasAttribute("Target") ) { set Reference = Parameters->GetAttributeObject("Target") } if ( true == Parameters -> HasAttribute("Context") ) { set ProductContext = Parameters->GetAttributeObject("Context") } if ( true == Parameters -> HasAttribute("Support") ) { set SupportFeat = Parameters->GetAttributeObject("Support") } if ( true == Parameters -> HasAttribute("RepInstance") ) { set RepInstance = Parameters->GetAttributeObject("RepInstance") } /* ------------------ */ /* Sample Tests */ /* ------------------ */ Validation=true /* Test on context maturity */ if ( ProductContext == NULL ) { Validation=false Parameters.Message = "Context must not be NULL" Parameters.Severity=2 } else { if ( true == ProductContext -> HasAttribute( "current" ) ) { maturity = ProductContext -> GetAttributeString( "current" ) if ( "IN_WORK" <> maturity ) { Validation=false Parameters.Message = "Applying material requires an \"IN_WORK\" product context" Parameters.Severity=2 } } } /* Test on Support type */ if ( SupportFeat == NULL ) { Validation=false Parameters.Message = "Support must not be NULL" Parameters.Severity=2 } else { if ( false == (SupportFeat -> IsASortOf( "PLMEntity" )) ) { Validation=false Parameters.Message = "Applying materials on feature is forbidden" Parameters.Severity=2 } } /* Test on material reference */ if (Reference == NULL) { Validation=false Parameters.Message = "Material Reference must not be NULL" Parameters.Severity=2 } else { if ( true == Reference -> HasAttribute( "project" ) ) { matProject = Reference -> GetAttributeString( "project" ) if ( "Default" <> matProject ) { Validation=false Parameters.Message = "Material reference must be in \"Default\" project" Parameters.Severity=2 } } } Sample For Documents Attached to ObjectsThe following rule sample shows how to check some attributes values (e.g. V_description) of the product to which the document is attached. If (ThisObject.V_description == "Test") { validation = TRUE } else { validation = FALSE } if (validation == FALSE) { Parameters.Message = "Cannot attach the document under the Product" Parameters.Severity=2 } Sample For Implement LinksThe following sample shows how to validate the implement links between logical references in the Functional & Logical Design: let PointingComplexObject(List) let PointedComplexObject(List) let PointingObj(PLMEntity) let PointedObj(PLMEntity) set PointingComplexObject = Parameters->GetAttributeObject("Source") set PointedComplexObject = Parameters->GetAttributeObject("Target") if(PointingComplexObject->Size() == 1) { set PointingObj = PointingComplexObject->GetItem(1) } if(PointedComplexObject->Size() == 1) { set PointedObj = PointedComplexObject->GetItem(1) } if (PointingObj.V_description == "AAAAA" AND PointedObj.V_description == "BBBBB") { Validation = true } else { Validation = false } if (Validation == false) { Parameters.Message = "BusinessLogic rule for PLMRelationEstablishmentCheck KO" } It will be associated with the RFLVPMLogicalReference type: <Script OpeningID="PLMRelationEstablishmentCheck" Type="RFLVPMLogicalReference" ScriptName="FL_ImplementLinkScope_Validation"> <Condition Attribute="RelationType" Value="PLM_ImplementLink_Target" /> </Script> |