Function RDS_Layer_Actions(Action, CalcColName, FSList, Handle, Name, FMC, Record, Status, OrigRecord, Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10) /*********************************************************************************************************************** This program is proprietary and is not to be used by or disclosed to others, nor is it to be copied without written permission from Infineon. Name : RDS_Layer_Actions Description : Handles calculated columns and MFS calls for the current table. Notes : This function uses @ID, @RECORD, and @DICT to make sure {ColumnName} references work correctly. If called from outside of a calculated column these will need to be set and restored. Parameters : Action [in] -- Name of the action to be taken CalcColName [in] -- Name of the calculated column that needs to be processed. Normally this should only be populated when the CalcField action is being used. FSList [in] -- The list of MFSs and the BFS name for the current file or volume. This is an @SVM delimited array, with the current MFS name as the first value in the array, and the BFS name as the last value. Normally set by a calling MFS. Handle [in] -- The file handle of the file or media map being accessed. Note, this does contain the entire handle structure that the Basic+ Open statement would provide. Normally set by a calling MFS. Name [in] -- The name (key) of the record or file being accessed. Normally set by a calling MFS. FMC [in] -- Various functions. Normally set by a calling MFS. Record [in] -- The entire record (for record-oriented functions) or a newly-created handle (for "get handle" functions). Normally set by a calling MFS. Status [in/out] -- Indicator of the success or failure of an action. Normally set by the calling MFS but for some actions can be set by the action handler to indicate failure. OrigRecord [in] -- Original content of the record being processed by the current action. This is automatically being assigned by the WRITE_RECORD and DELETE_RECORD actions within BASE_MFS. Param1-10 [in/out] -- Additional request parameter holders ActionFlow [out] -- Used to control the action chain (see the ACTION_SETUP insert for more information.) Can also be used to return a special value, such as the results of the CalcField method. History : (Date, Initials, Notes) 07/28/10 dmb Original programmer. 10/13/10 dmb Fix logic to extract the file handle if file has an index 03/26/11 dmb Add logic to save and restore @FILE.ERROR ***********************************************************************************************************************/ #pragma precomp SRP_PreCompiler $insert LOGICAL $insert FILE.SYSTEM.EQUATES $insert ACTION_SETUP $insert RDS_LAYER_EQUATES Declare function Tool_Parms_Services, Environment_Services, Logging_Services, Memberof Declare subroutine Logging_Services, Error_Services LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\RDS_LAYER_WriteIssue' LogDate = Oconv(Date(), 'D4/') LogTime = Oconv(Time(), 'MTS') LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' RDS_LAYER WriteIssue Log.csv' Headers = 'Logging DTM' : @FM : 'User' : @FM : 'RDS_LAYER Key ID' : @FM : 'Notes' objLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$) LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM If KeyID then GoSub Initialize_System_Variables Begin Case Case Action _EQC 'CalcField' ; GoSub Calc_Field Case Action _EQC 'READ_RECORD_PRE' ; GoSub READ_RECORD_PRE Case Action _EQC 'READ_RECORD' ; GoSub READ_RECORD Case Action _EQC 'READONLY_RECORD_PRE' ; GoSub READONLY_RECORD_PRE Case Action _EQC 'READONLY_RECORD' ; GoSub READONLY_RECORD Case Action _EQC 'WRITE_RECORD_PRE' ; GoSub WRITE_RECORD_PRE Case Action _EQC 'WRITE_RECORD' ; GoSub WRITE_RECORD Case Action _EQC 'DELETE_RECORD_PRE' ; GoSub DELETE_RECORD_PRE Case Action _EQC 'DELETE_RECORD' ; GoSub DELETE_RECORD Case Otherwise$ ; Status = 'Invalid Action' End Case If KeyID then GoSub Restore_System_Variables If Assigned(ActionFlow) else ActionFlow = ACTION_CONTINUE$ Return ActionFlow // ----- Calculated Columns -------------------------------------------------------------------------------------------- // // The typical structure of a calculated column will look like this: // // Declare function TableName_Actions // // A = {COL1} ; * Reference as many data columns in this way to ensure the dictionary dependency is generated. // // @ANS = TableName_Actions('CalcField', 'CalcColName') // // --------------------------------------------------------------------------------------------------------------------- Calc_Field: // Make sure the ActionFlow return variable is cleared in case nothing is calculated. ActionFlow = '' Begin Case Case CalcColName EQ 'EXPORT_CONTROL' ; GoSub EXPORT_CONTROL End Case return EXPORT_CONTROL: ProdSpecID = {PS_NO} ExportControl = Xlate('PROD_SPEC', ProdSpecID, 'EXPORT_CONTROL', 'X') If ExportControl NE True$ then ExportControl = False$ ActionFlow = ExportControl return // ----- MFS calls ----------------------------------------------------------------------------------------------------- READ_RECORD_PRE: // In order to stop a record from being read in this action these lines of code must be used: // // OrigFileError = 100 : @FM : KeyID // Status = 0 // Record = '' // ActionFlow = ACTION_STOP$ return READ_RECORD: // In order to stop a record from being read in this action these lines of code must be used: // // OrigFileError = 100 : @FM : KeyID // Status = 0 // Record = '' return READONLY_RECORD_PRE: // In order to stop a record from being read in this action these lines of code must be used: // // OrigFileError = 100 : @FM : KeyID // Status = 0 // Record = '' // ActionFlow = ACTION_STOP$ return READONLY_RECORD: // In order to stop a record from being read in this action these lines of code must be used: // // OrigFileError = 100 : @FM : KeyID // Status = 0 // Record = '' return WRITE_RECORD_PRE: EngineeringCheck = Memberof(@User4, 'ENGINEERING') If (EngineeringCheck EQ True$) then ActionFlow = ACTION_CONTINUE$ end else WriteIssue = False$ If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER Epi Time Min can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER Epi Time Min can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER Epi Time Max can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER Epi Time Max can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER Epi H2 Flow Min can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER Epi H2 Flow Min can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER Epi H2 Flow Max can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER Epi H2 Flow Max can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER TCS Flow Min can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER TCS Flow Min can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER TCS Flow Max can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER TCS Flow Max can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER Aux1 Min can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER Aux1 Min can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER Aux1 Max can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER Aux1 Max can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER F Offset Min can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER F Offset Min can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER F Offset Max can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER F Offset Max can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER Susc Etch Min can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER Susc Etch Min can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER Susc Etch Max can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER Susc Etch Max can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER Dilutent Min can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER Dilutent Min can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER Dilutent Max can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER Dilutent Max can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER Dopant Flow Min can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER Dopant Flow Min can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER Dopant Flow Max can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER Dopant Flow Max can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER HCL Flow Min can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER HCL Flow Min can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER HCL Flow Max can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER HCL Flow Max can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER Bake Time Min can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER Bake Time Min can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER Bake Time Max can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER Bake Time Max can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER DCS Flow Min can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER DCS Flow Min can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER DCS Flow Max can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER DCS Flow Max can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER Aux2 Min can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER Aux2 Min can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER Aux2 Max can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER Aux2 Max can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER S Offset Min can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER S Offset Min can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER S Offset Max can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER S Offset Max can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER R Offset Min can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER R Offset Min can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER R Offset Max can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER R Offset Max can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER Etch 1 Min can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER Etch 1 Min can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER Etch 1 Max can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER Etch 1 Max can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER Etch 2 Min can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER Etch 2 Min can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER Etch 2 Max can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER Etch 2 Max can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER Etch 3 Min can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER Etch 3 Min can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER Etch 3 Max can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER Etch 3 Max can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER UL Temp Min can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER UL Temp Min can only be cleared by a member of Engineering.') WriteIssue = True$ end If (OrigRecord NE '') AND (Record EQ '') then LogData = '' LogData<1> = LoggingDTM LogData<2> = @USER4 LogData<3> = Name LogData<4> = 'RDS_LAYER UL Temp Max can only be cleared by a member of Engineering.' Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$) Error_Services('Add', 'RDS_LAYER UL Temp Max can only be cleared by a member of Engineering.') WriteIssue = True$ end // User is attempting to erase data that is prohibited from being erased Set the FS104 error and block the write. If WriteIssue EQ True$ then OrigFileError = 104:': RDS_LAYER params can only be cleared by a member of Engineering.' Status = 0 Record = '' ActionFlow = ACTION_STOP$ Error_Services('LogStack') end else ActionFlow = ACTION_CONTINUE$ end end return WRITE_RECORD: return DELETE_RECORD_PRE: return DELETE_RECORD: return // ----- Internal Methods ---------------------------------------------------------------------------------------------- Initialize_System_Variables: // Save these for restoration later SaveDict = @DICT SaveID = @ID SaveRecord = @RECORD OrigFileError = @FILE.ERROR // Now make sure @DICT, ID, and @RECORD are populated CurrentDictName = '' If @DICT then DictHandle = @DICT<1, 2> Locate DictHandle in @TABLES(5) Using @FM Setting fPos then CurrentDictName = Field(@TABLES(0), @FM, fPos, 1) end end If CurrentDictName NE DictName then Open DictName to @DICT else Status = 'Unable to initialize @DICT' end @ID = KeyID If Record else // Record might not have been passed in. Read the record from the database table just to make sure. @FILE.ERROR = '' Open TableName to hTable then FullFSList = hTable[1, 'F' : @VM] BFS = FullFSList[-1, 'B' : @SVM] LastHandle = hTable[-1, 'B' : \0D\] FileHandle = \0D\ : LastHandle[1, @VM] Call @BFS(READO.RECORD, BFS, FileHandle, KeyID, FMC, Record, ReadOStatus) end end @RECORD = Record return Restore_System_Variables: Transfer SaveDict to @DICT Transfer SaveID to @ID Transfer SaveRecord to @RECORD @FILE.ERROR = OrigFileError return