Merged PR 28607: Archive Services Initial Pull
This is the initial pull for Archiving data.
This commit is contained in:
parent
cbb52c469b
commit
05e0fb3eda
240
LSL2/STPROC/ARCHIVE_ACTIONS.txt
Normal file
240
LSL2/STPROC/ARCHIVE_ACTIONS.txt
Normal file
@ -0,0 +1,240 @@
|
||||
Function ARCHIVE_Actions(Action, CalcColName, FSList, Handle, Name, FMC, Record, Status, OrigRecord, Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10)
|
||||
/***********************************************************************************************************************
|
||||
|
||||
This program is proprietary and is not to be used by or disclosed to others, nor is it to be copied without written
|
||||
permission from Infineon.
|
||||
|
||||
Name : RDS_Actions
|
||||
|
||||
Description : Handles calculated columns and MFS calls for the current table.
|
||||
|
||||
Notes : This function uses @ID, @RECORD, and @DICT to make sure {ColumnName} references work correctly.
|
||||
If called from outside of a calculated column these will need to be set and restored.
|
||||
|
||||
Parameters :
|
||||
Action [in] -- Name of the action to be taken
|
||||
CalcColName [in] -- Name of the calculated column that needs to be processed. Normally this should only be
|
||||
populated when the CalcField action is being used.
|
||||
FSList [in] -- The list of MFSs and the BFS name for the current file or volume. This is an @SVM
|
||||
delimited array, with the current MFS name as the first value in the array, and the BFS
|
||||
name as the last value. Normally set by a calling MFS.
|
||||
Handle [in] -- The file handle of the file or media map being accessed. Note, this does contain the
|
||||
entire handle structure that the Basic+ Open statement would provide. Normally set by a
|
||||
calling MFS.
|
||||
Name [in] -- The name (key) of the record or file being accessed. Normally set by a calling MFS.
|
||||
FMC [in] -- Various functions. Normally set by a calling MFS.
|
||||
Record [in] -- The entire record (for record-oriented functions) or a newly-created handle (for
|
||||
"get handle" functions). Normally set by a calling MFS.
|
||||
Status [in/out] -- Indicator of the success or failure of an action. Normally set by the calling MFS but
|
||||
for some actions can be set by the action handler to indicate failure.
|
||||
OrigRecord [in] -- Original content of the record being processed by the current action. This is
|
||||
automatically being assigned by the WRITE_RECORD and DELETE_RECORD actions within
|
||||
BASE_MFS.
|
||||
Param1-10 [in/out] -- Additional request parameter holders
|
||||
ActionFlow [out] -- Used to control the action chain (see the ACTION_SETUP insert for more information.)
|
||||
Can also be used to return a special value, such as the results of the CalcField
|
||||
method.
|
||||
|
||||
History : (Date, Initials, Notes)
|
||||
04/10/18 dmb Original programmer.
|
||||
10/04/18 djs Added a trigger within the WRITE_RECORD event, which fires when the reactor number has
|
||||
changed. When this occurs the related RDS_LAYER records for this RDS record are populated
|
||||
with the most recent associated TOOL_PARMS record. (related by PSN and Reactor)
|
||||
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#pragma precomp SRP_PreCompiler
|
||||
|
||||
$Insert FILE.SYSTEM.EQUATES
|
||||
$Insert ACTION_SETUP
|
||||
$Insert RLIST_EQUATES
|
||||
$Insert APP_INSERTS
|
||||
$Insert IFX_EQUATES
|
||||
$Insert ARCHIVE_EQUATES
|
||||
|
||||
Equ COMMA$ to ','
|
||||
|
||||
Declare function Error_Services, Database_Services, obj_RDS_Test, Logging_Services, Environment_Services
|
||||
Declare function Tool_Parms_Services, Signature_Services, obj_WO_Mat_QA, Datetime, Override_Services
|
||||
Declare function Rds_Services, SRP_DateTime, SRP_Math, obj_WO_Mat, Lot_Services, SRP_Array
|
||||
Declare function Lot_Event_Services, GetTickCount, Work_Order_Services, Archive_Services
|
||||
Declare subroutine Error_Services, Database_Services, Logging_Services, Service_Services, obj_WO_React
|
||||
Declare Subroutine Mona_Services
|
||||
|
||||
If KeyID then GoSub Initialize_System_Variables
|
||||
|
||||
Begin Case
|
||||
|
||||
Case Action _EQC 'CalculateColumn' ; GoSub CalculateColumn
|
||||
Case Action _EQC 'READ_RECORD_PRE' ; GoSub READ_RECORD_PRE
|
||||
Case Action _EQC 'READ_RECORD' ; GoSub READ_RECORD
|
||||
Case Action _EQC 'READONLY_RECORD_PRE' ; GoSub READONLY_RECORD_PRE
|
||||
Case Action _EQC 'READONLY_RECORD' ; GoSub READONLY_RECORD
|
||||
Case Action _EQC 'WRITE_RECORD_PRE' ; GoSub WRITE_RECORD_PRE
|
||||
Case Action _EQC 'WRITE_RECORD' ; GoSub WRITE_RECORD
|
||||
Case Action _EQC 'DELETE_RECORD_PRE' ; GoSub DELETE_RECORD_PRE
|
||||
Case Action _EQC 'DELETE_RECORD' ; GoSub DELETE_RECORD
|
||||
Case Otherwise$ ; Status = 'Invalid Action'
|
||||
|
||||
End Case
|
||||
|
||||
If KeyID then GoSub Restore_System_Variables
|
||||
|
||||
If Assigned(ActionFlow) else ActionFlow = ACTION_CONTINUE$
|
||||
|
||||
Return ActionFlow
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Calculated Columns
|
||||
//
|
||||
// The typical structure of a calculated column will look like this:
|
||||
//
|
||||
// Declare function Database_Services
|
||||
//
|
||||
// @ANS = Database_Services('CalculateColumn')
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CalculateColumn:
|
||||
|
||||
// Make sure the ActionFlow return variable is cleared in case nothing is calculated.
|
||||
ActionFlow = ''
|
||||
|
||||
return
|
||||
|
||||
// ----- MFS calls -----------------------------------------------------------------------------------------------------
|
||||
|
||||
READ_RECORD_PRE:
|
||||
// In order to stop a record from being read in this action these lines of code must be used:
|
||||
//
|
||||
// OrigFileError = 100 : @FM : KeyID
|
||||
// Status = 0
|
||||
// Record = ''
|
||||
// ActionFlow = ACTION_STOP$
|
||||
|
||||
* This code prevents an anomaly where an @SVM appears when the value is read
|
||||
* and causes an error when copying the record to SQL.
|
||||
|
||||
return
|
||||
|
||||
READ_RECORD:
|
||||
|
||||
// In order to stop a record from being read in this action these lines of code must be used:
|
||||
//
|
||||
// OrigFileError = 100 : @FM : KeyID
|
||||
// Status = 0
|
||||
// Record = ''
|
||||
|
||||
return
|
||||
|
||||
|
||||
READONLY_RECORD_PRE:
|
||||
// In order to stop a record from being read in this action these lines of code must be used:
|
||||
//
|
||||
// OrigFileError = 100 : @FM : KeyID
|
||||
// Status = 0
|
||||
// Record = ''
|
||||
// ActionFlow = ACTION_STOP$
|
||||
return
|
||||
|
||||
|
||||
READONLY_RECORD:
|
||||
// In order to stop a record from being read in this action these lines of code must be used:
|
||||
//
|
||||
// OrigFileError = 100 : @FM : KeyID
|
||||
// Status = 0
|
||||
// Record = ''
|
||||
|
||||
return
|
||||
|
||||
WRITE_RECORD_PRE:
|
||||
|
||||
|
||||
return
|
||||
|
||||
|
||||
WRITE_RECORD:
|
||||
|
||||
return
|
||||
|
||||
|
||||
DELETE_RECORD_PRE:
|
||||
|
||||
ActionFlow = ACTION_STOP$
|
||||
|
||||
return
|
||||
|
||||
|
||||
DELETE_RECORD:
|
||||
|
||||
ActionFlow = ACTION_STOP$
|
||||
|
||||
return
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Internal GoSubs
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ClearCursors:
|
||||
For counter = 0 to 8
|
||||
ClearSelect counter
|
||||
Next counter
|
||||
return
|
||||
|
||||
|
||||
Initialize_System_Variables:
|
||||
|
||||
// Save these for restoration later
|
||||
SaveDict = @DICT
|
||||
SaveID = @ID
|
||||
SaveRecord = @RECORD
|
||||
OrigFileError = @FILE.ERROR
|
||||
|
||||
// Now make sure @DICT, ID, and @RECORD are populated
|
||||
CurrentDictName = ''
|
||||
If @DICT then
|
||||
DictHandle = @DICT<1, 2>
|
||||
Locate DictHandle in @TABLES(5) Using @FM Setting fPos then
|
||||
CurrentDictName = Field(@TABLES(0), @FM, fPos, 1)
|
||||
end
|
||||
end
|
||||
|
||||
If CurrentDictName NE DictName then
|
||||
Open DictName to @DICT else Status = 'Unable to initialize @DICT'
|
||||
end
|
||||
|
||||
@ID = KeyID
|
||||
If Record else
|
||||
// Record might not have been passed in. Read the record from the database table just to make sure.
|
||||
@FILE.ERROR = ''
|
||||
Open TableName to hTable then
|
||||
FullFSList = hTable[1, 'F' : @VM]
|
||||
BFS = FullFSList[-1, 'B' : @SVM]
|
||||
LastHandle = hTable[-1, 'B' : \0D\]
|
||||
FileHandle = \0D\ : LastHandle[1, @VM]
|
||||
|
||||
Call @BFS(READO.RECORD, BFS, FileHandle, KeyID, FMC, Record, ReadOStatus)
|
||||
end
|
||||
end
|
||||
@RECORD = Record
|
||||
|
||||
return
|
||||
|
||||
|
||||
Restore_System_Variables:
|
||||
|
||||
Transfer SaveDict to @DICT
|
||||
Transfer SaveID to @ID
|
||||
Transfer SaveRecord to @RECORD
|
||||
@FILE.ERROR = OrigFileError
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
238
LSL2/STPROC/ARCHIVE_API.txt
Normal file
238
LSL2/STPROC/ARCHIVE_API.txt
Normal file
@ -0,0 +1,238 @@
|
||||
Function Archive_API(@API)
|
||||
/***********************************************************************************************************************
|
||||
|
||||
This program is proprietary and is not to be used by or disclosed to others, nor is it to be copied without written
|
||||
permission from SRP Computer Solutions, Inc.
|
||||
|
||||
Name : Archive_API
|
||||
|
||||
Description : API logic for the Archive resource.
|
||||
|
||||
Notes : All web APIs should include the API_SETUP insert. This will provide several useful variables:
|
||||
|
||||
HTTPMethod - The HTTP Method (Verb) submitted by the client (e.g., GET, POST, etc.)
|
||||
APIURL - The URL for the API entry point (e.g., api.mysite.com/v1).
|
||||
FullEndpointURL - The URL submitted by the client, including query params.
|
||||
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
||||
EndpointSegment - The URL endpoint segment.
|
||||
ParentURL - The URL path preceeding the current endpoint.
|
||||
CurrentAPI - The name of this stored procedure.
|
||||
|
||||
Parameters :
|
||||
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
||||
- APIPattern must follow this structure Archive[.ID.[<Property>]]
|
||||
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
||||
Examples:
|
||||
- Archive.POST
|
||||
- Archive.ID.PUT
|
||||
- Archive.ID.firstName.GET
|
||||
Response [out] -- Response to be sent back to the Controller (HTTP_MCP) or requesting procedure. Web API
|
||||
services do not rely upon anything being returned in the response. This is what the
|
||||
various services like SetResponseBody and SetResponseStatus services are for. A response
|
||||
value is only helpful if the developers want to use it for debug purposes.
|
||||
|
||||
History : (Date, Initials, Notes)
|
||||
10/10/25 xxx Original programmer.
|
||||
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#pragma precomp SRP_PreCompiler
|
||||
|
||||
$insert APP_INSERTS
|
||||
$insert API_SETUP
|
||||
$insert HTTP_INSERTS
|
||||
$insert SRPJSONX
|
||||
|
||||
Declare Function OI_WIZARD_SERVICES, ARCHIVE_SERVICES, Date_Services
|
||||
|
||||
GoToAPI else
|
||||
// The specific resource endpoint doesn't have a API handler yet.
|
||||
HTTP_Services('SetResponseStatus', 204, 'This is a valid endpoint but a web API handler has not yet been created.')
|
||||
end
|
||||
|
||||
Return Response OR ''
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Endpoint Handlers
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
API archive.HEAD
|
||||
API archive.GET
|
||||
|
||||
OIWizardID = ''
|
||||
Cookies = HTTP_Services('GetHTTPCookie')
|
||||
For each Cookie in Cookies using ';'
|
||||
Key = Field(Cookie, '=', 1)
|
||||
If Key EQ 'sessionID' then
|
||||
OIWizardID = Field(Cookie, '=', 2)
|
||||
end
|
||||
Next Cookie
|
||||
|
||||
ValidSession = OI_Wizard_Services('ValidateSession', OIWizardID)
|
||||
|
||||
If ValidSession then
|
||||
ArchiveIds = Archive_Services('GetAllArchiveIDs')
|
||||
ArchiveListJson = ''
|
||||
GoSub GenerateArchiveListJson
|
||||
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||
HTTP_Services('SetResponseBody', ArchiveListJson, False$, 'application/hal+json')
|
||||
If Assigned(Message) then
|
||||
HTTP_Services('SetResponseStatus', 201, Message)
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', 201)
|
||||
end
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', 401, 'Invalid session. Reauthentication required.')
|
||||
end
|
||||
|
||||
end api
|
||||
|
||||
|
||||
API archive.getarchive.HEAD
|
||||
API archive.getarchive.GET
|
||||
|
||||
OIWizardID = ''
|
||||
Cookies = HTTP_Services('GetHTTPCookie')
|
||||
For each Cookie in Cookies using ';'
|
||||
Key = Field(Cookie, '=', 1)
|
||||
If Key EQ 'sessionID' then
|
||||
OIWizardID = Field(Cookie, '=', 2)
|
||||
end
|
||||
Next Cookie
|
||||
|
||||
ValidSession = OI_Wizard_Services('ValidateSession', OIWizardID)
|
||||
|
||||
If ValidSession then
|
||||
ArchiveId = Http_Services('GetQueryField', 'ArchiveId')
|
||||
ArchiveJson = Archive_Services('ConvertArchiveRecordToJson', ArchiveId)
|
||||
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||
HTTP_Services('SetResponseBody', ArchiveJson, False$, 'application/hal+json')
|
||||
If Assigned(Message) then
|
||||
HTTP_Services('SetResponseStatus', 201, Message)
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', 201)
|
||||
end
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', 401, 'Invalid session. Reauthentication required.')
|
||||
end
|
||||
|
||||
|
||||
end api
|
||||
|
||||
|
||||
API archive.findarchivebyrecord.HEAD
|
||||
API archive.findarchivebyrecord.GET
|
||||
|
||||
OIWizardID = ''
|
||||
Cookies = HTTP_Services('GetHTTPCookie')
|
||||
For each Cookie in Cookies using ';'
|
||||
Key = Field(Cookie, '=', 1)
|
||||
If Key EQ 'sessionID' then
|
||||
OIWizardID = Field(Cookie, '=', 2)
|
||||
end
|
||||
Next Cookie
|
||||
|
||||
ValidSession = OI_Wizard_Services('ValidateSession', OIWizardID)
|
||||
|
||||
If ValidSession then
|
||||
|
||||
Table = Http_Services('GetQueryField', 'Table')
|
||||
RecordId = Http_Services('GetQueryField', 'RecordId')
|
||||
ArchiveIds = Archive_Services('GetArchiveIDsByRecord', RecordId, Table)
|
||||
|
||||
SRP_JsonX_Begin('JSON', '{')
|
||||
SRP_JsonX('ArchiveRecords','[')
|
||||
for each ArchiveId in ArchiveIds using @FM
|
||||
ThisArchiveJson = Archive_Services('ConvertArchiveRecordToJson', ArchiveId)
|
||||
SRP_JsonX(ThisArchiveJson)
|
||||
Next ArchiveId
|
||||
SRP_JsonX(']')
|
||||
ArchiveJson = SRP_JsonX_End('Pretty')
|
||||
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||
HTTP_Services('SetResponseBody', ArchiveJson, False$, 'application/hal+json')
|
||||
If Assigned(Message) then
|
||||
HTTP_Services('SetResponseStatus', 201, Message)
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', 201)
|
||||
end
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', 401, 'Invalid session. Reauthentication required.')
|
||||
end
|
||||
|
||||
end api
|
||||
|
||||
|
||||
API archive.findarchivebymetadata.HEAD
|
||||
API archive.findarchivebymetadata.GET
|
||||
|
||||
OIWizardID = ''
|
||||
Cookies = HTTP_Services('GetHTTPCookie')
|
||||
For each Cookie in Cookies using ';'
|
||||
Key = Field(Cookie, '=', 1)
|
||||
If Key EQ 'sessionID' then
|
||||
OIWizardID = Field(Cookie, '=', 2)
|
||||
end
|
||||
Next Cookie
|
||||
|
||||
ValidSession = OI_Wizard_Services('ValidateSession', OIWizardID)
|
||||
|
||||
If ValidSession then
|
||||
MetaDataType = Http_Services('GetQueryField', 'MetaDataType')
|
||||
SearchValues = Http_Services('GetQueryField', 'SearchValue')
|
||||
ArchiveIds = Archive_Services('GetArchiveIDsByMetaData', MetaDataType, SearchValues)
|
||||
|
||||
SRP_JsonX_Begin('JSON', '{')
|
||||
SRP_JsonX('ArchiveRecords','[')
|
||||
for each ArchiveId in ArchiveIds using @FM
|
||||
ThisArchiveJson = Archive_Services('ConvertArchiveRecordToJson', ArchiveId)
|
||||
SRP_JsonX(ThisArchiveJson)
|
||||
Next ArchiveId
|
||||
SRP_JsonX(']')
|
||||
ArchiveJson = SRP_JsonX_End('Pretty')
|
||||
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||
HTTP_Services('SetResponseBody', ArchiveJson, False$, 'application/hal+json')
|
||||
If Assigned(Message) then
|
||||
HTTP_Services('SetResponseStatus', 201, Message)
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', 201)
|
||||
end
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', 401, 'Invalid session. Reauthentication required.')
|
||||
end
|
||||
|
||||
end api
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Internal GoSubs
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
GenerateArchiveListJson:
|
||||
|
||||
If Assigned(ArchiveListJson) AND Assigned(ArchiveIds) then
|
||||
SRP_JsonX_Begin('JSON', '{')
|
||||
SRP_JsonX('Archives', '[')
|
||||
for each ArchiveId in ArchiveIds using @FM
|
||||
ArchiveType = Field(ArchiveId, '*', 1)
|
||||
ArchiveParent = Field(ArchiveId, '*', 2)
|
||||
CreationDtm = Date_Services('ConvertDateTimeToISO8601', XLATE('ARCHIVE', ArchiveId, ARCHIVE_ARCHIVE_CREATION_DTM$, 'X'))
|
||||
RecordCount = DCOUNT(XLATE('ARCHIVE', ArchiveId, ARCHIVE_CHILD_RECORD$, 'X'), @VM)
|
||||
SRP_JsonX('{')
|
||||
SRP_JsonX('ArchiveId', ArchiveId, 'String')
|
||||
SRP_JsonX('ArchiveType', ArchiveType, 'String')
|
||||
SRP_JsonX('ArchiveParent', ArchiveParent, 'String')
|
||||
SRP_JsonX('CreationDtm', CreationDtm, 'String')
|
||||
SRP_JsonX('RecordCount', RecordCount)
|
||||
SRP_JsonX('}')
|
||||
Next ArchiveId
|
||||
SRP_JsonX(']')
|
||||
ArchiveListJson = SRP_JsonX_End('Pretty')
|
||||
end
|
||||
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
105
LSL2/STPROC/DEARCHIVE_API.txt
Normal file
105
LSL2/STPROC/DEARCHIVE_API.txt
Normal file
@ -0,0 +1,105 @@
|
||||
Function Dearchive_API(@API)
|
||||
/***********************************************************************************************************************
|
||||
|
||||
This program is proprietary and is not to be used by or disclosed to others, nor is it to be copied without written
|
||||
permission from SRP Computer Solutions, Inc.
|
||||
|
||||
Name : Dearchive_API
|
||||
|
||||
Description : API logic for the Dearchive resource.
|
||||
|
||||
Notes : All web APIs should include the API_SETUP insert. This will provide several useful variables:
|
||||
|
||||
HTTPMethod - The HTTP Method (Verb) submitted by the client (e.g., GET, POST, etc.)
|
||||
APIURL - The URL for the API entry point (e.g., api.mysite.com/v1).
|
||||
FullEndpointURL - The URL submitted by the client, including query params.
|
||||
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
||||
EndpointSegment - The URL endpoint segment.
|
||||
ParentURL - The URL path preceeding the current endpoint.
|
||||
CurrentAPI - The name of this stored procedure.
|
||||
|
||||
Parameters :
|
||||
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
||||
- APIPattern must follow this structure Dearchive[.ID.[<Property>]]
|
||||
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
||||
Examples:
|
||||
- Dearchive.POST
|
||||
- Dearchive.ID.PUT
|
||||
- Dearchive.ID.firstName.GET
|
||||
Response [out] -- Response to be sent back to the Controller (HTTP_MCP) or requesting procedure. Web API
|
||||
services do not rely upon anything being returned in the response. This is what the
|
||||
various services like SetResponseBody and SetResponseStatus services are for. A response
|
||||
value is only helpful if the developers want to use it for debug purposes.
|
||||
|
||||
History : (Date, Initials, Notes)
|
||||
10/14/25 xxx Original programmer.
|
||||
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#pragma precomp SRP_PreCompiler
|
||||
|
||||
$insert APP_INSERTS
|
||||
$insert API_SETUP
|
||||
$insert HTTP_INSERTS
|
||||
$Insert IFX_EQUATES
|
||||
|
||||
Declare subroutine Service_Services
|
||||
Declare function OI_Wizard_Services
|
||||
|
||||
GoToAPI else
|
||||
// The specific resource endpoint doesn't have a API handler yet.
|
||||
HTTP_Services('SetResponseStatus', 204, 'This is a valid endpoint but a web API handler has not yet been created.')
|
||||
end
|
||||
|
||||
Return Response OR ''
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Endpoint Handlers
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
API dearchive.ID.POST
|
||||
|
||||
ErrorMsg = ''
|
||||
OIWizardID = ''
|
||||
Cookies = HTTP_Services('GetHTTPCookie')
|
||||
For each Cookie in Cookies using ';'
|
||||
Key = Field(Cookie, '=', 1)
|
||||
If Key EQ 'sessionID' then
|
||||
OIWizardID = Field(Cookie, '=', 2)
|
||||
end
|
||||
Next Cookie
|
||||
|
||||
ValidSession = OI_Wizard_Services('ValidateSession', OIWizardID)
|
||||
|
||||
If ValidSession then
|
||||
ArchiveId = EndpointSegment
|
||||
swap '__' with '*' in ArchiveId
|
||||
If RowExists('ARCHIVE', ArchiveId) then
|
||||
Service_Services('PostProcedure', 'ARCHIVE_SERVICES', 'DeArchiveDataFromTxt':SD$:ArchiveId)
|
||||
If Error_Services('NoError') then
|
||||
Message = 'Successfully queued data for de-archive.'
|
||||
end else
|
||||
ErrorMsg = 'Error queueing de-archiving.'
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Archive record not found in database.'
|
||||
end
|
||||
|
||||
If ErrorMsg NE '' then
|
||||
HTTP_Services('SetResponseStatus', 500, ErrorMsg)
|
||||
end else
|
||||
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||
If Assigned(Message) then
|
||||
HTTP_Services('SetResponseStatus', 201, Message)
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', 201)
|
||||
end
|
||||
end
|
||||
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', 500, 'Invalid session. Reauthentication required.')
|
||||
end
|
||||
|
||||
end api
|
@ -72,24 +72,24 @@ Options BOOLEAN = True$, False$
|
||||
// Therefore, this will be removed before returning to the caller.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service GetServer()
|
||||
|
||||
|
||||
NumFields = DCount(@Station, '_')
|
||||
Server = Field(@Station, '_', 1, NumFields - 1)
|
||||
|
||||
|
||||
Response = Server
|
||||
|
||||
|
||||
end service
|
||||
|
||||
|
||||
Service IsProd()
|
||||
|
||||
Machine = Environment_Services('GetServer')
|
||||
IsProd = False$
|
||||
If Machine _NEC "messa012" and Machine _NEC "mestsa01ec" and Machine _NEC "mestsa09ec" and Machine _NEC "mestsa010ec" and Machine _NEC "mestsa011ec" and Machine _NEC "mestsa012ec" and Machine _NEC "mestsa024ec" and Machine _NEC "MESTST1010" and Machine _NEC "MESTST1009" then
|
||||
IsProd = True$
|
||||
end
|
||||
Response = IsProd
|
||||
|
||||
|
||||
Machine = Environment_Services('GetServer')
|
||||
IsProd = False$
|
||||
If Machine _NEC "messa012" and Machine _NEC "mestsa01ec" and Machine _NEC "mestsa09ec" and Machine _NEC "mestsa010ec" and Machine _NEC "mestsa011ec" and Machine _NEC "mestsa012ec" and Machine _NEC "mestsa024ec" and Machine _NEC "MESTST1010" and Machine _NEC "MESTST1009" then
|
||||
IsProd = True$
|
||||
end
|
||||
Response = IsProd
|
||||
|
||||
end service
|
||||
|
||||
|
||||
@ -99,12 +99,12 @@ end service
|
||||
// Returns the application's root path. If this is a server, the shared folder will be included.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service GetApplicationRootPath()
|
||||
|
||||
|
||||
RootIP = Environment_Services('GetApplicationRootIP')
|
||||
ApplicationRootPath = RootIP : '\Apps'
|
||||
|
||||
|
||||
Response = ApplicationRootPath
|
||||
|
||||
|
||||
end service
|
||||
|
||||
|
||||
@ -114,17 +114,17 @@ end service
|
||||
// Returns the application's root IP.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service GetApplicationRootIP()
|
||||
|
||||
|
||||
Machine = Environment_Services('GetServer')
|
||||
|
||||
|
||||
Begin Case
|
||||
Case Machine EQ 'MESSA005' ; ApplicationRootIP = '\\messa005.infineon.com'
|
||||
Case Machine EQ 'MESSA005' ; ApplicationRootIP = '\\messa005.infineon.com'
|
||||
Case Machine EQ 'MESTSA01EC' ; ApplicationRootIP = '\\10.95.140.13'
|
||||
Case Machine EQ 'MESTSA09EC' ; ApplicationRootIP = '\\10.95.140.62'
|
||||
Case Machine EQ 'MESTSA010EC' ; ApplicationRootIP = '\\10.95.140.63'
|
||||
Case Machine EQ 'MESTSA011EC' ; ApplicationRootIP = '\\10.95.140.64'
|
||||
Case Machine EQ 'MESTSA012EC' ; ApplicationRootIP = '\\10.95.140.65'
|
||||
Case Machine EQ 'MESTSA024EC' ; ApplicationRootIP = '\\10.95.140.66'
|
||||
Case Machine EQ 'MESTSA09EC' ; ApplicationRootIP = '\\10.95.140.62'
|
||||
Case Machine EQ 'MESTSA010EC' ; ApplicationRootIP = '\\10.95.140.63'
|
||||
Case Machine EQ 'MESTSA011EC' ; ApplicationRootIP = '\\10.95.140.64'
|
||||
Case Machine EQ 'MESTSA012EC' ; ApplicationRootIP = '\\10.95.140.65'
|
||||
Case Machine EQ 'MESTSA024EC' ; ApplicationRootIP = '\\10.95.140.66'
|
||||
Case Machine EQ 'MESSA012' ; ApplicationRootIP = '\\10.95.176.50'
|
||||
Case Machine EQ 'MESST5201' ; ApplicationRootIP = '\\10.95.140.14'
|
||||
Case Machine EQ 'MESST5202' ; ApplicationRootIP = '\\10.95.140.14'
|
||||
@ -132,9 +132,9 @@ Service GetApplicationRootIP()
|
||||
Case Machine EQ 'MESTST1010' ; ApplicationRootIP = '\\10.95.140.13'
|
||||
Case Otherwise$ ; ApplicationRootIP = '\\10.95.140.14'
|
||||
End Case
|
||||
|
||||
|
||||
Response = ApplicationRootIP
|
||||
|
||||
|
||||
end service
|
||||
|
||||
|
||||
@ -144,10 +144,10 @@ end service
|
||||
// Returns the FTP root path. This is where the scripts and FTP transfer files will be located.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service GetFTPRootPath()
|
||||
|
||||
|
||||
Machine = Environment_Services('GetServer')
|
||||
RootPath = Environment_Services('GetLocalRootPath')
|
||||
|
||||
|
||||
Begin Case
|
||||
Case Machine EQ 'MESIRWAP001' ; FTPRootPath = RootPath
|
||||
Case Machine EQ 'MESSA005' ; FTPRootPath = RootPath : '\FTP'
|
||||
@ -156,9 +156,9 @@ Service GetFTPRootPath()
|
||||
Case Machine EQ 'MESST6502' ; FTPRootPath = RootPath : '\FTP'
|
||||
Case Otherwise$ ; FTPRootPath = RootPath : '\FTP'
|
||||
End Case
|
||||
|
||||
|
||||
Response = FTPRootPath
|
||||
|
||||
|
||||
end service
|
||||
|
||||
|
||||
@ -168,10 +168,10 @@ end service
|
||||
// Returns the Reports root path. This is where various reports will be located.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service GetReportsRootPath()
|
||||
|
||||
|
||||
RootPath = Environment_Services('GetLocalRootPath')
|
||||
Response = RootPath : '\OIReports'
|
||||
|
||||
|
||||
end service
|
||||
|
||||
|
||||
@ -181,10 +181,10 @@ end service
|
||||
// Returns the user data root path. This is where various reports will be located.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service GetUserDataRootPath()
|
||||
|
||||
|
||||
UserDataRootPath = '\\messdv002.na.infineon.com'
|
||||
Response = UserDataRootPath
|
||||
|
||||
|
||||
end service
|
||||
|
||||
|
||||
@ -194,10 +194,10 @@ end service
|
||||
// Returns the user data production path. This is where various reports will be located.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service GetUserDataProductionPath()
|
||||
|
||||
|
||||
ProductionPath = Environment_Services('GetUserDataRootPath') : '\IT'
|
||||
Response = ProductionPath
|
||||
|
||||
|
||||
end service
|
||||
|
||||
|
||||
@ -207,17 +207,17 @@ end service
|
||||
// Returns the SPC data path.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service GetSpcFilesharePath()
|
||||
|
||||
IsProd = Environment_Services("IsProd")
|
||||
|
||||
If IsProd EQ True$ then
|
||||
Response = '\\mesfs.infineon.com\EC_SPC_Si_Import\TXT'
|
||||
end else
|
||||
Path = Environment_Services('GetApplicationRootPath'):'\SPC_Data'
|
||||
MakeDirSuccess = Utility("MAKEDIR", Path)
|
||||
Response = Path
|
||||
end
|
||||
|
||||
|
||||
IsProd = Environment_Services("IsProd")
|
||||
|
||||
If IsProd EQ True$ then
|
||||
Response = '\\mesfs.infineon.com\EC_SPC_Si_Import\TXT'
|
||||
end else
|
||||
Path = Environment_Services('GetApplicationRootPath'):'\SPC_Data'
|
||||
MakeDirSuccess = Utility("MAKEDIR", Path)
|
||||
Response = Path
|
||||
end
|
||||
|
||||
end service
|
||||
|
||||
|
||||
@ -227,17 +227,17 @@ end service
|
||||
// Returns the SPC data path.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service GetSPCDataPath()
|
||||
|
||||
IsProd = Environment_Services("IsProd")
|
||||
|
||||
If IsProd EQ True$ then
|
||||
Response = '\\messa04ec.infineon.com\OI_SPC_Data_Transfer'
|
||||
end else
|
||||
Path = Environment_Services('GetApplicationRootPath'):'\SPC_Data'
|
||||
MakeDirSuccess = Utility("MAKEDIR", Path)
|
||||
Response = Path
|
||||
end
|
||||
|
||||
|
||||
IsProd = Environment_Services("IsProd")
|
||||
|
||||
If IsProd EQ True$ then
|
||||
Response = '\\messa04ec.infineon.com\OI_SPC_Data_Transfer'
|
||||
end else
|
||||
Path = Environment_Services('GetApplicationRootPath'):'\SPC_Data'
|
||||
MakeDirSuccess = Utility("MAKEDIR", Path)
|
||||
Response = Path
|
||||
end
|
||||
|
||||
end service
|
||||
|
||||
|
||||
@ -247,10 +247,10 @@ end service
|
||||
// Returns the Metrology Viewer URL.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service GetMetrologyViewerURL()
|
||||
|
||||
|
||||
ProductionPath = 'http://messa010ec.infineon.com/'
|
||||
Response = ProductionPath
|
||||
|
||||
|
||||
end service
|
||||
|
||||
|
||||
@ -260,10 +260,10 @@ end service
|
||||
// Returns the wafer map production path.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service GetWaferMapProductionPath()
|
||||
|
||||
|
||||
ProductionPath = '\\mesfs.infineon.com\EC_Metrology_Si\MetrologyAttachments\TencorRunData_'
|
||||
Response = ProductionPath
|
||||
|
||||
|
||||
end service
|
||||
|
||||
|
||||
@ -276,7 +276,7 @@ Service GetMetrologyProductionPath()
|
||||
|
||||
ProductionPath = 'messqlec1.infineon.com\PROD1,53959'
|
||||
Response = ProductionPath
|
||||
|
||||
|
||||
end service
|
||||
|
||||
|
||||
@ -307,11 +307,11 @@ end service
|
||||
// Returns the Control Plan production path.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service GetControlPlanProductionPath()
|
||||
|
||||
|
||||
ProductionPath = 'iqsdms1'
|
||||
|
||||
|
||||
Response = ProductionPath
|
||||
|
||||
|
||||
end service
|
||||
|
||||
|
||||
@ -321,11 +321,11 @@ end service
|
||||
// Returns the Wafer Track data production path.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service GetWaferTrackProductionPath()
|
||||
|
||||
|
||||
ProductionPath = 'IQSDMS1'
|
||||
|
||||
|
||||
Response = ProductionPath
|
||||
|
||||
|
||||
end service
|
||||
|
||||
|
||||
@ -335,29 +335,29 @@ end service
|
||||
// Returns the local root path. This is where the scripts and FTP transfer files will be located.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service GetLocalRootPath()
|
||||
|
||||
|
||||
Machine = Environment_Services('GetServer')
|
||||
|
||||
|
||||
Begin Case
|
||||
Case Machine EQ 'MESIRWAP001' ; LocalRootPath = 'C:'
|
||||
Case Machine EQ 'MESSA005' ; LocalRootPath = 'D:'
|
||||
Case Machine EQ 'MESSA012' ; LocalRootPath = 'D:'
|
||||
Case Machine EQ 'MESSA01EC' ; LocalRootPath = 'D:'
|
||||
Case Machine EQ 'MESTSA01EC' ; LocalRootPath = 'D:'
|
||||
Case Machine EQ 'MESTSA09EC' ; LocalRootPath = 'D:'
|
||||
Case Machine EQ 'MESTSA010EC' ; LocalRootPath = 'D:'
|
||||
Case Machine EQ 'MESTSA011EC' ; LocalRootPath = 'D:'
|
||||
Case Machine EQ 'MESTSA012EC' ; LocalRootPath = 'D:'
|
||||
Case Machine EQ 'MESTSA024EC' ; LocalRootPath = 'D:'
|
||||
Case Machine EQ 'MESTSA09EC' ; LocalRootPath = 'D:'
|
||||
Case Machine EQ 'MESTSA010EC' ; LocalRootPath = 'D:'
|
||||
Case Machine EQ 'MESTSA011EC' ; LocalRootPath = 'D:'
|
||||
Case Machine EQ 'MESTSA012EC' ; LocalRootPath = 'D:'
|
||||
Case Machine EQ 'MESTSA024EC' ; LocalRootPath = 'D:'
|
||||
Case Machine EQ 'MESST6501' ; LocalRootPath = 'C:' ; // This is a map to the user's actual C drive.
|
||||
Case Machine EQ 'MESST6502' ; LocalRootPath = 'C:' ; // This is a map to the user's actual C drive.
|
||||
Case Machine EQ 'MESTST1006' ; LocalRootPath = 'C:' ; // This is a map to the user's actual C drive.
|
||||
Case Machine EQ 'MESTST1007' ; LocalRootPath = 'C:' ; // This is a map to the user's actual C drive.
|
||||
Case Otherwise$ ; LocalRootPath = 'C:'
|
||||
End Case
|
||||
|
||||
|
||||
Response = LocalRootPath
|
||||
|
||||
|
||||
end service
|
||||
|
||||
|
||||
@ -367,12 +367,12 @@ end service
|
||||
// Returns the method that label programs should use for printing (i.e., OIPI or DirectPrint).
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service GetLabelPrintMethod()
|
||||
|
||||
|
||||
LabelPrintMethod = Database_Services('ReadDataRow', 'APP_INFO', 'LABEL_PRINT_METHOD')<1>
|
||||
Locate LabelPrintMethod in 'OIPI,DirectPrint' using ',' setting cPos else LabelPrintMethod = 'OIPI'
|
||||
|
||||
|
||||
Response = LabelPrintMethod
|
||||
|
||||
|
||||
end service
|
||||
|
||||
|
||||
@ -396,7 +396,7 @@ end service
|
||||
// Returns printer server UNC path.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service GetPrintServerPath()
|
||||
|
||||
|
||||
ServerPath = '\\messp1002.na.infineon.com\'
|
||||
Response = ServerPath
|
||||
|
||||
@ -424,10 +424,10 @@ end service
|
||||
// accessing the database.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service SetServerCanary()
|
||||
|
||||
|
||||
hSysLists = Database_Services('GetTableHandle', 'SYSLISTS')
|
||||
Lock hSysLists, ServiceKeyID then
|
||||
|
||||
|
||||
DateTimeStamp = Oconv(Date(), 'D4/') : ' - ' : Oconv(Time(), 'MTHS')
|
||||
Database_Services('WriteDataRow', 'APP_INFO', 'CANARY', DateTimeStamp, True$, False$, True$)
|
||||
If Error_Services('NoError') then
|
||||
@ -443,7 +443,7 @@ Service SetServerCanary()
|
||||
Message<7> = 'TEXT'
|
||||
Message<8> = 'Error in ' : Service : ' service. Message: ' : Error
|
||||
Message<9> = ''
|
||||
|
||||
|
||||
Config = ''
|
||||
Config<1> = SendUsing_Port$
|
||||
Config<3> = 25
|
||||
@ -454,10 +454,10 @@ Service SetServerCanary()
|
||||
Config<8> = False$
|
||||
Result = SRP_Send_Mail(Message, Config)
|
||||
end
|
||||
|
||||
|
||||
Unlock hSysLists, ServiceKeyID else Null
|
||||
end
|
||||
|
||||
|
||||
end service
|
||||
|
||||
|
||||
@ -465,12 +465,12 @@ Service GetSAPPath()
|
||||
|
||||
Machine = Environment_Services('GetServer')
|
||||
Environment = 'QA'
|
||||
|
||||
|
||||
Begin Case
|
||||
Case Machine EQ 'MESSA005' ; Environment = 'PRD'
|
||||
Case Machine EQ 'MESSA01EC' ; Environment = 'PRD'
|
||||
End Case
|
||||
|
||||
|
||||
Response = Environment
|
||||
|
||||
end service
|
||||
@ -478,25 +478,25 @@ end service
|
||||
|
||||
Service GetSQLScrapeConnectionString()
|
||||
|
||||
Machine = Environment_Services('GetServer')
|
||||
Begin Case
|
||||
Case Machine = 'MESSA01EC'
|
||||
// PROD SQL Servers
|
||||
ConnectionString = 'Provider=MSOLEDBSQL.1;Password=0okm9ijn;Persist Security Info=True;User ID=srpadmin;Initial Catalog=LSL2SQL;Data Source=MESSQLEC1.infineon.com\PROD1,53959;Initial File Name="";Trust Server Certificate=True;Server SPN="";Authentication="";Access Token=""'
|
||||
Case ( (Machine = 'MESTSA01EC') or (Machine = 'MESTSA09EC') or (Machine = 'MESTSA010EC') or (Machine = 'MESTSA011EC') or (Machine = 'MESTSA012EC') )
|
||||
// DEV SQL Servers
|
||||
Machine = Environment_Services('GetServer')
|
||||
Begin Case
|
||||
Case Machine = 'MESSA01EC'
|
||||
// PROD SQL Servers
|
||||
ConnectionString = 'Provider=MSOLEDBSQL.1;Password=0okm9ijn;Persist Security Info=True;User ID=srpadmin;Initial Catalog=LSL2SQL;Data Source=MESSQLEC1.infineon.com\PROD1,53959;Initial File Name="";Trust Server Certificate=True;Server SPN="";Authentication="";Access Token=""'
|
||||
Case ( (Machine = 'MESTSA01EC') or (Machine = 'MESTSA09EC') or (Machine = 'MESTSA010EC') or (Machine = 'MESTSA011EC') or (Machine = 'MESTSA012EC') )
|
||||
// DEV SQL Servers
|
||||
ConnectionString = 'Provider=MSOLEDBSQL.1;Password=Fisql2023!;Persist Security Info=True;User ID=fisql;Initial Catalog=LSL2SQL;Data Source=10.95.140.27\TEST1,50572;Initial File Name="";Trust Server Certificate=True;Server SPN="";Authentication="";Access Token=""'
|
||||
Case Otherwise$
|
||||
// Default to DEV SQL Servers just in case
|
||||
ConnectionString = 'Provider=MSOLEDBSQL.1;Password=Fisql2023!;Persist Security Info=True;User ID=fisql;Initial Catalog=LSL2SQL;Data Source=10.95.140.27\TEST1,50572;Initial File Name="";Trust Server Certificate=True;Server SPN="";Authentication="";Access Token=""'
|
||||
End Case
|
||||
Response = ConnectionString
|
||||
|
||||
Case Otherwise$
|
||||
// Default to DEV SQL Servers just in case
|
||||
ConnectionString = 'Provider=MSOLEDBSQL.1;Password=Fisql2023!;Persist Security Info=True;User ID=fisql;Initial Catalog=LSL2SQL;Data Source=10.95.140.27\TEST1,50572;Initial File Name="";Trust Server Certificate=True;Server SPN="";Authentication="";Access Token=""'
|
||||
End Case
|
||||
Response = ConnectionString
|
||||
|
||||
end service
|
||||
|
||||
|
||||
Service GetUserDesktopPath()
|
||||
|
||||
|
||||
Response = ''
|
||||
UserRootPath = ''
|
||||
UserName = RTI_GetNetworkUserName()
|
||||
@ -514,94 +514,115 @@ end service
|
||||
|
||||
|
||||
Service GetTempPath()
|
||||
|
||||
TempDirectory = Str(\00\, 1024)
|
||||
GetTempPath(Len(TempDirectory), TempDirectory)
|
||||
Convert \00\ to '' in TempDirectory
|
||||
Response = TempDirectory
|
||||
|
||||
|
||||
TempDirectory = Str(\00\, 1024)
|
||||
GetTempPath(Len(TempDirectory), TempDirectory)
|
||||
Convert \00\ to '' in TempDirectory
|
||||
Response = TempDirectory
|
||||
|
||||
end service
|
||||
|
||||
|
||||
Service GetMonaResource()
|
||||
|
||||
If Environment_Services("IsProd") then
|
||||
Response = "OPENINSIGHT_MES_OP_FE"
|
||||
end else
|
||||
Response = "OPENINSIGHT_MES_OP_FE_DEV"
|
||||
end
|
||||
|
||||
|
||||
If Environment_Services("IsProd") then
|
||||
Response = "OPENINSIGHT_MES_OP_FE"
|
||||
end else
|
||||
Response = "OPENINSIGHT_MES_OP_FE_DEV"
|
||||
end
|
||||
|
||||
end service
|
||||
|
||||
|
||||
Service GetMonInBufferedWorkerApiUrl()
|
||||
|
||||
If Environment_Services("IsProd") then
|
||||
Response = "https://messa014.infineon.com:7851"
|
||||
end else
|
||||
Response = "https://mestsa008.infineon.com:7851"
|
||||
end
|
||||
|
||||
|
||||
If Environment_Services("IsProd") then
|
||||
Response = "https://messa014.infineon.com:7851"
|
||||
end else
|
||||
Response = "https://mestsa008.infineon.com:7851"
|
||||
end
|
||||
|
||||
end service
|
||||
|
||||
|
||||
Service GetProveInApiUrl()
|
||||
|
||||
If Environment_Services("IsProd") then
|
||||
Response = "https://messa014.infineon.com:8851"
|
||||
end else
|
||||
Response = "https://mestsa008.infineon.com:8851"
|
||||
end
|
||||
|
||||
|
||||
If Environment_Services("IsProd") then
|
||||
Response = "https://messa014.infineon.com:8851"
|
||||
end else
|
||||
Response = "https://mestsa008.infineon.com:8851"
|
||||
end
|
||||
|
||||
end service
|
||||
|
||||
|
||||
Service GetIfxEmailServer()
|
||||
|
||||
Response = 'smtp.intra.infineon.com'
|
||||
|
||||
|
||||
Response = 'smtp.intra.infineon.com'
|
||||
|
||||
end service
|
||||
|
||||
|
||||
Service GetEnvironmentVariable(VariableName)
|
||||
|
||||
If VariableName NE '' then
|
||||
VarLength = GetEnvironmentVariable(VariableName, "", 0) + 1
|
||||
VarValue = space(VarLength+1)
|
||||
VarLength = GetEnvironmentVariable(VariableName, VarValue, VarLength)
|
||||
VarValue = VarValue[1, VarLength]
|
||||
Response = VarValue
|
||||
end else
|
||||
Error_Services('Add', 'Error in service ':Service:'. Null VariableName passed in')
|
||||
end
|
||||
|
||||
|
||||
If VariableName NE '' then
|
||||
VarLength = GetEnvironmentVariable(VariableName, "", 0) + 1
|
||||
VarValue = space(VarLength+1)
|
||||
VarLength = GetEnvironmentVariable(VariableName, VarValue, VarLength)
|
||||
VarValue = VarValue[1, VarLength]
|
||||
Response = VarValue
|
||||
end else
|
||||
Error_Services('Add', 'Error in service ':Service:'. Null VariableName passed in')
|
||||
end
|
||||
|
||||
end service
|
||||
|
||||
|
||||
Service GetServiceManagerPort()
|
||||
|
||||
|
||||
FilePath = Drive():'\SRPEngineServer.ini'
|
||||
OSRead IniFile from FilePath then
|
||||
CharIndex = Index(IniFile, 'Port', 1)
|
||||
Line = IniFile[CharIndex, 'F':CRLF$]
|
||||
Response = Trim(Line[-1, 'B='])
|
||||
end
|
||||
|
||||
|
||||
end service
|
||||
|
||||
|
||||
Service GetScrapeServerPort()
|
||||
|
||||
|
||||
FilePath = Drive():'\SRPEngineServerScrape.ini'
|
||||
OSRead IniFile from FilePath then
|
||||
CharIndex = Index(IniFile, 'Port', 1)
|
||||
Line = IniFile[CharIndex, 'F':CRLF$]
|
||||
Response = Trim(Line[-1, 'B='])
|
||||
end
|
||||
|
||||
|
||||
end service
|
||||
|
||||
Service GetTextDataBackupRootDir()
|
||||
|
||||
Machine = Environment_Services('GetServer')
|
||||
DataBackupDir = ''
|
||||
|
||||
Begin Case
|
||||
Case Machine = 'MESSA01EC'
|
||||
// PROD SQL Servers
|
||||
DataBackupDir = '\\MESFS.INFINEON.COM\MES_OpenInsight_Backups\DataBackups\'
|
||||
Case ( (Machine = 'MESTSA01EC') or (Machine = 'MESTSA09EC') or (Machine = 'MESTSA010EC') or (Machine = 'MESTSA011EC') or (Machine = 'MESTSA012EC') )
|
||||
// DEV SQL Servers
|
||||
DataBackupDir = 'd:\MES_OpenInsight_Backups\DataBackups\'
|
||||
Case Otherwise$
|
||||
// Default to DEV SQL Servers just in case
|
||||
DataBackupDir = 'd:\MES_OpenInsight_Backups\DataBackups\'
|
||||
End Case
|
||||
Response = DataBackupDir
|
||||
|
||||
end service
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Internal GoSubs
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
105
LSL2/STPROC/REARCHIVE_API.txt
Normal file
105
LSL2/STPROC/REARCHIVE_API.txt
Normal file
@ -0,0 +1,105 @@
|
||||
Function Rearchive_API(@API)
|
||||
/***********************************************************************************************************************
|
||||
|
||||
This program is proprietary and is not to be used by or disclosed to others, nor is it to be copied without written
|
||||
permission from SRP Computer Solutions, Inc.
|
||||
|
||||
Name : Rearchive_API
|
||||
|
||||
Description : API logic for the Rearchive resource.
|
||||
|
||||
Notes : All web APIs should include the API_SETUP insert. This will provide several useful variables:
|
||||
|
||||
HTTPMethod - The HTTP Method (Verb) submitted by the client (e.g., GET, POST, etc.)
|
||||
APIURL - The URL for the API entry point (e.g., api.mysite.com/v1).
|
||||
FullEndpointURL - The URL submitted by the client, including query params.
|
||||
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
||||
EndpointSegment - The URL endpoint segment.
|
||||
ParentURL - The URL path preceeding the current endpoint.
|
||||
CurrentAPI - The name of this stored procedure.
|
||||
|
||||
Parameters :
|
||||
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
||||
- APIPattern must follow this structure Rearchive[.ID.[<Property>]]
|
||||
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
||||
Examples:
|
||||
- Rearchive.POST
|
||||
- Rearchive.ID.PUT
|
||||
- Rearchive.ID.firstName.GET
|
||||
Response [out] -- Response to be sent back to the Controller (HTTP_MCP) or requesting procedure. Web API
|
||||
services do not rely upon anything being returned in the response. This is what the
|
||||
various services like SetResponseBody and SetResponseStatus services are for. A response
|
||||
value is only helpful if the developers want to use it for debug purposes.
|
||||
|
||||
History : (Date, Initials, Notes)
|
||||
10/16/25 xxx Original programmer.
|
||||
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#pragma precomp SRP_PreCompiler
|
||||
|
||||
$insert APP_INSERTS
|
||||
$insert API_SETUP
|
||||
$insert HTTP_INSERTS
|
||||
$Insert IFX_EQUATES
|
||||
|
||||
Declare subroutine Service_Services
|
||||
Declare function OI_Wizard_Services
|
||||
|
||||
GoToAPI else
|
||||
// The specific resource endpoint doesn't have a API handler yet.
|
||||
HTTP_Services('SetResponseStatus', 204, 'This is a valid endpoint but a web API handler has not yet been created.')
|
||||
end
|
||||
|
||||
Return Response OR ''
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Endpoint Handlers
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
API rearchive.ID.POST
|
||||
|
||||
ErrorMsg = ''
|
||||
OIWizardID = ''
|
||||
Cookies = HTTP_Services('GetHTTPCookie')
|
||||
For each Cookie in Cookies using ';'
|
||||
Key = Field(Cookie, '=', 1)
|
||||
If Key EQ 'sessionID' then
|
||||
OIWizardID = Field(Cookie, '=', 2)
|
||||
end
|
||||
Next Cookie
|
||||
|
||||
ValidSession = OI_Wizard_Services('ValidateSession', OIWizardID)
|
||||
|
||||
If ValidSession then
|
||||
ArchiveId = EndpointSegment
|
||||
swap '__' with '*' in ArchiveId
|
||||
If RowExists('ARCHIVE', ArchiveId) then
|
||||
Service_Services('PostProcedure', 'ARCHIVE_SERVICES', 'ReArchive':SD$:ArchiveId)
|
||||
If Error_Services('NoError') then
|
||||
Message = 'Successfully queued data for re-archive.'
|
||||
end else
|
||||
ErrorMsg = 'Error queueing re-archiving.'
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Archive record not found in database.'
|
||||
end
|
||||
|
||||
If ErrorMsg NE '' then
|
||||
HTTP_Services('SetResponseStatus', 500, ErrorMsg)
|
||||
end else
|
||||
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||
If Assigned(Message) then
|
||||
HTTP_Services('SetResponseStatus', 201, Message)
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', 201)
|
||||
end
|
||||
end
|
||||
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', 500, 'Invalid session. Reauthentication required.')
|
||||
end
|
||||
|
||||
end api
|
70
LSL2/STPROC/TW_USE_SERVICES.txt
Normal file
70
LSL2/STPROC/TW_USE_SERVICES.txt
Normal file
@ -0,0 +1,70 @@
|
||||
Compile function TW_Use_Services(@Service, @Params)
|
||||
#pragma precomp SRP_PreCompiler
|
||||
$Insert SERVICE_SETUP
|
||||
$Insert LOGICAL
|
||||
$Insert TW_USE_EQUATES
|
||||
|
||||
Declare subroutine Error_Services, Delay, Update_Index
|
||||
|
||||
Equ NUM_ATTEMPTS$ to 10
|
||||
|
||||
GoToService
|
||||
|
||||
Return Response or ""
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// SERVICES
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Service VerifyRelationalIndexes(TWUseKey)
|
||||
ErrorMsg = ''
|
||||
If TWUseKey NE '' then
|
||||
RDSTestKey = Field(TWUseKey, '*', 1, 1)
|
||||
If RDSTestKey NE '' then
|
||||
// Add index transaction to update TW_USE relational index (target RDS_TEST table)
|
||||
If RowExists('TW_USE', TWUseKey) then
|
||||
IndexTransactionRow = 'RDS_TEST*TW_USE_ID*AR':@FM:TWUseKey:@FM:"":@FM:RDSTestKey:@FM
|
||||
end else
|
||||
IndexTransactionRow = 'RDS_TEST*TW_USE_ID*AR':@FM:TWUseKey:@FM:RDSTestKey:@FM:"":@FM
|
||||
end
|
||||
Done = False$
|
||||
For AttemptNo = 1 to NUM_ATTEMPTS$
|
||||
If AttemptNo GT 1 then Delay(1)
|
||||
Open "!TW_USE" to BangTable then
|
||||
Lock BangTable, 0 then
|
||||
Read PendingTrans from BangTable, 0 else PendingTrans = '0':@FM
|
||||
PendingTrans := IndexTransactionRow
|
||||
Write PendingTrans on BangTable, 0 then
|
||||
Done = True$
|
||||
end else
|
||||
If AttemptNo GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Error in ':Service:' service. Unable to write index transaction to !TW_USE. ':TWUseKey
|
||||
end
|
||||
end
|
||||
Unlock BangTable, 0 else ErrorMsg = 'Error in ':Service:' service. Unable to Open !TW_USE to add index transaction. ':TWUseKey
|
||||
end else
|
||||
If AttemptNo GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Error in ':Service:' service. Unable to Lock !TW_USE to add index transaction. ':TWUseKey
|
||||
end
|
||||
end
|
||||
end else
|
||||
If AttemptNo GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Error in ':Service:' service. Unable to Open !TW_USE to add index transaction. ':TWUseKey
|
||||
end
|
||||
end
|
||||
Until Done or ErrorMsg
|
||||
Next AttemptNo
|
||||
If Done then
|
||||
ErrCode = ''
|
||||
Update_Index('TW_USE', 'MET_NO', False$, True$)
|
||||
If Get_Status(ErrCode) then
|
||||
ErrorMsg = 'Error in ':Service:' service. Update_Index call failed. Error code: ':ErrCode
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
|
||||
|
||||
End Service
|
||||
|
@ -73,7 +73,7 @@ Declare subroutine Database_Services, SRP_JSON, Error_Services, Extract_Si_Keys,
|
||||
Declare subroutine Logging_Services, Btree.Extract, Update_Index, Delay
|
||||
|
||||
GoToService else
|
||||
Error_Services('Set', Service : ' is not a valid service request within the ' : ServiceModule : ' services module.')
|
||||
Error_Services('Set', Service : ' is not a valid service request within the ' : ServiceModule : ' services module.')
|
||||
end
|
||||
|
||||
Return Response else ''
|
||||
@ -95,15 +95,15 @@ Service GetComments(WMOutNo)
|
||||
|
||||
CommentArray = ''
|
||||
WMOutRow = Database_Services('ReadDataRow', 'WM_OUT', WMOutNo)
|
||||
|
||||
CommentDates = Oconv(WMOutRow<WM_OUT_EPP_COMMENT_DATE$>, 'DT')
|
||||
|
||||
CommentDates = Oconv(WMOutRow<WM_OUT_EPP_COMMENT_DATE$>, 'DT')
|
||||
CommentUsers = WMOutRow<WM_OUT_EPP_COMMENT_USER$>
|
||||
Comments = WMOutRow<WM_OUT_EPP_COMMENT_NOTE$>
|
||||
|
||||
|
||||
CommentList = CommentDates :@FM: CommentUsers :@FM: Comments
|
||||
CommentArray = SRP_Rotate_Array(CommentList)
|
||||
Response = CommentArray
|
||||
|
||||
|
||||
End Service
|
||||
|
||||
|
||||
@ -121,35 +121,35 @@ Service AddComment(WMOutNo, Comment, UsernameOpt)
|
||||
WMOutRow = Database_Services('ReadDataRow', 'WM_OUT', WMOutNo)
|
||||
UserName = @USER4
|
||||
If Assigned(UsernameOpt) then
|
||||
If UsernameOpt NE '' then
|
||||
Username = UsernameOpt
|
||||
end
|
||||
end
|
||||
If UsernameOpt NE '' then
|
||||
Username = UsernameOpt
|
||||
end
|
||||
end
|
||||
CommentTime = Datetime()
|
||||
|
||||
OldDates = WMOutRow<WM_OUT_EPP_COMMENT_DATE$>
|
||||
OldUsers = WMOutRow<WM_OUT_EPP_COMMENT_USER$>
|
||||
|
||||
OldDates = WMOutRow<WM_OUT_EPP_COMMENT_DATE$>
|
||||
OldUsers = WMOutRow<WM_OUT_EPP_COMMENT_USER$>
|
||||
OldComments = WMOutRow<WM_OUT_EPP_COMMENT_NOTE$>
|
||||
If (OldDates EQ '' AND OldUsers EQ '' AND OldComments EQ '') then
|
||||
WMOutRow<WM_OUT_EPP_COMMENT_DATE$> = CommentTime
|
||||
WMOutRow<WM_OUT_EPP_COMMENT_USER$> = UserName
|
||||
WMOutRow<WM_OUT_EPP_COMMENT_NOTE$> = Comment
|
||||
end else
|
||||
WMOutRow<WM_OUT_EPP_COMMENT_DATE$> = CommentTime :@VM: OldDates
|
||||
WMOutRow<WM_OUT_EPP_COMMENT_USER$> = UserName :@VM: OldUsers
|
||||
WMOutRow<WM_OUT_EPP_COMMENT_NOTE$> = Comment :@VM: OldComments
|
||||
end
|
||||
Database_Services('WriteDataRow', 'WM_OUT', WMOutNo, WMOutRow, 1, 0, 0)
|
||||
|
||||
If (OldDates EQ '' AND OldUsers EQ '' AND OldComments EQ '') then
|
||||
WMOutRow<WM_OUT_EPP_COMMENT_DATE$> = CommentTime
|
||||
WMOutRow<WM_OUT_EPP_COMMENT_USER$> = UserName
|
||||
WMOutRow<WM_OUT_EPP_COMMENT_NOTE$> = Comment
|
||||
end else
|
||||
WMOutRow<WM_OUT_EPP_COMMENT_DATE$> = CommentTime :@VM: OldDates
|
||||
WMOutRow<WM_OUT_EPP_COMMENT_USER$> = UserName :@VM: OldUsers
|
||||
WMOutRow<WM_OUT_EPP_COMMENT_NOTE$> = Comment :@VM: OldComments
|
||||
end
|
||||
Database_Services('WriteDataRow', 'WM_OUT', WMOutNo, WMOutRow, 1, 0, 0)
|
||||
|
||||
End Service
|
||||
|
||||
|
||||
Service ConvertRecordToJSON(KeyID, Record, ItemURL)
|
||||
|
||||
jsonRecord = ''
|
||||
|
||||
|
||||
If KeyID NE '' then
|
||||
|
||||
|
||||
If Record EQ '' then Record = Database_Services('ReadDataRow', 'WM_OUT', KeyID)
|
||||
If Error_Services('NoError') then
|
||||
@DICT = Database_Services('GetTableHandle', 'DICT.WM_OUT')
|
||||
@ -169,9 +169,9 @@ Service ConvertRecordToJSON(KeyID, Record, ItemURL)
|
||||
SRP_JSON(objWMOut, 'SetValue', 'CURR_WFR_CNT', CurrWfrQty)
|
||||
CustNo = Database_Services('ReadDataColumn', 'WO_LOG', {WO_NO}, WO_LOG_CUST_NO$, True$, 0, False$)
|
||||
CustReshipNo = Database_Services('ReadDataColumn', 'WO_MAT', WoMatKey, WO_MAT_RESHIP_CUST_NO$, True$, 0, False$)
|
||||
If CustReshipNo NE '' then
|
||||
CustNo = CustReshipNo
|
||||
end
|
||||
If CustReshipNo NE '' then
|
||||
CustNo = CustReshipNo
|
||||
end
|
||||
CustName = Database_Services('ReadDataColumn', 'COMPANY', CustNo, COMPANY_CO_NAME$, True$, 0, False$)
|
||||
CustAbbrev = Database_Services('ReadDataColumn', 'COMPANY', CustNo, COMPANY_ABBREV$, True$, 0, False$)
|
||||
SRP_JSON(objWMOut, 'SetValue', 'CustNo', CustNo)
|
||||
@ -231,16 +231,16 @@ Service ConvertRecordToJSON(KeyID, Record, ItemURL)
|
||||
For each RTFRecordId in AllRTFRecords using @VM setting vPos
|
||||
objRTF = ''
|
||||
If SRP_JSON(objRTF, 'New', 'Object') then
|
||||
RTFRecord = Database_Services('ReadDataRow', 'RETURN_TO_FAB_LOTS', RTFRecordId, True$, 0, False$)
|
||||
SRP_JSON(objRTF, 'SetValue', 'ReturnToFabLotsId', RTFRecordId)
|
||||
SRP_JSON(objRTF, 'SetValue', 'StartDtm', OConv(RTFRecord<RETURN_TO_FAB_LOTS_MH_INIT_DTM$>, 'DT'))
|
||||
SRP_JSON(objRTF, 'SetValue', 'Completed', RTFRecord<RETURN_TO_FAB_LOTS_COMPLETED$>, 'Boolean')
|
||||
SRP_JSON(objRTFRecords, 'Set', 'ReturnToFabRecord', objRTF)
|
||||
SRP_JSON(objRTFRecords, 'Add', objRTF)
|
||||
SRP_JSON(objRTF, 'Release')
|
||||
RTFRecord = Database_Services('ReadDataRow', 'RETURN_TO_FAB_LOTS', RTFRecordId, True$, 0, False$)
|
||||
SRP_JSON(objRTF, 'SetValue', 'ReturnToFabLotsId', RTFRecordId)
|
||||
SRP_JSON(objRTF, 'SetValue', 'StartDtm', OConv(RTFRecord<RETURN_TO_FAB_LOTS_MH_INIT_DTM$>, 'DT'))
|
||||
SRP_JSON(objRTF, 'SetValue', 'Completed', RTFRecord<RETURN_TO_FAB_LOTS_COMPLETED$>, 'Boolean')
|
||||
SRP_JSON(objRTFRecords, 'Set', 'ReturnToFabRecord', objRTF)
|
||||
SRP_JSON(objRTFRecords, 'Add', objRTF)
|
||||
SRP_JSON(objRTF, 'Release')
|
||||
end
|
||||
Next RTFRecordId
|
||||
|
||||
|
||||
SRP_JSON(objWMOut, 'Set', 'ReturnToFabRecords', objRTFRecords)
|
||||
SRP_JSON(objRTFRecords, 'Release')
|
||||
end
|
||||
@ -279,7 +279,7 @@ Service ConvertRecordToJSON(KeyID, Record, ItemURL)
|
||||
end else
|
||||
Error_Services('Add', 'KeyID argument was missing in the ' : Service : ' service.')
|
||||
end
|
||||
|
||||
|
||||
Response = jsonRecord
|
||||
|
||||
End Service
|
||||
@ -295,9 +295,9 @@ End Service
|
||||
// Rows are @FM delimted while columns are @VM delimited.
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
Service GetWMOData(WorkOrderNo, Columns, ShowGasGauge, WMOOverrideList)
|
||||
|
||||
|
||||
WMOList = ''
|
||||
|
||||
|
||||
If ( (WorkOrderNo NE '') or (WMOOverrideList NE '') ) then
|
||||
If ShowGasGauge NE True$ then ShowGasGauge = False$
|
||||
rv = Set_Status(0)
|
||||
@ -333,28 +333,28 @@ Service GetWMOData(WorkOrderNo, Columns, ShowGasGauge, WMOOverrideList)
|
||||
If Error_Services('NoError') then
|
||||
For each Column in Columns using @VM setting vPos
|
||||
Begin Case
|
||||
Case Column EQ 'HOLD'
|
||||
HoldStatus = Calculate(Column)
|
||||
If HoldStatus EQ True$ then
|
||||
HoldStatus = 'On Hold'
|
||||
end else
|
||||
HoldStatus = 'Off Hold'
|
||||
end
|
||||
WMOList<fPos, vPos> = HoldStatus
|
||||
Case Otherwise$
|
||||
Val = Calculate(Column)
|
||||
Conv = Xlate('DICT.WM_OUT', Column, DICT_CONV$, 'X')
|
||||
If Conv NE '' then
|
||||
Val = OConv(Val, Conv)
|
||||
end
|
||||
WMOList<fPos, vPos> = Val
|
||||
Case Column EQ 'HOLD'
|
||||
HoldStatus = Calculate(Column)
|
||||
If HoldStatus EQ True$ then
|
||||
HoldStatus = 'On Hold'
|
||||
end else
|
||||
HoldStatus = 'Off Hold'
|
||||
end
|
||||
WMOList<fPos, vPos> = HoldStatus
|
||||
Case Otherwise$
|
||||
Val = Calculate(Column)
|
||||
Conv = Xlate('DICT.WM_OUT', Column, DICT_CONV$, 'X')
|
||||
If Conv NE '' then
|
||||
Val = OConv(Val, Conv)
|
||||
end
|
||||
WMOList<fPos, vPos> = Val
|
||||
End Case
|
||||
Next Column
|
||||
end else
|
||||
Error_Services('Add', 'Error reading WM_OUT Record ' : @ID : ' in the ' : Service : ' service.')
|
||||
end
|
||||
* update the gauge
|
||||
If ShowGasGauge then Msg(@Window, MsgUp, fPos, MSGINSTUPDATE$)
|
||||
If ShowGasGauge then Msg(@Window, MsgUp, fPos, MSGINSTUPDATE$)
|
||||
Next @ID
|
||||
end else
|
||||
Error_Services('Add', 'Error opening WM_OUT dictionary in the ' : Service : ' service.')
|
||||
@ -365,7 +365,7 @@ Service GetWMOData(WorkOrderNo, Columns, ShowGasGauge, WMOOverrideList)
|
||||
end
|
||||
If ShowGasGauge then Msg(@Window, MsgUp) ;* take down the gauge
|
||||
Response = WMOList
|
||||
|
||||
|
||||
end service
|
||||
|
||||
|
||||
@ -410,45 +410,45 @@ Service GetWaferMap(WMOKey)
|
||||
end service
|
||||
|
||||
Service SetVoidFlag(WMOutKey, Username)
|
||||
ErrorMessage = ''
|
||||
If RowExists('WM_OUT', WMOutKey) then
|
||||
WMOutRec = Database_Services('ReadDataRow', 'WM_OUT', WMOutKey, True$, 0, False$)
|
||||
If Error_Services('NoError') then
|
||||
WMOutRec<WM_OUT_VOID$> = True$
|
||||
Database_Services('WriteDataRow', 'WM_OUT', WMOutKey, WMOutRec, True$, False, False$)
|
||||
If Error_Services('NoError') then
|
||||
Set_Status(0)
|
||||
WONo = Field(WMOutKey, '*', 1)
|
||||
CassNo = Field(WMOutKey, '*', 3)
|
||||
WOMLParms = ''
|
||||
LogFile = 'WO_MAT' ; WOMLParms = LogFile:@RM
|
||||
LogDTM = OConv(Datetime(), 'DT') ; WOMLParms := LogDTM:@RM
|
||||
Action = 'WM_OUT_VOID' ; WOMLParms := Action:@RM
|
||||
WhCd = 'CR' ; WOMLParms := WhCd:@RM
|
||||
LocCd = 'VOID' ; WOMLParms := LocCd:@RM
|
||||
WONos = WONo ; WOMLParms := WONos:@RM
|
||||
CassNos = CassNo ; WOMLParms := CassNos:@RM
|
||||
UserID = Username ; WOMLParms := UserID:@RM
|
||||
Tags = '' ; WOMLParms := Tags:@RM
|
||||
ToolID = '' ; WOMLParms := ToolID:@RM
|
||||
WOMLParms := ''
|
||||
obj_WO_Mat_Log('Create',WOMLParms)
|
||||
IF Get_Status(errCode) THEN
|
||||
ErrorMessage = 'Error writing inventory transactions'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Failed to write to the WM_OUT record ' : WMOutKey : ' while attempting to set void status.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Failed to read WM_OUT record ' : WMOutKey : ' while attempting to set void status.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Invalid WM_OUT Key ' : WMOutKey : ' passed to SetVoidFlag routine.'
|
||||
end
|
||||
If ErrorMessage NE '' then
|
||||
Error_Services('Add', ErrorMessage)
|
||||
end
|
||||
|
||||
ErrorMessage = ''
|
||||
If RowExists('WM_OUT', WMOutKey) then
|
||||
WMOutRec = Database_Services('ReadDataRow', 'WM_OUT', WMOutKey, True$, 0, False$)
|
||||
If Error_Services('NoError') then
|
||||
WMOutRec<WM_OUT_VOID$> = True$
|
||||
Database_Services('WriteDataRow', 'WM_OUT', WMOutKey, WMOutRec, True$, False, False$)
|
||||
If Error_Services('NoError') then
|
||||
Set_Status(0)
|
||||
WONo = Field(WMOutKey, '*', 1)
|
||||
CassNo = Field(WMOutKey, '*', 3)
|
||||
WOMLParms = ''
|
||||
LogFile = 'WO_MAT' ; WOMLParms = LogFile:@RM
|
||||
LogDTM = OConv(Datetime(), 'DT') ; WOMLParms := LogDTM:@RM
|
||||
Action = 'WM_OUT_VOID' ; WOMLParms := Action:@RM
|
||||
WhCd = 'CR' ; WOMLParms := WhCd:@RM
|
||||
LocCd = 'VOID' ; WOMLParms := LocCd:@RM
|
||||
WONos = WONo ; WOMLParms := WONos:@RM
|
||||
CassNos = CassNo ; WOMLParms := CassNos:@RM
|
||||
UserID = Username ; WOMLParms := UserID:@RM
|
||||
Tags = '' ; WOMLParms := Tags:@RM
|
||||
ToolID = '' ; WOMLParms := ToolID:@RM
|
||||
WOMLParms := ''
|
||||
obj_WO_Mat_Log('Create',WOMLParms)
|
||||
IF Get_Status(errCode) THEN
|
||||
ErrorMessage = 'Error writing inventory transactions'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Failed to write to the WM_OUT record ' : WMOutKey : ' while attempting to set void status.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Failed to read WM_OUT record ' : WMOutKey : ' while attempting to set void status.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Invalid WM_OUT Key ' : WMOutKey : ' passed to SetVoidFlag routine.'
|
||||
end
|
||||
If ErrorMessage NE '' then
|
||||
Error_Services('Add', ErrorMessage)
|
||||
end
|
||||
|
||||
end service
|
||||
|
||||
|
||||
@ -531,6 +531,94 @@ Service VerifyWoStepWMOKeyIndex(WMOKey)
|
||||
|
||||
end service
|
||||
|
||||
Service VerifyRelationalIndexes(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
|
||||
|
||||
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)
|
||||
|
||||
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)
|
||||
|
||||
If RowExists('WM_OUT', WMOKey) then
|
||||
IndexTransactionRow = 'WO_STEP*WM_OUT_KEYS*AR':@FM:WMOKey:@FM:"":@FM:WOStepKey:@FM
|
||||
end else
|
||||
IndexTransactionRow = 'WO_STEP*WM_OUT_KEYS*AR':@FM:WMOKey:@FM:WOStepKey:@FM:"":@FM
|
||||
end
|
||||
Done = False$
|
||||
For AttemptNo = 1 to NUM_ATTEMPTS$
|
||||
If AttemptNo GT 1 then Delay(1)
|
||||
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
|
||||
Done = True$
|
||||
LogData<4> = 'Index transaction successfully added.'
|
||||
Logging_Services('AppendLog', objVerifyWMOKeyLog, LogData, @RM, @FM)
|
||||
end else
|
||||
If AttemptNo GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Unable to write index transaction to !WM_OUT. ':WMOKey
|
||||
end
|
||||
end
|
||||
Unlock BangTable, 0 else ErrorMsg = 'Unable to Open !WM_OUT to add index transaction. ':WMOKey
|
||||
end else
|
||||
If AttemptNo GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Unable to Lock !WM_OUT to add index transaction. ':WMOKey
|
||||
end
|
||||
end
|
||||
end else
|
||||
If AttemptNo GE NUM_ATTEMPTS$ then
|
||||
ErrorMsg = 'Unable to Open !WM_OUT to add index transaction. ':WMOKey
|
||||
end
|
||||
end
|
||||
Until Done or ErrorMsg
|
||||
Next AttemptNo
|
||||
If Done then
|
||||
ErrCode = ''
|
||||
Update_Index('WM_OUT', 'WO_STEP_KEY', False$, True$)
|
||||
If Get_Status(ErrCode) then
|
||||
ErrorMsg = 'Error in ':Service:' service. Update_Index call failed. Error code: ':ErrCode
|
||||
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
|
||||
|
||||
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)
|
||||
|
||||
@ -744,7 +832,7 @@ Service GetWmOutZpl(WmOutKey)
|
||||
PONo = WORec<WO_LOG_CUST_PO_NO$>
|
||||
PSNo = XLATE('WO_STEP',WONo:'*':WOStep,WO_STEP_PROD_SPEC_ID$,'X')
|
||||
PSRec = XLATE('PROD_SPEC',PSNo,'','X')
|
||||
|
||||
|
||||
CustSpecNo = ''
|
||||
IF Captive THEN
|
||||
CustSpecNos = PSRec<PROD_SPEC_SPEC_NUM$>
|
||||
@ -762,7 +850,7 @@ Service GetWmOutZpl(WmOutKey)
|
||||
UNTIL CustSpecNo NE ''
|
||||
NEXT I
|
||||
END
|
||||
|
||||
|
||||
EpiPartNo = WORec<WO_LOG_EPI_PART_NO$>
|
||||
CustEpiPartRec = XLATE('CUST_EPI_PART',CustNo:'*':EpiPartNo,'','X')
|
||||
ShipBagReq = CustEpiPartRec<CUST_EPI_PART_SHIP_BAG_REQ$>
|
||||
@ -793,13 +881,13 @@ Service GetWmOutZpl(WmOutKey)
|
||||
RecipeNo = XLATE( 'PROD_SPEC', PSNo, 'RECIPE_NO', 'X' )
|
||||
RecipeInfo = XLATE( 'RECIPE', RecipeNo, 'RECIPE_NAME_NO', 'X' )
|
||||
CleaningReqs = ''
|
||||
|
||||
|
||||
ThickCnt = FIELDCOUNT( ThickTarget<1>, @VM )
|
||||
PrintThickTargets = ''
|
||||
FOR J = 1 TO ThickCnt
|
||||
PrintThickTargets<1,J> = ThickTarget<1,J>:ThickUnit<1,J>
|
||||
NEXT J
|
||||
|
||||
|
||||
ResCnt = FIELDCOUNT( ResTarget<1>, @VM )
|
||||
PrintResTargets = ''
|
||||
FOR J = 1 TO ResCnt
|
||||
@ -810,30 +898,30 @@ Service GetWmOutZpl(WmOutKey)
|
||||
END
|
||||
PrintResTargets<1,J> = TargetVal:ResUnit<1,J>
|
||||
NEXT J
|
||||
|
||||
|
||||
APreRec = ''
|
||||
APostRec = ''
|
||||
IF ( PreAkrionRecipe<1> <> '' ) THEN
|
||||
APreRec = ' ':PreAkrionRecipe:' '
|
||||
SubOxide = 'No' ;* If Akrion then no oxide strip
|
||||
END
|
||||
|
||||
|
||||
IF ( PostAkrionRecipe<1> <> '' ) THEN
|
||||
APostRec = ' ':PostAkrionRecipe
|
||||
END
|
||||
|
||||
|
||||
PrintCleaningReqs = TRIM( 'Strip:':SubOxide:' Pre:':SubPreClean:APreRec:' Post:':SubPostClean:APostRec )
|
||||
|
||||
|
||||
swap UNIT_MICROMETER$ with 'um' in PrintThickTargets
|
||||
swap UNIT_OHM_CM$ with 'ohm.cm' in PrintThickTargets
|
||||
swap UNIT_OHM_PER_SQ$ with 'ohm/sq' in PrintThickTargets
|
||||
swap UNIT_A$ with 'A' in PrintThickTargets
|
||||
|
||||
|
||||
swap UNIT_MICROMETER$ with 'um' in PrintResTargets
|
||||
swap UNIT_OHM_CM$ with 'ohm.cm' in PrintResTargets
|
||||
swap UNIT_OHM_PER_SQ$ with 'ohm/sq' in PrintResTargets
|
||||
swap UNIT_A$ with 'A' in PrintResTargets
|
||||
|
||||
|
||||
MakeupBox = XLATE('WM_OUT',WMOutKey,WM_OUT_MAKEUP_BOX$ ,'X')
|
||||
|
||||
PrintWMOutKey = WMOutKey
|
||||
@ -990,3 +1078,5 @@ Service GetWmOutZpl(WmOutKey)
|
||||
|
||||
end service
|
||||
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,19 +1,24 @@
|
||||
compile insert ARCHIVE_EQUATES
|
||||
/*----------------------------------------
|
||||
Author : Table Create Insert Routine
|
||||
Written : 28/08/2025
|
||||
Written : 15/10/2025
|
||||
Description : Insert for Table ARCHIVE
|
||||
----------------------------------------*/
|
||||
#ifndef __ARCHIVE_EQUATES__
|
||||
#define __ARCHIVE_EQUATES__
|
||||
|
||||
equ ARCHIVE_ARCHIVE_DTM$ to 1
|
||||
equ ARCHIVE_COMPLETE$ to 2
|
||||
equ ARCHIVE_CHILD_RECORD$ to 3
|
||||
equ ARCHIVE_CHILD_TABLE$ to 4
|
||||
equ ARCHIVE_CHILD_RECORD_ARCHIVED$ to 5
|
||||
equ ARCHIVE_CHILD_RECORD_DELETED$ to 6
|
||||
equ ARCHIVE_CHILD_RECORD_ARCHIVE_DTM$ to 7
|
||||
equ ARCHIVE_CHILD_RECORD_DELETE_DTM$ to 8
|
||||
equ ARCHIVE_ARCHIVE_CREATION_DTM$ to 1
|
||||
equ ARCHIVE_ARCHIVE_PATH$ to 2
|
||||
equ ARCHIVE_COMPLETE$ to 3
|
||||
equ ARCHIVE_ARCHIVE_COMPLETION_DTM$ to 4
|
||||
equ ARCHIVE_CHILD_RECORD$ to 5
|
||||
equ ARCHIVE_CHILD_TABLE$ to 6
|
||||
equ ARCHIVE_CHILD_RECORD_ARCHIVED$ to 7
|
||||
equ ARCHIVE_CHILD_RECORD_DELETED$ to 8
|
||||
equ ARCHIVE_DEARCHIVE_DATETIME$ to 9
|
||||
equ ARCHIVE_METADATA_FIELD$ to 10
|
||||
equ ARCHIVE_METADATA_TYPE$ to 11
|
||||
equ ARCHIVE_METADATA_VALUE$ to 12
|
||||
equ ARCHIVE_CHILD_RECORD_DE_ARCHIVED$ to 13
|
||||
|
||||
#endif
|
||||
|
13
LSL2/STPROCINS/ARCHIVE_QUEUE_EQUATES.txt
Normal file
13
LSL2/STPROCINS/ARCHIVE_QUEUE_EQUATES.txt
Normal file
@ -0,0 +1,13 @@
|
||||
compile insert ARCHIVE_QUEUE_EQUATES
|
||||
/*----------------------------------------
|
||||
Author : Table Create Insert Routine
|
||||
Written : 05/09/2025
|
||||
Description : Insert for Table ARCHIVE_QUEUE
|
||||
----------------------------------------*/
|
||||
#ifndef __ARCHIVE_QUEUE_EQUATES__
|
||||
#define __ARCHIVE_QUEUE_EQUATES__
|
||||
|
||||
equ ARCHIVE_QUEUE_ARCHIVE_ID$ to 1
|
||||
equ ARCHIVE_QUEUE_COMPLETED$ to 2
|
||||
|
||||
#endif
|
13
LSL2/STPROCINS/ARCHIVE_QUEUE_ERROR_EQUATES.txt
Normal file
13
LSL2/STPROCINS/ARCHIVE_QUEUE_ERROR_EQUATES.txt
Normal file
@ -0,0 +1,13 @@
|
||||
compile insert ARCHIVE_QUEUE_ERROR_EQUATES
|
||||
/*----------------------------------------
|
||||
Author : Table Create Insert Routine
|
||||
Written : 02/10/2025
|
||||
Description : Insert for Table ARCHIVE_QUEUE_ERROR
|
||||
----------------------------------------*/
|
||||
#ifndef __ARCHIVE_QUEUE_ERROR_EQUATES__
|
||||
#define __ARCHIVE_QUEUE_ERROR_EQUATES__
|
||||
|
||||
equ ARCHIVE_QUEUE_ERROR_ARCHIVE_ID$ to 1
|
||||
equ ARCHIVE_QUEUE_ERROR_ERROR_MSG$ to 2
|
||||
|
||||
#endif
|
13
LSL2/STPROCINS/DELETE_QUEUE_EQUATES.txt
Normal file
13
LSL2/STPROCINS/DELETE_QUEUE_EQUATES.txt
Normal file
@ -0,0 +1,13 @@
|
||||
compile insert DELETE_QUEUE_EQUATES
|
||||
/*----------------------------------------
|
||||
Author : Table Create Insert Routine
|
||||
Written : 05/09/2025
|
||||
Description : Insert for Table DELETE_QUEUE
|
||||
----------------------------------------*/
|
||||
#ifndef __DELETE_QUEUE_EQUATES__
|
||||
#define __DELETE_QUEUE_EQUATES__
|
||||
|
||||
equ DELETE_QUEUE_ARCHIVE_ID$ to 1
|
||||
equ DELETE_QUEUE_COMPLETED$ to 2
|
||||
|
||||
#endif
|
13
LSL2/STPROCINS/DELETE_QUEUE_ERROR_EQUATES.txt
Normal file
13
LSL2/STPROCINS/DELETE_QUEUE_ERROR_EQUATES.txt
Normal file
@ -0,0 +1,13 @@
|
||||
compile insert DELETE_QUEUE_ERROR_EQUATES
|
||||
/*----------------------------------------
|
||||
Author : Table Create Insert Routine
|
||||
Written : 29/09/2025
|
||||
Description : Insert for Table DELETE_QUEUE_ERROR
|
||||
----------------------------------------*/
|
||||
#ifndef __DELETE_QUEUE_ERROR_EQUATES__
|
||||
#define __DELETE_QUEUE_ERROR_EQUATES__
|
||||
|
||||
equ DELETE_QUEUE_ERROR_ARCHIVE_ID$ to 1
|
||||
equ DELETE_QUEUE_ERROR_ERROR_MSG$ to 2
|
||||
|
||||
#endif
|
@ -25,3 +25,4 @@ Equ Server.Port$ to 25000
|
||||
Equ Server.KeepAlive$ to 60000
|
||||
Equ MessageProcessor$ to 'NDW_MESSAGING_PROCESSOR'
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user