Compare commits
	
		
			18 Commits
		
	
	
		
			71daf317f0
			...
			8499d03ef8
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 8499d03ef8 | |||
| 3186ec1ad6 | |||
| 898f21b73d | |||
| f7ee12a78d | |||
| 475df5ba54 | |||
| 28a8a10ba2 | |||
| 6934799e92 | |||
| 03f42dedea | |||
| 033e3baee8 | |||
| 4bfae8e7b7 | |||
| 0f0c735023 | |||
| 4eee1b0f0a | |||
| e2e8731316 | |||
| a21f41fd29 | |||
| 2bbc5c065d | |||
| 9e54865e1e | |||
| c7f1f86249 | |||
| c89bb6b3d4 | 
| @ -488,9 +488,11 @@ Service PushSigProfileToWoMat(CleanInspKey) | |||||||
| 					If WOMatKey NE '' then | 					If WOMatKey NE '' then | ||||||
| 						WOMatRec     = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey) | 						WOMatRec     = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey) | ||||||
| 						If Error_Services('NoError') then  | 						If Error_Services('NoError') then  | ||||||
| 							WOMatSigProf = WOMatRec<WO_MAT_SIG_PROFILE$> | 							WOMatSigProf     = WOMatRec<WO_MAT_SIG_PROFILE$> | ||||||
| 							WOMatSigs    = WOMatRec<WO_MAT_SIGNATURE$> | 							WOMatSigs        = WOMatRec<WO_MAT_SIGNATURE$> | ||||||
| 							WOMatSigDTMs = WOMatRec<WO_MAT_SIG_DTM$> | 							WOMatSigDTMs     = WOMatRec<WO_MAT_SIG_DTM$> | ||||||
|  | 							WOMatSigsOrig    = WOMatSigs | ||||||
|  | 							WOMatSigDTMsOrig = WOMatSigDTMs | ||||||
| 							 | 							 | ||||||
| 							InspSig         = Record<CLEAN_INSP_INSP_SIG$> | 							InspSig         = Record<CLEAN_INSP_INSP_SIG$> | ||||||
| 							InspSigDTM      = Record<CLEAN_INSP_INSP_SIG_DTM$> | 							InspSigDTM      = Record<CLEAN_INSP_INSP_SIG_DTM$> | ||||||
| @ -520,8 +522,12 @@ Service PushSigProfileToWoMat(CleanInspKey) | |||||||
| 							NumSteps     = DCount(WOMatSigProf, @VM) | 							NumSteps     = DCount(WOMatSigProf, @VM) | ||||||
| 							WOMatSigs    = Field(WOMatSigs, @VM, 1, NumSteps) | 							WOMatSigs    = Field(WOMatSigs, @VM, 1, NumSteps) | ||||||
| 							WOMatSigDTMs = Field(WOMatSigDTMs, @VM, 1, NumSteps) | 							WOMatSigDTMs = Field(WOMatSigDTMs, @VM, 1, NumSteps) | ||||||
| 							Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIGNATURE$, WOMatSigs) | 							If WOMatSigs NE WOMatSigsOrig then | ||||||
| 							Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIG_DTM$, WOMatSigDTMs) | 								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 | 						end else | ||||||
| 							ErrorMsg = 'Error in ':Service:' service. Error message: ':Error_Services('GetMessage') | 							ErrorMsg = 'Error in ':Service:' service. Error message: ':Error_Services('GetMessage') | ||||||
| 						end | 						end | ||||||
|  | |||||||
| @ -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 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 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   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   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 | DECLARE FUNCTION   Logging_Services, Environment_Services, Work_Order_Services, Error_Services, Service_Services | ||||||
| @ -180,14 +180,18 @@ Read: | |||||||
|     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' |     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) |     WOMatKeys = Wo_Mat_Services('GetWOMatKeys', WONo) | ||||||
|     If Error_Services('NoError') then |     If Error_Services('NoError') then | ||||||
|         CassData = WO_Mat_Services('GetWOMatData', WOMatKeys, Columns) |     	If (WOMatKeys NE '') then  | ||||||
|         If Error_Services('NoError') then | 			CassData = WO_Mat_Services('GetWOMatData', WOMatKeys, Columns) | ||||||
|             Set_Property(@Window:'.CASS_NO', 'ARRAY', CassData) | 			If Error_Services('NoError') then | ||||||
|             Msg(@window, MsgUp)  | 				Set_Property(@Window:'.CASS_NO', 'ARRAY', CassData) | ||||||
|         end else | 				Msg(@window, MsgUp)  | ||||||
|             Msg(@window, MsgUp)         | 			end else | ||||||
|             Msg(@Window, '', 'OK', '', 'Process Error':@FM:Error_Services('GetMessage')) | 				Msg(@window, MsgUp)         | ||||||
|         end | 				Msg(@Window, '', 'OK', '', 'Process Error':@FM:Error_Services('GetMessage')) | ||||||
|  | 			end | ||||||
|  | 		end else | ||||||
|  | 			Msg(@window, MsgUp)        | ||||||
|  | 		end | ||||||
|     end else |     end else | ||||||
|         Msg(@window, MsgUp)          |         Msg(@window, MsgUp)          | ||||||
|         Msg(@Window, '', 'OK', '', 'Process Error':@FM:Error_Services('GetMessage')) |         Msg(@Window, '', 'OK', '', 'Process Error':@FM:Error_Services('GetMessage')) | ||||||
| @ -647,6 +651,8 @@ Scan: | |||||||
|         end |         end | ||||||
|         Logging_Services('AppendLog', objReceiveLog, LogData, @RM, @FM)   |         Logging_Services('AppendLog', objReceiveLog, LogData, @RM, @FM)   | ||||||
|          |          | ||||||
|  |         Service_Services('PostProcedure', 'WORK_ORDER_SERVICES', 'UpdateWorkOrderData':SD$:WONo) | ||||||
|  |          | ||||||
|         Post_Event(@Window, 'READ') |         Post_Event(@Window, 'READ') | ||||||
|     end |     end | ||||||
|  |  | ||||||
| @ -931,4 +937,3 @@ AddLeftover: | |||||||
|  |  | ||||||
| RETURN | RETURN | ||||||
|  |  | ||||||
|  |  | ||||||
|  | |||||||
| @ -62,11 +62,10 @@ Main: | |||||||
| 											Open "DICT.":Table to @DICT then null | 											Open "DICT.":Table to @DICT then null | ||||||
| 											@ID = Key | 											@ID = Key | ||||||
| 											Ans = Function(@Handler(Connection, Key, @RECORD)) | 											Ans = Function(@Handler(Connection, Key, @RECORD)) | ||||||
| 											If Ans EQ '' then | 											If (Ans EQ '') then | ||||||
| 												If Assigned(pKey) then | 												If Assigned(pKey) then | ||||||
| 													If pKey NE '' then | 													If (pKey NE '') then | ||||||
| 														Delete pTable, pKey else Null | 														Delete pTable, pKey else Null | ||||||
| 														Unlock pTable, pKey else Null	 |  | ||||||
| 													end | 													end | ||||||
| 												end | 												end | ||||||
| 											end | 											end | ||||||
| @ -102,6 +101,8 @@ Main: | |||||||
| 					 | 					 | ||||||
| 					If Assigned(pKey) then | 					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 | 							// Always log the result | ||||||
| 							Open 'SQL_LOG' to hLog then | 							Open 'SQL_LOG' to hLog then | ||||||
| 								If Ans EQ '' then | 								If Ans EQ '' then | ||||||
|  | |||||||
| @ -52,10 +52,11 @@ Main: | |||||||
| 							// Read the record and call the handler | 							// Read the record and call the handler | ||||||
| 							If Key NE "" then | 							If Key NE "" then | ||||||
| 								Ans = Function(@Handler(Connection, Key)) | 								Ans = Function(@Handler(Connection, Key)) | ||||||
| 								If Ans EQ '' then | 								If (Ans EQ '') then | ||||||
| 									If Assigned(pKey) then | 									If Assigned(pKey) then | ||||||
| 										Delete pTable, pKey else Null | 									    If (pKey NE '') then | ||||||
| 										Unlock pTable, pKey else Null | 									        Delete pTable, pKey else Null | ||||||
|  | 									    end | ||||||
| 									end | 									end | ||||||
| 								end | 								end | ||||||
| 							end | 							end | ||||||
| @ -86,6 +87,8 @@ Main: | |||||||
|  |  | ||||||
| 			If Assigned(pKey) then | 			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 | 					Open 'SQL_LOG' to hLog then | ||||||
| 						If Ans EQ '' then | 						If Ans EQ '' then | ||||||
| 							Result = 'PROCESSED' | 							Result = 'PROCESSED' | ||||||
|  | |||||||
| @ -590,7 +590,9 @@ Service SetupDevServices() | |||||||
| 		BaselineServices  = 'Update Material Logs':@VM:'Log Transaction Postings':@VM:'Process Wafer Image Queue':@VM | 		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 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 := '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" | 		Query = "SELECT SERVICES" | ||||||
|  |  | ||||||
|  | |||||||
| @ -81,7 +81,7 @@ objLotStartLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ',', He | |||||||
|  |  | ||||||
| LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' LotRun.csv' | 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' | 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' | LogFileName   = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' LotMove.csv' | ||||||
| Headers       = 'Logging DTM' : @FM : 'Lot Id' : @FM : 'Username' : @FM : 'Message' | Headers       = 'Logging DTM' : @FM : 'Lot Id' : @FM : 'Username' : @FM : 'Message' | ||||||
| @ -1614,3 +1614,4 @@ end service | |||||||
| // Internal GoSubs | // Internal GoSubs | ||||||
| //---------------------------------------------------------------------------------------------------------------------- | //---------------------------------------------------------------------------------------------------------------------- | ||||||
|  |  | ||||||
|  |  | ||||||
|  | |||||||
| @ -383,16 +383,12 @@ Service GetSP1(Handle) | |||||||
| 			Result<10> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnHazeAvgMean'); // HazeAvg | 			Result<10> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnHazeAvgMean'); // HazeAvg | ||||||
| 			Result<28> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].RDS'); // RDSKeyID | 			Result<28> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].RDS'); // RDSKeyID | ||||||
| 			Result<30> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Session'); // ScanRecipe | 			Result<30> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Session'); // ScanRecipe | ||||||
| 			IsMisfit = IndexC(Result<30>, 'MISFIT', 1) | 			Result<3> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnLpdMean'); // SoDAvg | ||||||
| 			IF IsMisfit THEN | 			Result<2> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnLpdMax'); // SoDMax | ||||||
| 				Result<3> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAllMean'); // SoDAvg | 			Result<1> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnLpdMin'); // SoDMin | ||||||
| 				Result<2> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAllMax'); // SoDMax | 			Result<39> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAllMean'); // SoDAvg | ||||||
| 				Result<1> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAllMin'); // SoDMin | 			Result<40> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAllMax'); // SoDMax | ||||||
| 			END ELSE | 			Result<41> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAllMin'); // 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 |  | ||||||
| 			END |  | ||||||
| 			Result<43> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].MesEntity'); // ScanTool | 			Result<43> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].MesEntity'); // ScanTool | ||||||
| 			Result<44> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAreaMean'); // DCNMM2 | 			Result<44> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAreaMean'); // DCNMM2 | ||||||
| 		END | 		END | ||||||
|  | |||||||
| @ -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   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   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 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 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 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 MSG_EQUATES | ||||||
| $Insert APP_INSERTS | $Insert APP_INSERTS | ||||||
| @ -40,6 +40,8 @@ $Insert CLEAN_INSP_EQUATES | |||||||
| $Insert WMO_WFRS_EQUATES | $Insert WMO_WFRS_EQUATES | ||||||
| $Insert REACT_RUN_EQUATES | $Insert REACT_RUN_EQUATES | ||||||
|  |  | ||||||
|  | EQU NUM_RETRIES$ TO 50 | ||||||
|  |  | ||||||
| ErrTitle = 'Error in Stored Procedure "obj_WM_Out"' | ErrTitle = 'Error in Stored Procedure "obj_WM_Out"' | ||||||
| ErrorMsg = '' | ErrorMsg = '' | ||||||
| ErrCode  = '' | ErrCode  = '' | ||||||
| @ -167,14 +169,37 @@ Create: | |||||||
| 	 | 	 | ||||||
| 	WMOutKeys	= XLATE('WO_STEP',WONo:'*':WOStep,WO_STEP_WM_OUT_KEYS$,'X') | 	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 | 		WMOStartBox = 1 | ||||||
| 		WMOStartSlot = 1 | 		WMOStartSlot = 1 | ||||||
| 	END ELSE | 	END ELSE | ||||||
| 		LastBoxOut = WMOutKeys[-1,'B':@VM] | 	    PrevCassNo      = CassNo - 1 | ||||||
| 		LastWMORec = XLATE('WM_OUT',LastBoxOut,'','X') | 		LastBoxOut      = WONo:'*':WOStep:'*':PrevCassNo | ||||||
|  | 		LastWMORec      = XLATE('WM_OUT',LastBoxOut,'','X') | ||||||
| 		LastBoxLastSlot = LastWMORec<WM_OUT_SLOT_NO$>[-1,'B':@VM] | 		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 | 			WMOStartBox  = FIELD(LastBoxOut,'*',3)							;* Start IN the last box | ||||||
| 			WMOStartSlot = LastBoxLastSlot + 1								;* Start with first slot past current and less than Load Qty | 			WMOStartSlot = LastBoxLastSlot + 1								;* Start with first slot past current and less than Load Qty | ||||||
| 		END ELSE | 		END ELSE | ||||||
| @ -225,7 +250,8 @@ Create: | |||||||
| 		NumAttempts = 0 | 		NumAttempts = 0 | ||||||
| 		Loop | 		Loop | ||||||
| 			NumAttempts += 1 | 			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 | 			If Error_Services('HasError') then | ||||||
| 				// Log the error | 				// Log the error | ||||||
| 				LogData    = '' | 				LogData    = '' | ||||||
| @ -247,9 +273,11 @@ Create: | |||||||
| 				Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) | 				Logging_Services('AppendLog', objReleaseLog, LogData, @RM, @FM) | ||||||
| 				Done       = True$ | 				Done       = True$ | ||||||
| 			end | 			end | ||||||
| 		Until ( (NumAttempts EQ 10) or (Done EQ True$) ) | 		Until ( (NumAttempts GT NUM_RETRIES$) or (Done EQ True$) ) | ||||||
| 		Repeat | 		Repeat | ||||||
| 		 | 		 | ||||||
|  | 		Unlock hSysLists, CandidateWmOutKey else Null | ||||||
|  | 		 | ||||||
| 		WMOutRec = Database_Services('ReadDataRow', 'WM_OUT', WMOutKey) | 		WMOutRec = Database_Services('ReadDataRow', 'WM_OUT', WMOutKey) | ||||||
| 		If WMOutRec EQ '' then | 		If WMOutRec EQ '' then | ||||||
| 			// Record did not write to the database | 			// Record did not write to the database | ||||||
| @ -280,7 +308,6 @@ Create: | |||||||
| 		WMOCassNo += 1 | 		WMOCassNo += 1 | ||||||
| 		WMOSlotNo = 1 | 		WMOSlotNo = 1 | ||||||
| 		 | 		 | ||||||
| 		 |  | ||||||
| 	REPEAT | 	REPEAT | ||||||
| 	 | 	 | ||||||
| 	Result = OutOnlyCassIDs | 	Result = OutOnlyCassIDs | ||||||
| @ -1961,5 +1988,3 @@ ConvertCleanInsp: | |||||||
| 	 | 	 | ||||||
| RETURN | RETURN | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | |||||||
| @ -1132,8 +1132,9 @@ ReleaseCassettes: | |||||||
|                      |                      | ||||||
|                 END ELSE |                 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$> |                         CassLotNo      = WOMatRec<WO_MAT_LOT_NO$> | ||||||
|                         CassWaferQty   = WOMatRec<WO_MAT_WAFER_QTY$> |                         CassWaferQty   = WOMatRec<WO_MAT_WAFER_QTY$> | ||||||
| @ -1228,7 +1229,7 @@ ReleaseCassettes: | |||||||
|                             END |                             END | ||||||
|                              |                              | ||||||
|                         END	;* End of check for GAN reactor |                         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 |                 END		;* End of check for EpiPRO reactor type | ||||||
|             NEXT N |             NEXT N | ||||||
|         NEXT WOStep         |         NEXT WOStep         | ||||||
|  | |||||||
| @ -121,6 +121,11 @@ SAPFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' SetS | |||||||
| SAPHeaders  = 'Logging DTM' : @FM : 'WOMatKey' : @FM : 'SAPBatchNo' | SAPHeaders  = 'Logging DTM' : @FM : 'WOMatKey' : @FM : 'SAPBatchNo' | ||||||
| objSAPLog   = Logging_Services('NewLog', SAPLogPath, SAPFileName, CRLF$, Comma$, SAPHeaders, '', False$, False$) | 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') | IsProd = Environment_Services('IsProd') | ||||||
| If IsProd EQ True$ then | If IsProd EQ True$ then | ||||||
| 	MonaResource = 'GRP_OPENINSIGHT_MES_OP_FE_OBJWOMAT' | 	MonaResource = 'GRP_OPENINSIGHT_MES_OP_FE_OBJWOMAT' | ||||||
| @ -1040,6 +1045,20 @@ AddInvTrans: | |||||||
| 	IF ErrorMsg NE '' THEN | 	IF ErrorMsg NE '' THEN | ||||||
| 		ErrorMsg := CRLF$:Parms | 		ErrorMsg := CRLF$:Parms | ||||||
| 		SWAP @RM WITH CRLF$ IN ErrorMsg | 		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 | 		RETURN | ||||||
| 	END | 	END | ||||||
| 	 | 	 | ||||||
| @ -1065,6 +1084,21 @@ AddInvTrans: | |||||||
| 			 | 			 | ||||||
| 			IF Get_Status(errCode) THEN | 			IF Get_Status(errCode) THEN | ||||||
| 				obj_Tables('UnlockRec',OtParms) | 				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 | 				RETURN | ||||||
| 			END | 			END | ||||||
| 			 | 			 | ||||||
| @ -1080,6 +1114,21 @@ AddInvTrans: | |||||||
| 					IF Get_Status(errCode) THEN | 					IF Get_Status(errCode) THEN | ||||||
| 						obj_Tables('UnlockRec',WOtParms) | 						obj_Tables('UnlockRec',WOtParms) | ||||||
| 						obj_Tables('UnlockRec',OtParms) | 						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 | 						RETURN | ||||||
| 					END | 					END | ||||||
| 					 | 					 | ||||||
| @ -1095,7 +1144,21 @@ AddInvTrans: | |||||||
| 					obj_Tables('WriteRec',WOtParms) | 					obj_Tables('WriteRec',WOtParms) | ||||||
| 					 | 					 | ||||||
| 					IF Get_Status(errCode) THEN | 					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	;* End of check for PTO or PKO location | 				END	;* End of check for PTO or PKO location | ||||||
| @ -1108,6 +1171,21 @@ AddInvTrans: | |||||||
| 					IF Get_Status(errCode) THEN | 					IF Get_Status(errCode) THEN | ||||||
| 						obj_Tables('UnlockRec',WOtParms) | 						obj_Tables('UnlockRec',WOtParms) | ||||||
| 						obj_Tables('UnlockRec',OtParms) | 						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 | 						RETURN | ||||||
| 					END | 					END | ||||||
| 					 | 					 | ||||||
| @ -1125,6 +1203,21 @@ AddInvTrans: | |||||||
| 			IF @WINDOW NE 'WO_MAT_INV' THEN | 			IF @WINDOW NE 'WO_MAT_INV' THEN | ||||||
| 				IF WOMatRec<WO_MAT_LOT_NO$> = '' OR WOMatRec<WO_MAT_CUST_PART_NO$> = '' THEN | 				IF WOMatRec<WO_MAT_LOT_NO$> = '' OR WOMatRec<WO_MAT_CUST_PART_NO$> = '' THEN | ||||||
| 					obj_Tables('UnlockRec',OtParms) | 					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 | 					RETURN | ||||||
| 				END | 				END | ||||||
| 			END | 			END | ||||||
| @ -1162,7 +1255,51 @@ AddInvTrans: | |||||||
| 			NumAttempts = 0 | 			NumAttempts = 0 | ||||||
| 			Loop | 			Loop | ||||||
| 				NumAttempts     += 1 | 				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) | 				WOMatRecVerify  = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey) | ||||||
| 				LastEntryIndex  = DCount(WOMatRecVerify<WO_MAT_INV_WH$>, @VM) | 				LastEntryIndex  = DCount(WOMatRecVerify<WO_MAT_INV_WH$>, @VM) | ||||||
| 				LastEntryAction = WOMatRecVerify<WO_MAT_INV_ACTION$, LastEntryIndex> | 				LastEntryAction = WOMatRecVerify<WO_MAT_INV_ACTION$, LastEntryIndex> | ||||||
| @ -1203,14 +1340,6 @@ AddInvTrans: | |||||||
| 			 | 			 | ||||||
| 			Logging_Services('AppendLog', WOMatObjLog2, LogData, @RM, @FM) | 			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) | 			obj_Tables('UnlockRec',OtParms) | ||||||
| 			 | 			 | ||||||
| 		CASE 1 | 		CASE 1 | ||||||
| @ -5546,6 +5675,9 @@ RETURN | |||||||
| SendErrorNotification: | SendErrorNotification: | ||||||
| * * * * * * * * * * *  | * * * * * * * * * * *  | ||||||
| 	 | 	 | ||||||
|  | 	If Not(Assigned(errCode)) then | ||||||
|  | 	    errCode = '' | ||||||
|  | 	end | ||||||
| 	swap @SVM with CRLF$ in errCode | 	swap @SVM with CRLF$ in errCode | ||||||
| 	ErrorMsg = 'Error code: ':errCode | 	ErrorMsg = 'Error code: ':errCode | ||||||
| 	 | 	 | ||||||
| @ -5581,3 +5713,4 @@ ExpCOA: | |||||||
| 	 | 	 | ||||||
| RETURN | RETURN | ||||||
|  |  | ||||||
|  |  | ||||||
|  | |||||||
| @ -47,6 +47,14 @@ LogTime     = Oconv(Time(), 'MTS') | |||||||
| LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Front-end Create Log.csv' | LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Front-end Create Log.csv' | ||||||
| Headers     = 'Logging DTM' | Headers     = 'Logging DTM' | ||||||
| objLog      = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$) | 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 | LoggingDTM  = LogDate : ' ' : LogTime   ; // Logging DTM | ||||||
|  |  | ||||||
| IsProd = Environment_Services('IsProd') | IsProd = Environment_Services('IsProd') | ||||||
| @ -250,6 +258,7 @@ RETURN | |||||||
| * * * * * * * | * * * * * * * | ||||||
| Post: | Post: | ||||||
| * * * * * * * | * * * * * * * | ||||||
|  |  | ||||||
|     hSysLists       = Database_Services('GetTableHandle', 'SYSLISTS') |     hSysLists       = Database_Services('GetTableHandle', 'SYSLISTS') | ||||||
|     ServiceKeyID    = 'Obj_WO_Mat_Log*Post' |     ServiceKeyID    = 'Obj_WO_Mat_Log*Post' | ||||||
|     Lock hSysLists, ServiceKeyID then |     Lock hSysLists, ServiceKeyID then | ||||||
| @ -350,7 +359,29 @@ Post: | |||||||
|                         LockedToolID		= ScanToolID |                         LockedToolID		= ScanToolID | ||||||
|                         LockedScanEntry		= ScanEntry |                         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 |                 NEXT I | ||||||
|                  |                  | ||||||
|                 WMLRec<WO_MAT_LOG_WO_NO$>	= LockedWONos |                 WMLRec<WO_MAT_LOG_WO_NO$>	= LockedWONos | ||||||
| @ -376,3 +407,4 @@ Post: | |||||||
| RETURN | RETURN | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | |||||||
| @ -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>)  |                                 AllFailedWafers<0, WfrIndex> = (PreFailedWafers<0, WfrIndex> OR FWIFailedWafers<0, WfrIndex> OR LWIFailedWafers<0, WfrIndex> OR PostFailedWafers<0, WfrIndex>)  | ||||||
|                             Next WfrIndex                             |                             Next WfrIndex                             | ||||||
|                         end |                         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 |                     end else | ||||||
|                         Error_Services('Add', 'Error in ':Service:' service. RDSNo is null') |                         Error_Services('Add', 'Error in ':Service:' service. RDSNo is null') | ||||||
|                     end |                     end | ||||||
|  | |||||||
| @ -903,6 +903,10 @@ WRITE_RECORD: | |||||||
|     	Service_Services('PostProcedure', 'WORK_ORDER_SERVICES', 'UpdateScrappedQty':SD$:WONo) |     	Service_Services('PostProcedure', 'WORK_ORDER_SERVICES', 'UpdateScrappedQty':SD$:WONo) | ||||||
|     end |     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() |     EndTick = GetTickCount() | ||||||
|     Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick) |     Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick) | ||||||
|      |      | ||||||
|  | |||||||
| @ -1889,9 +1889,12 @@ Service PushSigProfileToWoMat(RDSNo) | |||||||
| 					If WOMatKey NE '' then | 					If WOMatKey NE '' then | ||||||
| 						WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey) | 						WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey) | ||||||
| 						If Error_Services('NoError') then  | 						If Error_Services('NoError') then  | ||||||
| 							WOMatSigProf = obj_WO_Mat('CassSigProfile', WOMatKey) | 							WOMatSigProf     = obj_WO_Mat('CassSigProfile', WOMatKey) | ||||||
| 							WOMatSig     = WOMatRec<WO_MAT_SIGNATURE$> | 							WOMatSig         = WOMatRec<WO_MAT_SIGNATURE$> | ||||||
| 							WOMatSigDTM  = WOMatRec<WO_MAT_SIG_DTM$> | 							WOMatSigDTM      = WOMatRec<WO_MAT_SIG_DTM$> | ||||||
|  | 							WOMatSigProfOrig = WOMatSigProf | ||||||
|  | 							WOMatSigOrig     = WOMatSig | ||||||
|  | 							WOMatSigDTMOrig  = WOMatSigDTM | ||||||
|  |  | ||||||
| 							// Update WO_MAT signature profile to match for the "1VER" stage | 							// Update WO_MAT signature profile to match for the "1VER" stage | ||||||
| 							Stage = '1VER' | 							Stage = '1VER' | ||||||
| @ -1963,9 +1966,15 @@ Service PushSigProfileToWoMat(RDSNo) | |||||||
| 								WOMatSigDTM<0, vPos> = FQASigDTM | 								WOMatSigDTM<0, vPos> = FQASigDTM | ||||||
| 							end         | 							end         | ||||||
| 							 | 							 | ||||||
| 							Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIG_PROFILE$, WOMatSigProf) | 							If WOMatSigProf NE WOMatSigProfOrig then | ||||||
| 							Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIGNATURE$, WOMatSig) | 								Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIG_PROFILE$, WOMatSigProf) | ||||||
| 							Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIG_DTM$, WOMatSigDTM) | 							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 | 						end else | ||||||
| 							ErrorMsg = Error_Services('GetMessage') | 							ErrorMsg = Error_Services('GetMessage') | ||||||
| @ -2064,6 +2073,219 @@ Service GetRDSKeys(WONo) | |||||||
|      |      | ||||||
| end service | 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 | // Internal GoSubs | ||||||
| //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||||||
|  | |||||||
| @ -279,55 +279,61 @@ Event PUB_SIGN.CLICK() | |||||||
| 					ReactorType = XLATE('RDS',RDSNo,'REACTOR_TYPE','X') | 					ReactorType = XLATE('RDS',RDSNo,'REACTOR_TYPE','X') | ||||||
| 					ErrMsg = '' | 					ErrMsg = '' | ||||||
| 					If Len(ReactorType) GE 3 and ReactorType[1, 3] _EQC 'HTR' then | 					If Len(ReactorType) GE 3 and ReactorType[1, 3] _EQC 'HTR' then | ||||||
| 						WoMatKey = WONo:'*':CassNo | 					    If ( (WONo NE '') and (CassNo NE '') ) then | ||||||
| 						IsLastCassetteInWo = WO_MAT_Services('CassetteIsLastInWo', WoMatKey) |                             WoMatKey           = WONo:'*':CassNo | ||||||
| 						If Error_Services('NoError') then |                             If RowExists('WO_MAT', WOMatKey) then | ||||||
| 							If IsLastCassetteInWo then |                                 IsLastCassetteInWo = WO_MAT_Services('CassetteIsLastInWo', WoMatKey) | ||||||
| 								NextEventScheduled = False$ |                                 If Error_Services('NoError') then | ||||||
| 								NextEventHasSamePsn = True$ |                                     If IsLastCassetteInWo then | ||||||
| 								NextEventIsBlock = False$ |                                         NextEventScheduled  = False$ | ||||||
| 								 |                                         NextEventHasSamePsn = True$ | ||||||
| 								NextScheduledEvent = Schedule_Services('GetNextEvent', Reactor) |                                         NextEventIsBlock    = False$ | ||||||
| 								If Error_Services('NoError') then |                                         NextScheduledEvent = Schedule_Services('GetNextEvent', Reactor) | ||||||
| 									NextEventScheduled = True$ |                                         If Error_Services('NoError') then | ||||||
| 									 |                                             NextEventScheduled  = True$ | ||||||
| 									NextEventHasSamePsn = Schedule_Services('NextEventIsSamePsn', Reactor) |                                             NextEventHasSamePsn = Schedule_Services('NextEventIsSamePsn', Reactor) | ||||||
| 									NextEventIsBlock = Schedule_Services('NextEventIsBlock', Reactor) |                                             NextEventIsBlock    = Schedule_Services('NextEventIsBlock', Reactor) | ||||||
| 								end |                                         end | ||||||
| 								 |                                         If NextEventScheduled EQ False$ or NextEventHasSamePsn EQ False$ or NextEventIsBlock EQ True$ then | ||||||
| 								If NextEventScheduled EQ False$ or NextEventHasSamePsn EQ False$ or NextEventIsBlock EQ True$ then |                                             WoMatRecord = Database_Services('ReadDataRow', 'WO_MAT', WoMatKey) | ||||||
| 									WoMatRecord = Database_Services('ReadDataRow', 'WO_MAT', WoMatKey) |                                             If Error_Services('NoError') then | ||||||
| 									WoMatRecord<WO_MAT_LAST_CASSETTE_TEST_WAFER_ACK_REQ$> = True$ |                                                 If WOMatRecord NE '' then | ||||||
| 									 |                                                     WoMatRecord<WO_MAT_LAST_CASSETTE_TEST_WAFER_ACK_REQ$> = True$ | ||||||
| 									TestWaferRanSinceLoad = WoMatRecord<WO_MAT_LAST_CASSETTE_TEST_WAFER_RAN$> |                                                     TestWaferRanSinceLoad                                 = WoMatRecord<WO_MAT_LAST_CASSETTE_TEST_WAFER_RAN$> | ||||||
| 									 |                                                     If TestWaferRanSinceLoad NE True$ then | ||||||
| 									If TestWaferRanSinceLoad NE True$ then |                                                         TestWaferRanSinceLoad = Rds_Services('TestWaferRanAfterLoad', RDSNo) | ||||||
| 										TestWaferRanSinceLoad = Rds_Services('TestWaferRanAfterLoad', RDSNo) |                                                         WoMatRecord<WO_MAT_LAST_CASSETTE_TEST_WAFER_RAN$> = TestWaferRanSinceLoad | ||||||
| 										WoMatRecord<WO_MAT_LAST_CASSETTE_TEST_WAFER_RAN$> = TestWaferRanSinceLoad |                                                         If TestWaferRanSinceLoad NE True$ then | ||||||
| 										 |                                                             Message = '' | ||||||
| 										If TestWaferRanSinceLoad NE True$ then |                                                             If NextEventScheduled EQ False$ or NextEventIsBlock EQ True$ then | ||||||
| 											Message = '' |                                                                 Message = 'No material scheduled. Test wafer required.' | ||||||
| 											If NextEventScheduled EQ False$ or NextEventIsBlock EQ True$ then |                                                             end else if NextEventHasSamePsn EQ False$ then | ||||||
| 												Message = 'No material scheduled. Test wafer required.' |                                                                 Message = 'Next work order is a NEW PSN number. Test wafer required.' | ||||||
| 											end else if NextEventHasSamePsn EQ False$ then |                                                             end | ||||||
| 												Message = 'Next work order is a NEW PSN number. Test wafer required.' |                                                             Message_Box(@Window, Message, "Test Wafer Required", MSG_BTN_OK$ + MSG_ICON_EXCLAM$) | ||||||
| 											end |                                                             TWLogResult                                       = Dialog_Box('NDW_LOG_TEST_WAFER_USAGE', @Window, RDSNo : @VM : '' : @VM : 'REACTOR' : @VM :  Reactor) | ||||||
| 											 |                                                             WoMatRecord<WO_MAT_LAST_CASSETTE_TEST_WAFER_RAN$> = TWLogResult | ||||||
| 											Message_Box(@Window, Message, "Test Wafer Required", MSG_BTN_OK$ + MSG_ICON_EXCLAM$) |                                                             If TWLogResult NE True$ then | ||||||
| 											 |                                                                 ErrMsg = 'Unload blocked! You must run a test wafer before signing the unload' | ||||||
| 											TWLogResult = Dialog_Box('NDW_LOG_TEST_WAFER_USAGE', @Window, RDSNo : @VM : '' : @VM : 'REACTOR' : @VM :  Reactor) |                                                             end | ||||||
| 											 |                                                         end | ||||||
| 											WoMatRecord<WO_MAT_LAST_CASSETTE_TEST_WAFER_RAN$> = TWLogResult |                                                     end									         | ||||||
| 											 |                                                 end else | ||||||
| 											If TWLogResult NE True$ then |                                                     ErrMsg = 'WO_MAT record for ':WOMatKey:' is null!' | ||||||
| 												ErrMsg = 'Unload blocked! You must run a test wafer before signing the unload' |                                                 end | ||||||
| 											end |                                             end else | ||||||
| 										end |                                                 ErrMsg = Error_Services('GetMessage') | ||||||
| 									end |                                             end | ||||||
| 								end |                                         end | ||||||
| 								Database_Services('WriteDataRow', 'WO_MAT', WoMatKey, WoMatRecord, True$, False$, False$) |                                         Database_Services('WriteDataRow', 'WO_MAT', WoMatKey, WoMatRecord, True$, False$, False$) | ||||||
| 							end |                                     end | ||||||
| 						end |                                 end | ||||||
|  |                             end else | ||||||
|  |                                 ErrMsg = 'WO_MAT ':WOMatKey:' does not exist!' | ||||||
|  |                             end | ||||||
|  | 					    end else | ||||||
|  | 					        ErrMsg = 'Null WONo or null CassNo!' | ||||||
|  | 					    end | ||||||
| 					end | 					end | ||||||
| 					 | 					 | ||||||
| 					If ErrMsg NE '' then | 					If ErrMsg NE '' then | ||||||
| @ -462,7 +468,3 @@ Setup_OLE_Controls: | |||||||
|  |  | ||||||
| return | return | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | |||||||
| @ -182,27 +182,27 @@ Service ProcessProcedureQueue() | |||||||
|                 Loop |                 Loop | ||||||
|                     ReadNext RequestKeyID else EOF = True$ |                     ReadNext RequestKeyID else EOF = True$ | ||||||
|                 Until EOF |                 Until EOF | ||||||
|                     SendRequest = True$ |  | ||||||
|                     Read RequestRec from hProcQueue, RequestKeyID then |                     Read RequestRec from hProcQueue, RequestKeyID then | ||||||
|                         InQueue  = RequestRec<PROC_QUEUE.IN_QUEUE$> |                     	SendRequest = True$ | ||||||
|  |                         InQueue     = RequestRec<PROC_QUEUE.IN_QUEUE$> | ||||||
|                         If InQueue then |                         If InQueue then | ||||||
|                             QueuedDtm = RequestRec<PROC_QUEUE.QUEUED_DTM$> |                             QueuedDtm = RequestRec<PROC_QUEUE.QUEUED_DTM$> | ||||||
|                             If QueuedDtm GT SRP_Datetime('AddMinutes', Datetime(), -10) then |                             If QueuedDtm GT SRP_Datetime('AddMinutes', Datetime(), -10) then | ||||||
|                                 SendRequest = False$ |                                 SendRequest = False$ | ||||||
|                             end |                             end | ||||||
|                         end |                         end | ||||||
|                     end | 						If SendRequest then  | ||||||
|                     If SendRequest then  | 							TcpClientHandle = 0 | ||||||
|                         TcpClientHandle = 0 | 							If SRP_TcpClient(TcpClientHandle, 'CONNECT', ServerIP, ServerPort) then | ||||||
|                         If SRP_TcpClient(TcpClientHandle, 'CONNECT', ServerIP, ServerPort) then | 								RequestRec<PROC_QUEUE.IN_QUEUE$>   = True$ | ||||||
|                             RequestRec<PROC_QUEUE.IN_QUEUE$>   = True$ | 								RequestRec<PROC_QUEUE.QUEUED_DTM$> = Datetime() | ||||||
|                             RequestRec<PROC_QUEUE.QUEUED_DTM$> = Datetime() | 								Write RequestRec on hProcQueue, RequestKeyID then  | ||||||
|                             Write RequestRec on hProcQueue, RequestKeyID then  | 									Command                            = 'RUN SERVICE_SERVICES "ProcessRequest", ':Quote(RequestKeyID) | ||||||
|                                 Command                            = 'RUN SERVICE_SERVICES "ProcessRequest", ':Quote(RequestKeyID) | 									SRP_TcpClient(TcpClientHandle, 'SEND_SES', Command) | ||||||
|                                 SRP_TcpClient(TcpClientHandle, 'SEND_SES', Command) | 								end | ||||||
|                             end | 								SRP_TcpClient(TcpClientHandle, 'CLOSE_SES') | ||||||
|                             SRP_TcpClient(TcpClientHandle, 'CLOSE_SES') | 							end | ||||||
|                         end | 						end                         | ||||||
|                     end |                     end | ||||||
|                 Repeat |                 Repeat | ||||||
| 		    end | 		    end | ||||||
| @ -279,20 +279,21 @@ Service ProcessRequest(RequestKeyID) | |||||||
| 						Database_Services('WriteDataRow', 'PROC_QUEUE2', RequestKeyId, RequestRow, True$, False$, False$) | 						Database_Services('WriteDataRow', 'PROC_QUEUE2', RequestKeyId, RequestRow, True$, False$, False$) | ||||||
| 					end else | 					end else | ||||||
| 						// Notify OI_SYSADMIN group | 						// Notify OI_SYSADMIN group | ||||||
| 						Recipients                           = '' | 						Recipients                               = '' | ||||||
| 						SentFrom                             = 'SYSTEM' | 						SentFrom                                 = 'SYSTEM' | ||||||
| 						Subject                              = 'Background Procedure Queue Error' | 						Subject                                  = 'Background Procedure Queue Error' | ||||||
| 						Message                              = OConv(Datetime(), 'DT2/^H') | 						Message                                  = OConv(Datetime(), 'DT2/^H') | ||||||
| 						Message<2>                           = 'Error on server ':Server | 						Message<2>                               = 'Error on server ':Server | ||||||
| 						Message<3>                           = 'Stored Procedure: ':Procedure | 						Message<3>                               = 'Stored Procedure: ':Procedure | ||||||
| 						StatCodes                            = 'Parameters: ':Params | 						Message<4>                               = 'Error_Services error message: ':ErrorMessage | ||||||
| 						Message<4>                           = 'Error_Services error message: ':ErrorMessage | 						Message<5>                               = 'Get_Status error code: ':ErrCode | ||||||
| 						Message<5>                           = 'Get_Status error code: ':ErrCode | 						Message<6>                               = 'Record Dump:' | ||||||
|  | 						Message<7>                               = RequestRow | ||||||
| 						Swap @FM with \0D0A\ in Message | 						Swap @FM with \0D0A\ in Message | ||||||
| 						AttachWindow                         = '' | 						AttachWindow                             = '' | ||||||
| 						AttachKey                            = '' | 						AttachKey                                = '' | ||||||
| 						SendToGroup                          = 'OI_SYSADMIN' | 						SendToGroup                              = 'OI_SYSADMIN' | ||||||
| 						Parms                                = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup | 						Parms                                    = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup | ||||||
| 						obj_Notes('Create',Parms) | 						obj_Notes('Create',Parms) | ||||||
| 						// Move request to PROC_QUEUE_FAILED | 						// Move request to PROC_QUEUE_FAILED | ||||||
| 						RequestRow<PROC_QUEUE.NUM_ATTEMPTS$>     = NumAttempts | 						RequestRow<PROC_QUEUE.NUM_ATTEMPTS$>     = NumAttempts | ||||||
| @ -346,17 +347,25 @@ Service PostProcedure(ProcedureName, Params) | |||||||
|      |      | ||||||
|     ErrorMsg = '' |     ErrorMsg = '' | ||||||
|     If (ProcedureName NE '') then |     If (ProcedureName NE '') then | ||||||
| 		RequestKeyID                      = RTI_CreateGUID() |     	ProcedureName = UCase(ProcedureName) | ||||||
| 		RequestRow                        = '' | 		LSL2Key       = '$':ProcedureName:'*LSL2' | ||||||
| 		RequestRow<PROC_QUEUE.PROC_NAME$> = ProcedureName | 		FrameworksKey = '$':ProcedureName:'*FRAMEWORKS' | ||||||
| 		RequestRow<PROC_QUEUE.PARAMS$>    = Params | 		SysprogKey    = '$':ProcedureName | ||||||
| 		RequestRow<PROC_QUEUE.ENTRY_DTM$> = Datetime() | 		If ( RowExists('SYSOBJ', LSL2Key) or RowExists('SYSOBJ', FrameworksKey) or RowExists('SYSOBJ', SysprogKey) ) then    	 | ||||||
| 		RequestRow<PROC_QUEUE.IN_QUEUE$>  = False$ | 			RequestKeyID                      = RTI_CreateGUID() | ||||||
| 		Database_Services('WriteDataRow', 'PROC_QUEUE2', RequestKeyID, RequestRow, True$, False$, False$) | 			RequestRow                        = '' | ||||||
| 		If Error_Services('NoError') then | 			RequestRow<PROC_QUEUE.PROC_NAME$> = ProcedureName | ||||||
| 		    Response = RequestKeyId | 			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 | 		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 | ||||||
|     end else |     end else | ||||||
|         ErrorMsg = 'Error in ':Service:' service. Null ProcedureName passed in.' |         ErrorMsg = 'Error in ':Service:' service. Null ProcedureName passed in.' | ||||||
|  | |||||||
| @ -164,7 +164,7 @@ WRITE_RECORD: | |||||||
| 		MetrologyID = Field(Name, '*', 1) | 		MetrologyID = Field(Name, '*', 1) | ||||||
| 		RDSNo = Xlate('RDS_TEST', MetrologyID, RDS_TEST_RDS_NO$, 'X') | 		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 | 	end | ||||||
| return | return | ||||||
|  |  | ||||||
|  | |||||||
| @ -53,9 +53,8 @@ $Insert MSG_EQUATES | |||||||
| $Insert DICT_EQUATES | $Insert DICT_EQUATES | ||||||
| $Insert WM_IN_EQUATES | $Insert WM_IN_EQUATES | ||||||
|  |  | ||||||
| Declare function   Database_Services | Declare function   PSN_Services, SRP_Rotate_Array, Datetime, Database_Services, Environment_Services, Logging_Services | ||||||
| Declare function   PSN_Services, SRP_Rotate_Array, Datetime | Declare subroutine Database_Services, Set_Status, obj_Wo_Mat_Log, Logging_Services, Extract_Si_Keys | ||||||
| Declare subroutine Database_Services, Set_Status, OBJ_WO_MAT_LOG |  | ||||||
|  |  | ||||||
| GoToService | GoToService | ||||||
|  |  | ||||||
| @ -121,7 +120,9 @@ Service AddComment(WMInNo, Comment) | |||||||
| 	 | 	 | ||||||
| End Service | End Service | ||||||
|  |  | ||||||
|  |  | ||||||
| Service SetVoidFlag(WMInKey, Username) | Service SetVoidFlag(WMInKey, Username) | ||||||
|  |      | ||||||
| 	ErrorMessage = '' | 	ErrorMessage = '' | ||||||
| 	If RowExists('WM_IN', WMInKey) then | 	If RowExists('WM_IN', WMInKey) then | ||||||
| 			WMInRec = Database_Services('ReadDataRow', 'WM_IN', WMInKey, True$, 0, False$) | 			WMInRec = Database_Services('ReadDataRow', 'WM_IN', WMInKey, True$, 0, False$) | ||||||
| @ -160,7 +161,210 @@ Service SetVoidFlag(WMInKey, Username) | |||||||
| 	If ErrorMessage NE '' then | 	If ErrorMessage NE '' then | ||||||
| 		Error_Services('Add', ErrorMessage) | 		Error_Services('Add', ErrorMessage) | ||||||
| 	end | 	end | ||||||
|  | 	 | ||||||
| end service | 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 | ||||||
|  |  | ||||||
|  | |||||||
| @ -59,8 +59,10 @@ $Insert COMPANY_EQUATES | |||||||
| $Insert RETURN_TO_FAB_LOTS_EQUATES | $Insert RETURN_TO_FAB_LOTS_EQUATES | ||||||
|  |  | ||||||
| Declare function   Database_Services, SRP_JSON, Error_Services, Clean_Insp_Services, WO_Mat_QA_Services | 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 Database_Services, SRP_JSON, Error_Services, Extract_Si_Keys, Set_Status, obj_wo_mat_log | ||||||
|  | Declare subroutine Logging_Services | ||||||
|  |  | ||||||
| GoToService | GoToService | ||||||
|  |  | ||||||
| @ -436,8 +438,210 @@ Service SetVoidFlag(WMOutKey, Username) | |||||||
| 	If ErrorMessage NE '' then | 	If ErrorMessage NE '' then | ||||||
| 		Error_Services('Add', ErrorMessage) | 		Error_Services('Add', ErrorMessage) | ||||||
| 	end | 	end | ||||||
|  | 	 | ||||||
| end service | 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 | ||||||
|  |  | ||||||
|  | |||||||
| @ -50,6 +50,8 @@ $Insert VOIDED_LOT_EQUATES | |||||||
| $Insert IFX_EQUATES | $Insert IFX_EQUATES | ||||||
| $Insert CUST_EPI_PART_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  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  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 | 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    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    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    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' | LogPath       = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_LOG' | ||||||
| LogDate       = Oconv(Date(), 'D4/') | LogDate       = Oconv(Date(), 'D4/') | ||||||
| @ -646,7 +648,6 @@ Service ReceiveCassette(WONo, ReceiveUser, LotNo, CassQty, SubPartNo, SubVendorC | |||||||
|                 WOMatKeys    = SRP_Array('SortRows', WOMatKeys, 'AR2', 'LIST', @VM, '*') |                 WOMatKeys    = SRP_Array('SortRows', WOMatKeys, 'AR2', 'LIST', @VM, '*') | ||||||
|                  |                  | ||||||
|                 If WOMatKeys NE '' then |                 If WOMatKeys NE '' then | ||||||
|                     WOMatKeys  = SRP_Array('SortRows', WOMatKeys, 'AR2', 'LIST', @VM, '*') |  | ||||||
|                     LastCassNo = WOMatKeys[-1, 'B*'] |                     LastCassNo = WOMatKeys[-1, 'B*'] | ||||||
|                 end else |                 end else | ||||||
|                     LastCassNo = 0 |                     LastCassNo = 0 | ||||||
| @ -1892,20 +1893,22 @@ Service UpdateOpenWorkOrderStatuses() | |||||||
|         end else |         end else | ||||||
|             MonaResource = 'GRP_OPENINSIGHT_MES_OP_FE_DEV_SERVICE_MANAGER' |             MonaResource = 'GRP_OPENINSIGHT_MES_OP_FE_DEV_SERVICE_MANAGER' | ||||||
|         end	     |         end	     | ||||||
|  | 	    MonaStatus = 'ok' | ||||||
| 	     | 	     | ||||||
|         Server       = Environment_Services('GetServer') |         LogPath               = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_LOG' | ||||||
|         LogPath      = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_LOG' |         LogDate               = Oconv(Date(), 'D4/') | ||||||
|         LogDate      = Oconv(Date(), 'D4/') |         LogTime               = Oconv(Time(), 'MTS') | ||||||
|         LogTime      = Oconv(Time(), 'MTS') |         LogFileName           = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Update Work Order Status Log.csv' | ||||||
|         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' | ||||||
|         Headers      = 'Logging DTM' : @FM : 'Work Order No' : @FM : 'Log' |         objVerifyWOMatKeysLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$) | ||||||
|         objStatusLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$,',', Headers, '', False$, False$)     |         LoggingDTM            = LogDate : ' ' : LogTime   ; // Logging DTM     | ||||||
|  |         Server                = Environment_Services('GetServer') | ||||||
|          |          | ||||||
|         LogData     = '' |         LogData    = '' | ||||||
|         LogData<1>  = OConv(Datetime(), 'DT/^S') |         LogData<1> = LoggingDtm | ||||||
|         LogData<2>  = Server |         LogData<2> = Server | ||||||
|         LogData<3>  = 'Begin ':Service |         LogData<4> = 'Begin ':Service | ||||||
|         Logging_Services('AppendLog', objStatusLog, LogData, @RM, @FM)					     |         Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)   			     | ||||||
|          |          | ||||||
|         ErrorMsg      = '' |         ErrorMsg      = '' | ||||||
|         OpenWoLogKeys = '' |         OpenWoLogKeys = '' | ||||||
| @ -1913,46 +1916,49 @@ Service UpdateOpenWorkOrderStatuses() | |||||||
|         Extract_Si_Keys('WO_LOG', 'CLOSE_DATE', '', OpenWoLogKeys) |         Extract_Si_Keys('WO_LOG', 'CLOSE_DATE', '', OpenWoLogKeys) | ||||||
|         If Not(Get_Status(ErrCode)) then  |         If Not(Get_Status(ErrCode)) then  | ||||||
|             If OpenWoLogKeys NE '' then |             If OpenWoLogKeys NE '' then | ||||||
|                 For each OpenWoLogKey in OpenWoLogKeys using @VM |             	OpenWoLogKeys     = SRP_Array('SortSimpleList', OpenWoLogKeys, 'AscendingNumbers', @VM) | ||||||
|                     Service_Services('PostProcedure', 'WORK_ORDER_SERVICES', 'UpdateWorkOrderStatus':SD$:OpenWoLogKey) |             	LastOpenWoUpdated = '' | ||||||
|                     If Error_Services('NoError') then |             	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<1> = OConv(Datetime(), 'DT/^S') | ||||||
|                         LogData<2> = Server |                         ErrorMsg   = 'Error calling UpdateWorkOrderStatus for WO_LOG ':NextOpenWoLogKey:'. ':Error_Services('GetMessage') | ||||||
|                         LogData<3> = 'Successfully posted UpdateWorkOrderStatus procedure to PROC_QUEUE for WO_LOG ':OpenWOLogKey:'.' |                         LogData<4> = ErrorMsg | ||||||
|                         Logging_Services('AppendLog', objStatusLog, LogData, @RM, @FM)                            |                         Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM) | ||||||
|                     end else |                         MonaStatus = 'critical'                         | ||||||
|                         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                     |                     end                     | ||||||
|                 Next OpenWoLogKey |             	end | ||||||
|             end else |             end else | ||||||
|                 LogData<1> = OConv(Datetime(), 'DT/^S') |                 LogData<1> = OConv(Datetime(), 'DT/^S') | ||||||
|                 LogData<2> = Server |                 LogData<4> = 'No open work orders to update.' | ||||||
|                 LogData<3> = 'No open work orders to update.' |                 Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)	 | ||||||
|                 Logging_Services('AppendLog', objStatusLog, LogData, @RM, @FM)	 |  | ||||||
|             end |             end | ||||||
|         end else |         end else | ||||||
|  |             MonaStatus = 'critical' | ||||||
|             ErrorMsg   = 'Error calling Extract_Si_Keys. Error code: ':ErrCode:'.' |             ErrorMsg   = 'Error calling Extract_Si_Keys. Error code: ':ErrCode:'.' | ||||||
|             LogData<1> = OConv(Datetime(), 'DT/^S') |             LogData<1> = OConv(Datetime(), 'DT/^S') | ||||||
|             LogData<2> = Server |             LogData<4> = ErrorMsg | ||||||
|             LogData<3> = ErrorMsg |             Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)         | ||||||
|             Logging_Services('AppendLog', objStatusLog, LogData, @RM, @FM)         |  | ||||||
|         end |         end | ||||||
|          |          | ||||||
|         LogData     = '' |         LogData<1> = OConv(Datetime(), 'DT/^S') | ||||||
|         LogData<1>  = OConv(Datetime(), 'DT/^S') |         LogData<4> = 'End ':Service | ||||||
|         LogData<2>  = Server |         Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM) | ||||||
|         LogData<3>  = 'End ':Service |  | ||||||
|         Logging_Services('AppendLog', objStatusLog, LogData, @RM, @FM) |  | ||||||
|          |  | ||||||
|         If ErrorMsg EQ '' then |  | ||||||
|             MonaStatus = 'ok' |  | ||||||
|         end else |  | ||||||
|             MonaStatus = 'critical' |  | ||||||
|         end |  | ||||||
|          |          | ||||||
|         Mona_Services('PostStatus', MonaResource, StatusName, MonaStatus) |         Mona_Services('PostStatus', MonaResource, StatusName, MonaStatus) | ||||||
|          |          | ||||||
| @ -2062,6 +2068,252 @@ Service UpdateWorkOrderStatus(WOLogId) | |||||||
|      |      | ||||||
| end service | 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 | // Internal GoSubs | ||||||
| //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||||||
| @ -2074,4 +2326,3 @@ ClearCursors: | |||||||
|      |      | ||||||
| return | return | ||||||
|  |  | ||||||
|  |  | ||||||
|  | |||||||
| @ -285,16 +285,15 @@ WRITE_RECORD_PRE: | |||||||
|     		end else |     		end else | ||||||
|     			CriticalFieldName = 'Error determining field name' |     			CriticalFieldName = 'Error determining field name' | ||||||
|     		end |     		end | ||||||
|     		Record<CriticalField> = OrigRecord<CriticalField> |  | ||||||
|     		 |     		 | ||||||
| 			Recipients   = '' | 			Recipients   = '' | ||||||
| 			SentFrom     = 'SYSTEM' | 			SentFrom     = 'SYSTEM' | ||||||
| 			Subject      = 'WO_MAT_ACTIONS - Critical Field Erase Attempt' | 			Subject      = 'WO_MAT_ACTIONS - Critical Field Erased' | ||||||
| 			Message      = OConv(Datetime(), 'DT2/^H') | 			Message      = OConv(Datetime(), 'DT2/^H') | ||||||
| 			Message<2>   = 'Computer: ':@Station | 			Message<2>   = 'Computer: ':@Station | ||||||
| 			Message<3>   = 'User: ':@User4 | 			Message<3>   = 'User: ':@User4 | ||||||
| 			Message<4>   = 'WO_MAT key: ':Name | 			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<5>   = NoteMessage | ||||||
| 			Message<6>   = 'Call Stack:':CRLF$:RetStack() | 			Message<6>   = 'Call Stack:':CRLF$:RetStack() | ||||||
| 			Swap @FM with \0D0A\ in Message | 			Swap @FM with \0D0A\ in Message | ||||||
|  | |||||||
| @ -1,4 +1,50 @@ | |||||||
| Compile function WO_MAT_Services(@Service, @Params) | 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 | #pragma precomp SRP_PreCompiler | ||||||
|  |  | ||||||
| $insert LOGICAL | $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 function   Datetime, Rds_Services, GetTickCount, SRP_Array | ||||||
| Declare subroutine Error_Services, SRP_Json, SRP_Com, Wo_Mat_Services, Database_Services, Logging_Services | 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 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' | LogPath     = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_Mat\InvActionsSyncUp' | ||||||
| LogDate     = Oconv(Date(), 'D4/') | LogDate     = Oconv(Date(), 'D4/') | ||||||
| @ -584,3 +631,67 @@ Service GetWOMatKeys(WONo) | |||||||
|     If ErrorMsg NE '' then Error_Services('Add', ErrorMsg) |     If ErrorMsg NE '' then Error_Services('Add', ErrorMsg) | ||||||
|      |      | ||||||
| end service | 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 | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	