Merged PR 21598: Refactored receive and release codebase.
Refactored receive and release codebase. bug fixes and performance improvements modified WO_REC form to use the same receive and same release dtm for all cassettes released in a given batch Related work items: #259878
This commit is contained in:
@ -527,7 +527,7 @@ end service
|
||||
// Reads a data column for the indicated Key ID and database table.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service ReadDataColumn(TableName, KeyID, ColumnNo, NotExpired, ExpirationDuration, IgnoreMFSRoutines)
|
||||
|
||||
|
||||
If NotExpired NE False$ then NotExpired = True$
|
||||
If (ExpirationDuration EQ '') OR (Not(Num(ExpirationDuration))) then ExpirationDuration = 0
|
||||
If IgnoreMFSRoutines NE True$ then IgnoreMFSRoutines = False$
|
||||
@ -609,7 +609,6 @@ Service ReadDataRow(TableName, KeyID, NotExpired, ExpirationDuration, IgnoreMFSR
|
||||
Memory_Services('SetValue', ServiceKeyID, DataRow)
|
||||
end else
|
||||
Error_Services('Add', 'Error reading ' : KeyID : ' from the ' : TableName : ' table in the ' : Service : ' service. Error = ' : @File_Error<1>)
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -943,11 +942,9 @@ Service WriteDataRow(TableName, KeyID, DataRow, IgnoreSelfLock, IgnoreMFSRoutine
|
||||
Error_Services('Add', 'Error writing ' : KeyID : ' to the ' : TableName : ' table in the ' : Service : ' service. Error message: ':ErrorMsg)
|
||||
end
|
||||
end
|
||||
* If Error_Services('NoError') then
|
||||
If IgnoreAllLocks EQ False$ then
|
||||
Database_Services('ReleaseKeyIDLock', TableName, KeyID)
|
||||
end
|
||||
* end
|
||||
If IgnoreAllLocks EQ False$ then
|
||||
Database_Services('ReleaseKeyIDLock', TableName, KeyID)
|
||||
end
|
||||
end else
|
||||
Error_Services('Add', 'Unable to lock ' : KeyID : ' for the ' : TableName : ' table in the ' : Service : ' service.')
|
||||
end
|
||||
@ -958,6 +955,68 @@ Service WriteDataRow(TableName, KeyID, DataRow, IgnoreSelfLock, IgnoreMFSRoutine
|
||||
end service
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
// WriteDataColumn
|
||||
//
|
||||
// TableName. The linear hash database table name. - [REQUIRED]
|
||||
// KeyID. The KeyID to the database table. - [REQUIRED]
|
||||
// ColumnNo. Column number of the table to write. - [REQUIRED]
|
||||
//
|
||||
// Writes a value to a column for the indicated Key ID and database table.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service WriteDataColumn(TableName, KeyID, ColumnNo, Value, IgnoreSelfLock, IgnoreMFSRoutines, IgnoreAllLocks)
|
||||
|
||||
If TableName NE '' AND KeyID NE '' AND ColumnNo NE '' then
|
||||
|
||||
If ( Num(ColumnNo) and (ColumnNo GT 0) ) then
|
||||
If Unassigned(Value) then Value = ''
|
||||
If IgnoreSelfLock NE True$ then IgnoreSelfLock = False$
|
||||
If IgnoreMFSRoutines NE True$ then IgnoreMFSRoutines = False$
|
||||
If IgnoreAllLocks NE True$ then IgnoreAllLocks = False$
|
||||
If IgnoreAllLocks then
|
||||
HaveLock = True$
|
||||
end else
|
||||
HaveLock = Database_Services('GetKeyIDLock', TableName, KeyID, IgnoreSelfLock)
|
||||
end
|
||||
If HaveLock EQ True$ then
|
||||
TableHandle = Database_Services('GetTableHandle', TableName)
|
||||
If IgnoreMFSRoutines then
|
||||
MFSList = TableHandle<1, 1> ; // MFS routines are @SVM delimited.
|
||||
NumMFS = DCount(MFSList, @SVM)
|
||||
For MFSCnt = NumMFS to 1 Step -1
|
||||
MFSRoutine = MFSList<0, 0, MFSCnt>
|
||||
If (MFSRoutine NE 'SI.MFS') AND (MFSRoutine NE 'RTP57') then
|
||||
MFSList = Delete(MFSList, 0, 0, MFSCnt)
|
||||
end
|
||||
Next MFSCnt
|
||||
TableHandle<1, 1> = MFSList
|
||||
end
|
||||
|
||||
If Error_Services('NoError') then
|
||||
WriteV Value on TableHandle, KeyID, ColumnNo then
|
||||
Memory_Services('SetValue', ServiceModule : '*' : 'ReadDataColumn' : '*' : TableName : '*' : KeyID : '*' : ColumnNo, Value)
|
||||
end else
|
||||
ErrorMsg = 'Error writing value ' : Quote(Value) ' to column number ' : ColumnNo : ' to key ' : KeyID |
|
||||
: ' of table ' : TableName : ' in the ' : Service : ' service.'
|
||||
Error_Services('Add', ErrorMsg)
|
||||
end
|
||||
end
|
||||
If IgnoreAllLocks EQ False$ then
|
||||
Database_Services('ReleaseKeyIDLock', TableName, KeyID)
|
||||
end
|
||||
end else
|
||||
Error_Services('Add', 'Unable to lock ' : KeyID : ' for the ' : TableName : ' table in the ' : Service : ' service.')
|
||||
end
|
||||
end else
|
||||
Error_Services('Add', 'ColumnNo was not a number or was not greater than zero in the ' :Service : ' service.')
|
||||
end
|
||||
end else
|
||||
Error_Services('Add', 'TableName, KeyID, or ColumnNo argument was missing in the ' : Service : ' service.')
|
||||
end
|
||||
|
||||
end service
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
// UnlockKeyID
|
||||
//
|
||||
@ -1043,5 +1102,3 @@ end service
|
||||
// Internal GoSubs
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user