General InformationThis opening ID is invoked when using a command that displays a list of specifications. The following commands are impacted:
This opening ID is used to customize to filter the list of specifications to only display the applicable specifications for the current context. The table below provides you with information related to the definition of the Opening ID.
Input ObjectsInput objects must be of the following types:
Context Object Parameters
SampleThe following sample is an example for filtering specifications for the following context: for "Out Of Spec" operation if the LineID operating temperature lies in between the Min && Max temp of the . /* Sample Rule - Start*/ /* Rule:- For "Out Of Spec" operation if the LineID operating temperature lies in between the Min && Max temp of the PipSpecification. Append it to the list to be sent as OUTPUT */ let EnsSpecs_Input (List) let EnsSpecs_Output (List) let EnsSpec_CurrentObj (EnsSpecification) let PipSpec_CurrentObj (PipSpecification) let NbEnsSpecs (Integer) let LineIDOcc_Value (LogicalOccurrence) let OperationName_Value(String) let name(String) let LogRef(RFLVPMLogicalReference) let LineID_Obj(Piping_Line) let LineID_Attr_Standard(string) let LineID_Attr_Temp(TEMPRTRE) let Spec_Attr_MinTemp(TEMPRTRE) let Spec_Attr_MaxTemp(TEMPRTRE) let Spec_Attr_Standard(String) let j (Integer) // Attribute names set on the Context to retrieve the value let EnsSpecList_Input_attr = "EnsSpecList_Input" /*List of EnsSpecifications */ let EnsSpecList_Output_attr = "EnsSpecList_Output" /*List of EnsSpecifications */ let EnsSpecList_OperationName_attr = "ApplicativeOperationName" let EnsSpecList_LineIDOcc_attr = "LineID_Occurrence" // Get OperationName attribute Value set OperationName_Value = Parameters.GetAttributeString(EnsSpecList_OperationName_attr) // Get LineID Occurrence object and retrieve the required information e.g. LineID Operating // Temperature set LineIDOcc_Value = Parameters ->GetAttributeObject( EnsSpecList_LineIDOcc_attr ) if ( NULL <> LineIDOcc_Value ) { Trace(1,"LineID Occurrence retrieved Successfully !!!") set LogRef = LineIDOcc_Value.Reference if ( NULL <> LogRef ) { set LineID_Obj = LogRef if ( NULL <> LineID_Obj) { set LineID_Attr_Standard = LineID_Obj.V_Standard set LineID_Attr_Temp = LineID_Obj.V_OperatingTemperature Trace(1,"LineID Attributes read successfully !!!") } } } // Get Input Spec List to process set EnsSpecs_Input = Parameters ->GetAttributeObject (EnsSpecList_Input_attr) set NbEnsSpecs = EnsSpecs_Input.Size() let EnsSpecName_Value (String) set j = 1 for j while j <= NbEnsSpecs { set EnsSpec_CurrentObj = EnsSpecs_Input.GetItem(j) if (NULL <> EnsSpec_CurrentObj) { set EnsSpecName_Value = EnsSpec_CurrentObj.V_Name set PipSpec_CurrentObj = EnsSpec_CurrentObj if ( NULL <> PipSpec_CurrentObj ) { set Spec_Attr_MinTemp = PipSpec_CurrentObj.V_MinTemperature set Spec_Attr_MaxTemp = PipSpec_CurrentObj.V_MaxTemperature set Spec_Attr_Standard = PipSpec_CurrentObj.V_Standard if ( OperationName_Value == "Operation_OutOfSpec" ) // For *OUT OF SPEC* operation //use the follwing logic to filter the EnsSpecifications { // If the LineID operating temperature less than Max temp of the PipSpecification and // Standards are same. Append it to the list to be sent as OUTPUT if ( ( LineID_Attr_Temp <= Spec_Attr_MaxTemp ) and ( Spec_Attr_Standard == LineID_Attr_Standard )) { EnsSpecs_Output.Append( EnsSpec_CurrentObj ) } } else { if ( OperationName_Value == "Operation_SetLineIDSpec" ) { if ( ( LineID_Attr_Temp >= Spec_Attr_MinTemp ) and ( LineID_Attr_Temp <= Spec_Attr_MaxTemp ) and ( Spec_Attr_Standard == LineID_Attr_Standard ) ) { EnsSpecs_Output.Append( EnsSpec_CurrentObj ) } } } } } } // Set the output Parameters ->SetAttributeObject (EnsSpecList_Output_attr, EnsSpecs_Output) if ( EnsSpecs_Output.Size() > 0 ) { Trace(1,"Business Rule - Successful Execution !!!") } else { Trace(1,"Business Rule - No matching EnsSpecification found as per the criteria !!!") } /* Sample Rule - End*/ |