{
    "header": {
        "version": 1,
        "type": "record"
    },
    "body": {
        "record1": {
            "<1>": "declare function msg, fieldcount, send_event, rds_comm, next_key, Get_Status\r\ndeclare subroutine forward_event, btree.extract, obj_WO_Step, Set_Status, ErrMsg, Set_Property\r\nDECLARE SUBROUTINE RDS_REACT_RUN\r\n\r\n$insert logical\r\n$insert msg_equates\r\n$insert prod_spec_equates\r\n$insert quote_spec_equ\r\n$insert rds_equ\r\n$insert wo_verify_equ\r\nequ CrLf$ to char(13):char(10)\r\n\r\n\r\n  \r\nRDSId = Get_Property(@WINDOW:'.RDS_NO','TEXT')\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\nIF Get_Property(@WINDOW,'SAVEWARN') = 1 THEN\r\n\t\r\n\tVoid = RDS_Comm( 'STAMP_MOD' )\r\n\tVoid = RDS_Comm( 'WRITE_STAMP' )\r\n\t\t\r\n\tSet_Property(@WINDOW,'SAVEWARN',0)\t\t\t\t\t\t\t;* Added 9/18/2007\r\n\t\t\r\nEND\r\n\t\r\n\t\r\nForward_Event()\t\r\nRDS_React_Run(RDSId)\t;* Conversion of data to REACT_RUN and REACT_RUN_CI & Adds Sig to WO_MAT 3/18/2008 JCH\t   \r\n\t\t\r\n\r\n\t\r\n      \r\n\r\nRETURN 0\r\n****************************************************************************************************************************\r\nCreateWoVerify:\r\n   * GOING TO LEAVE THIS CODE HERE CAUSE THIS IS THE ONLY PLACE WHERE THEY CAN CHANGE THE REACTOR NUMBER\r\n   CurReactor = .reactor->text\r\n   RDSID      = .rds_no->text\r\n   if CurReactor <> get_property( @window, '@OrigReactor' ) then\r\n\t   * CHECK TO SEE IF IT IS THE FIRST BOX ON THIS REACTOR OF THIS WORK ORDER\r\n\t   WO = trim( field( .po_wo_partnum->text, '/', 3 ) )\r\n\t   open 'DICT.RDS' to DictRDSTable else\r\n\t      msg( '', 'Unable to open DICT.RDS...' )\r\n\t      return 0\r\n\t   end\r\n\t   SearchStr = 'WO':@vm:WO:@fm\r\n\t   btree.extract( SearchStr, 'RDS', DictRDSTable, keys, '', flag)\r\n\t   if Flag <> 0 then\r\n\t      Void = msg( '', 'Error while extracting RDS records...' )\r\n\t      return 0\r\n\t   end\r\n\t   if Keys then\r\n\t      convert @vm to @fm in Keys\r\n\t      Reactors = xlate( 'RDS', Keys, rds_reactor$, 'X' )\r\n\t      locate CurReactor in Reactors using @fm setting FPos else\r\n             * NEEDS A WO VERIFICATION DUE TO IT BEING THE FIRST BOX TO RUN OUT OF THIS WORK ORDER ON THIS REACTOR \r\n\t\t\t * CREATE THE VERIFICATION AND STAMP RDS ID\r\n\t\t\t open 'RDS' to RDSTable else\r\n\t\t\t    msg( '', 'Unable to open RDS...' )\r\n\t\t\t    return 0\r\n\t\t\t end\r\n\t\t\t open 'WO_VERIFY' to WOVerifyTable else\r\n\t\t\t    msg( '', 'Unable to open RDS...' )\r\n\t\t\t    return 0\t\t\t \r\n\t\t\t end\r\n\t\t\t KeyToUse = next_key( 'WO_VERIFY', WOVerifyTable, 'NEXT', '' )\r\n\t\t\t WOVRec = ''\r\n  \t\t\t WOVRec<wo_verify_entry_id$>   = @user4\r\n\t\t\t WOVRec<wo_verify_entry_date$> = date()\r\n\t\t\t WOVRec<wo_verify_rds_id$>     = RDSID\r\n \t\t\t WOVRec<wo_verify_status$>     = 'O'\r\n\t\t\t write WOVRec on WOVerifyTable, KeyToUse else\r\n\t\t\t\tVoid = msg( '', 'Unable to write WO_VERIFY ':KeyToUse )\r\n\t\t\t\treturn 0\r\n\t\t\t end\r\n\t\t\t unlock WOVerifyTable, KeyToUse else\r\n\t\t\t\tVoid = msg( '', 'Unable to unlock WO_VERIFY ':KeyToUse )\r\n\t\t\t\treturn 0\r\n \t\t\t end  \r\n\t\t\t Void = next_key( 'WO_VERIFY', WOVerifyTable, 'UPDATE', KeyToUse )\r\n\t\t\t * NOW UPDATE THE RDS WITH THE WO_VERIFY ID\r\n\t\t\t * DO NOT NEED TO LOCK THE RDS CAUSE IT IS ALREADY LOCKED\r\n\t\t\t writev KeyToUse on RDSTable, RDSID, rds_wo_verify_id$ else\r\n\t\t\t\tVoid = msg( '', 'Unable to write to RDS ':RDSID )\r\n\t\t\t\treturn 0\r\n\t\t\t end\r\n\t      end\r\n\t   end\r\n   end\r\nreturn"
        }
    }
}