Compare commits

...

18 Commits

Author SHA1 Message Date
8499d03ef8 modified update work order services to throttle better 2025-08-01 08:26:27 -07:00
3186ec1ad6 Bug fix to ensure correct WM_OUT key is identified and created. Added services to ensure WM_IN and WM_OUT indexes are maintained. 2025-07-31 17:18:09 -07:00
898f21b73d Refactored error checking to utilize ErrorMsg variable so that errors make their way back to the calling routine. 2025-07-30 17:07:01 +00:00
f7ee12a78d Fixed a bug where the ProcessProcedureQueue service would write an invalid record to the PROC_QUEUE2 table when failing to read a record. 2025-07-30 09:48:56 -07:00
475df5ba54 Minor bug fix in UpdateWorkOrderData. Modified ProcessRequest service to dump record for troubleshooting purposes. 2025-07-30 09:24:02 -07:00
28a8a10ba2 Not sure how this bug was re-introduced. 99% sure we pushed this to prod. 2025-07-29 16:16:32 -07:00
6934799e92 Added troubleshooting logs to find cause of LBLCHK transactions going missing 2025-07-29 21:11:25 +00:00
03f42dedea updated UpdateWorkOrderData service to correct WO_MAT records containing multiple RDS keys 2025-07-29 13:34:57 -07:00
033e3baee8 added condition to search RDS table for matching WO_MAT record to correct index 2025-07-29 12:52:06 -07:00
4bfae8e7b7 minor fix to prevent an error message from being displayed on brand new work orders 2025-07-29 12:03:55 -07:00
0f0c735023 added SYSOBJ check to the PostProcedure service to prevent invalid procedures from getting posted to the procedure queue 2025-07-29 11:56:42 -07:00
4eee1b0f0a modified check to look at WO_MAT record instead of WO_STEP to see if RDS already exists for a given cassette 2025-07-29 18:22:52 +00:00
e2e8731316 Removed uneccessary transaction postings 2025-07-29 10:52:39 -07:00
a21f41fd29 modified service to dispatch a single job at a time to avoid clogging up the SRP Engine Server 2025-07-29 09:33:11 -07:00
2bbc5c065d updated service to remove keys if lot is voided 2025-07-28 15:08:11 -07:00
9e54865e1e moved procedure call from WO_MAT_ACTIONS to a standalone service to avoid posting too many transactions 2025-07-28 14:34:20 -07:00
c7f1f86249 SP1 Misfit bug fix 2025-07-28 16:06:35 +00:00
c89bb6b3d4 added services and triggers to manually add index transactions to keep indexes up-to-date 2025-07-28 15:57:33 +00:00
22 changed files with 1427 additions and 213 deletions

View File

@ -488,9 +488,11 @@ Service PushSigProfileToWoMat(CleanInspKey)
If WOMatKey NE '' then
WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey)
If Error_Services('NoError') then
WOMatSigProf = WOMatRec<WO_MAT_SIG_PROFILE$>
WOMatSigs = WOMatRec<WO_MAT_SIGNATURE$>
WOMatSigDTMs = WOMatRec<WO_MAT_SIG_DTM$>
WOMatSigProf = WOMatRec<WO_MAT_SIG_PROFILE$>
WOMatSigs = WOMatRec<WO_MAT_SIGNATURE$>
WOMatSigDTMs = WOMatRec<WO_MAT_SIG_DTM$>
WOMatSigsOrig = WOMatSigs
WOMatSigDTMsOrig = WOMatSigDTMs
InspSig = Record<CLEAN_INSP_INSP_SIG$>
InspSigDTM = Record<CLEAN_INSP_INSP_SIG_DTM$>
@ -520,8 +522,12 @@ Service PushSigProfileToWoMat(CleanInspKey)
NumSteps = DCount(WOMatSigProf, @VM)
WOMatSigs = Field(WOMatSigs, @VM, 1, NumSteps)
WOMatSigDTMs = Field(WOMatSigDTMs, @VM, 1, NumSteps)
Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIGNATURE$, WOMatSigs)
Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIG_DTM$, WOMatSigDTMs)
If WOMatSigs NE WOMatSigsOrig then
Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIGNATURE$, WOMatSigs)
end
If WOMatSigDTMs NE WOMatSigDTMsOrig then
Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIG_DTM$, WOMatSigDTMs)
end
end else
ErrorMsg = 'Error in ':Service:' service. Error message: ':Error_Services('GetMessage')
end

View File

@ -8,7 +8,7 @@ COMPILE FUNCTION Comm_WO_Rec(Instruction, Parm1,Parm2)
DECLARE SUBROUTINE Set_Property, Set_Status, ErrMsg, Set_Property, obj_AppWindow, obj_Notes, Print_RX_Voucher, obj_Tables
DECLARE SUBROUTINE Btree.Extract, Send_Event, Security_Err_Msg, Forward_Event, End_Window, obj_WO_Log, obj_WO_Mat
DECLARE SUBROUTINE Logging_Services, Post_Event, Work_Order_Services, Error_Services, Database_Services
DECLARE SUBROUTINE Logging_Services, Post_Event, Work_Order_Services, Error_Services, Database_Services, Service_Services
DECLARE FUNCTION Get_Property, Get_Status, Popup, Send_Message, Msg, Security_Check, Dialog_Box, RowExists, obj_Prod_Spec
DECLARE FUNCTION obj_Schedule, Dialog_Box, obj_WO_Log, obj_Order_Det, FindWindow,ShowWindow, obj_Tables, obj_WO_Mat, MemberOf
DECLARE FUNCTION Logging_Services, Environment_Services, Work_Order_Services, Error_Services, Service_Services
@ -179,15 +179,19 @@ Read:
MsgUp = Msg(@window, Def)
Columns = 'CASS_NO':@VM:'LOT_NO':@VM:'WAFER_QTY':@VM:'CUST_PART_NO':@VM:'SUB_PART_NO':@VM:'SUB_VEND_CD':@VM:'RX_DTM':@VM:'RX_BY':@VM:'ORDER_ITEM'
WOMatKeys = Wo_Mat_Services('GetWOMatKeys', WONo)
If Error_Services('NoError') then
CassData = WO_Mat_Services('GetWOMatData', WOMatKeys, Columns)
If Error_Services('NoError') then
Set_Property(@Window:'.CASS_NO', 'ARRAY', CassData)
Msg(@window, MsgUp)
end else
Msg(@window, MsgUp)
Msg(@Window, '', 'OK', '', 'Process Error':@FM:Error_Services('GetMessage'))
end
If Error_Services('NoError') then
If (WOMatKeys NE '') then
CassData = WO_Mat_Services('GetWOMatData', WOMatKeys, Columns)
If Error_Services('NoError') then
Set_Property(@Window:'.CASS_NO', 'ARRAY', CassData)
Msg(@window, MsgUp)
end else
Msg(@window, MsgUp)
Msg(@Window, '', 'OK', '', 'Process Error':@FM:Error_Services('GetMessage'))
end
end else
Msg(@window, MsgUp)
end
end else
Msg(@window, MsgUp)
Msg(@Window, '', 'OK', '', 'Process Error':@FM:Error_Services('GetMessage'))
@ -647,6 +651,8 @@ Scan:
end
Logging_Services('AppendLog', objReceiveLog, LogData, @RM, @FM)
Service_Services('PostProcedure', 'WORK_ORDER_SERVICES', 'UpdateWorkOrderData':SD$:WONo)
Post_Event(@Window, 'READ')
end
@ -931,4 +937,3 @@ AddLeftover:
RETURN

View File

@ -62,11 +62,10 @@ Main:
Open "DICT.":Table to @DICT then null
@ID = Key
Ans = Function(@Handler(Connection, Key, @RECORD))
If Ans EQ '' then
If (Ans EQ '') then
If Assigned(pKey) then
If pKey NE '' then
If (pKey NE '') then
Delete pTable, pKey else Null
Unlock pTable, pKey else Null
end
end
end
@ -101,7 +100,9 @@ Main:
end
If Assigned(pKey) then
If (pKey NE '') then
If (pKey NE '') then
// Call unlock here in case we ran into an error above
Unlock pTable, pKey else Null
// Always log the result
Open 'SQL_LOG' to hLog then
If Ans EQ '' then

View File

@ -52,10 +52,11 @@ Main:
// Read the record and call the handler
If Key NE "" then
Ans = Function(@Handler(Connection, Key))
If Ans EQ '' then
If (Ans EQ '') then
If Assigned(pKey) then
Delete pTable, pKey else Null
Unlock pTable, pKey else Null
If (pKey NE '') then
Delete pTable, pKey else Null
end
end
end
end
@ -85,7 +86,9 @@ Main:
// Always log the result
If Assigned(pKey) then
If (pKey NE '') then
If (pKey NE '') then
// Call unlock here in case an error was encountered above
Unlock pTable, pKey else Null
Open 'SQL_LOG' to hLog then
If Ans EQ '' then
Result = 'PROCESSED'

View File

@ -590,7 +590,9 @@ Service SetupDevServices()
BaselineServices = 'Update Material Logs':@VM:'Log Transaction Postings':@VM:'Process Wafer Image Queue':@VM
BaselineServices := 'Process UCL Requests':@VM:'Process ROTR Requests':@VM:'Process Wafer Image Requests':@VM
BaselineServices := 'Process SQL Requests':@VM:'Send Notes':@VM:'Update Notification Groups':@VM
BaselineServices := 'Update Security Groups':@VM:'Auto Scheduler'
BaselineServices := 'Update Security Groups':@VM:'Auto Scheduler':@VM:'Update NICA Orders':@VM:'Process Procedure Queue':@VM
BaselineServices := 'Process Transaction Queue':@VM:'Update Open Work Order Statuses':@VM:'Update Work Order Wafer Quantities':@VM
BaselineServices := 'Process Mona Requests'
Query = "SELECT SERVICES"

View File

@ -81,7 +81,7 @@ objLotStartLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ',', He
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' LotRun.csv'
Headers = 'Logging DTM' : @FM : 'Lot Id' : @FM : 'Username' : @FM : 'Tool Id' : @FM : 'Message'
objRunLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ',', Headers, '', False$, False$)
objLotRunLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ',', Headers, '', False$, False$)
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' LotMove.csv'
Headers = 'Logging DTM' : @FM : 'Lot Id' : @FM : 'Username' : @FM : 'Message'
@ -1614,3 +1614,4 @@ end service
// Internal GoSubs
//----------------------------------------------------------------------------------------------------------------------

View File

@ -383,16 +383,12 @@ Service GetSP1(Handle)
Result<10> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnHazeAvgMean'); // HazeAvg
Result<28> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].RDS'); // RDSKeyID
Result<30> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Session'); // ScanRecipe
IsMisfit = IndexC(Result<30>, 'MISFIT', 1)
IF IsMisfit THEN
Result<3> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAllMean'); // SoDAvg
Result<2> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAllMax'); // SoDMax
Result<1> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAllMin'); // SoDMin
END ELSE
Result<39> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAllMean'); // SoDAvg
Result<40> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAllMax'); // SoDMax
Result<41> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAllMin'); // SoDMin
END
Result<3> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnLpdMean'); // SoDAvg
Result<2> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnLpdMax'); // SoDMax
Result<1> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnLpdMin'); // SoDMin
Result<39> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAllMean'); // SoDAvg
Result<40> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAllMax'); // SoDMax
Result<41> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAllMin'); // SoDMin
Result<43> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].MesEntity'); // ScanTool
Result<44> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAreaMean'); // DCNMM2
END

View File

@ -19,11 +19,11 @@ Compile Function obj_WM_Out(Method,Parms)
Declare Function Get_Status, Msg, Utility, obj_Tables, NextKey, obj_WO_Verify, obj_Prod_Spec, Send_Dyn, obj_RDS_Makeup
Declare Function obj_RDS2, obj_WM_Out, Delete, Signature_Services, Environment_Services, Logging_Services
Declare Function Database_Services
Declare Function Database_Services, SRP_Array
Declare Subroutine Set_Status, Msg, obj_Tables, Send_Dyn, obj_WO_Step, obj_RDS_Layer, obj_RDS_Test, Btree.Extract
Declare Subroutine Extract_SI_Keys, obj_WM_Out, obj_WO_Mat, obj_Post_Log, obj_WO_Mat_Log, ErrMsg, obj_WO_Wfr
Declare Subroutine Logging_Services, Material_Services, Database_Services, Update_Index, Work_Order_Services
Declare Subroutine Service_Services, obj_Notes
Declare Subroutine Service_Services, obj_Notes, Delay
$Insert MSG_EQUATES
$Insert APP_INSERTS
@ -40,6 +40,8 @@ $Insert CLEAN_INSP_EQUATES
$Insert WMO_WFRS_EQUATES
$Insert REACT_RUN_EQUATES
EQU NUM_RETRIES$ TO 50
ErrTitle = 'Error in Stored Procedure "obj_WM_Out"'
ErrorMsg = ''
ErrCode = ''
@ -167,14 +169,37 @@ Create:
WMOutKeys = XLATE('WO_STEP',WONo:'*':WOStep,WO_STEP_WM_OUT_KEYS$,'X')
IF WMOutKeys = '' THEN
WMOutKeys = SRP_Array('SortRows', WMOutKeys, 'AR3', 'LIST', @VM, '*')
If WMOutKeys NE '' then
LastCassNo = WMOutKeys[-1, 'B*']
end else
LastCassNo = 0
end
hSysLists = Database_Services('GetTableHandle', 'SYSLISTS')
CassNo = ''
CandidateCassNo = LastCassNo + 1
Loop
CandidateWmOutKey = WONo:'*':WOStep:'*':CandidateCassNo
If Not(RowExists('WM_OUT', CandidateWmOutKey)) then
Lock hSysLists, CandidateWmOutKey then
CassNo = CandidateCassNo
end
end
Until (CassNo NE '')
CandidateCassNo += 1
Repeat
IF (CassNo EQ 1) THEN
WMOStartBox = 1
WMOStartSlot = 1
END ELSE
LastBoxOut = WMOutKeys[-1,'B':@VM]
LastWMORec = XLATE('WM_OUT',LastBoxOut,'','X')
PrevCassNo = CassNo - 1
LastBoxOut = WONo:'*':WOStep:'*':PrevCassNo
LastWMORec = XLATE('WM_OUT',LastBoxOut,'','X')
LastBoxLastSlot = LastWMORec<WM_OUT_SLOT_NO$>[-1,'B':@VM]
IF LastBoxLastSlot < CassLoadQty THEN
IF ( (LastBoxLastSlot NE '') and (LastBoxLastSlot LT CassLoadQty) ) THEN
WMOStartBox = FIELD(LastBoxOut,'*',3) ;* Start IN the last box
WMOStartSlot = LastBoxLastSlot + 1 ;* Start with first slot past current and less than Load Qty
END ELSE
@ -225,7 +250,8 @@ Create:
NumAttempts = 0
Loop
NumAttempts += 1
Database_Services('WriteDataRow', 'WM_OUT', WMOutKey, WMOutRec)
If NumAttempts GT 1 then Delay(NumAttempts)
Database_Services('WriteDataRow', 'WM_OUT', WMOutKey, WMOutRec, True$, False$, False$)
If Error_Services('HasError') then
// Log the error
LogData = ''
@ -247,9 +273,11 @@ Create:
Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM)
Done = True$
end
Until ( (NumAttempts EQ 10) or (Done EQ True$) )
Until ( (NumAttempts GT NUM_RETRIES$) or (Done EQ True$) )
Repeat
Unlock hSysLists, CandidateWmOutKey else Null
WMOutRec = Database_Services('ReadDataRow', 'WM_OUT', WMOutKey)
If WMOutRec EQ '' then
// Record did not write to the database
@ -280,7 +308,6 @@ Create:
WMOCassNo += 1
WMOSlotNo = 1
REPEAT
Result = OutOnlyCassIDs
@ -1961,5 +1988,3 @@ ConvertCleanInsp:
RETURN

View File

@ -1132,8 +1132,9 @@ ReleaseCassettes:
END ELSE
IF WOStepRec<WO_STEP_RDS_KEY$,CassNo> EQ '' THEN
WOMatRec = XLATE('WO_MAT',WoNo:'*':CassNo,'','X')
WOMatRec = XLATE('WO_MAT',WoNo:'*':CassNo,'','X')
RDSNoCheck = WOMatRec<WO_MAT_RDS_NO$>
If RDSNoCheck EQ '' then
CassLotNo = WOMatRec<WO_MAT_LOT_NO$>
CassWaferQty = WOMatRec<WO_MAT_WAFER_QTY$>
@ -1228,7 +1229,7 @@ ReleaseCassettes:
END
END ;* End of check for GAN reactor
END ;* End of Check for existing RDS on this WO_Step*CassetteNo
END ;* End of Check for existing RDS
END ;* End of check for EpiPRO reactor type
NEXT N
NEXT WOStep

View File

@ -121,6 +121,11 @@ SAPFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' SetS
SAPHeaders = 'Logging DTM' : @FM : 'WOMatKey' : @FM : 'SAPBatchNo'
objSAPLog = Logging_Services('NewLog', SAPLogPath, SAPFileName, CRLF$, Comma$, SAPHeaders, '', False$, False$)
WOMatLogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_Mat'
WOMatLogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' WO_MAT_LOG - Inv Transaction Error.csv'
WOMatHeaders = 'Logging DTM' : @FM : 'WONo' : @FM : 'CassNo' : @FM : 'User' : @FM : 'Log Pos' : @FM : 'Tag' : @FM : 'Warehouse' : @FM : 'Loc' : @FM : 'InvAction' : @FM : 'ToolID'
objLogInvTransError = Logging_Services('NewLog', WOMatLogPath, WOMatLogFileName, CRLF$, Comma$, WOMatHeaders, '', False$, False$)
IsProd = Environment_Services('IsProd')
If IsProd EQ True$ then
MonaResource = 'GRP_OPENINSIGHT_MES_OP_FE_OBJWOMAT'
@ -1040,6 +1045,20 @@ AddInvTrans:
IF ErrorMsg NE '' THEN
ErrorMsg := CRLF$:Parms
SWAP @RM WITH CRLF$ IN ErrorMsg
LogData = ''
LogData<1> = LogFile
LogData<2> = WONo
LogData<3> = CassNo
LogData<4> = InvLocation
LogData<5> = InvAction
LogData<6> = InvDTM
LogData<7> = ScanUserID
LogData<8> = Tag
LogData<9> = ToolID
LogData<10> = ScanEntry
LogData<11> = ''
LogData<12> = 'Unable to add inv. transaction. Missing Parameter detected. ' : ErrorMsg
Logging_Services('AppendLog', objLogInvTransError, LogData, @RM, @FM)
RETURN
END
@ -1065,6 +1084,21 @@ AddInvTrans:
IF Get_Status(errCode) THEN
obj_Tables('UnlockRec',OtParms)
ErrorMsg = 'Unable to add inv. transaction. Unable to read OR get a lock on the WO_MAT record.'
LogData = ''
LogData<1> = LogFile
LogData<2> = WONo
LogData<3> = CassNo
LogData<4> = InvLocation
LogData<5> = InvAction
LogData<6> = InvDTM
LogData<7> = ScanUserID
LogData<8> = Tag
LogData<9> = ToolID
LogData<10> = ScanEntry
LogData<11> = ''
LogData<12> = ErrorMsg
Logging_Services('AppendLog', objLogInvTransError, LogData, @RM, @FM)
RETURN
END
@ -1080,6 +1114,21 @@ AddInvTrans:
IF Get_Status(errCode) THEN
obj_Tables('UnlockRec',WOtParms)
obj_Tables('UnlockRec',OtParms)
ErrorMsg = 'Unable to add inv. transaction. Unable to read or get a lock for WM_OUT record.'
LogData = ''
LogData<1> = LogFile
LogData<2> = WONo
LogData<3> = CassNo
LogData<4> = InvLocation
LogData<5> = InvAction
LogData<6> = InvDTM
LogData<7> = ScanUserID
LogData<8> = Tag
LogData<9> = ToolID
LogData<10> = ScanEntry
LogData<11> = ''
LogData<12> = ErrorMsg
Logging_Services('AppendLog', objLogInvTransError, LogData, @RM, @FM)
RETURN
END
@ -1095,7 +1144,21 @@ AddInvTrans:
obj_Tables('WriteRec',WOtParms)
IF Get_Status(errCode) THEN
NULL
ErrorMsg = 'Unable to add inv. transaction. Unable to write WM_OUT record.'
LogData = ''
LogData<1> = LogFile
LogData<2> = WONo
LogData<3> = CassNo
LogData<4> = InvLocation
LogData<5> = InvAction
LogData<6> = InvDTM
LogData<7> = ScanUserID
LogData<8> = Tag
LogData<9> = ToolID
LogData<10> = ScanEntry
LogData<11> = ''
LogData<12> = ErrorMsg
Logging_Services('AppendLog', objLogInvTransError, LogData, @RM, @FM)
END
END ;* End of check for PTO or PKO location
@ -1108,6 +1171,21 @@ AddInvTrans:
IF Get_Status(errCode) THEN
obj_Tables('UnlockRec',WOtParms)
obj_Tables('UnlockRec',OtParms)
ErrorMsg = 'Unable to add inv. transaction. Unable to read WM_OUT record.'
LogData = ''
LogData<1> = LogFile
LogData<2> = WONo
LogData<3> = CassNo
LogData<4> = InvLocation
LogData<5> = InvAction
LogData<6> = InvDTM
LogData<7> = ScanUserID
LogData<8> = Tag
LogData<9> = ToolID
LogData<10> = ScanEntry
LogData<11> = ''
LogData<12> = ErrorMsg
Logging_Services('AppendLog', objLogInvTransError, LogData, @RM, @FM)
RETURN
END
@ -1125,6 +1203,21 @@ AddInvTrans:
IF @WINDOW NE 'WO_MAT_INV' THEN
IF WOMatRec<WO_MAT_LOT_NO$> = '' OR WOMatRec<WO_MAT_CUST_PART_NO$> = '' THEN
obj_Tables('UnlockRec',OtParms)
ErrorMsg = 'Unable to add inv. transaction. null LOT_NO or CUST_PART_NO values.'
LogData = ''
LogData<1> = LogFile
LogData<2> = WONo
LogData<3> = CassNo
LogData<4> = InvLocation
LogData<5> = InvAction
LogData<6> = InvDTM
LogData<7> = ScanUserID
LogData<8> = Tag
LogData<9> = ToolID
LogData<10> = ScanEntry
LogData<11> = ''
LogData<12> = ErrorMsg
Logging_Services('AppendLog', objLogInvTransError, LogData, @RM, @FM)
RETURN
END
END
@ -1162,7 +1255,51 @@ AddInvTrans:
NumAttempts = 0
Loop
NumAttempts += 1
Database_Services('WriteDataRow', 'WO_MAT', WOMatKey, WOMatRec, True$, False$, True$)
Database_Services('WriteDataRow', 'WO_MAT', WOMatKey, WOMatRec, True$, False$, False$)
if Error_Services('HasError') then
ErrorMsg = Error_Services('GetMessage')
LogData = ''
LogData<1> = LogFile
LogData<2> = WONo
LogData<3> = CassNo
LogData<4> = InvLocation
LogData<5> = InvAction
LogData<6> = InvDTM
LogData<7> = ScanUserID
LogData<8> = Tag
LogData<9> = ToolID
LogData<10> = ScanEntry
LogData<11> = ''
LogData<12> = 'Unable to add inv. transaction. ' : ErrorMsg : ' Next line is the expected INV Actions.'
Logging_Services('AppendLog', objLogInvTransError, LogData, @RM, @FM)
LogData = ''
LogData<1> = WONo
LogData<2> = CassNo
LogData<3> = WOMatRec<WO_MAT_INV_ACTION$>
Logging_Services('AppendLog', objLogInvTransError, LogData, @RM, @FM)
end else
LogData = ''
LogData<1> = LogFile
LogData<2> = WONo
LogData<3> = CassNo
LogData<4> = InvLocation
LogData<5> = InvAction
LogData<6> = InvDTM
LogData<7> = ScanUserID
LogData<8> = Tag
LogData<9> = ToolID
LogData<10> = ScanEntry
LogData<11> = ''
LogData<12> = 'Successfully wrote inv transaction to WO_MAT record. Next line is the resultant INV Actions.'
Logging_Services('AppendLog', objLogInvTransError, LogData, @RM, @FM)
LogData = ''
LogData<1> = WONo
LogData<2> = CassNo
LogData<3> = WOMatRec<WO_MAT_INV_ACTION$>
Logging_Services('AppendLog', objLogInvTransError, LogData, @RM, @FM)
end
WOMatRecVerify = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey)
LastEntryIndex = DCount(WOMatRecVerify<WO_MAT_INV_WH$>, @VM)
LastEntryAction = WOMatRecVerify<WO_MAT_INV_ACTION$, LastEntryIndex>
@ -1203,14 +1340,6 @@ AddInvTrans:
Logging_Services('AppendLog', WOMatObjLog2, LogData, @RM, @FM)
IF Get_Status(errCode) THEN
errCode = errCode:'User = ':ScanUserID
Gosub SendErrorNotification
END ELSE
END ;* End of check for Write error
obj_Tables('UnlockRec',OtParms)
CASE 1
@ -5546,6 +5675,9 @@ RETURN
SendErrorNotification:
* * * * * * * * * * *
If Not(Assigned(errCode)) then
errCode = ''
end
swap @SVM with CRLF$ in errCode
ErrorMsg = 'Error code: ':errCode
@ -5581,3 +5713,4 @@ ExpCOA:
RETURN

View File

@ -47,6 +47,14 @@ LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Front-end Create Log.csv'
Headers = 'Logging DTM'
objLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_MAT_LOG'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : '_Post_Log.csv'
Headers = 'Logging DTM'
objLogPost = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
IsProd = Environment_Services('IsProd')
@ -250,6 +258,7 @@ RETURN
* * * * * * *
Post:
* * * * * * *
hSysLists = Database_Services('GetTableHandle', 'SYSLISTS')
ServiceKeyID = 'Obj_WO_Mat_Log*Post'
Lock hSysLists, ServiceKeyID then
@ -350,7 +359,29 @@ Post:
LockedToolID = ScanToolID
LockedScanEntry = ScanEntry
END
//Log the error
LogData = ''
LogData<1> = LoggingDTM
LogData<2> = WONo
LogData<3> = CassNo
LogData<4> = Tag
LogData<5> = ScanUserId
LogData<6> = ScanToolId
LogData<7> = ScanEntry
LogData<8> = 'Error reported from obj_wo_mat -> Add InvTrans. Check specific log.'
Logging_Services('AppendLog', objLogPost, LogData, @RM, @FM)
END else
LogData = ''
LogData<1> = LoggingDTM
LogData<2> = WONo
LogData<3> = CassNo
LogData<4> = Tag
LogData<5> = ScanUserId
LogData<6> = ScanToolId
LogData<7> = ScanEntry
LogData<8> = 'Successfully process obj_wo_mat -> AddInvTrans. Check specific log file for more details.'
Logging_Services('AppendLog', objLogPost, LogData, @RM, @FM)
end
NEXT I
WMLRec<WO_MAT_LOG_WO_NO$> = LockedWONos
@ -376,3 +407,4 @@ Post:
RETURN

View File

@ -3170,7 +3170,10 @@ Service UpdateFailedWafers(WOMatKey)
AllFailedWafers<0, WfrIndex> = (PreFailedWafers<0, WfrIndex> OR FWIFailedWafers<0, WfrIndex> OR LWIFailedWafers<0, WfrIndex> OR PostFailedWafers<0, WfrIndex>)
Next WfrIndex
end
Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_FAILED_WAFERS$, AllFailedWafers)
AllFailedWafersOrig = WOMatRec<WO_MAT_FAILED_WAFERS$>
If AllFailedWafers NE AllFailedWafersOrig then
Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_FAILED_WAFERS$, AllFailedWafers)
end
end else
Error_Services('Add', 'Error in ':Service:' service. RDSNo is null')
end

View File

@ -903,6 +903,10 @@ WRITE_RECORD:
Service_Services('PostProcedure', 'WORK_ORDER_SERVICES', 'UpdateScrappedQty':SD$:WONo)
end
If {WO} NE '' then Service_Services('PostProcedure', 'RDS_SERVICES', 'VerifyWOLogRDSKeyIndex':SD$:Name)
If {WO_MAT_KEY} NE '' then Service_Services('PostProcedure', 'RDS_SERVICES', 'VerifyWOMatRDSNoIndex':SD$:Name)
If {WO_STEP_KEY} NE '' then Service_Services('PostProcedure', 'RDS_SERVICES', 'VerifyWOStepRDSKeyIndex':SD$:Name)
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)

View File

@ -1889,9 +1889,12 @@ Service PushSigProfileToWoMat(RDSNo)
If WOMatKey NE '' then
WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey)
If Error_Services('NoError') then
WOMatSigProf = obj_WO_Mat('CassSigProfile', WOMatKey)
WOMatSig = WOMatRec<WO_MAT_SIGNATURE$>
WOMatSigDTM = WOMatRec<WO_MAT_SIG_DTM$>
WOMatSigProf = obj_WO_Mat('CassSigProfile', WOMatKey)
WOMatSig = WOMatRec<WO_MAT_SIGNATURE$>
WOMatSigDTM = WOMatRec<WO_MAT_SIG_DTM$>
WOMatSigProfOrig = WOMatSigProf
WOMatSigOrig = WOMatSig
WOMatSigDTMOrig = WOMatSigDTM
// Update WO_MAT signature profile to match for the "1VER" stage
Stage = '1VER'
@ -1963,9 +1966,15 @@ Service PushSigProfileToWoMat(RDSNo)
WOMatSigDTM<0, vPos> = FQASigDTM
end
Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIG_PROFILE$, WOMatSigProf)
Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIGNATURE$, WOMatSig)
Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIG_DTM$, WOMatSigDTM)
If WOMatSigProf NE WOMatSigProfOrig then
Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIG_PROFILE$, WOMatSigProf)
end
If WOMatSig NE WOMatSigOrig then
Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIGNATURE$, WOMatSig)
end
If WOMatSigDTM NE WOMatSigDTMOrig then
Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIG_DTM$, WOMatSigDTM)
end
end else
ErrorMsg = Error_Services('GetMessage')
@ -2064,6 +2073,219 @@ Service GetRDSKeys(WONo)
end service
Service VerifyWOMatRDSNoIndex(RDSNo)
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\RDS'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !RDS WO_MAT{RDS_NO} Log.csv'
Headers = 'Logging DTM':@FM:'RDSNo':@FM:'WOMatKey':@FM:'Result'
objVerifyRDSNoLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = RDSNo
LogData<4> = 'Begin ':Service
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM)
ErrorMsg = ''
If RDSNo NE '' then
If RowExists('RDS', RDSNo) then
WOMatKey = Xlate('RDS', RDSNo, 'WO_MAT_KEY', 'X')
If WOMatKey NE '' then
WOMatRDSNo = Xlate('WO_MAT', WOMatKey, 'RDS_NO', 'X')
LogData<3> = WOMatKey
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM)
If WOMatRDSNo EQ '' then
LogData<4> = 'RDSNo missing from WO_MAT record. Generating index transaction.'
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM)
// Add index transaction to update RDS_NO relational index (target WO_MAT table)
IndexTransactionRow = 'WO_MAT*RDS_NO*AR':@FM:RDSNo:@FM:"":@FM:WOMatKey:@FM
Open "!RDS" to BangTable then
Lock BangTable, 0 then
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
PendingTrans := IndexTransactionRow
Write PendingTrans on BangTable, 0 then
LogData<4> = 'Index transaction successfully added.'
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM)
end else
ErrorMsg = 'Unable to write index transaction to !RDS. ':RDSNo
end
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !RDS to add index transaction. ':RDSNo
end else
ErrorMsg = 'Unable to Lock !RDS to add index transaction. ':RDSNo
end
end else
ErrorMsg = 'Unable to Open !RDS to add index transaction. ':RDSNo
end
end else
LogData<4> = 'Index ok. RDSNo not missing from WO_MAT record.'
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM)
end
end else
LogData<4> = 'WO_MAT key for RDS ':RDSNo:' is null. Nothing to update.'
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM)
end
end
end
If ErrorMsg NE '' then
LogData<4> = ErrorMsg
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM)
end
LogData<4> = 'End ':Service
Logging_Services('AppendLog', objVerifyRDSNoLog, LogData, @RM, @FM)
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
end service
Service VerifyWOStepRDSKeyIndex(RDSNo)
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\RDS'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !RDS WO_STEP{RDS_KEY} Log.csv'
Headers = 'Logging DTM':@FM:'RDSNo':@FM:'WOStep':@FM:'Result'
objVerifyRDSKeyLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = RDSNo
LogData<4> = 'Begin ':Service
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM)
ErrorMsg = ''
If RDSNo NE '' then
If RowExists('RDS', RDSNo) then
WOStepKey = Xlate('RDS', RDSNo, 'WO_STEP_KEY', 'X')
If WOStepKey NE '' then
WOStepRDSKeys = Xlate('WO_STEP', WOStepKey, 'RDS_KEY', 'X')
LogData<3> = WOStepKey
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM)
Locate RDSNo in WOStepRDSKeys using @VM setting vPos then
LogData<4> = 'Index ok. RDSNo not missing from WO_STEP record.'
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM)
end else
LogData<4> = 'RDSNo missing from WO_STEP record. Generating index transaction.'
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM)
// Add index transaction to update RDS_KEY relational index (target WO_STEP table)
IndexTransactionRow = 'WO_STEP*RDS_KEY*AR':@FM:RDSNo:@FM:"":@FM:WOStepKey:@FM
Open "!RDS" to BangTable then
Lock BangTable, 0 then
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
PendingTrans := IndexTransactionRow
Write PendingTrans on BangTable, 0 then
LogData<4> = 'Index transaction successfully added.'
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM)
end else
ErrorMsg = 'Unable to write index transaction to !RDS. ':RDSNo
end
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !RDS to add index transaction. ':RDSNo
end else
ErrorMsg = 'Unable to Lock !RDS to add index transaction. ':RDSNo
end
end else
ErrorMsg = 'Unable to Open !RDS to add index transaction. ':RDSNo
end
end
end else
LogData<4> = 'WO_STEP key for RDS ':RDSNo:' is null. Nothing to update.'
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM)
end
end
end
If ErrorMsg NE '' then
LogData<4> = ErrorMsg
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM)
end
LogData<4> = 'End ':Service
Logging_Services('AppendLog', objVerifyRDSKeyLog, LogData, @RM, @FM)
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
end service
Service VerifyWOLogRDSKeyIndex(RDSNo)
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\RDS'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !RDS RDS{WO} Log.csv'
Headers = 'Logging DTM':@FM:'RDSNo':@FM:'WOStep':@FM:'Result'
objVerifyRDSWoIndexLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = RDSNo
LogData<4> = 'Begin ':Service
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM)
ErrorMsg = ''
If RDSNo NE '' then
If RowExists('RDS', RDSNo) then
WONo = Xlate('RDS', RDSNo, 'WO', 'X')
If WONo NE '' then
WOLogRDSKeys = ''
Extract_Si_Keys('RDS', 'WO', WONo, WOLogRDSKeys)
LogData<3> = WONo
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM)
Locate RDSNo in WOLogRDSKeys using @VM setting vPos then
LogData<4> = 'Index ok. RDSNo not missing from Btree index.'
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM)
end else
LogData<4> = 'RDSNo missing from Btree index. Generating index transaction.'
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM)
// Add index transaction to update RDS_KEY relational index (target WO_STEP table)
IndexTransactionRow = 'WO':@FM:RDSNo:@FM:"":@FM:WONo:@FM
Open "!RDS" to BangTable then
Lock BangTable, 0 then
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
PendingTrans := IndexTransactionRow
Write PendingTrans on BangTable, 0 then
LogData<4> = 'Index transaction successfully added.'
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM)
end else
ErrorMsg = 'Error in ':Service:' service. Unable to write index transaction to !RDS. ':RDSNo
end
Unlock BangTable, 0 else ErrorMsg = 'Error in ':Service:' service. Unable to Open !RDS to add index transaction. ':RDSNo
end else
ErrorMsg = 'Error in ':Service:' service. Unable to Lock !RDS to add index transaction. ':RDSNo
end
end else
ErrorMsg = 'Error in ':Service:' service. Unable to Open !RDS to add index transaction. ':RDSNo
end
end
end else
LogData<4> = 'WONo for RDS ':RDSNo:' is null. Nothing to update.'
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM)
end
end
end else
ErrorMsg = 'Error in ':Service:' service. Null RDSNo passed in.'
end
If ErrorMsg NE '' then
LogData<4> = ErrorMsg
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM)
end
LogData<4> = 'End ':Service
Logging_Services('AppendLog', objVerifyRDSWoIndexLog, LogData, @RM, @FM)
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
end service
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Internal GoSubs
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -279,55 +279,61 @@ Event PUB_SIGN.CLICK()
ReactorType = XLATE('RDS',RDSNo,'REACTOR_TYPE','X')
ErrMsg = ''
If Len(ReactorType) GE 3 and ReactorType[1, 3] _EQC 'HTR' then
WoMatKey = WONo:'*':CassNo
IsLastCassetteInWo = WO_MAT_Services('CassetteIsLastInWo', WoMatKey)
If Error_Services('NoError') then
If IsLastCassetteInWo then
NextEventScheduled = False$
NextEventHasSamePsn = True$
NextEventIsBlock = False$
NextScheduledEvent = Schedule_Services('GetNextEvent', Reactor)
If Error_Services('NoError') then
NextEventScheduled = True$
NextEventHasSamePsn = Schedule_Services('NextEventIsSamePsn', Reactor)
NextEventIsBlock = Schedule_Services('NextEventIsBlock', Reactor)
end
If NextEventScheduled EQ False$ or NextEventHasSamePsn EQ False$ or NextEventIsBlock EQ True$ then
WoMatRecord = Database_Services('ReadDataRow', 'WO_MAT', WoMatKey)
WoMatRecord<WO_MAT_LAST_CASSETTE_TEST_WAFER_ACK_REQ$> = True$
TestWaferRanSinceLoad = WoMatRecord<WO_MAT_LAST_CASSETTE_TEST_WAFER_RAN$>
If TestWaferRanSinceLoad NE True$ then
TestWaferRanSinceLoad = Rds_Services('TestWaferRanAfterLoad', RDSNo)
WoMatRecord<WO_MAT_LAST_CASSETTE_TEST_WAFER_RAN$> = TestWaferRanSinceLoad
If TestWaferRanSinceLoad NE True$ then
Message = ''
If NextEventScheduled EQ False$ or NextEventIsBlock EQ True$ then
Message = 'No material scheduled. Test wafer required.'
end else if NextEventHasSamePsn EQ False$ then
Message = 'Next work order is a NEW PSN number. Test wafer required.'
end
Message_Box(@Window, Message, "Test Wafer Required", MSG_BTN_OK$ + MSG_ICON_EXCLAM$)
TWLogResult = Dialog_Box('NDW_LOG_TEST_WAFER_USAGE', @Window, RDSNo : @VM : '' : @VM : 'REACTOR' : @VM : Reactor)
WoMatRecord<WO_MAT_LAST_CASSETTE_TEST_WAFER_RAN$> = TWLogResult
If TWLogResult NE True$ then
ErrMsg = 'Unload blocked! You must run a test wafer before signing the unload'
end
end
end
end
Database_Services('WriteDataRow', 'WO_MAT', WoMatKey, WoMatRecord, True$, False$, False$)
end
end
If ( (WONo NE '') and (CassNo NE '') ) then
WoMatKey = WONo:'*':CassNo
If RowExists('WO_MAT', WOMatKey) then
IsLastCassetteInWo = WO_MAT_Services('CassetteIsLastInWo', WoMatKey)
If Error_Services('NoError') then
If IsLastCassetteInWo then
NextEventScheduled = False$
NextEventHasSamePsn = True$
NextEventIsBlock = False$
NextScheduledEvent = Schedule_Services('GetNextEvent', Reactor)
If Error_Services('NoError') then
NextEventScheduled = True$
NextEventHasSamePsn = Schedule_Services('NextEventIsSamePsn', Reactor)
NextEventIsBlock = Schedule_Services('NextEventIsBlock', Reactor)
end
If NextEventScheduled EQ False$ or NextEventHasSamePsn EQ False$ or NextEventIsBlock EQ True$ then
WoMatRecord = Database_Services('ReadDataRow', 'WO_MAT', WoMatKey)
If Error_Services('NoError') then
If WOMatRecord NE '' then
WoMatRecord<WO_MAT_LAST_CASSETTE_TEST_WAFER_ACK_REQ$> = True$
TestWaferRanSinceLoad = WoMatRecord<WO_MAT_LAST_CASSETTE_TEST_WAFER_RAN$>
If TestWaferRanSinceLoad NE True$ then
TestWaferRanSinceLoad = Rds_Services('TestWaferRanAfterLoad', RDSNo)
WoMatRecord<WO_MAT_LAST_CASSETTE_TEST_WAFER_RAN$> = TestWaferRanSinceLoad
If TestWaferRanSinceLoad NE True$ then
Message = ''
If NextEventScheduled EQ False$ or NextEventIsBlock EQ True$ then
Message = 'No material scheduled. Test wafer required.'
end else if NextEventHasSamePsn EQ False$ then
Message = 'Next work order is a NEW PSN number. Test wafer required.'
end
Message_Box(@Window, Message, "Test Wafer Required", MSG_BTN_OK$ + MSG_ICON_EXCLAM$)
TWLogResult = Dialog_Box('NDW_LOG_TEST_WAFER_USAGE', @Window, RDSNo : @VM : '' : @VM : 'REACTOR' : @VM : Reactor)
WoMatRecord<WO_MAT_LAST_CASSETTE_TEST_WAFER_RAN$> = TWLogResult
If TWLogResult NE True$ then
ErrMsg = 'Unload blocked! You must run a test wafer before signing the unload'
end
end
end
end else
ErrMsg = 'WO_MAT record for ':WOMatKey:' is null!'
end
end else
ErrMsg = Error_Services('GetMessage')
end
end
Database_Services('WriteDataRow', 'WO_MAT', WoMatKey, WoMatRecord, True$, False$, False$)
end
end
end else
ErrMsg = 'WO_MAT ':WOMatKey:' does not exist!'
end
end else
ErrMsg = 'Null WONo or null CassNo!'
end
end
If ErrMsg NE '' then
@ -462,7 +468,3 @@ Setup_OLE_Controls:
return

View File

@ -182,27 +182,27 @@ Service ProcessProcedureQueue()
Loop
ReadNext RequestKeyID else EOF = True$
Until EOF
SendRequest = True$
Read RequestRec from hProcQueue, RequestKeyID then
InQueue = RequestRec<PROC_QUEUE.IN_QUEUE$>
SendRequest = True$
InQueue = RequestRec<PROC_QUEUE.IN_QUEUE$>
If InQueue then
QueuedDtm = RequestRec<PROC_QUEUE.QUEUED_DTM$>
If QueuedDtm GT SRP_Datetime('AddMinutes', Datetime(), -10) then
SendRequest = False$
end
end
end
If SendRequest then
TcpClientHandle = 0
If SRP_TcpClient(TcpClientHandle, 'CONNECT', ServerIP, ServerPort) then
RequestRec<PROC_QUEUE.IN_QUEUE$> = True$
RequestRec<PROC_QUEUE.QUEUED_DTM$> = Datetime()
Write RequestRec on hProcQueue, RequestKeyID then
Command = 'RUN SERVICE_SERVICES "ProcessRequest", ':Quote(RequestKeyID)
SRP_TcpClient(TcpClientHandle, 'SEND_SES', Command)
end
SRP_TcpClient(TcpClientHandle, 'CLOSE_SES')
end
If SendRequest then
TcpClientHandle = 0
If SRP_TcpClient(TcpClientHandle, 'CONNECT', ServerIP, ServerPort) then
RequestRec<PROC_QUEUE.IN_QUEUE$> = True$
RequestRec<PROC_QUEUE.QUEUED_DTM$> = Datetime()
Write RequestRec on hProcQueue, RequestKeyID then
Command = 'RUN SERVICE_SERVICES "ProcessRequest", ':Quote(RequestKeyID)
SRP_TcpClient(TcpClientHandle, 'SEND_SES', Command)
end
SRP_TcpClient(TcpClientHandle, 'CLOSE_SES')
end
end
end
Repeat
end
@ -279,20 +279,21 @@ Service ProcessRequest(RequestKeyID)
Database_Services('WriteDataRow', 'PROC_QUEUE2', RequestKeyId, RequestRow, True$, False$, False$)
end else
// Notify OI_SYSADMIN group
Recipients = ''
SentFrom = 'SYSTEM'
Subject = 'Background Procedure Queue Error'
Message = OConv(Datetime(), 'DT2/^H')
Message<2> = 'Error on server ':Server
Message<3> = 'Stored Procedure: ':Procedure
StatCodes = 'Parameters: ':Params
Message<4> = 'Error_Services error message: ':ErrorMessage
Message<5> = 'Get_Status error code: ':ErrCode
Recipients = ''
SentFrom = 'SYSTEM'
Subject = 'Background Procedure Queue Error'
Message = OConv(Datetime(), 'DT2/^H')
Message<2> = 'Error on server ':Server
Message<3> = 'Stored Procedure: ':Procedure
Message<4> = 'Error_Services error message: ':ErrorMessage
Message<5> = 'Get_Status error code: ':ErrCode
Message<6> = 'Record Dump:'
Message<7> = RequestRow
Swap @FM with \0D0A\ in Message
AttachWindow = ''
AttachKey = ''
SendToGroup = 'OI_SYSADMIN'
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
AttachWindow = ''
AttachKey = ''
SendToGroup = 'OI_SYSADMIN'
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
obj_Notes('Create',Parms)
// Move request to PROC_QUEUE_FAILED
RequestRow<PROC_QUEUE.NUM_ATTEMPTS$> = NumAttempts
@ -346,17 +347,25 @@ Service PostProcedure(ProcedureName, Params)
ErrorMsg = ''
If (ProcedureName NE '') then
RequestKeyID = RTI_CreateGUID()
RequestRow = ''
RequestRow<PROC_QUEUE.PROC_NAME$> = ProcedureName
RequestRow<PROC_QUEUE.PARAMS$> = Params
RequestRow<PROC_QUEUE.ENTRY_DTM$> = Datetime()
RequestRow<PROC_QUEUE.IN_QUEUE$> = False$
Database_Services('WriteDataRow', 'PROC_QUEUE2', RequestKeyID, RequestRow, True$, False$, False$)
If Error_Services('NoError') then
Response = RequestKeyId
ProcedureName = UCase(ProcedureName)
LSL2Key = '$':ProcedureName:'*LSL2'
FrameworksKey = '$':ProcedureName:'*FRAMEWORKS'
SysprogKey = '$':ProcedureName
If ( RowExists('SYSOBJ', LSL2Key) or RowExists('SYSOBJ', FrameworksKey) or RowExists('SYSOBJ', SysprogKey) ) then
RequestKeyID = RTI_CreateGUID()
RequestRow = ''
RequestRow<PROC_QUEUE.PROC_NAME$> = ProcedureName
RequestRow<PROC_QUEUE.PARAMS$> = Params
RequestRow<PROC_QUEUE.ENTRY_DTM$> = Datetime()
RequestRow<PROC_QUEUE.IN_QUEUE$> = False$
Database_Services('WriteDataRow', 'PROC_QUEUE2', RequestKeyID, RequestRow, True$, False$, False$)
If Error_Services('NoError') then
Response = RequestKeyId
end else
ErrorMsg = 'Error in ':Service:' service. Error message: ':Error_Services('GetMessage')
end
end else
ErrorMsg = 'Error in ':Service:' service. Error message: ':Error_Services('GetMessage')
ErrorMsg = 'Error in ':Service:' service. PROC_NAME ':Quote(ProcedureName):' does not exist.'
end
end else
ErrorMsg = 'Error in ':Service:' service. Null ProcedureName passed in.'

View File

@ -164,7 +164,7 @@ WRITE_RECORD:
MetrologyID = Field(Name, '*', 1)
RDSNo = Xlate('RDS_TEST', MetrologyID, RDS_TEST_RDS_NO$, 'X')
Service_Services('PostProcedure', 'RDS_Services', 'AllTWUseSigned':SD$:RDSNo)
Service_Services('PostProcedure', 'RDS_SERVICES', 'AllTWUseSigned':SD$:RDSNo)
end
return

View File

@ -53,9 +53,8 @@ $Insert MSG_EQUATES
$Insert DICT_EQUATES
$Insert WM_IN_EQUATES
Declare function Database_Services
Declare function PSN_Services, SRP_Rotate_Array, Datetime
Declare subroutine Database_Services, Set_Status, OBJ_WO_MAT_LOG
Declare function PSN_Services, SRP_Rotate_Array, Datetime, Database_Services, Environment_Services, Logging_Services
Declare subroutine Database_Services, Set_Status, obj_Wo_Mat_Log, Logging_Services, Extract_Si_Keys
GoToService
@ -121,7 +120,9 @@ Service AddComment(WMInNo, Comment)
End Service
Service SetVoidFlag(WMInKey, Username)
ErrorMessage = ''
If RowExists('WM_IN', WMInKey) then
WMInRec = Database_Services('ReadDataRow', 'WM_IN', WMInKey, True$, 0, False$)
@ -160,7 +161,210 @@ Service SetVoidFlag(WMInKey, Username)
If ErrorMessage NE '' then
Error_Services('Add', ErrorMessage)
end
end service
Service VerifyWoStepWMIKeyIndex(WMIKey)
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WM_IN'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !WM_IN WO_STEP{WM_IN_KEY} Log.csv'
Headers = 'Logging DTM':@FM:'WMIKey':@FM:'WOStep':@FM:'Result'
objVerifyWMIKeyLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = WMIKey
LogData<4> = 'Begin ':Service
Logging_Services('AppendLog', objVerifyWMIKeyLog, LogData, @RM, @FM)
ErrorMsg = ''
If WMIKey NE '' then
If RowExists('WM_IN', WMIKey) then
WOStepKey = Field(WMIKey, '*', 1, 2)
If WOStepKey NE '' then
WOStepWMIKeys = Xlate('WO_STEP', WOStepKey, 'WM_IN_KEYS', 'X')
LogData<3> = WOStepKey
Logging_Services('AppendLog', objVerifyWMIKeyLog, LogData, @RM, @FM)
Locate WMIKey in WOStepWMIKeys using @VM setting vPos else
LogData<4> = 'WMIKey missing from WO_STEP record. Generating index transaction.'
Logging_Services('AppendLog', objVerifyWMIKeyLog, LogData, @RM, @FM)
// Add index transaction to update WM_IN_KEYS relational index (target WO_STEP table)
IndexTransactionRow = 'WO_STEP*WM_IN_KEYS*AR':@FM:WMIKey:@FM:"":@FM:WOStepKey:@FM
Open "!WM_IN" to BangTable then
Lock BangTable, 0 then
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
PendingTrans := IndexTransactionRow
Write PendingTrans on BangTable, 0 then
LogData<4> = 'Index transaction successfully added.'
Logging_Services('AppendLog', objVerifyWMIKeyLog, LogData, @RM, @FM)
end else
ErrorMsg = 'Unable to write index transaction to !WM_IN. ':WMIKey
end
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !WM_IN to add index transaction. ':WMIKey
end else
ErrorMsg = 'Unable to Lock !WM_IN to add index transaction. ':WMIKey
end
end else
ErrorMsg = 'Unable to Open !WM_IN to add index transaction. ':WMIKey
end
end
end else
LogData<4> = 'WO_STEP key for WM_IN ':WMIKey:' is null. Nothing to update.'
Logging_Services('AppendLog', objVerifyWMIKeyLog, LogData, @RM, @FM)
end
end
end
If ErrorMsg NE '' then
LogData<4> = ErrorMsg
Logging_Services('AppendLog', objVerifyWMIKeyLog, LogData, @RM, @FM)
end
LogData<4> = 'End ':Service
Logging_Services('AppendLog', objVerifyWMIKeyLog, LogData, @RM, @FM)
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
end service
Service VerifyWOLogWMIKeyIndex(WMIKey)
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WM_IN'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !WM_IN WM_IN{WO_NO} Log.csv'
Headers = 'Logging DTM':@FM:'WMIKey':@FM:'WOStep':@FM:'Result'
objVerifyWMIWoIndexLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = WMIKey
LogData<4> = 'Begin ':Service
Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM)
ErrorMsg = ''
If WMIKey NE '' then
If RowExists('WM_IN', WMIKey) then
WONo = Field(WMIKey, '*', 1, 1)
If WONo NE '' then
WOLogRDSKeys = ''
Extract_Si_Keys('WM_IN', 'WO_NO', WONo, WOLogRDSKeys)
LogData<3> = WONo
Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM)
Locate WMIKey in WOLogRDSKeys using @VM setting vPos else
LogData<4> = 'WMIKey missing from Btree index. Generating index transaction.'
Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM)
// Add index transaction to update WO_NO btree index
IndexTransactionRow = 'WO_NO':@FM:WMIKey:@FM:"":@FM:WONo:@FM
Open "!WM_IN" to BangTable then
Lock BangTable, 0 then
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
PendingTrans := IndexTransactionRow
Write PendingTrans on BangTable, 0 then
LogData<4> = 'Index transaction successfully added.'
Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM)
end else
ErrorMsg = 'Error in ':Service:' service. Unable to write index transaction to !WM_IN. ':WMIKey
end
Unlock BangTable, 0 else ErrorMsg = 'Error in ':Service:' service. Unable to Open !WM_IN to add index transaction. ':WMIKey
end else
ErrorMsg = 'Error in ':Service:' service. Unable to Lock !WM_IN to add index transaction. ':WMIKey
end
end else
ErrorMsg = 'Error in ':Service:' service. Unable to Open !WM_IN to add index transaction. ':WMIKey
end
end
end else
LogData<4> = 'WONo for WM_IN ':WMIKey:' is null. Nothing to update.'
Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM)
end
end
end else
ErrorMsg = 'Error in ':Service:' service. Null WMIKey passed in.'
end
If ErrorMsg NE '' then
LogData<4> = ErrorMsg
Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM)
end
LogData<4> = 'End ':Service
Logging_Services('AppendLog', objVerifyWMIWoIndexLog, LogData, @RM, @FM)
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
end service
Service VerifyWOMatWMIKeyIndex(WMIKey)
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WM_IN'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !WM_IN WO_MAT{WMI_KEY} Log.csv'
Headers = 'Logging DTM':@FM:'WMIKey':@FM:'WOMatKey':@FM:'Result'
objVerifyWoMatWmiKeyLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = WMIKey
LogData<4> = 'Begin ':Service
Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM)
ErrorMsg = ''
If WMIKey NE '' then
If RowExists('WM_IN', WMIKey) then
WOMatKey = Field(WMIKey, '*', 1, 1):'*':Field(WMIKey, '*', 3, 1)
If WOMatKey NE '' then
WOMatWMIKey = Xlate('WO_MAT', WOMatKey, 'WMI_KEY', 'X')
LogData<3> = WOMatKey
Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM)
If WOMatWMIKey EQ '' then
LogData<4> = 'WMIKey missing from WO_MAT record. Generating index transaction.'
Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM)
// Add index transaction to update WMI_KEY relational index (target WO_MAT table)
IndexTransactionRow = 'WO_MAT*WMI_KEY*TOP':@FM:WMIKey:@FM:"":@FM:WOMatKey:@FM
Open "!WM_IN" to BangTable then
Lock BangTable, 0 then
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
PendingTrans := IndexTransactionRow
Write PendingTrans on BangTable, 0 then
LogData<4> = 'Index transaction successfully added.'
Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM)
end else
ErrorMsg = 'Unable to write index transaction to !WM_IN. ':WMIKey
end
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !WM_IN to add index transaction. ':WMIKey
end else
ErrorMsg = 'Unable to Lock !WM_IN to add index transaction. ':WMIKey
end
end else
ErrorMsg = 'Unable to Open !WM_IN to add index transaction. ':WMIKey
end
end
end else
LogData<4> = 'WO_MAT key for WM_IN ':WMIKey:' is null. Nothing to update.'
Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM)
end
end
end
If ErrorMsg NE '' then
LogData<4> = ErrorMsg
Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM)
end
LogData<4> = 'End ':Service
Logging_Services('AppendLog', objVerifyWoMatWmiKeyLog, LogData, @RM, @FM)
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
end service

View File

@ -59,8 +59,10 @@ $Insert COMPANY_EQUATES
$Insert RETURN_TO_FAB_LOTS_EQUATES
Declare function Database_Services, SRP_JSON, Error_Services, Clean_Insp_Services, WO_Mat_QA_Services
Declare function PSN_Services, SRP_Rotate_Array, Datetime, Return_To_Fab_Services
Declare function PSN_Services, SRP_Rotate_Array, Datetime, Return_To_Fab_Services, Environment_Services
Declare function Logging_Services
Declare subroutine Database_Services, SRP_JSON, Error_Services, Extract_Si_Keys, Set_Status, obj_wo_mat_log
Declare subroutine Logging_Services
GoToService
@ -436,8 +438,210 @@ Service SetVoidFlag(WMOutKey, Username)
If ErrorMessage NE '' then
Error_Services('Add', ErrorMessage)
end
end service
Service VerifyWoStepWMOKeyIndex(WMOKey)
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WM_OUT'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !WM_OUT WO_STEP{WM_OUT_KEYS} Log.csv'
Headers = 'Logging DTM':@FM:'WMOKey':@FM:'WOStep':@FM:'Result'
objVerifyWMOKeyLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = WMOKey
LogData<4> = 'Begin ':Service
Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM)
ErrorMsg = ''
If WMOKey NE '' then
If RowExists('WM_OUT', WMOKey) then
WOStepKey = Field(WMOKey, '*', 1, 2)
If WOStepKey NE '' then
WOStepWMOKeys = Xlate('WO_STEP', WOStepKey, 'WM_OUT_KEYS', 'X')
LogData<3> = WOStepKey
Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM)
Locate WMOKey in WOStepWMOKeys using @VM setting vPos else
LogData<4> = 'WMOKey missing from WO_STEP record. Generating index transaction.'
Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM)
// Add index transaction to update WM_OUT_KEYS relational index (target WO_STEP table)
IndexTransactionRow = 'WO_STEP*WM_OUT_KEYS*AR':@FM:WMOKey:@FM:"":@FM:WOStepKey:@FM
Open "!WM_OUT" to BangTable then
Lock BangTable, 0 then
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
PendingTrans := IndexTransactionRow
Write PendingTrans on BangTable, 0 then
LogData<4> = 'Index transaction successfully added.'
Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM)
end else
ErrorMsg = 'Unable to write index transaction to !WM_OUT. ':WMOKey
end
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !WM_OUT to add index transaction. ':WMOKey
end else
ErrorMsg = 'Unable to Lock !WM_OUT to add index transaction. ':WMOKey
end
end else
ErrorMsg = 'Unable to Open !WM_OUT to add index transaction. ':WMOKey
end
end
end else
LogData<4> = 'WO_STEP key for WM_OUT ':WMOKey:' is null. Nothing to update.'
Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM)
end
end
end
If ErrorMsg NE '' then
LogData<4> = ErrorMsg
Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM)
end
LogData<4> = 'End ':Service
Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM)
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
end service
Service VerifyWOLogWMOKeyIndex(WMOKey)
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WM_OUT'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !WM_OUT WM_OUT{WO_NO} Log.csv'
Headers = 'Logging DTM':@FM:'WMOKey':@FM:'WOStep':@FM:'Result'
objVerifyWMOWoIndexLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = WMOKey
LogData<4> = 'Begin ':Service
Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM)
ErrorMsg = ''
If WMOKey NE '' then
If RowExists('WM_OUT', WMOKey) then
WONo = Field(WMOKey, '*', 1, 1)
If WONo NE '' then
WOLogRDSKeys = ''
Extract_Si_Keys('WM_OUT', 'WO_NO', WONo, WOLogRDSKeys)
LogData<3> = WONo
Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM)
Locate WMOKey in WOLogRDSKeys using @VM setting vPos else
LogData<4> = 'WMOKey missing from Btree index. Generating index transaction.'
Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM)
// Add index transaction to update WO_NO btree index
IndexTransactionRow = 'WO_NO':@FM:WMOKey:@FM:"":@FM:WONo:@FM
Open "!WM_OUT" to BangTable then
Lock BangTable, 0 then
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
PendingTrans := IndexTransactionRow
Write PendingTrans on BangTable, 0 then
LogData<4> = 'Index transaction successfully added.'
Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM)
end else
ErrorMsg = 'Error in ':Service:' service. Unable to write index transaction to !WM_OUT. ':WMOKey
end
Unlock BangTable, 0 else ErrorMsg = 'Error in ':Service:' service. Unable to Open !WM_OUT to add index transaction. ':WMOKey
end else
ErrorMsg = 'Error in ':Service:' service. Unable to Lock !WM_OUT to add index transaction. ':WMOKey
end
end else
ErrorMsg = 'Error in ':Service:' service. Unable to Open !WM_OUT to add index transaction. ':WMOKey
end
end
end else
LogData<4> = 'WONo for WM_OUT ':WMOKey:' is null. Nothing to update.'
Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM)
end
end
end else
ErrorMsg = 'Error in ':Service:' service. Null WMOKey passed in.'
end
If ErrorMsg NE '' then
LogData<4> = ErrorMsg
Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM)
end
LogData<4> = 'End ':Service
Logging_Services('AppendLog', objVerifyWMOWoIndexLog, LogData, @RM, @FM)
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
end service
Service VerifyWOMatWMOKeyIndex(WMOKey)
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WM_OUT'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' !WM_OUT WO_MAT{WMO_KEY} Log.csv'
Headers = 'Logging DTM':@FM:'WMOKey':@FM:'WOMatKey':@FM:'Result'
objVerifyWOMatWmoKeyLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = WMOKey
LogData<4> = 'Begin ':Service
Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM)
ErrorMsg = ''
If WMOKey NE '' then
If RowExists('WM_OUT', WMOKey) then
WOMatKey = Field(WMOKey, '*', 1, 1):'*':Field(WMOKey, '*', 3, 1)
If WOMatKey NE '' then
WOMatWMOKey = Xlate('WO_MAT', WOMatKey, 'WMO_KEY', 'X')
LogData<3> = WOMatKey
Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM)
If WOMatWMOKey EQ '' then
LogData<4> = 'WMOKey missing from WO_MAT record. Generating index transaction.'
Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM)
// Add index transaction to update WMO_KEY relational index (target WO_MAT table)
IndexTransactionRow = 'WO_MAT*WMO_KEY*TOP':@FM:WMOKey:@FM:"":@FM:WOMatKey:@FM
Open "!WM_OUT" to BangTable then
Lock BangTable, 0 then
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
PendingTrans := IndexTransactionRow
Write PendingTrans on BangTable, 0 then
LogData<4> = 'Index transaction successfully added.'
Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM)
end else
ErrorMsg = 'Unable to write index transaction to !WM_OUT. ':WMOKey
end
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !WM_OUT to add index transaction. ':WMOKey
end else
ErrorMsg = 'Unable to Lock !WM_OUT to add index transaction. ':WMOKey
end
end else
ErrorMsg = 'Unable to Open !WM_OUT to add index transaction. ':WMOKey
end
end
end else
LogData<4> = 'WO_MAT key for WM_OUT ':WMOKey:' is null. Nothing to update.'
Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM)
end
end
end
If ErrorMsg NE '' then
LogData<4> = ErrorMsg
Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM)
end
LogData<4> = 'End ':Service
Logging_Services('AppendLog', objVerifyWOMatWmoKeyLog, LogData, @RM, @FM)
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
end service

View File

@ -50,6 +50,8 @@ $Insert VOIDED_LOT_EQUATES
$Insert IFX_EQUATES
$Insert CUST_EPI_PART_EQUATES
Equ MAX_NUM_CASS$ to 96
Declare subroutine Error_Services, Work_Order_Services, Memory_Services, RList, Database_Services, SRP_JSON
Declare subroutine Btree.Extract, Set_Status, obj_WO_Log, obj_Notes, Print_Wo_Mat_In_Labels, Print_Wo_Mat_Out_Labels
Declare subroutine Print_Wmi_Labels, Print_Wmo_Labels, ErrMsg, Print_Cass_Labels, Logging_Services, Service_Services
@ -59,7 +61,7 @@ Declare subroutine obj_WO_Mat, obj_Post_Log
Declare function SRP_Array, Work_Order_Services, Memory_Services, Database_Services, SRP_Sort_Array, SRP_JSON
Declare function Company_Services, obj_Prod_Spec, Schedule_Services, obj_WO_Log, obj_WO_Step, Memberof, Datetime
Declare function Environment_Services, Logging_Services, Hold_Services, Signature_Services, Lot_Services
Declare function SRP_Datetime, RTI_CreateGUID, RDS_Services
Declare function SRP_Datetime, RTI_CreateGUID, RDS_Services, UCase
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_LOG'
LogDate = Oconv(Date(), 'D4/')
@ -646,7 +648,6 @@ Service ReceiveCassette(WONo, ReceiveUser, LotNo, CassQty, SubPartNo, SubVendorC
WOMatKeys = SRP_Array('SortRows', WOMatKeys, 'AR2', 'LIST', @VM, '*')
If WOMatKeys NE '' then
WOMatKeys = SRP_Array('SortRows', WOMatKeys, 'AR2', 'LIST', @VM, '*')
LastCassNo = WOMatKeys[-1, 'B*']
end else
LastCassNo = 0
@ -1892,20 +1893,22 @@ Service UpdateOpenWorkOrderStatuses()
end else
MonaResource = 'GRP_OPENINSIGHT_MES_OP_FE_DEV_SERVICE_MANAGER'
end
MonaStatus = 'ok'
Server = Environment_Services('GetServer')
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_LOG'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Update Work Order Status Log.csv'
Headers = 'Logging DTM' : @FM : 'Work Order No' : @FM : 'Log'
objStatusLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$,',', Headers, '', False$, False$)
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_LOG'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Update Work Order Status Log.csv'
Headers = 'Logging DTM':@FM:'Server':@FM:'WONo':@FM:'Result'
objVerifyWOMatKeysLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
Server = Environment_Services('GetServer')
LogData = ''
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<2> = Server
LogData<3> = 'Begin ':Service
Logging_Services('AppendLog', objStatusLog, LogData, @RM, @FM)
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = Server
LogData<4> = 'Begin ':Service
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
ErrorMsg = ''
OpenWoLogKeys = ''
@ -1913,46 +1916,49 @@ Service UpdateOpenWorkOrderStatuses()
Extract_Si_Keys('WO_LOG', 'CLOSE_DATE', '', OpenWoLogKeys)
If Not(Get_Status(ErrCode)) then
If OpenWoLogKeys NE '' then
For each OpenWoLogKey in OpenWoLogKeys using @VM
Service_Services('PostProcedure', 'WORK_ORDER_SERVICES', 'UpdateWorkOrderStatus':SD$:OpenWoLogKey)
If Error_Services('NoError') then
OpenWoLogKeys = SRP_Array('SortSimpleList', OpenWoLogKeys, 'AscendingNumbers', @VM)
LastOpenWoUpdated = ''
ServiceKey = UCase(Service)
If RowExists('APP_INFO', ServiceKey) then
LastOpenWoUpdated = Database_Services('ReadDataRow', 'APP_INFO', ServiceKey)
end
If (LastOpenWoUpdated NE '') then
Locate LastOpenWoUpdated in OpenWoLogKeys using @VM setting vPos then
vPos += 1
end else
vPos = 1
end
end else
vPos = 1
end
NextOpenWoLogKey = OpenWoLogKeys<0, vPos>
Database_Services('WriteDataRow', 'APP_INFO', ServiceKey, NextOpenWoLogKey, True$, False$, False$)
If NextOpenWoLogKey NE '' then
Work_Order_Services('UpdateWorkOrderStatus', NextOpenWoLogKey)
If Error_Services('HasError') then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<2> = Server
LogData<3> = 'Successfully posted UpdateWorkOrderStatus procedure to PROC_QUEUE for WO_LOG ':OpenWOLogKey:'.'
Logging_Services('AppendLog', objStatusLog, LogData, @RM, @FM)
end else
ErrorMsg = 'Error posting UpdateWorkOrderStatus procedure to PROC_QUEUE for WO_LOG ':OpenWOLogKey:'.'
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<2> = Server
LogData<3> = ErrorMsg
Logging_Services('AppendLog', objStatusLog, LogData, @RM, @FM)
end
Next OpenWoLogKey
ErrorMsg = 'Error calling UpdateWorkOrderStatus for WO_LOG ':NextOpenWoLogKey:'. ':Error_Services('GetMessage')
LogData<4> = ErrorMsg
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
MonaStatus = 'critical'
end
end
end else
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<2> = Server
LogData<3> = 'No open work orders to update.'
Logging_Services('AppendLog', objStatusLog, LogData, @RM, @FM)
LogData<4> = 'No open work orders to update.'
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
end
end else
MonaStatus = 'critical'
ErrorMsg = 'Error calling Extract_Si_Keys. Error code: ':ErrCode:'.'
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<2> = Server
LogData<3> = ErrorMsg
Logging_Services('AppendLog', objStatusLog, LogData, @RM, @FM)
LogData<4> = ErrorMsg
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
end
LogData = ''
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<2> = Server
LogData<3> = 'End ':Service
Logging_Services('AppendLog', objStatusLog, LogData, @RM, @FM)
If ErrorMsg EQ '' then
MonaStatus = 'ok'
end else
MonaStatus = 'critical'
end
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'End ':Service
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
Mona_Services('PostStatus', MonaResource, StatusName, MonaStatus)
@ -2062,6 +2068,252 @@ Service UpdateWorkOrderStatus(WOLogId)
end service
Service UpdateOpenWorkOrderData()
hSysLists = Database_Services('GetTableHandle', 'SYSLISTS')
Lock hSysLists, ServiceKeyID then
StatusName = Service
IsProd = Environment_Services('IsProd')
If IsProd then
MonaResource = 'GRP_OPENINSIGHT_MES_OP_FE_SERVICE_MANAGER'
end else
MonaResource = 'GRP_OPENINSIGHT_MES_OP_FE_DEV_SERVICE_MANAGER'
end
MonaStatus = 'ok'
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_LOG'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Update Work Order Data Log.csv'
Headers = 'Logging DTM':@FM:'Server':@FM:'WONo':@FM:'Result'
objVerifyWOMatKeysLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
Server = Environment_Services('GetServer')
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = Server
LogData<4> = 'Begin ':Service
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
ErrorMsg = ''
OpenWoLogKeys = ''
ErrCode = ''
Extract_Si_Keys('WO_LOG', 'CLOSE_DATE', '', OpenWoLogKeys)
If Not(Get_Status(ErrCode)) then
If OpenWoLogKeys NE '' then
OpenWoLogKeys = SRP_Array('SortSimpleList', OpenWoLogKeys, 'AscendingNumbers', @VM)
LastOpenWoUpdated = ''
ServiceKey = UCase(Service)
If RowExists('APP_INFO', ServiceKey) then
LastOpenWoUpdated = Database_Services('ReadDataRow', 'APP_INFO', ServiceKey)
end
If (LastOpenWoUpdated NE '') then
Locate LastOpenWoUpdated in OpenWoLogKeys using @VM setting vPos then
vPos += 1
end else
vPos = 1
end
end else
vPos = 1
end
NextOpenWoLogKey = OpenWoLogKeys<0, vPos>
Database_Services('WriteDataRow', 'APP_INFO', ServiceKey, NextOpenWoLogKey, True$, False$, False$)
If NextOpenWoLogKey NE '' then
Work_Order_Services('UpdateWorkOrderData', NextOpenWoLogKey)
If Error_Services('HasError') then
LogData<1> = OConv(Datetime(), 'DT/^S')
ErrorMsg = 'Error calling UpdateWorkOrderData for WO_LOG ':NextOpenWoLogKey:'. ':Error_Services('GetMessage')
LogData<4> = ErrorMsg
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
MonaStatus = 'critical'
end
end
end else
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'No open work orders to update.'
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
end
end else
MonaStatus = 'critical'
ErrorMsg = 'Error calling Extract_Si_Keys. Error code: ':ErrCode:'.'
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = ErrorMsg
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
end
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'End ':Service
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
Mona_Services('PostStatus', MonaResource, StatusName, MonaStatus)
Unlock hSysLists, ServiceKeyID else Null
end
end service
Service UpdateWorkOrderData(WONo)
hSysLists = Database_Services('GetTableHandle', 'SYSLISTS')
Lock hSysLists, ServiceKeyID:'*':WONo then
StatusName = Service
IsProd = Environment_Services('IsProd')
If IsProd then
MonaResource = 'GRP_OPENINSIGHT_MES_OP_FE_SERVICE_MANAGER'
end else
MonaResource = 'GRP_OPENINSIGHT_MES_OP_FE_DEV_SERVICE_MANAGER'
end
MonaStatus = 'ok'
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_MAT'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : '-' : WONo : ' WO_MAT WO_LOG{WO_MAT_KEY} Log.csv'
Headers = 'Logging DTM':@FM:'Server':@FM:'WONo':@FM:'Result'
objVerifyWOMatKeysLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
Server = Environment_Services('GetServer')
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = Server
LogData<3> = WONo
LogData<4> = 'Begin ':Service
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
Done = False$
ErrorMsg = ''
OpenWoLogKeys = ''
ErrCode = ''
EpiPro = (Xlate('WO_LOG', WONo, 'PS_REACTOR_TYPE', 'X') _EQC 'EPP')
OrigWOLogWOMatKeys = Database_Services('ReadDataColumn', 'WO_LOG', WONo, WO_LOG_WO_MAT_KEY$, True$, 0)
If Error_Services('NoError') then
NewWOLogWOMatKeys = ''
For CassNo = 1 to MAX_NUM_CASS$
WOMatKey = WONo:'*':CassNo
If RowExists('WO_MAT', WOMatKey) then
If EpiPro then
WMIKey = Xlate('WO_MAT', WOMatKey, 'WMI_KEY', 'X')
If (WMIKey EQ '') then
If RowExists('WM_IN', WONo:'*1*':CassNo) then
WMIKey = WONo:'*1*':CassNo
WM_In_Services('VerifyWOMatWMIKeyIndex', WMIKey)
end
end
If (WMIKey NE '') then
WM_In_Services('VerifyWoStepWMIKeyIndex', WMIKey)
WM_In_Services('VerifyWOLogWMIKeyIndex', WMIKey)
end
WMOKey = Xlate('WO_MAT', WOMatKey, 'WMO_KEY', 'X')
If (WMOKey EQ '') then
If RowExists('WM_OUT', WONo:'*1*':CassNo) then
WMOKey = WONo:'*1*':CassNo
WM_Out_Services('VerifyWOMatWMOKeyIndex', WMOKey)
end
end
If (WMOKey NE '') then
WM_Out_Services('VerifyWoStepWMOKeyIndex', WMOKey)
WM_Out_Services('VerifyWOLogWMOKeyIndex', WMOKey)
end
end
RDSNo = Xlate('WO_MAT', WOMatKey, 'RDS_NO', 'X')
If (RDSNo NE '') then
If (DCount(RDSNo, @VM) GT 1) then
NewRDSNo = ''
NumRDS = 0
For each RDSKey in RDSNo using @VM setting vPos
If RowExists('RDS', RDSKey) then
NumRDS += 1
NewRDSNo = RDSKey
RDS_Services('VerifyWOLogRDSKeyIndex', RDSNo)
RDS_Services('VerifyWOMatRDSNoIndex', RDSNo)
RDS_Services('VerifyWOStepRDSKeyIndex', RDSNo)
end
Next RDSKey
If (NumRDS EQ 1) then
Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_RDS_NO$, NewRDSNo)
end else
MonaStatus = 'critical'
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'Multiple RDS records associated with WO_MAT ':WOMatKey:'.'
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
end
end else
RDS_Services('VerifyWOLogRDSKeyIndex', RDSNo)
RDS_Services('VerifyWOMatRDSNoIndex', RDSNo)
RDS_Services('VerifyWOStepRDSKeyIndex', RDSNo)
end
end else
If Not(EpiPro) then
Query = 'SELECT RDS WITH WO EQ ':WONo:' AND WITH CASS_NO EQ ':CassNo
RList(Query, TARGET_ACTIVELIST$, '', '', '')
ErrCode = ''
If Not(Get_Status(ErrCode)) then
ReadNext RDSNo then
RDS_Services('VerifyWOLogRDSKeyIndex', RDSNo)
RDS_Services('VerifyWOMatRDSNoIndex', RDSNo)
RDS_Services('VerifyWOStepRDSKeyIndex', RDSNo)
end else
MonaStatus = 'critical'
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'No RDS found for WO_MAT ':WOMatKey:'.'
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
end
end else
MonaStatus = 'critical'
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'Error calling RList to find RDSNo associated with WO_MAT ':WOMatKey:'. Error code: ':ErrCode
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
end
end
end
Voided = Xlate('WO_MAT', WOMatKey, 'VOID', 'X')
If Not(Voided) then NewWOLogWOMatKeys<0, -1> = WOMatKey
end else
Done = True$
end
Until Done
Next CassNo
NewWOLogWOMatKeys = SRP_Array('SortRows', NewWOLogWOMatKeys, 'AR2', 'LIST', @VM, '*')
If OrigWOLogWOMatKeys NE NewWOLogWOMatKeys then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'WOMatKeys column out of date. Posting transaction to update WO_MAT_KEY column.'
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
Transaction_Services('PostWriteFieldTransaction', 'WO_LOG', WONo, WO_LOG_WO_MAT_KEY$, NewWOLogWOMatKeys)
If Error_Services('HasError') then ErrorMsg = Error_Services('GetMessage')
end else
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = 'WOMatKeys column accurate. Nothing to update.'
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
end
end else
ErrorMsg = 'Error in ':Service:' service. ':Error_Services('GetMessage')
end
If ErrorMsg NE '' then
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<4> = ErrorMsg
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
MonaStatus = 'critical'
end
LogData<1> = OConv(Datetime(), 'DT/^S')
LogData<2> = Server
LogData<4> = 'End ':Service
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
Mona_Services('PostStatus', MonaResource, StatusName, MonaStatus)
Unlock hSysLists, ServiceKeyID:'*':WONo else Null
end
end service
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Internal GoSubs
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -2074,4 +2326,3 @@ ClearCursors:
return

View File

@ -285,16 +285,15 @@ WRITE_RECORD_PRE:
end else
CriticalFieldName = 'Error determining field name'
end
Record<CriticalField> = OrigRecord<CriticalField>
Recipients = ''
SentFrom = 'SYSTEM'
Subject = 'WO_MAT_ACTIONS - Critical Field Erase Attempt'
Subject = 'WO_MAT_ACTIONS - Critical Field Erased'
Message = OConv(Datetime(), 'DT2/^H')
Message<2> = 'Computer: ':@Station
Message<3> = 'User: ':@User4
Message<4> = 'WO_MAT key: ':Name
NoteMessage = 'Readonly field ':CriticalField:' (':CriticalFieldName:') restored.'
NoteMessage = 'Readonly field ':CriticalField:' (':CriticalFieldName:') erased. Value erased ':Quote(OrigRecord<CriticalField>)
Message<5> = NoteMessage
Message<6> = 'Call Stack:':CRLF$:RetStack()
Swap @FM with \0D0A\ in Message
@ -869,7 +868,7 @@ WRITE_RECORD:
// This should catch cases where the entire cassette is "peeled off", NCR'ed, or used for destructive testing.
Service_Services('PostProcedure', 'SCHEDULE_SERVICES', 'MarkCassProcessed':SD$:WONo:SD$:CassNo:SD$:Datetime())
end
return

View File

@ -1,4 +1,50 @@
Compile function WO_MAT_Services(@Service, @Params)
/***********************************************************************************************************************
Name : WO_MAT_Services
Description : Handler program for all WO_MAT services.
Notes : Application errors should be logged using the Error Services module. There are a few methodological
assumptions built into way errors are managed which are important to understand in order to properly
work with Error Services:
- The term 'top' refers to the originating procedure of a call stack and the term 'bottom' refers to
the last routine (or the current routine) within a call stack. Within the OpenInsight Debugger
this will appear backwards since the originating procedure always appears at the bottom of the
list and the current routine appears at the top of the list. We are using this orientation because
it is common to refer to the process of calling other procedures as 'drilling down'.
- The reason for defining the orientation of the call stack is because Error_Services allows for
multiple error conditions to be appended to an original error. In most cases this will happen when
a procedure at the bottom of the stack generates an error condition and then returns to its
calling procedure. This higher level procedure can optionally add more information relevant to
itself. This continues as the call stack 'bubbles' its way back to the top to where the
originating procedure is waiting.
- Native OpenInsight commands that handle errors (e.g., Set_Status, Set_FSError, Set_EventStatus)
preserve their error state until explicitly cleared. This can hinder the normal execution of code
since subsequent procedures (usually SSPs) will fail if a pre-existing error condition exists.
Our philosophy is that error conditions should automatically be cleared before a new procedure
is executed to avoid this problem. However, the nature of Basic+ does not make this easy to
automate for any given stored procedure. Therefore, if a stored procedure wants to conform to our
philosophy then it should include a call into the 'Clear' service request at the top of the
program. Alternatively this can be done through a common insert (see SERVICE_SETUP for example.)
- Service modules will use the SERVICE_SETUP insert and therefore automatically clear out any
error conditions that were set before.
Parameters :
Service [in] -- Name of the service being requested
Param1-10 [in/out] -- Additional request parameter holders
Response [out] -- Response to be sent back to the Controller (MCP) or requesting procedure
Metadata :
History : (Date, Initials, Notes)
05/14/18 djs Added VerifyWOLogWOMatKeyColumn service.
***********************************************************************************************************************/
#pragma precomp SRP_PreCompiler
$insert LOGICAL
@ -12,6 +58,7 @@ Declare function Database_Services, Error_Services, SRP_Json, SRP_Com, Environ
Declare function Datetime, Rds_Services, GetTickCount, SRP_Array
Declare subroutine Error_Services, SRP_Json, SRP_Com, Wo_Mat_Services, Database_Services, Logging_Services
Declare subroutine obj_wo_mat_log, Set_Status, Rds_Services, Signature_Services, Mona_Services, Btree.Extract
Declare subroutine Transaction_Services
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_Mat\InvActionsSyncUp'
LogDate = Oconv(Date(), 'D4/')
@ -584,3 +631,67 @@ Service GetWOMatKeys(WONo)
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
end service
Service VerifyWOLogWOMatKeyColumn(WOMatKey)
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_MAT'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' WO_MAT WO_LOG{WO_MAT_KEY} Log.csv'
Headers = 'Logging DTM':@FM:'WOMatKey':@FM:'Result'
objVerifyWOMatKeysLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = WOMatKey
LogData<3> = 'Begin ':Service
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
ErrorMsg = ''
If WOMatKey NE '' then
If RowExists('WO_MAT', WOMatKey) then
WONo = Field(WOMatKey, '*', 1, 1)
If WONo NE '' then
If RowExists('WO_LOG', WONo) then
WOLogWOMatKeys = Database_Services('ReadDataColumn', 'WO_LOG', WONo, WO_LOG_WO_MAT_KEY$, True$, 0)
If Error_Services('NoError') then
Locate WOMatKey in WOLogWOMatKeys using @VM setting vPos then
LogData<3> = 'WOMatKey found in WO_LOG record. Nothing to update.'
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
end else
LogData<3> = 'WOMatKey not found in WO_LOG record. Posting transaction to update column.'
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
WOLogWOMatKeys<0, -1> = WOMatKey
WOLogWOMatKeys = SRP_Array('SortRows', WOLogWOMatKeys, 'AR2', 'LIST', @VM, '*')
Transaction_Services('PostWriteFieldTransaction', 'WO_LOG', WONo, WO_LOG_WO_MAT_KEY$, WOLogWOMatKeys)
end
end else
ErrorMsg = 'Error in ':Service:' service. ':Error_Services('GetMessage')
end
end else
ErrorMsg = 'Error in ':Service:' service. WO_LOG ':WONo:' does not exist.'
end
end else
ErrorMsg = 'Error in ':Service:' service. WO_NO is null.'
end
end else
ErrorMsg = 'Error in ':Service:' service. WO_MAT ':WOMatKey:' does not exist.'
end
end else
ErrorMsg = 'Error in ':Service:' service. Null WOMatKey passed into service.'
end
LogData<3> = 'End ':Service
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
If ErrorMsg NE '' then
LogData<3> = ErrorMsg
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
end
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
end service