Merged PR 21151: Return To Fab Operations and Processing
This commit is contained in:
parent
b607432be4
commit
aabd4c3a91
File diff suppressed because it is too large
Load Diff
@ -1,152 +1,151 @@
|
|||||||
Function Authentication_API(@API)
|
Function Authentication_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
|
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.
|
permission from SRP Computer Solutions, Inc.
|
||||||
|
|
||||||
Name : Authentication_API
|
Name : Authentication_API
|
||||||
|
|
||||||
Description : API logic for the Authentication resource.
|
Description : API logic for the Authentication resource.
|
||||||
|
|
||||||
Notes : All web APIs should include the API_SETUP insert. This will provide several useful variables:
|
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.)
|
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).
|
APIURL - The URL for the API entry point (e.g., api.mysite.com/v1).
|
||||||
FullEndpointURL - The URL submitted by the client, including query params.
|
FullEndpointURL - The URL submitted by the client, including query params.
|
||||||
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
||||||
EndpointSegment - The URL endpoint segment.
|
EndpointSegment - The URL endpoint segment.
|
||||||
ParentURL - The URL path preceeding the current endpoint.
|
ParentURL - The URL path preceeding the current endpoint.
|
||||||
CurrentAPI - The name of this stored procedure.
|
CurrentAPI - The name of this stored procedure.
|
||||||
|
|
||||||
Parameters :
|
Parameters :
|
||||||
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
||||||
- APIPattern must follow this structure Authentication[.ID.[<Property>]]
|
- APIPattern must follow this structure Authentication[.ID.[<Property>]]
|
||||||
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
||||||
Examples:
|
Examples:
|
||||||
- Authentication.POST
|
- Authentication.POST
|
||||||
- Authentication.ID.PUT
|
- Authentication.ID.PUT
|
||||||
- Authentication.ID.firstName.GET
|
- Authentication.ID.firstName.GET
|
||||||
Response [out] -- Response to be sent back to the Controller (HTTP_MCP) or requesting procedure. Web API
|
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
|
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
|
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.
|
value is only helpful if the developers want to use it for debug purposes.
|
||||||
|
|
||||||
History : (Date, Initials, Notes)
|
History : (Date, Initials, Notes)
|
||||||
07/17/24 djs Original programmer.
|
07/17/24 djs Original programmer.
|
||||||
|
|
||||||
***********************************************************************************************************************/
|
***********************************************************************************************************************/
|
||||||
|
|
||||||
#pragma precomp SRP_PreCompiler
|
#pragma precomp SRP_PreCompiler
|
||||||
|
|
||||||
$insert APP_INSERTS
|
$insert APP_INSERTS
|
||||||
$insert API_SETUP
|
$insert API_SETUP
|
||||||
$insert HTTP_INSERTS
|
$insert HTTP_INSERTS
|
||||||
$insert LSL_USERS_EQUATES
|
$insert LSL_USERS_EQUATES
|
||||||
|
|
||||||
Equ USERNAME$ To 1
|
Equ USERNAME$ To 1
|
||||||
Equ GROUP$ To 2
|
Equ GROUP$ To 2
|
||||||
Equ PASSWORD$ To 3
|
Equ PASSWORD$ To 3
|
||||||
Equ CONTEXT$ To 4
|
Equ CONTEXT$ To 4
|
||||||
|
|
||||||
Declare function Database_Services, MemberOf
|
Declare function Database_Services, MemberOf
|
||||||
|
|
||||||
GoToAPI else
|
GoToAPI else
|
||||||
// The specific resource endpoint doesn't have a API handler yet.
|
// 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.')
|
HTTP_Services('SetResponseStatus', 204, 'This is a valid endpoint but a web API handler has not yet been created.')
|
||||||
end
|
end
|
||||||
|
|
||||||
Return Response OR ''
|
Return Response OR ''
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Endpoint Handlers
|
// Endpoint Handlers
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
API authentication.POST
|
API authentication.POST
|
||||||
|
|
||||||
Body = HTTP_Services('GetHTTPPostString')
|
Body = HTTP_Services('GetHTTPPostString')
|
||||||
If Body NE '' then
|
If Body NE '' then
|
||||||
// The POST string will have been encoded so use percent (URL) decoding
|
// The POST string will have been encoded so use percent (URL) decoding
|
||||||
AuthJson = HTTP_Services('DecodePercentString', Body)
|
AuthJson = HTTP_Services('DecodePercentString', Body)
|
||||||
hAuthJson = ''
|
hAuthJson = ''
|
||||||
ParseResponse = SRP_JSON(hAuthJson, 'PARSE', AuthJson)
|
ParseResponse = SRP_JSON(hAuthJson, 'PARSE', AuthJson)
|
||||||
If (ParseResponse EQ '') then
|
If (ParseResponse EQ '') then
|
||||||
Username = SRP_JSON(hAuthJson, 'GetValue', 'Username')
|
Username = SRP_JSON(hAuthJson, 'GetValue', 'Username')
|
||||||
Password = SRP_JSON(hAuthJson, 'GetValue', 'Password')
|
Password = SRP_JSON(hAuthJson, 'GetValue', 'Password')
|
||||||
Groups = ''
|
Groups = ''
|
||||||
hGroups = SRP_JSON(hAuthJson, 'get', 'Groups')
|
hGroups = SRP_JSON(hAuthJson, 'get', 'Groups')
|
||||||
If hGroups then
|
If hGroups then
|
||||||
ElementHandles = SRP_JSON(hGroups, 'GetElements', @VM)
|
ElementHandles = SRP_JSON(hGroups, 'GetElements', @VM)
|
||||||
If ElementHandles NE '' then
|
If ElementHandles NE '' then
|
||||||
For each ElementHandle in ElementHandles using @VM
|
For each ElementHandle in ElementHandles using @VM
|
||||||
Groups<0, -1> = SRP_JSON(ElementHandle, 'GetValue')
|
Groups<0, -1> = SRP_JSON(ElementHandle, 'GetValue')
|
||||||
SRP_JSON(ElementHandle, 'Release')
|
SRP_JSON(ElementHandle, 'Release')
|
||||||
Next ElementHandle
|
Next ElementHandle
|
||||||
end
|
end
|
||||||
SRP_JSON(hGroups, 'Release')
|
SRP_JSON(hGroups, 'Release')
|
||||||
end
|
end
|
||||||
SRP_JSON(hAuthJson, 'Release')
|
SRP_JSON(hAuthJson, 'Release')
|
||||||
// Validate Credentials
|
// Validate Credentials
|
||||||
UserRec = Database_Services('ReadDataRow', 'LSL_USERS', Username)
|
UserRec = Database_Services('ReadDataRow', 'LSL_USERS', Username)
|
||||||
If Error_Services('NoError') then
|
If Error_Services('NoError') then
|
||||||
Credentials = ''
|
Credentials = ''
|
||||||
Credentials<USERNAME$> = Username
|
Credentials<USERNAME$> = Username
|
||||||
Credentials<PASSWORD$> = UserRec<LSL_USERS_PASSWORD$>
|
Credentials<PASSWORD$> = UserRec<LSL_USERS_PASSWORD$>
|
||||||
Credentials<GROUP$> = UserRec<LSL_USERS_GROUPS$>
|
Credentials<GROUP$> = UserRec<LSL_USERS_GROUPS$>
|
||||||
|
|
||||||
Member = False$
|
Member = False$
|
||||||
Group = ''
|
Group = ''
|
||||||
If Groups NE '' then
|
If Groups NE '' then
|
||||||
For each Group in Groups using @VM
|
For each Group in Groups using @VM
|
||||||
Member = MemberOf(Credentials<USERNAME$>, Group)
|
Member = MemberOf(Credentials<USERNAME$>, Group)
|
||||||
Until Member EQ True$
|
Until Member EQ True$
|
||||||
Next Group
|
Next Group
|
||||||
end else
|
end else
|
||||||
Member = True$
|
Member = True$
|
||||||
end
|
end
|
||||||
|
|
||||||
Begin Case
|
Begin Case
|
||||||
|
|
||||||
Case (Password EQ Credentials<PASSWORD$>) AND (Member EQ True$)
|
Case (Password EQ Credentials<PASSWORD$>) AND (Member EQ True$)
|
||||||
// Return 200, authentication successful
|
// Return 200, authentication successful
|
||||||
StatusCode = 200
|
StatusCode = 200
|
||||||
Message = 'Authentication successful'
|
Message = 'Authentication successful'
|
||||||
HTTP_Services('SetResponseStatus', 200, Message)
|
HTTP_Services('SetResponseStatus', 200, Message)
|
||||||
Case (Password EQ Credentials<PASSWORD$>) AND (Member EQ False$)
|
Case (Password EQ Credentials<PASSWORD$>) AND (Member EQ False$)
|
||||||
// Return 401, not a member of required groups
|
// Return 401, not a member of required groups
|
||||||
NumGroups = DCount(Groups, @VM)
|
NumGroups = DCount(Groups, @VM)
|
||||||
If NumGroups GT 1 then
|
If NumGroups GT 1 then
|
||||||
Swap @VM with ' or ' in Groups
|
Swap @VM with ' or ' in Groups
|
||||||
Message = 'User is not a member of the ' : Groups : ' groups.'
|
Message = 'User is not a member of the ' : Groups : ' groups.'
|
||||||
end else
|
end else
|
||||||
Message = 'User is not a member of the ' : Group : ' group.'
|
Message = 'User is not a member of the ' : Group : ' group.'
|
||||||
end
|
end
|
||||||
HTTP_Services('SetResponseStatus', 401, 'Authentication failed. ':Message)
|
HTTP_Services('SetResponseStatus', 401, 'Authentication failed. ':Message)
|
||||||
|
|
||||||
Case Password NE Credentials<PASSWORD$>
|
Case Password NE Credentials<PASSWORD$>
|
||||||
// Return 401, unable to validate password
|
// Return 401, unable to validate password
|
||||||
Message = 'Unable to validate username. Please re-enter.'
|
Message = 'Unable to validate username. Please re-enter.'
|
||||||
HTTP_Services('SetResponseStatus', 401, 'Authentication failed. ':Message)
|
HTTP_Services('SetResponseStatus', 401, 'Authentication failed. ':Message)
|
||||||
Case Otherwise$
|
Case Otherwise$
|
||||||
HTTP_Services('SetResponseStatus', 500, 'Error in the ' : CurrentAPI : ' API. Unhandled case.')
|
HTTP_Services('SetResponseStatus', 500, 'Error in the ' : CurrentAPI : ' API. Unhandled case.')
|
||||||
End Case
|
End Case
|
||||||
end else
|
end else
|
||||||
// Error reading user record
|
// Error reading user record
|
||||||
ErrorMsg = Error_Services('GetMessage')
|
ErrorMsg = Error_Services('GetMessage')
|
||||||
HTTP_Services('SetResponseStatus', 500, 'Error in the ' : CurrentAPI : ' API. Message: ': ErrorMsg)
|
HTTP_Services('SetResponseStatus', 500, 'Error in the ' : CurrentAPI : ' API. Message: ': ErrorMsg)
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
HTTP_Services('SetResponseStatus', 400, 'Error in the ' : CurrentAPI : ' API. Error parsing JSON.')
|
HTTP_Services('SetResponseStatus', 400, 'Error in the ' : CurrentAPI : ' API. Error parsing JSON.')
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
HTTP_Services('SetResponseStatus', 400, 'Error in the ' : CurrentAPI : ' API. Empty request.')
|
HTTP_Services('SetResponseStatus', 400, 'Error in the ' : CurrentAPI : ' API. Empty request.')
|
||||||
end
|
end
|
||||||
|
|
||||||
end api
|
end api
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Internal GoSubs
|
// Internal GoSubs
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@ -1,139 +1,138 @@
|
|||||||
Function Changelog_API(@API)
|
Function Changelog_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
|
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.
|
permission from SRP Computer Solutions, Inc.
|
||||||
|
|
||||||
Name : Changelog_API
|
Name : Changelog_API
|
||||||
|
|
||||||
Description : API logic for the Changelog resource.
|
Description : API logic for the Changelog resource.
|
||||||
|
|
||||||
Notes : All web APIs should include the API_SETUP insert. This will provide several useful variables:
|
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.)
|
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).
|
APIURL - The URL for the API entry point (e.g., api.mysite.com/v1).
|
||||||
FullEndpointURL - The URL submitted by the client, including query params.
|
FullEndpointURL - The URL submitted by the client, including query params.
|
||||||
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
||||||
EndpointSegment - The URL endpoint segment.
|
EndpointSegment - The URL endpoint segment.
|
||||||
ParentURL - The URL path preceeding the current endpoint.
|
ParentURL - The URL path preceeding the current endpoint.
|
||||||
CurrentAPI - The name of this stored procedure.
|
CurrentAPI - The name of this stored procedure.
|
||||||
|
|
||||||
Parameters :
|
Parameters :
|
||||||
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
||||||
- APIPattern must follow this structure Changelog[.ID.[<Property>]]
|
- APIPattern must follow this structure Changelog[.ID.[<Property>]]
|
||||||
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
||||||
Examples:
|
Examples:
|
||||||
- Changelog.POST
|
- Changelog.POST
|
||||||
- Changelog.ID.PUT
|
- Changelog.ID.PUT
|
||||||
- Changelog.ID.firstName.GET
|
- Changelog.ID.firstName.GET
|
||||||
Response [out] -- Response to be sent back to the Controller (HTTP_MCP) or requesting procedure. Web API
|
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
|
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
|
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.
|
value is only helpful if the developers want to use it for debug purposes.
|
||||||
|
|
||||||
History : (Date, Initials, Notes)
|
History : (Date, Initials, Notes)
|
||||||
07/24/24 xxx Original programmer.
|
07/24/24 xxx Original programmer.
|
||||||
|
|
||||||
***********************************************************************************************************************/
|
***********************************************************************************************************************/
|
||||||
|
|
||||||
#pragma precomp SRP_PreCompiler
|
#pragma precomp SRP_PreCompiler
|
||||||
|
|
||||||
Declare function Datetime, SRP_Datetime, Change_Log_Services, Environment_Services, Logging_Services
|
Declare function Datetime, SRP_Datetime, Change_Log_Services, Environment_Services, Logging_Services
|
||||||
Declare subroutine Logging_Services
|
Declare subroutine Logging_Services
|
||||||
|
|
||||||
$insert APP_INSERTS
|
$insert APP_INSERTS
|
||||||
$insert API_SETUP
|
$insert API_SETUP
|
||||||
$insert HTTP_INSERTS
|
$insert HTTP_INSERTS
|
||||||
EQU Comma$ to ','
|
EQU Comma$ to ','
|
||||||
|
|
||||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\API\Admin\ChangeLog'
|
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\API\Admin\ChangeLog'
|
||||||
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] : ' ChangeLogArchiveService.csv'
|
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' ChangeLogArchiveService.csv'
|
||||||
Headers = 'Logging DTM' : @FM : 'From IP Address' : @FM : 'Message'
|
Headers = 'Logging DTM' : @FM : 'From IP Address' : @FM : 'Message'
|
||||||
objLogChangeLogAPI = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
|
objLogChangeLogAPI = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
|
||||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||||
RequesterIPAddr = HTTP_Services('GetHTTPRemoteAddr')
|
RequesterIPAddr = HTTP_Services('GetHTTPRemoteAddr')
|
||||||
|
|
||||||
GoToAPI else
|
GoToAPI else
|
||||||
// The specific resource endpoint doesn't have a API handler yet.
|
// The specific resource endpoint doesn't have a API handler yet.
|
||||||
HTTP_Services('SetResponseStatus', 200, 'This is a valid endpoint but a web API handler has not yet been created.')
|
HTTP_Services('SetResponseStatus', 200, 'This is a valid endpoint but a web API handler has not yet been created.')
|
||||||
end
|
end
|
||||||
|
|
||||||
Return Response OR ''
|
Return Response OR ''
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Endpoint Handlers
|
// Endpoint Handlers
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
API changelog.HEAD
|
API changelog.HEAD
|
||||||
API changelog.GET
|
API changelog.GET
|
||||||
StartDtm = Http_Services('GetQueryField', 'FromDatetime')
|
StartDtm = Http_Services('GetQueryField', 'FromDatetime')
|
||||||
ToDtm = Http_Services('GetQueryField', 'ToDatetime')
|
ToDtm = Http_Services('GetQueryField', 'ToDatetime')
|
||||||
|
|
||||||
StartDtm = IConv(StartDtm, 'DT')
|
StartDtm = IConv(StartDtm, 'DT')
|
||||||
ToDtm = IConv(ToDtm, 'DT')
|
ToDtm = IConv(ToDtm, 'DT')
|
||||||
|
|
||||||
If StartDtm EQ '' then
|
If StartDtm EQ '' then
|
||||||
StartDtm = SRP_Datetime('AddDays', Datetime(), -60)
|
StartDtm = SRP_Datetime('AddDays', Datetime(), -60)
|
||||||
end
|
end
|
||||||
If ToDtm EQ '' then
|
If ToDtm EQ '' then
|
||||||
ToDtm = Datetime()
|
ToDtm = Datetime()
|
||||||
end
|
end
|
||||||
|
|
||||||
EntityName = Http_Services('GetQueryField', 'EntityName')
|
EntityName = Http_Services('GetQueryField', 'EntityName')
|
||||||
UserId = Http_Services('GetQueryField', 'UserID')
|
UserId = Http_Services('GetQueryField', 'UserID')
|
||||||
|
|
||||||
ChangeLogIDs = Change_Log_Services('GetChangeLogRecIDs', EntityName, StartDtm, ToDtm, UserId)
|
ChangeLogIDs = Change_Log_Services('GetChangeLogRecIDs', EntityName, StartDtm, ToDtm, UserId)
|
||||||
If Error_Services('NoError') then
|
If Error_Services('NoError') then
|
||||||
GoSub CreateHALCollection
|
GoSub CreateHALCollection
|
||||||
end else
|
end else
|
||||||
ErrorMsg = Error_Services('GetMessage')
|
ErrorMsg = Error_Services('GetMessage')
|
||||||
LogData = ''
|
LogData = ''
|
||||||
LogData<1> = LoggingDTM
|
LogData<1> = LoggingDTM
|
||||||
LogData<2> = RequesterIPAddr
|
LogData<2> = RequesterIPAddr
|
||||||
LogData<3> = ErrorMsg
|
LogData<3> = ErrorMsg
|
||||||
Logging_Services('AppendLog', objLogChangeLogAPI, LogData, @RM, @FM)
|
Logging_Services('AppendLog', objLogChangeLogAPI, LogData, @RM, @FM)
|
||||||
HTTP_Services('SetResponseStatus', 500, 'Error Getting change log records from change_log table.')
|
HTTP_Services('SetResponseStatus', 500, 'Error Getting change log records from change_log table.')
|
||||||
end
|
end
|
||||||
|
|
||||||
end api
|
end api
|
||||||
|
|
||||||
CreateHALCollection:
|
CreateHALCollection:
|
||||||
hJsonCollection = ''
|
hJsonCollection = ''
|
||||||
hChangeLogArray = ''
|
hChangeLogArray = ''
|
||||||
hChangeLogObj = ''
|
hChangeLogObj = ''
|
||||||
hChangeLog = ''
|
hChangeLog = ''
|
||||||
hChangeLogJson = ''
|
hChangeLogJson = ''
|
||||||
Abort = False$
|
Abort = False$
|
||||||
If SRP_JSON(hJSONCollection, 'New', 'Object') then
|
If SRP_JSON(hJSONCollection, 'New', 'Object') then
|
||||||
If SRP_JSON(hChangeLogArray, 'New', 'Array') then
|
If SRP_JSON(hChangeLogArray, 'New', 'Array') then
|
||||||
For each ChangeLogID in ChangeLogIDs using @VM setting fPos
|
For each ChangeLogID in ChangeLogIDs using @VM setting fPos
|
||||||
//rdsJSON = Rds_Services('ConvertRecordToJSON', rds, '' ,FullEndpointURL:'/':rds)
|
//rdsJSON = Rds_Services('ConvertRecordToJSON', rds, '' ,FullEndpointURL:'/':rds)
|
||||||
ChangeLogJson = Change_Log_Services('ConvertRecordToJSON', ChangeLogID)
|
ChangeLogJson = Change_Log_Services('ConvertRecordToJSON', ChangeLogID)
|
||||||
If Error_Services('NoError') then
|
If Error_Services('NoError') then
|
||||||
If (SRP_JSON(hChangeLog, 'Parse', ChangeLogJson) EQ '') then
|
If (SRP_JSON(hChangeLog, 'Parse', ChangeLogJson) EQ '') then
|
||||||
SRP_JSON(hChangeLogArray, 'Add', hChangeLog)
|
SRP_JSON(hChangeLogArray, 'Add', hChangeLog)
|
||||||
SRP_JSON(hChangeLog, 'Release')
|
SRP_JSON(hChangeLog, 'Release')
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
Abort = True$
|
Abort = True$
|
||||||
end
|
end
|
||||||
Until Abort
|
Until Abort
|
||||||
Next rds
|
Next rds
|
||||||
If Abort EQ False$ then
|
If Abort EQ False$ then
|
||||||
SRP_JSON(hJSONCollection, 'Set', 'ChangeLogRecords', hChangeLogArray)
|
SRP_JSON(hJSONCollection, 'Set', 'ChangeLogRecords', hChangeLogArray)
|
||||||
end
|
end
|
||||||
SRP_JSON(hChangeLogArray, 'Release')
|
SRP_JSON(hChangeLogArray, 'Release')
|
||||||
end
|
end
|
||||||
JSONCollection = SRP_JSON(hJSONCollection, 'Stringify', 'Styled')
|
JSONCollection = SRP_JSON(hJSONCollection, 'Stringify', 'Styled')
|
||||||
SRP_JSON(hJSONCollection, 'Release')
|
SRP_JSON(hJSONCollection, 'Release')
|
||||||
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
HTTP_Services('SetResponseBody', JSONCollection, False$, 'application/hal+json')
|
HTTP_Services('SetResponseBody', JSONCollection, False$, 'application/hal+json')
|
||||||
HTTP_Services('SetResponseStatus', 200)
|
HTTP_Services('SetResponseStatus', 200)
|
||||||
end
|
end
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
258
LSL2/STPROC/CLEAN_API.txt
Normal file
258
LSL2/STPROC/CLEAN_API.txt
Normal file
@ -0,0 +1,258 @@
|
|||||||
|
Function Clean_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 : Clean_API
|
||||||
|
|
||||||
|
Description : API logic for the Clean 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 Clean[.ID.[<Property>]]
|
||||||
|
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
||||||
|
Examples:
|
||||||
|
- Clean.POST
|
||||||
|
- Clean.ID.PUT
|
||||||
|
- Clean.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)
|
||||||
|
06/18/25 xxx Original programmer.
|
||||||
|
|
||||||
|
***********************************************************************************************************************/
|
||||||
|
|
||||||
|
#pragma precomp SRP_PreCompiler
|
||||||
|
|
||||||
|
Declare function OI_Wizard_Services, Lot_Operation_Services, Database_Services, Lot_Services, Clean_Services
|
||||||
|
Declare subroutine Clean_Services, Lot_Services
|
||||||
|
|
||||||
|
$insert APP_INSERTS
|
||||||
|
$insert API_SETUP
|
||||||
|
$insert HTTP_INSERTS
|
||||||
|
$insert OI_WIZARD_EQUATES
|
||||||
|
$insert LOT_OPERATION_EQUATES
|
||||||
|
|
||||||
|
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 clean.ID.HEAD
|
||||||
|
API clean.ID.GET
|
||||||
|
|
||||||
|
ErrorMessage = ''
|
||||||
|
ResponseCode = ''
|
||||||
|
ResponseMessage = ''
|
||||||
|
Body = ''
|
||||||
|
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
|
||||||
|
UserId = Xlate('OI_WIZARD', OIWizardID, OI_WIZARD.EMPLOYEE_ID$, 'X')
|
||||||
|
StatusCode = ''
|
||||||
|
CleanRecId = EndpointSegment
|
||||||
|
CleanRecJson = Clean_Services('ConvertCleanRecToJson', CleanRecId)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
Http_Services('SetResponseBody', CleanRecJson, False$, 'application/hal+json')
|
||||||
|
ResponseCode = 200
|
||||||
|
end else
|
||||||
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
|
ResponseCode = 500
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Invalid session. Reauthentication required.'
|
||||||
|
ResponseCode = 401
|
||||||
|
end
|
||||||
|
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
|
HTTP_Services('SetResponseStatus', ResponseCode, ErrorMessage)
|
||||||
|
|
||||||
|
end api
|
||||||
|
|
||||||
|
|
||||||
|
API clean.ID.markcleanrecordcomplete.POST
|
||||||
|
|
||||||
|
ErrorMessage = ''
|
||||||
|
ResponseCode = ''
|
||||||
|
ResponseMessage = ''
|
||||||
|
Body = ''
|
||||||
|
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
|
||||||
|
UserId = Xlate('OI_WIZARD', OIWizardID, OI_WIZARD.EMPLOYEE_ID$, 'X')
|
||||||
|
StatusCode = ''
|
||||||
|
Body = HTTP_Services('GetHTTPPostString', True$)
|
||||||
|
// The POST string will have been encoded so use percent (URL) decoding.
|
||||||
|
DecodedJSON = HTTP_Services('DecodePercentString', Body)
|
||||||
|
If SRP_JSON(objBody, 'Parse', Body) EQ '' then
|
||||||
|
CleanRecId = ParentSegment
|
||||||
|
LotOperationId = SRP_JSON(objBody, 'GetValue', 'LotOperationId')
|
||||||
|
CleanTool = SRP_JSON(objBody, 'GetValue', 'CleanTool')
|
||||||
|
CleanRecipe = SRP_JSON(objBody, 'GetValue', 'CleanRecipe')
|
||||||
|
SRP_JSON(objBody, 'Release')
|
||||||
|
Clean_Services('MarkCleanRecComplete', CleanRecId, CleanRecipe, CleanTool, UserId)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
CleanRecJson = Clean_Services('ConvertCleanRecToJson', CleanRecId)
|
||||||
|
HTTP_Services('SetResponseBody', CleanRecJson, False$, 'application/hal+json')
|
||||||
|
ResponseCode = 200
|
||||||
|
end else
|
||||||
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
|
ResponseCode = 500
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Invalid session. Reauthentication required.'
|
||||||
|
ResponseCode = 401
|
||||||
|
end
|
||||||
|
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
|
HTTP_Services('SetResponseStatus', ResponseCode, ErrorMessage)
|
||||||
|
|
||||||
|
end api
|
||||||
|
|
||||||
|
|
||||||
|
API clean.createcleanrecord.POST
|
||||||
|
|
||||||
|
ErrorMessage = ''
|
||||||
|
ResponseCode = ''
|
||||||
|
ResponseMessage = ''
|
||||||
|
Body = ''
|
||||||
|
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
|
||||||
|
UserId = Xlate('OI_WIZARD', OIWizardID, OI_WIZARD.EMPLOYEE_ID$, 'X')
|
||||||
|
StatusCode = ''
|
||||||
|
Body = HTTP_Services('GetHTTPPostString', True$)
|
||||||
|
// The POST string will have been encoded so use percent (URL) decoding.
|
||||||
|
DecodedJSON = HTTP_Services('DecodePercentString', Body)
|
||||||
|
If SRP_JSON(objBody, 'Parse', Body) EQ '' then
|
||||||
|
LotId = SRP_JSON(objBody, 'GetValue', 'LotId')
|
||||||
|
LotOperationId = SRP_JSON(objBody, 'GetValue', 'LotOperationId')
|
||||||
|
SRP_JSON(objBody, 'Release')
|
||||||
|
end
|
||||||
|
CleanRecId = Clean_Services('CreateNewCleanRecord', LotId, LotOperationId, UserId)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
CleanRecJson = Clean_Services('ConvertCleanRecToJson', CleanRecId)
|
||||||
|
HTTP_Services('SetResponseBody', CleanRecJson, False$, 'application/hal+json')
|
||||||
|
ResponseCode = 200
|
||||||
|
end else
|
||||||
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
|
ResponseCode = 500
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Invalid session. Reauthentication required.'
|
||||||
|
ResponseCode = 401
|
||||||
|
end
|
||||||
|
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
|
HTTP_Services('SetResponseStatus', ResponseCode, ErrorMessage)
|
||||||
|
|
||||||
|
end api
|
||||||
|
|
||||||
|
|
||||||
|
API clean.getnewcleanoperationparams.HEAD
|
||||||
|
API clean.getnewcleanoperationparams.GET
|
||||||
|
|
||||||
|
JSONCollection = ''
|
||||||
|
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
|
||||||
|
Body = HTTP_Services('GetHTTPGetString')
|
||||||
|
If Body NE '' then
|
||||||
|
RequestJson = HTTP_Services('DecodePercentString', Body)
|
||||||
|
LotId = Http_Services('GetQueryField', 'LotId')
|
||||||
|
objJSONResponse = ''
|
||||||
|
If SRP_Json(objJSONResponse, 'New', 'Object') then
|
||||||
|
//Available Tools
|
||||||
|
If SRP_Json(objCleanTools, 'New', 'Array') then
|
||||||
|
CleanTools = Clean_Services('GetCleanToolOptions')
|
||||||
|
for each CleanTool in CleanTools using @FM
|
||||||
|
SRP_Json(objCleanTools, 'AddValue', CleanTool, 'String')
|
||||||
|
Next CleanTool
|
||||||
|
SRP_Json(objJsonResponse, 'Set', 'CleanToolOptions', objCleanTools)
|
||||||
|
SRP_Json(objCleanTools, 'Release')
|
||||||
|
end
|
||||||
|
//Available Recipes
|
||||||
|
If SRP_Json(objCleanRecipes, 'New', 'Array') then
|
||||||
|
CleanRecipes = Clean_Services('GetCleanRecipeOptions')
|
||||||
|
for each Recipe in CleanRecipes using @VM
|
||||||
|
SRP_Json(objCleanRecipes, 'AddValue', Recipe, 'String')
|
||||||
|
Next Recipe
|
||||||
|
SRP_Json(objJsonResponse, 'Set', 'CleanRecipeOptions', objCleanRecipes)
|
||||||
|
SRP_Json(objCleanRecipes, 'Release')
|
||||||
|
end
|
||||||
|
JsonResponse = SRP_Json(objJsonResponse, 'Stringify', 'Styled')
|
||||||
|
SRP_Json(objJsonResponse, 'Release')
|
||||||
|
end else
|
||||||
|
Error_Services('Add', 'Error when creating JSON response.')
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
Error_Services('Add', 'No body was sent with the request.')
|
||||||
|
end
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
HTTP_Services('SetResponseStatus', 201, 'Success')
|
||||||
|
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
|
HTTP_Services('SetResponseBody', JsonResponse, False$, 'application/hal+json')
|
||||||
|
end else
|
||||||
|
HTTP_Services('SetResponseStatus', 400, Error_Services('GetMessage'))
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
HTTP_Services('SetResponseStatus', 401, 'Invalid session. Reauthentication required.')
|
||||||
|
end
|
||||||
|
|
||||||
|
end api
|
217
LSL2/STPROC/CLEAN_SERVICES.txt
Normal file
217
LSL2/STPROC/CLEAN_SERVICES.txt
Normal file
@ -0,0 +1,217 @@
|
|||||||
|
Compile function Clean_Services(@Service, @Params)
|
||||||
|
#pragma precomp SRP_PreCompiler
|
||||||
|
|
||||||
|
Declare Function Database_Services, Error_Services, Logging_Services, Datetime
|
||||||
|
Declare Function RTI_CreateGUID, Tool_Services, SRP_Json, Date_Services
|
||||||
|
Declare Subroutine Database_Services, Error_Services, Logging_Services, SRP_Json, Lot_Event_Services
|
||||||
|
|
||||||
|
$insert LOGICAL
|
||||||
|
$Insert CLEAN_EQUATES
|
||||||
|
$Insert LOT_EQUATES
|
||||||
|
$Insert LOT_OPERATION_EQUATES
|
||||||
|
$Insert TOOL_EQUATES
|
||||||
|
$Insert TOOL_CLASS_EQUATES
|
||||||
|
|
||||||
|
Options Stage = 'LWI',
|
||||||
|
|
||||||
|
GoToService
|
||||||
|
|
||||||
|
Return Response or ""
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// SERVICES
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Service CreateNewCleanRecord(LotId, LotOperationId, UserId)
|
||||||
|
|
||||||
|
ErrorMessage = ''
|
||||||
|
CleanRecId = ''
|
||||||
|
If RowExists('LOT', LotId) then
|
||||||
|
//ToDo check Lot Operation Exists
|
||||||
|
//Checks complete, create the CLEAN record
|
||||||
|
TransDtm = Datetime()
|
||||||
|
CleanRecId = RTI_CreateGUID()
|
||||||
|
CleanRec = ''
|
||||||
|
CleanRec<CLEAN_LOT_ID$> = LotId
|
||||||
|
CleanRec<CLEAN_LOT_OPERATION_ID$> = LotOperationId
|
||||||
|
CleanRec<CLEAN_CLEAN_START_DTM$> = TransDtm
|
||||||
|
CleanRec<CLEAN_CLEAN_START_USER_ID$> = UserId
|
||||||
|
Database_Services('WriteDataRow', 'CLEAN', CleanRecId, CleanRec)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
If LotOperationId NE '' then
|
||||||
|
LotOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', LotOperationId, True$, 0, False$)
|
||||||
|
LotOperationRec<LOT_OPERATION_CLEAN_ID$> = CleanRecId
|
||||||
|
Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationId, LotOperationRec)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
Lot_Event_Services('CreateLotEvent', LotId, TransDtm, 'CLEAN_START', 'Created clean record.', '', UserId)
|
||||||
|
end else
|
||||||
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
//Todo add error message
|
||||||
|
end
|
||||||
|
|
||||||
|
If ErrorMessage EQ '' then
|
||||||
|
Response = CleanRecId
|
||||||
|
end else
|
||||||
|
// Todo: Add logging
|
||||||
|
ErrorMessage = 'Error Creating a new clean record: ' : ErrorMessage
|
||||||
|
Error_Services('Add', ErrorMessage)
|
||||||
|
end
|
||||||
|
|
||||||
|
End Service
|
||||||
|
|
||||||
|
Service ConvertCleanRecToJson(CleanRecId)
|
||||||
|
|
||||||
|
ErrorMessage = ''
|
||||||
|
CleanRecJson = ''
|
||||||
|
|
||||||
|
If RowExists('CLEAN', CleanRecId) then
|
||||||
|
CleanRec = Database_Services('ReadDataRow', 'CLEAN', CleanRecId, True$, 0, False$)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
objJson = ''
|
||||||
|
If SRP_Json(objJson, 'New', 'Object') then
|
||||||
|
SRP_Json(objJson, 'SetValue', 'CleanId', CleanRecId, 'String')
|
||||||
|
SRP_Json(objJson, 'SetValue', 'LotId', CleanRec<CLEAN_LOT_ID$>, 'String')
|
||||||
|
LegacyLotId = Database_Services('ReadDataColumn', 'LOT', CleanRec<CLEAN_LOT_ID$>, LOT_LEGACY_LOT_ID$)
|
||||||
|
SRP_Json(objJson, 'SetValue', 'LegacyLotId', LegacyLotId, 'String')
|
||||||
|
SRP_Json(objJson, 'SetValue', 'Recipe', CleanRec<CLEAN_RECIPE$>, 'String')
|
||||||
|
SRP_Json(objJson, 'SetValue', 'Tool', CleanRec<CLEAN_TOOL$>, 'String')
|
||||||
|
SRP_Json(objJson, 'SetValue', 'StartUser', CleanRec<CLEAN_CLEAN_START_USER_ID$>, 'String')
|
||||||
|
StartDtm = Date_Services('ConvertDateTimeToISO8601', CleanRec<CLEAN_CLEAN_START_DTM$>)
|
||||||
|
if StartDtm NE '' then
|
||||||
|
SRP_Json(objJson, 'SetValue', 'StartDtm', StartDtm)
|
||||||
|
end
|
||||||
|
SRP_Json(objJson, 'SetValue', 'StopUser', CleanRec<CLEAN_CLEAN_STOP_USER_ID$>, 'String')
|
||||||
|
StopDtm = Date_Services('ConvertDateTimeToISO8601', CleanRec<CLEAN_CLEAN_STOP_DTM$>)
|
||||||
|
if StopDtm NE '' then
|
||||||
|
SRP_Json(objJson, 'SetValue', 'StopDtm', StopDtm, 'String')
|
||||||
|
end
|
||||||
|
SRP_Json(objJson, 'SetValue', 'LotOperationId', CleanRec<CLEAN_LOT_OPERATION_ID$>, 'String')
|
||||||
|
CleanRecJson = SRP_Json(objJson, 'Stringify', 'Styled')
|
||||||
|
SRP_Json(objJson, 'Release')
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Error creating clean record json'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Clean record not found.'
|
||||||
|
end
|
||||||
|
|
||||||
|
If ErrorMessage EQ '' then
|
||||||
|
Response = CleanRecJson
|
||||||
|
end else
|
||||||
|
Error_Services('Add', 'Error getting clean record : ' : ErrorMessage)
|
||||||
|
end
|
||||||
|
|
||||||
|
end service
|
||||||
|
|
||||||
|
Service MarkCleanRecComplete(CleanRecId, CleanRecipe, CleanTool, CleanUser)
|
||||||
|
|
||||||
|
ErrorMessage = ''
|
||||||
|
TransDtm = Datetime()
|
||||||
|
|
||||||
|
If RowExists('CLEAN', CleanRecId) then
|
||||||
|
CleanRec = Database_Services('ReadDataRow', 'CLEAN', CleanRecId, True$, 0, False$)
|
||||||
|
If CleanRec<CLEAN_CLEAN_START_DTM$> NE '' then
|
||||||
|
If CleanRec<CLEAN_TOOL$> EQ '' AND CleanRec<CLEAN_RECIPE$> EQ '' then
|
||||||
|
if RowExists('LSL_USERS', CleanUser) then
|
||||||
|
If CleanRec<CLEAN_COMPLETE_DTM$> EQ '' then
|
||||||
|
CleanRec<CLEAN_TOOL$> = CleanTool
|
||||||
|
CleanRec<CLEAN_RECIPE$> = CleanRecipe
|
||||||
|
CleanRec<CLEAN_CLEAN_STOP_USER_ID$> = CleanUser
|
||||||
|
CleanRec<CLEAN_CLEAN_STOP_DTM$> = TransDtm
|
||||||
|
Database_Services('WriteDataRow', 'CLEAN', CleanRecId, CleanRec)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
LotId = CleanRec<CLEAN_LOT_ID$>
|
||||||
|
Lot_Event_Services('CreateLotEvent', LotId, TransDtm, 'CLEAN', 'Clean completed', CleanTool, CleanUser)
|
||||||
|
end else
|
||||||
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Clean is already signed off.'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Clean tool or clean recipe is missing.'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Clean has already been logged.'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Clean has not been started.'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Clean record not found.'
|
||||||
|
end
|
||||||
|
|
||||||
|
If ErrorMessage NE '' then
|
||||||
|
Error_Services('Add', ErrorMessage)
|
||||||
|
end
|
||||||
|
|
||||||
|
end service
|
||||||
|
|
||||||
|
Service ValidateCleanRecord(CleanRecId)
|
||||||
|
|
||||||
|
//ErrorMessage = ''
|
||||||
|
CleanRecValid = False$
|
||||||
|
|
||||||
|
* If CleanRecId NE '' then
|
||||||
|
* If RowExists('CLEAN', CleanRecId) then
|
||||||
|
* CleanRec = Database_Services('ReadDataRow', 'CLEAN', CleanRecId, True$, 0, False$)
|
||||||
|
* SpecTool = CleanRec<CLEAN_TOOL$>
|
||||||
|
* ToolUsed = CleanRec<CLEAN_RECIPE$>
|
||||||
|
* If ToolUsed EQ SpecTool AND ToolUsed NE '' then
|
||||||
|
* SpecRecipe = CleanRec<CLEAN_SPEC_RECIPE$>
|
||||||
|
* RecipeUsed = CleanRec<CLEAN_RECIPE$>
|
||||||
|
* If RecipeUsed EQ SpecRecipe AND RecipeUsed NE '' then
|
||||||
|
* CleanRecValid = True$
|
||||||
|
* end
|
||||||
|
* end
|
||||||
|
* end else
|
||||||
|
* ErrorMessage = 'Clean record not found in CLEAN database.'
|
||||||
|
* end
|
||||||
|
* end else
|
||||||
|
* ErrorMessage = 'Clean ID was null.'
|
||||||
|
* end
|
||||||
|
*
|
||||||
|
* If ErrorMessage EQ '' then
|
||||||
|
* Response = CleanRecValid
|
||||||
|
* end else
|
||||||
|
* // Todo: Add logging
|
||||||
|
* ErrorMessage = 'Error validating clean record: ' : ErrorMessage
|
||||||
|
* Error_Services('Add', ErrorMessage)
|
||||||
|
* end
|
||||||
|
|
||||||
|
Response = CleanRecValid
|
||||||
|
End Service
|
||||||
|
|
||||||
|
Service GetCleanToolOptions(CleanRecId)
|
||||||
|
|
||||||
|
If RowExists('CLEAN', CleanRecId) then
|
||||||
|
CleanTools = Database_Services('ReadDataColumn', 'CLEAN', CleanRecId, CLEAN_SPEC_CLEAN_TOOL$, True$, 0, False$)
|
||||||
|
end else
|
||||||
|
CleanTools = Tool_Services('GetTools', 'AKRION')
|
||||||
|
end
|
||||||
|
|
||||||
|
Response = CleanTools
|
||||||
|
|
||||||
|
end service
|
||||||
|
|
||||||
|
Service GetCleanRecipeOptions(CleanRecId)
|
||||||
|
|
||||||
|
If RowExists('CLEAN', CleanRecId) then
|
||||||
|
Recipes = Database_Services('ReadDataColumn', 'CLEAN', CleanRecId, CLEAN_SPEC_CLEAN_RECIPE$, True$, 0, False$)
|
||||||
|
end else
|
||||||
|
//Todo: Make this smarter, so as to block out pre-epi recipes
|
||||||
|
Recipes = XLATE('TOOL_CLASS','AKRION',TOOL_CLASS_RECIPES$,'X')
|
||||||
|
end
|
||||||
|
|
||||||
|
Response = Recipes
|
||||||
|
|
||||||
|
end service
|
@ -858,3 +858,4 @@ Result = ReturnData
|
|||||||
RETURN
|
RETURN
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -213,4 +213,3 @@ UpdateHALItem:
|
|||||||
end
|
end
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -220,6 +220,13 @@ Service GetWeekNum(InputDate)
|
|||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
Service ConvertDateTimeToISO8601(DatetimeToConv)
|
||||||
|
|
||||||
|
Response = OConv(DatetimeToConv, "[SRP_DATETIME,()YYYY-MM-DD hh:mm:ss.000Z]")
|
||||||
|
swap ' ' with 'T' in Response
|
||||||
|
|
||||||
|
end service
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Internal GoSubs
|
// Internal GoSubs
|
||||||
|
@ -1,97 +1,96 @@
|
|||||||
Function Engineinfo_API(@API)
|
Function Engineinfo_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
|
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.
|
permission from SRP Computer Solutions, Inc.
|
||||||
|
|
||||||
Name : Engineinfo_API
|
Name : Engineinfo_API
|
||||||
|
|
||||||
Description : API logic for the Engineinfo resource.
|
Description : API logic for the Engineinfo resource.
|
||||||
|
|
||||||
Notes : All web APIs should include the API_SETUP insert. This will provide several useful variables:
|
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.)
|
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).
|
APIURL - The URL for the API entry point (e.g., api.mysite.com/v1).
|
||||||
FullEndpointURL - The URL submitted by the client, including query params.
|
FullEndpointURL - The URL submitted by the client, including query params.
|
||||||
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
||||||
EndpointSegment - The URL endpoint segment.
|
EndpointSegment - The URL endpoint segment.
|
||||||
ParentURL - The URL path preceeding the current endpoint.
|
ParentURL - The URL path preceeding the current endpoint.
|
||||||
CurrentAPI - The name of this stored procedure.
|
CurrentAPI - The name of this stored procedure.
|
||||||
|
|
||||||
Parameters :
|
Parameters :
|
||||||
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
||||||
- APIPattern must follow this structure Engineinfo[.ID.[<Property>]]
|
- APIPattern must follow this structure Engineinfo[.ID.[<Property>]]
|
||||||
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
||||||
Examples:
|
Examples:
|
||||||
- Engineinfo.POST
|
- Engineinfo.POST
|
||||||
- Engineinfo.ID.PUT
|
- Engineinfo.ID.PUT
|
||||||
- Engineinfo.ID.firstName.GET
|
- Engineinfo.ID.firstName.GET
|
||||||
Response [out] -- Response to be sent back to the Controller (HTTP_MCP) or requesting procedure. Web API
|
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
|
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
|
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.
|
value is only helpful if the developers want to use it for debug purposes.
|
||||||
|
|
||||||
History : (Date, Initials, Notes)
|
History : (Date, Initials, Notes)
|
||||||
07/17/24 xxx Original programmer.
|
07/17/24 xxx Original programmer.
|
||||||
|
|
||||||
***********************************************************************************************************************/
|
***********************************************************************************************************************/
|
||||||
|
|
||||||
#pragma precomp SRP_PreCompiler
|
#pragma precomp SRP_PreCompiler
|
||||||
|
|
||||||
$insert APP_INSERTS
|
$insert APP_INSERTS
|
||||||
$insert API_SETUP
|
$insert API_SETUP
|
||||||
$insert HTTP_INSERTS
|
$insert HTTP_INSERTS
|
||||||
$insert ENGINE_HEALTH_EQUATES
|
$insert ENGINE_HEALTH_EQUATES
|
||||||
|
|
||||||
Declare function System_Healthcheck_Services
|
Declare function System_Healthcheck_Services
|
||||||
|
|
||||||
GoToAPI else
|
GoToAPI else
|
||||||
// The specific resource endpoint doesn't have a API handler yet.
|
// The specific resource endpoint doesn't have a API handler yet.
|
||||||
HTTP_Services('SetResponseStatus', 200, 'This is a valid endpoint but a web API handler has not yet been created.')
|
HTTP_Services('SetResponseStatus', 200, 'This is a valid endpoint but a web API handler has not yet been created.')
|
||||||
end
|
end
|
||||||
|
|
||||||
Return Response OR ''
|
Return Response OR ''
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Endpoint Handlers
|
// Endpoint Handlers
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
API remotehealthcheck.HEAD
|
API remotehealthcheck.HEAD
|
||||||
API remotehealthcheck.GET
|
API remotehealthcheck.GET
|
||||||
|
|
||||||
HTTP_Resource_Services('LoremIpsum')
|
HTTP_Resource_Services('LoremIpsum')
|
||||||
|
|
||||||
end api
|
end api
|
||||||
|
|
||||||
|
|
||||||
API engineinfo.HEAD
|
API engineinfo.HEAD
|
||||||
API engineinfo.GET
|
API engineinfo.GET
|
||||||
|
|
||||||
HTTP_Resource_Services('LoremIpsum')
|
HTTP_Resource_Services('LoremIpsum')
|
||||||
|
|
||||||
end api
|
end api
|
||||||
|
|
||||||
|
|
||||||
API engineinfo.ID.HEAD
|
API engineinfo.ID.HEAD
|
||||||
API engineinfo.ID.GET
|
API engineinfo.ID.GET
|
||||||
|
|
||||||
EngineID = EndpointSegment
|
EngineID = EndpointSegment
|
||||||
If RowExists('APP_INFO', EngineID) then
|
If RowExists('APP_INFO', EngineID) then
|
||||||
EngineHealthInfo = System_Healthcheck_Services('GetEngineHealthInfo', EngineID)
|
EngineHealthInfo = System_Healthcheck_Services('GetEngineHealthInfo', EngineID)
|
||||||
If Error_Services('NoError') then
|
If Error_Services('NoError') then
|
||||||
EngineJSON = System_Healthcheck_Services('ConvertEngineHealthInfoToJSON', EngineHealthInfo, FullEndpointURL)
|
EngineJSON = System_Healthcheck_Services('ConvertEngineHealthInfoToJSON', EngineHealthInfo, FullEndpointURL)
|
||||||
ResponseCode = 200
|
ResponseCode = 200
|
||||||
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
HTTP_Services('SetResponseBody', EngineJSON, False$, 'application/hal+json')
|
HTTP_Services('SetResponseBody', EngineJSON, False$, 'application/hal+json')
|
||||||
HTTP_Services('SetResponseStatus', ResponseCode)
|
HTTP_Services('SetResponseStatus', ResponseCode)
|
||||||
end else
|
end else
|
||||||
HTTP_Services('SetResponseStatus', 500, Error_Services('GetMessage'))
|
HTTP_Services('SetResponseStatus', 500, Error_Services('GetMessage'))
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
HTTP_Services('SetResponseStatus', 401, 'Invalid Engine ID.')
|
HTTP_Services('SetResponseStatus', 401, 'Invalid Engine ID.')
|
||||||
end
|
end
|
||||||
|
|
||||||
end api
|
end api
|
||||||
|
|
||||||
|
@ -1,72 +1,71 @@
|
|||||||
Function Healthinfo_API(@API)
|
Function Healthinfo_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
|
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.
|
permission from SRP Computer Solutions, Inc.
|
||||||
|
|
||||||
Name : Healthinfo_API
|
Name : Healthinfo_API
|
||||||
|
|
||||||
Description : API logic for the Healthinfo resource.
|
Description : API logic for the Healthinfo resource.
|
||||||
|
|
||||||
Notes : All web APIs should include the API_SETUP insert. This will provide several useful variables:
|
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.)
|
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).
|
APIURL - The URL for the API entry point (e.g., api.mysite.com/v1).
|
||||||
FullEndpointURL - The URL submitted by the client, including query params.
|
FullEndpointURL - The URL submitted by the client, including query params.
|
||||||
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
||||||
EndpointSegment - The URL endpoint segment.
|
EndpointSegment - The URL endpoint segment.
|
||||||
ParentURL - The URL path preceeding the current endpoint.
|
ParentURL - The URL path preceeding the current endpoint.
|
||||||
CurrentAPI - The name of this stored procedure.
|
CurrentAPI - The name of this stored procedure.
|
||||||
|
|
||||||
Parameters :
|
Parameters :
|
||||||
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
||||||
- APIPattern must follow this structure Healthinfo[.ID.[<Property>]]
|
- APIPattern must follow this structure Healthinfo[.ID.[<Property>]]
|
||||||
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
||||||
Examples:
|
Examples:
|
||||||
- Healthinfo.POST
|
- Healthinfo.POST
|
||||||
- Healthinfo.ID.PUT
|
- Healthinfo.ID.PUT
|
||||||
- Healthinfo.ID.firstName.GET
|
- Healthinfo.ID.firstName.GET
|
||||||
Response [out] -- Response to be sent back to the Controller (HTTP_MCP) or requesting procedure. Web API
|
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
|
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
|
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.
|
value is only helpful if the developers want to use it for debug purposes.
|
||||||
|
|
||||||
History : (Date, Initials, Notes)
|
History : (Date, Initials, Notes)
|
||||||
07/17/24 xxx Original programmer.
|
07/17/24 xxx Original programmer.
|
||||||
|
|
||||||
***********************************************************************************************************************/
|
***********************************************************************************************************************/
|
||||||
|
|
||||||
#pragma precomp SRP_PreCompiler
|
#pragma precomp SRP_PreCompiler
|
||||||
|
|
||||||
$insert APP_INSERTS
|
$insert APP_INSERTS
|
||||||
$insert API_SETUP
|
$insert API_SETUP
|
||||||
$insert HTTP_INSERTS
|
$insert HTTP_INSERTS
|
||||||
|
|
||||||
GoToAPI else
|
GoToAPI else
|
||||||
// The specific resource endpoint doesn't have a API handler yet.
|
// The specific resource endpoint doesn't have a API handler yet.
|
||||||
HTTP_Services('SetResponseStatus', 200, 'This is a valid endpoint but a web API handler has not yet been created.')
|
HTTP_Services('SetResponseStatus', 200, 'This is a valid endpoint but a web API handler has not yet been created.')
|
||||||
end
|
end
|
||||||
|
|
||||||
Return Response OR ''
|
Return Response OR ''
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Endpoint Handlers
|
// Endpoint Handlers
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
API remotehealthcheck.HEAD
|
API remotehealthcheck.HEAD
|
||||||
API remotehealthcheck.GET
|
API remotehealthcheck.GET
|
||||||
|
|
||||||
HTTP_Resource_Services('LoremIpsum')
|
HTTP_Resource_Services('LoremIpsum')
|
||||||
|
|
||||||
end api
|
end api
|
||||||
|
|
||||||
|
|
||||||
API healthinfo.HEAD
|
API healthinfo.HEAD
|
||||||
API healthinfo.GET
|
API healthinfo.GET
|
||||||
|
|
||||||
HTTP_Resource_Services('LoremIpsum')
|
HTTP_Resource_Services('LoremIpsum')
|
||||||
|
|
||||||
end api
|
end api
|
||||||
|
|
||||||
|
@ -1,167 +1,163 @@
|
|||||||
Function Lock_API(@API)
|
Function Lock_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
|
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.
|
permission from SRP Computer Solutions, Inc.
|
||||||
|
|
||||||
Name : Lock_API
|
Name : Lock_API
|
||||||
|
|
||||||
Description : API logic for the Lock resource.
|
Description : API logic for the Lock resource.
|
||||||
|
|
||||||
Notes : All web APIs should include the API_SETUP insert. This will provide several useful variables:
|
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.)
|
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).
|
APIURL - The URL for the API entry point (e.g., api.mysite.com/v1).
|
||||||
FullEndpointURL - The URL submitted by the client, including query params.
|
FullEndpointURL - The URL submitted by the client, including query params.
|
||||||
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
||||||
EndpointSegment - The URL endpoint segment.
|
EndpointSegment - The URL endpoint segment.
|
||||||
ParentURL - The URL path preceeding the current endpoint.
|
ParentURL - The URL path preceeding the current endpoint.
|
||||||
CurrentAPI - The name of this stored procedure.
|
CurrentAPI - The name of this stored procedure.
|
||||||
|
|
||||||
Parameters :
|
Parameters :
|
||||||
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
||||||
- APIPattern must follow this structure Lock[.ID.[<Property>]]
|
- APIPattern must follow this structure Lock[.ID.[<Property>]]
|
||||||
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
||||||
Examples:
|
Examples:
|
||||||
- Lock.POST
|
- Lock.POST
|
||||||
- Lock.ID.PUT
|
- Lock.ID.PUT
|
||||||
- Lock.ID.firstName.GET
|
- Lock.ID.firstName.GET
|
||||||
Response [out] -- Response to be sent back to the Controller (HTTP_MCP) or requesting procedure. Web API
|
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
|
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
|
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.
|
value is only helpful if the developers want to use it for debug purposes.
|
||||||
|
|
||||||
History : (Date, Initials, Notes)
|
History : (Date, Initials, Notes)
|
||||||
03/14/24 djm Original programmer.
|
03/14/24 djm Original programmer.
|
||||||
|
|
||||||
***********************************************************************************************************************/
|
***********************************************************************************************************************/
|
||||||
|
|
||||||
#pragma precomp SRP_PreCompiler
|
#pragma precomp SRP_PreCompiler
|
||||||
|
|
||||||
$insert APP_INSERTS
|
$insert APP_INSERTS
|
||||||
$insert API_SETUP
|
$insert API_SETUP
|
||||||
$insert HTTP_INSERTS
|
$insert HTTP_INSERTS
|
||||||
|
|
||||||
Declare function Database_Services, Oi_Wizard_Services, Memberof, Lock_Services
|
Declare function Database_Services, Oi_Wizard_Services, Memberof, Lock_Services
|
||||||
Declare subroutine Lock_Services
|
Declare subroutine Lock_Services
|
||||||
|
|
||||||
GoToAPI else
|
GoToAPI else
|
||||||
// The specific resource endpoint doesn't have a API handler yet.
|
// 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.')
|
HTTP_Services('SetResponseStatus', 204, 'This is a valid endpoint but a web API handler has not yet been created.')
|
||||||
end
|
end
|
||||||
|
|
||||||
Return Response OR ''
|
Return Response OR ''
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Endpoint Handlers
|
// Endpoint Handlers
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
API Lock.HEAD
|
API Lock.HEAD
|
||||||
|
|
||||||
|
|
||||||
// GET Method removed until RTI_LH_Info(CMD_LOCKS_INFO$, '') is fixed ////////////////////////////////
|
// GET Method removed until RTI_LH_Info(CMD_LOCKS_INFO$, '') is fixed ////////////////////////////////
|
||||||
|
|
||||||
* API Lock.GET
|
* API Lock.GET
|
||||||
*
|
*
|
||||||
* OIWizardID = ''
|
* OIWizardID = ''
|
||||||
* Cookies = HTTP_Services('GetHTTPCookie')
|
* Cookies = HTTP_Services('GetHTTPCookie')
|
||||||
* For each Cookie in Cookies using ';'
|
* For each Cookie in Cookies using ';'
|
||||||
* Key = Trim(Field(Cookie, '=', 1))
|
* Key = Trim(Field(Cookie, '=', 1))
|
||||||
* If Key EQ 'sessionID' then
|
* If Key EQ 'sessionID' then
|
||||||
* OIWizardID = Field(Cookie, '=', 2)
|
* OIWizardID = Field(Cookie, '=', 2)
|
||||||
* end
|
* end
|
||||||
* If Key EQ 'userID' then
|
* If Key EQ 'userID' then
|
||||||
* CurrUser = Field(Cookie, '=', 2)
|
* CurrUser = Field(Cookie, '=', 2)
|
||||||
* end
|
* end
|
||||||
* Next Cookie
|
* Next Cookie
|
||||||
*
|
*
|
||||||
* ValidSession = OI_Wizard_Services('ValidateSession', OIWizardID)
|
* ValidSession = OI_Wizard_Services('ValidateSession', OIWizardID)
|
||||||
*
|
*
|
||||||
* If ValidSession then
|
* If ValidSession then
|
||||||
*
|
*
|
||||||
* Allowed = Lock_Services("GetLockPermissions", CurrUser)
|
* Allowed = Lock_Services("GetLockPermissions", CurrUser)
|
||||||
*
|
*
|
||||||
* If Allowed NE FALSE$ then
|
* If Allowed NE FALSE$ then
|
||||||
*
|
*
|
||||||
* StatusCode = 200
|
* StatusCode = 200
|
||||||
* LockJSON = Lock_Services("GetAllowedLocks", CurrUser)
|
* LockJSON = Lock_Services("GetAllowedLocks", CurrUser)
|
||||||
*
|
*
|
||||||
* If Error_Services('NoError') then
|
* If Error_Services('NoError') then
|
||||||
* HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
* HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
* HTTP_Services('SetResponseBody', LockJSON, False$, 'application/hal+json')
|
* HTTP_Services('SetResponseBody', LockJSON, False$, 'application/hal+json')
|
||||||
* If Assigned(Message) then
|
* If Assigned(Message) then
|
||||||
* HTTP_Services('SetResponseStatus', StatusCode, Message)
|
* HTTP_Services('SetResponseStatus', StatusCode, Message)
|
||||||
* end else
|
* end else
|
||||||
* HTTP_Services('SetResponseStatus', StatusCode)
|
* HTTP_Services('SetResponseStatus', StatusCode)
|
||||||
* end
|
* end
|
||||||
* end else
|
* end else
|
||||||
* Message = Error_Services('GetMessage')
|
* Message = Error_Services('GetMessage')
|
||||||
* HTTP_Services('SetResponseStatus', 500, 'Error in the ' : CurrentAPI : ' API. Message: ': Message)
|
* HTTP_Services('SetResponseStatus', 500, 'Error in the ' : CurrentAPI : ' API. Message: ': Message)
|
||||||
* end
|
* end
|
||||||
* End Else
|
* End Else
|
||||||
* HTTP_Services('SetResponseStatus', 403, 'User is not permitted to access this resource.')
|
* HTTP_Services('SetResponseStatus', 403, 'User is not permitted to access this resource.')
|
||||||
* end
|
* end
|
||||||
* End else
|
* End else
|
||||||
* HTTP_Services('SetResponseStatus', 401, 'User must be signed in to access this resource.')
|
* HTTP_Services('SetResponseStatus', 401, 'User must be signed in to access this resource.')
|
||||||
* end
|
* end
|
||||||
*
|
*
|
||||||
* end api
|
* end api
|
||||||
|
|
||||||
|
|
||||||
API Lock.POST
|
API Lock.POST
|
||||||
|
|
||||||
OIWizardID = ''
|
OIWizardID = ''
|
||||||
Cookies = HTTP_Services('GetHTTPCookie')
|
Cookies = HTTP_Services('GetHTTPCookie')
|
||||||
For each Cookie in Cookies using ';'
|
For each Cookie in Cookies using ';'
|
||||||
Key = Trim(Field(Cookie, '=', 1))
|
Key = Trim(Field(Cookie, '=', 1))
|
||||||
If Key EQ 'sessionID' then
|
If Key EQ 'sessionID' then
|
||||||
OIWizardID = Field(Cookie, '=', 2)
|
OIWizardID = Field(Cookie, '=', 2)
|
||||||
end
|
end
|
||||||
If Key EQ 'userID' then
|
If Key EQ 'userID' then
|
||||||
CurrUser = Field(Cookie, '=', 2)
|
CurrUser = Field(Cookie, '=', 2)
|
||||||
end
|
end
|
||||||
Next Cookie
|
Next Cookie
|
||||||
|
|
||||||
ValidSession = OI_Wizard_Services('ValidateSession', OIWizardID)
|
ValidSession = OI_Wizard_Services('ValidateSession', OIWizardID)
|
||||||
|
|
||||||
If ValidSession then
|
If ValidSession then
|
||||||
Allowed = Lock_Services("GetLockPermissions", CurrUser)
|
Allowed = Lock_Services("GetLockPermissions", CurrUser)
|
||||||
|
|
||||||
If Allowed NE FALSE$ then
|
If Allowed NE FALSE$ then
|
||||||
StatusCode = ''
|
StatusCode = ''
|
||||||
Body = HTTP_Services('GetHTTPPostString', True$)
|
Body = HTTP_Services('GetHTTPPostString', True$)
|
||||||
// The POST string will have been encoded so use percent (URL) decoding.
|
// The POST string will have been encoded so use percent (URL) decoding.
|
||||||
DecodedJSON = HTTP_Services('DecodePercentString', Body)
|
DecodedJSON = HTTP_Services('DecodePercentString', Body)
|
||||||
If SRP_JSON(objBody, 'Parse', Body) EQ '' then
|
If SRP_JSON(objBody, 'Parse', Body) EQ '' then
|
||||||
Table = SRP_JSON(objBody, 'GetValue', 'table')
|
Table = SRP_JSON(objBody, 'GetValue', 'table')
|
||||||
Key = SRP_JSON(objBody, 'GetValue', 'key')
|
Key = SRP_JSON(objBody, 'GetValue', 'key')
|
||||||
SRP_JSON(objBody, 'Release')
|
SRP_JSON(objBody, 'Release')
|
||||||
end
|
end
|
||||||
|
|
||||||
If (Table NE '') AND (Key NE '') then
|
If (Table NE '') AND (Key NE '') then
|
||||||
Result = Lock_Services("AttemptUnlock",CurrUser, Table, Key)
|
Result = Lock_Services("AttemptUnlock",CurrUser, Table, Key)
|
||||||
If Result EQ TRUE$ then
|
If Result EQ TRUE$ then
|
||||||
HTTP_Services('SetResponseStatus', 200, 'Record successfully unlocked.')
|
HTTP_Services('SetResponseStatus', 200, 'Record successfully unlocked.')
|
||||||
Lock_Services("LogUnlockRequest", Table, Key, CurrUser, TRUE$)
|
Lock_Services("LogUnlockRequest", Table, Key, CurrUser, TRUE$)
|
||||||
end else
|
end else
|
||||||
ErrCode = Error_Services('GetMessage')
|
ErrCode = Error_Services('GetMessage')
|
||||||
HTTP_Services('SetResponseStatus', 500, ErrCode)
|
HTTP_Services('SetResponseStatus', 500, ErrCode)
|
||||||
Lock_Services("LogUnlockRequest", Table, Key, CurrUser, FALSE$)
|
Lock_Services("LogUnlockRequest", Table, Key, CurrUser, FALSE$)
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
HTTP_Services('SetResponseStatus', 400, 'The table or key property is missing.')
|
HTTP_Services('SetResponseStatus', 400, 'The table or key property is missing.')
|
||||||
end
|
end
|
||||||
End Else
|
End Else
|
||||||
HTTP_Services('SetResponseStatus', 403, 'User is not permitted to access this resource.')
|
HTTP_Services('SetResponseStatus', 403, 'User is not permitted to access this resource.')
|
||||||
end
|
end
|
||||||
End else
|
End else
|
||||||
HTTP_Services('SetResponseStatus', 401, 'User must be signed in to access this resource.')
|
HTTP_Services('SetResponseStatus', 401, 'User must be signed in to access this resource.')
|
||||||
end
|
end
|
||||||
|
|
||||||
end api
|
end api
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
460
LSL2/STPROC/LOTOPERATION_API.txt
Normal file
460
LSL2/STPROC/LOTOPERATION_API.txt
Normal file
@ -0,0 +1,460 @@
|
|||||||
|
Function Lotoperation_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 : Lotoperation_API
|
||||||
|
|
||||||
|
Description : API logic for the Lotoperation 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 Lotoperation[.ID.[<Property>]]
|
||||||
|
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
||||||
|
Examples:
|
||||||
|
- Lotoperation.POST
|
||||||
|
- Lotoperation.ID.PUT
|
||||||
|
- Lotoperation.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)
|
||||||
|
05/20/25 xxx Original programmer.
|
||||||
|
|
||||||
|
***********************************************************************************************************************/
|
||||||
|
|
||||||
|
#pragma precomp SRP_PreCompiler
|
||||||
|
|
||||||
|
Declare function OI_Wizard_Services, Lot_Operation_Services, Database_Services, Lot_Services, Clean_Services
|
||||||
|
Declare function Met_Test_Services
|
||||||
|
Declare subroutine Lot_Services, Met_Test_Services, Wafer_Counter_Services
|
||||||
|
|
||||||
|
$insert APP_INSERTS
|
||||||
|
$insert API_SETUP
|
||||||
|
$insert HTTP_INSERTS
|
||||||
|
$insert OI_WIZARD_EQUATES
|
||||||
|
$insert LOT_OPERATION_EQUATES
|
||||||
|
|
||||||
|
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 lotoperation.HEAD
|
||||||
|
API lotoperation.GET
|
||||||
|
|
||||||
|
HTTP_Resource_Services('LoremIpsum')
|
||||||
|
|
||||||
|
end api
|
||||||
|
|
||||||
|
|
||||||
|
API lotoperation.addoperation.POST
|
||||||
|
|
||||||
|
ErrorMessage = ''
|
||||||
|
ResponseCode = ''
|
||||||
|
ResponseMessage = ''
|
||||||
|
Body = ''
|
||||||
|
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
|
||||||
|
UserId = Xlate('OI_WIZARD', OIWizardID, OI_WIZARD.EMPLOYEE_ID$, 'X')
|
||||||
|
StatusCode = ''
|
||||||
|
Body = HTTP_Services('GetHTTPPostString', True$)
|
||||||
|
// The POST string will have been encoded so use percent (URL) decoding.
|
||||||
|
DecodedJSON = HTTP_Services('DecodePercentString', Body)
|
||||||
|
If SRP_JSON(objBody, 'Parse', Body) EQ '' then
|
||||||
|
LotId = SRP_JSON(objBody, 'GetValue', 'NewLotOperationData.LotId')
|
||||||
|
OperationId = SRP_JSON(objBody, 'GetValue', 'NewLotOperationData.OperationId')
|
||||||
|
Sequence = SRP_JSON(objBody, 'GetValue', 'NewLotOperationData.Sequence')
|
||||||
|
SRP_JSON(objBody, 'Release')
|
||||||
|
end
|
||||||
|
If RowExists('LOT', LotId) then
|
||||||
|
If RowExists('OPERATION', OperationId) then
|
||||||
|
If Sequence NE '' then
|
||||||
|
NewOperationId = Lot_Operation_Services('AddOperationToLot', LotId, OperationId, Sequence, UserId)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
LotJsonString = Lot_Services('ConvertLotRecordToJson', LotId, '', UserId)
|
||||||
|
HTTP_Services('SetResponseBody', LotJsonString, False$, 'application/hal+json')
|
||||||
|
ResponseCode = 200
|
||||||
|
end else
|
||||||
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
|
ResponseCode = 500
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Invalid Sequence.'
|
||||||
|
ResponseCode = 500
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Invalid Operation.'
|
||||||
|
ResponseCode = 500
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Invalid Lot.'
|
||||||
|
ResponseCode = 500
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Invalid session. Reauthentication required.'
|
||||||
|
ResponseCode = 401
|
||||||
|
end
|
||||||
|
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
|
HTTP_Services('SetResponseStatus', ResponseCode, ErrorMessage)
|
||||||
|
|
||||||
|
end api
|
||||||
|
|
||||||
|
API lotoperation.removeoperation.POST
|
||||||
|
|
||||||
|
ErrorMessage = ''
|
||||||
|
ResponseCode = ''
|
||||||
|
ResponseMessage = ''
|
||||||
|
Body = ''
|
||||||
|
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
|
||||||
|
UserId = Xlate('OI_WIZARD', OIWizardID, OI_WIZARD.EMPLOYEE_ID$, 'X')
|
||||||
|
StatusCode = ''
|
||||||
|
Body = HTTP_Services('GetHTTPPostString', True$)
|
||||||
|
// The POST string will have been encoded so use percent (URL) decoding.
|
||||||
|
DecodedJSON = HTTP_Services('DecodePercentString', Body)
|
||||||
|
If SRP_JSON(objBody, 'Parse', Body) EQ '' then
|
||||||
|
LotOperationId = SRP_JSON(objBody, 'GetValue', 'LotOperationIdToRemove')
|
||||||
|
SRP_JSON(objBody, 'Release')
|
||||||
|
end
|
||||||
|
|
||||||
|
If RowExists('LOT_OPERATION', LotOperationId) then
|
||||||
|
LotId = Database_Services('ReadDataColumn', 'LOT_OPERATION', LotOperationId, LOT_OPERATION_LOT_ID$, True$, 0, False$)
|
||||||
|
Removed = Lot_Operation_Services('RemoveLotOperation', LotOperationId, UserId)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
LotJsonString = Lot_Services('ConvertLotRecordToJson', LotId, '', UserId)
|
||||||
|
HTTP_Services('SetResponseBody', LotJsonString, False$, 'application/hal+json')
|
||||||
|
ResponseCode = 200
|
||||||
|
end else
|
||||||
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
|
ResponseCode = 500
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Invalid Operation.'
|
||||||
|
ResponseCode = 500
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Invalid session. Reauthentication required.'
|
||||||
|
ResponseCode = 401
|
||||||
|
end
|
||||||
|
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
|
HTTP_Services('SetResponseStatus', ResponseCode, ErrorMessage)
|
||||||
|
|
||||||
|
end api
|
||||||
|
|
||||||
|
API lotoperation.startlotoperation.POST
|
||||||
|
|
||||||
|
ErrorMessage = ''
|
||||||
|
ResponseCode = ''
|
||||||
|
ResponseMessage = ''
|
||||||
|
Body = ''
|
||||||
|
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
|
||||||
|
UserId = Xlate('OI_WIZARD', OIWizardID, OI_WIZARD.EMPLOYEE_ID$, 'X')
|
||||||
|
StatusCode = ''
|
||||||
|
Body = HTTP_Services('GetHTTPPostString', True$)
|
||||||
|
// The POST string will have been encoded so use percent (URL) decoding.
|
||||||
|
DecodedJSON = HTTP_Services('DecodePercentString', Body)
|
||||||
|
If SRP_JSON(objBody, 'Parse', Body) EQ '' then
|
||||||
|
LotOperationId = SRP_JSON(objBody, 'GetValue', 'lotOperationId')
|
||||||
|
SRP_JSON(objBody, 'Release')
|
||||||
|
end
|
||||||
|
|
||||||
|
LotProcessStarted = Lot_Operation_Services('StartLotOperation', LotOperationId, UserId)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
LotOperationJson = Lot_Operation_Services('ConvertRecordToJson', LotOperationId)
|
||||||
|
HTTP_Services('SetResponseBody', LotOperationJson,False$, 'application/hal+json')
|
||||||
|
ResponseCode = 200
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Error while moving lot in. ' : Error_Services('GetMessage')
|
||||||
|
ResponseCode = 500
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Invalid session. Reauthentication required.'
|
||||||
|
ResponseCode = 401
|
||||||
|
end
|
||||||
|
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
|
HTTP_Services('SetResponseStatus', ResponseCode, ErrorMessage)
|
||||||
|
|
||||||
|
end api
|
||||||
|
|
||||||
|
|
||||||
|
API lotoperation.completelotoperation.POST
|
||||||
|
|
||||||
|
ErrorMessage = ''
|
||||||
|
ResponseCode = ''
|
||||||
|
ResponseMessage = ''
|
||||||
|
Body = ''
|
||||||
|
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
|
||||||
|
UserId = Xlate('OI_WIZARD', OIWizardID, OI_WIZARD.EMPLOYEE_ID$, 'X')
|
||||||
|
StatusCode = ''
|
||||||
|
Body = HTTP_Services('GetHTTPPostString', True$)
|
||||||
|
// The POST string will have been encoded so use percent (URL) decoding.
|
||||||
|
DecodedJSON = HTTP_Services('DecodePercentString', Body)
|
||||||
|
If SRP_JSON(objBody, 'Parse', Body) EQ '' then
|
||||||
|
LotOperationId = SRP_JSON(objBody, 'GetValue', 'lotOperationId')
|
||||||
|
SRP_JSON(objBody, 'Release')
|
||||||
|
end
|
||||||
|
|
||||||
|
LotProcessCompleted = Lot_Operation_Services('CompleteLotOperation', LotOperationId, UserId)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
LotOperationJson = Lot_Operation_Services('ConvertRecordToJson', LotOperationId)
|
||||||
|
HTTP_Services('SetResponseBody', LotOperationJson)
|
||||||
|
ResponseCode = 200
|
||||||
|
end else
|
||||||
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
|
ResponseCode = 500
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Invalid session. Reauthentication required.'
|
||||||
|
ResponseCode = 401
|
||||||
|
end
|
||||||
|
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
|
HTTP_Services('SetResponseStatus', ResponseCode, ErrorMessage)
|
||||||
|
|
||||||
|
end api
|
||||||
|
|
||||||
|
|
||||||
|
API lotoperation.ID.HEAD
|
||||||
|
API lotoperation.ID.GET
|
||||||
|
ErrorMessage = ''
|
||||||
|
ResponseCode = ''
|
||||||
|
ResponseMessage = ''
|
||||||
|
Body = ''
|
||||||
|
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
|
||||||
|
LotOperationId = EndpointSegment
|
||||||
|
If RowExists('LOT_OPERATION', LotOperationId) then
|
||||||
|
LotOperationJson = Lot_Operation_Services('ConvertRecordToJson', LotOperationId)
|
||||||
|
HTTP_Services('SetResponseBody', LotOperationJson, False$, 'application/hal+json')
|
||||||
|
ResponseCode = 200
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Lot Operation not found in database.'
|
||||||
|
end
|
||||||
|
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Invalid session. Reauthentication required.'
|
||||||
|
ResponseCode = 401
|
||||||
|
end
|
||||||
|
|
||||||
|
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
|
HTTP_Services('SetResponseStatus', ResponseCode, ErrorMessage)
|
||||||
|
|
||||||
|
end api
|
||||||
|
|
||||||
|
|
||||||
|
API lotoperation.associatemettest.POST
|
||||||
|
|
||||||
|
ErrorMessage = ''
|
||||||
|
ResponseCode = ''
|
||||||
|
ResponseMessage = ''
|
||||||
|
Body = ''
|
||||||
|
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
|
||||||
|
UserId = Xlate('OI_WIZARD', OIWizardID, OI_WIZARD.EMPLOYEE_ID$, 'X')
|
||||||
|
StatusCode = ''
|
||||||
|
Body = HTTP_Services('GetHTTPPostString', True$)
|
||||||
|
// The POST string will have been encoded so use percent (URL) decoding.
|
||||||
|
DecodedJSON = HTTP_Services('DecodePercentString', Body)
|
||||||
|
If SRP_JSON(objBody, 'Parse', Body) EQ '' then
|
||||||
|
LotOperationId = SRP_JSON(objBody, 'GetValue', 'LotOperationId')
|
||||||
|
MetTestId = SRP_JSON(objBody, 'GetValue', 'MetTestId')
|
||||||
|
SRP_JSON(objBody, 'Release')
|
||||||
|
end
|
||||||
|
|
||||||
|
Met_Test_Services('AttachMetTestToLotOperation', MetTestId, LotOperationId, UserId)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
ResponseCode = 200
|
||||||
|
end else
|
||||||
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
|
ResponseCode = 500
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Invalid session. Reauthentication required.'
|
||||||
|
ResponseCode = 401
|
||||||
|
end
|
||||||
|
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
|
HTTP_Services('SetResponseStatus', ResponseCode, ErrorMessage)
|
||||||
|
|
||||||
|
end api
|
||||||
|
|
||||||
|
|
||||||
|
API lotoperation.removemettest.POST
|
||||||
|
|
||||||
|
ErrorMessage = ''
|
||||||
|
ResponseCode = ''
|
||||||
|
ResponseMessage = ''
|
||||||
|
Body = ''
|
||||||
|
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
|
||||||
|
UserId = Xlate('OI_WIZARD', OIWizardID, OI_WIZARD.EMPLOYEE_ID$, 'X')
|
||||||
|
StatusCode = ''
|
||||||
|
Body = HTTP_Services('GetHTTPPostString', True$)
|
||||||
|
// The POST string will have been encoded so use percent (URL) decoding.
|
||||||
|
DecodedJSON = HTTP_Services('DecodePercentString', Body)
|
||||||
|
If SRP_JSON(objBody, 'Parse', Body) EQ '' then
|
||||||
|
LotOperationId = SRP_JSON(objBody, 'GetValue', 'LotOperationId')
|
||||||
|
MetTestId = SRP_JSON(objBody, 'GetValue', 'MetTestId')
|
||||||
|
SRP_JSON(objBody, 'Release')
|
||||||
|
end
|
||||||
|
|
||||||
|
Met_Test_Services('RemoveMetTestFromLotOperation', MetTestId, LotOperationId, UserId)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
HTTP_Services('SetResponseBody', LotJsonString, False$, 'application/hal+json')
|
||||||
|
ResponseCode = 200
|
||||||
|
end else
|
||||||
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
|
ResponseCode = 500
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Invalid session. Reauthentication required.'
|
||||||
|
ResponseCode = 401
|
||||||
|
end
|
||||||
|
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
|
HTTP_Services('SetResponseStatus', ResponseCode, ErrorMessage)
|
||||||
|
|
||||||
|
end api
|
||||||
|
|
||||||
|
|
||||||
|
API lotoperation.associatewafercounter.POST
|
||||||
|
|
||||||
|
ErrorMessage = ''
|
||||||
|
ResponseCode = ''
|
||||||
|
ResponseMessage = ''
|
||||||
|
Body = ''
|
||||||
|
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
|
||||||
|
UserId = Xlate('OI_WIZARD', OIWizardID, OI_WIZARD.EMPLOYEE_ID$, 'X')
|
||||||
|
StatusCode = ''
|
||||||
|
Body = HTTP_Services('GetHTTPPostString', True$)
|
||||||
|
// The POST string will have been encoded so use percent (URL) decoding.
|
||||||
|
DecodedJSON = HTTP_Services('DecodePercentString', Body)
|
||||||
|
If SRP_JSON(objBody, 'Parse', Body) EQ '' then
|
||||||
|
LotOperationId = SRP_JSON(objBody, 'GetValue', 'LotOperationId')
|
||||||
|
WaferCounterId = SRP_JSON(objBody, 'GetValue', 'WaferCounterId')
|
||||||
|
SRP_JSON(objBody, 'Release')
|
||||||
|
end
|
||||||
|
|
||||||
|
Wafer_Counter_Services('AssociateWaferCounter', LotOperationId, WaferCounterId, UserId)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
ResponseCode = 200
|
||||||
|
end else
|
||||||
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
|
ResponseCode = 500
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Invalid session. Reauthentication required.'
|
||||||
|
ResponseCode = 401
|
||||||
|
end
|
||||||
|
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
|
HTTP_Services('SetResponseStatus', ResponseCode, ErrorMessage)
|
||||||
|
|
||||||
|
end api
|
@ -38,9 +38,12 @@ Function Lot_API(@API)
|
|||||||
|
|
||||||
#pragma precomp SRP_PreCompiler
|
#pragma precomp SRP_PreCompiler
|
||||||
|
|
||||||
|
Declare function OI_Wizard_Services, Lot_Services, Database_Services, PSN_Services, Clean_Services
|
||||||
|
|
||||||
$insert APP_INSERTS
|
$insert APP_INSERTS
|
||||||
$insert API_SETUP
|
$insert API_SETUP
|
||||||
$insert HTTP_INSERTS
|
$insert HTTP_INSERTS
|
||||||
|
$Insert OI_WIZARD_EQUATES
|
||||||
|
|
||||||
GoToAPI else
|
GoToAPI else
|
||||||
// The specific resource endpoint doesn't have a API handler yet.
|
// The specific resource endpoint doesn't have a API handler yet.
|
||||||
@ -55,3 +58,159 @@ Return Response OR ''
|
|||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
API lot.ID.HEAD
|
||||||
|
API lot.ID.GET
|
||||||
|
|
||||||
|
ErrorMessage = ''
|
||||||
|
ResponseCode = ''
|
||||||
|
ResponseMessage = ''
|
||||||
|
Body = ''
|
||||||
|
OIWizardID = ''
|
||||||
|
UserId = ''
|
||||||
|
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
|
||||||
|
UserId = Xlate('OI_WIZARD', OIWizardID, OI_WIZARD.EMPLOYEE_ID$, 'X')
|
||||||
|
LotId = EndpointSegment
|
||||||
|
If RowExists('LOT', LotId) then
|
||||||
|
LotJson = Lot_Services('ConvertLotRecordToJson', LotId, '', UserId)
|
||||||
|
HTTP_Services('SetResponseBody', LotJson, False$, 'application/hal+json')
|
||||||
|
ResponseCode = 200
|
||||||
|
end else
|
||||||
|
ResponseCode = 500
|
||||||
|
ErrorMessage = 'Lot not found in database.'
|
||||||
|
end
|
||||||
|
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Invalid session. Reauthentication required.'
|
||||||
|
ResponseCode = 401
|
||||||
|
end
|
||||||
|
|
||||||
|
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
|
HTTP_Services('SetResponseStatus', ResponseCode, ErrorMessage)
|
||||||
|
|
||||||
|
end api
|
||||||
|
|
||||||
|
|
||||||
|
API lot.getlotbylegacylotid.HEAD
|
||||||
|
API lot.getlotbylegacylotid.GET
|
||||||
|
|
||||||
|
ErrorMessage = ''
|
||||||
|
ResponseCode = ''
|
||||||
|
ResponseMessage = ''
|
||||||
|
Body = ''
|
||||||
|
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
|
||||||
|
UserId = Xlate('OI_WIZARD', OIWizardID, OI_WIZARD.EMPLOYEE_ID$, 'X')
|
||||||
|
StatusCode = ''
|
||||||
|
Body = HTTP_Services('GetHTTPGetString')
|
||||||
|
|
||||||
|
LegacyLotId = Http_Services('GetQueryField', 'LegacyLotId')
|
||||||
|
LegacyLotType = Http_Services('GetQueryField', 'LegacyLotType')
|
||||||
|
|
||||||
|
LotId = Lot_Services('GetLotIdByLegacyLotIdAndType', LegacyLotId, LegacyLotType)
|
||||||
|
LotJson = Lot_Services('ConvertLotRecordToJson', LotId, '', UserId)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
HTTP_Services('SetResponseBody', LotJson, False$, 'application/hal+json')
|
||||||
|
ResponseCode = 200
|
||||||
|
end else
|
||||||
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
|
ResponseCode = 500
|
||||||
|
end
|
||||||
|
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Invalid session. Reauthentication required.'
|
||||||
|
ResponseCode = 401
|
||||||
|
end
|
||||||
|
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
|
HTTP_Services('SetResponseStatus', ResponseCode, ErrorMessage)
|
||||||
|
|
||||||
|
end api
|
||||||
|
|
||||||
|
end api
|
||||||
|
|
||||||
|
|
||||||
|
API lot.ID.getrecipeoptions.HEAD
|
||||||
|
API lot.ID.getrecipeoptions.GET
|
||||||
|
|
||||||
|
JSONCollection = ''
|
||||||
|
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
|
||||||
|
LotId = EndpointSegment
|
||||||
|
PSN = Database_Services('ReadDataColumn', 'LOT', LotId, LOT_PROD_SPEC_ID$, True$, 0, False$)
|
||||||
|
RecipeParameters = PSN_Services('GetAllMetrologyRecipes', PSN, True$, True$, True$, True$)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
If Body NE '' then
|
||||||
|
RequestJson = HTTP_Services('DecodePercentString', Body)
|
||||||
|
objJSONResponse = ''
|
||||||
|
If SRP_Json(objJSONResponse, 'New', 'Object') then
|
||||||
|
//Available Tools
|
||||||
|
If SRP_Json(objCleanTools, 'New', 'Array') then
|
||||||
|
CleanTools = Clean_Services('GetCleanToolOptions')
|
||||||
|
for each CleanTool in CleanTools using @FM
|
||||||
|
SRP_Json(objCleanTools, 'AddValue', CleanTool, 'String')
|
||||||
|
Next CleanTool
|
||||||
|
SRP_Json(objJsonResponse, 'Set', 'CleanToolOptions', objCleanTools)
|
||||||
|
SRP_Json(objCleanTools, 'Release')
|
||||||
|
end
|
||||||
|
//Available Recipes
|
||||||
|
If SRP_Json(objCleanRecipes, 'New', 'Array') then
|
||||||
|
CleanRecipes = Clean_Services('GetCleanRecipeOptions')
|
||||||
|
for each Recipe in CleanRecipes using @VM
|
||||||
|
SRP_Json(objCleanRecipes, 'AddValue', Recipe, 'String')
|
||||||
|
Next Recipe
|
||||||
|
SRP_Json(objJsonResponse, 'Set', 'CleanRecipeOptions', objCleanRecipes)
|
||||||
|
SRP_Json(objCleanRecipes, 'Release')
|
||||||
|
end
|
||||||
|
JsonResponse = SRP_Json(objJsonResponse, 'Stringify', 'Styled')
|
||||||
|
SRP_Json(objJsonResponse, 'Release')
|
||||||
|
end else
|
||||||
|
Error_Services('Add', 'Error when creating JSON response.')
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
Error_Services('Add', 'No body was sent with the request.')
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
|
end
|
||||||
|
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
HTTP_Services('SetResponseStatus', 201, 'Success')
|
||||||
|
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
|
HTTP_Services('SetResponseBody', JsonResponse, False$, 'application/hal+json')
|
||||||
|
end else
|
||||||
|
HTTP_Services('SetResponseStatus', 400, Error_Services('GetMessage'))
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
HTTP_Services('SetResponseStatus', 401, 'Invalid session. Reauthentication required.')
|
||||||
|
end
|
||||||
|
|
||||||
|
end api
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ Declare function Lot_Event_Services, Lot_Services
|
|||||||
Declare subroutine Error_Services, Logging_Services, Database_Services, Lot_Services, Service_Services
|
Declare subroutine Error_Services, Logging_Services, Database_Services, Lot_Services, Service_Services
|
||||||
Declare subroutine Transaction_Services
|
Declare subroutine Transaction_Services
|
||||||
|
|
||||||
Options EVENT_TYPES = 'MOVE_IN', 'MOVE_OUT', 'HOLD_ON', 'HOLD_OFF', 'REDUCE_WAFER_QTY', 'BONUS_WAFER_QTY', 'COMMENT', 'LOCATION', 'LOAD', 'UNSIGN_LOAD', 'TW_USE', 'CLOSE', 'SIGN_FQA', 'UNSIGN_FQA'
|
Options EVENT_TYPES = 'MOVE_IN', 'MOVE_OUT', 'HOLD_ON', 'HOLD_OFF', 'REDUCE_WAFER_QTY', 'BONUS_WAFER_QTY', 'COMMENT', 'LOCATION', 'LOAD', 'UNSIGN_LOAD', 'TW_USE', 'CLOSE', 'SIGN_FQA', 'UNSIGN_FQA', 'ADD_LOT_OPERATION', 'REMOVE_LOT_OPERATION', 'MET_TEST', 'LOG_WAFER_COUNT', 'PACKAGING'
|
||||||
Options LOT_TYPES = 'TW', 'RDS', 'WM_OUT', 'WM_IN', 'WO_MAT', 'LOT'
|
Options LOT_TYPES = 'TW', 'RDS', 'WM_OUT', 'WM_IN', 'WO_MAT', 'LOT'
|
||||||
Options LEGACY_LOT_TYPES = 'RDS', 'WM_OUT', 'WM_IN'
|
Options LEGACY_LOT_TYPES = 'RDS', 'WM_OUT', 'WM_IN'
|
||||||
Options BOOLEAN = 'True', 'False'
|
Options BOOLEAN = 'True', 'False'
|
||||||
@ -230,3 +230,6 @@ InitEventLog:
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,12 +3,12 @@ Compile function Lot_Operation_Services(@Service, @Params)
|
|||||||
|
|
||||||
Declare function Lot_Services, Database_Services, Error_Services, Srp_Sort_Array, Lot_Operation_Services
|
Declare function Lot_Services, Database_Services, Error_Services, Srp_Sort_Array, Lot_Operation_Services
|
||||||
Declare function RTI_CreateGUID, MemberOf, SRP_JSON, Operation_Services, Datetime, Met_Test_Services, PSN_Services
|
Declare function RTI_CreateGUID, MemberOf, SRP_JSON, Operation_Services, Datetime, Met_Test_Services, PSN_Services
|
||||||
|
Declare function Date_Services
|
||||||
Declare subroutine Database_Services, Error_Services, SRP_JSON, Lot_Services, Lot_Event_Services, Lot_Operation_Services
|
Declare subroutine Database_Services, Error_Services, SRP_JSON, Lot_Services, Lot_Event_Services, Lot_Operation_Services
|
||||||
|
|
||||||
$insert LOGICAL
|
$insert LOGICAL
|
||||||
$insert LOT_EQUATES
|
$insert LOT_EQUATES
|
||||||
$Insert LOT_OPERATION_EQUATES
|
$Insert LOT_OPERATION_EQUATES
|
||||||
$Insert METROLOGY_DATA_EXAMPLE_EQUATES
|
|
||||||
$Insert OPERATION_EQUATES
|
$Insert OPERATION_EQUATES
|
||||||
$Insert MET_TEST_EQUATES
|
$Insert MET_TEST_EQUATES
|
||||||
$Insert WAFER_COUNTER_EQUATES
|
$Insert WAFER_COUNTER_EQUATES
|
||||||
@ -30,7 +30,7 @@ Service AddOperationToLot(LotId, OperationId, PrescribedSequence, UserId)
|
|||||||
If RowExists('LOT', LotId) then
|
If RowExists('LOT', LotId) then
|
||||||
If RowExists('OPERATION', OperationId) then
|
If RowExists('OPERATION', OperationId) then
|
||||||
If PrescribedSequence AND Num(PrescribedSequence) then
|
If PrescribedSequence AND Num(PrescribedSequence) then
|
||||||
If Lot_Operation_Services('CanUserAddLotOperation', UserId) then
|
If Lot_Services('CanUserModifyLot', UserId) then
|
||||||
LotCurrOperation = Lot_Services('GetLotCurrOperationId', LotId)
|
LotCurrOperation = Lot_Services('GetLotCurrOperationId', LotId)
|
||||||
CurrOperationSequence = Xlate('LOT_OPERATION', LotCurrOperation, LOT_OPERATION_OPERATION_SEQUENCE$, 'X')
|
CurrOperationSequence = Xlate('LOT_OPERATION', LotCurrOperation, LOT_OPERATION_OPERATION_SEQUENCE$, 'X')
|
||||||
If CurrOperationSequence LT PrescribedSequence then
|
If CurrOperationSequence LT PrescribedSequence then
|
||||||
@ -74,7 +74,8 @@ Service AddOperationToLot(LotId, OperationId, PrescribedSequence, UserId)
|
|||||||
IsOperationRework = Database_Services('ReadDataColumn', 'OPERATION', OperationId, OPERATION_REWORK$)
|
IsOperationRework = Database_Services('ReadDataColumn', 'OPERATION', OperationId, OPERATION_REWORK$)
|
||||||
Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationRecId, LotOperationRec)
|
Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationRecId, LotOperationRec)
|
||||||
If Error_Services('NoError') then
|
If Error_Services('NoError') then
|
||||||
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'ADD_LOT_OPERATION', 'Added operation ' : Operation : ' to lot.', '', UserId)
|
OperationDesc = XLATE('OPERATION', OperationId, OPERATION_OPERATION_DESCRIPTION$, 'X')
|
||||||
|
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'ADD_LOT_OPERATION', 'Added operation ' : Quote(OperationDesc) : ' to lot.', '', UserId)
|
||||||
end else
|
end else
|
||||||
ErrorMessage = Error_Services('GetMessage')
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
end
|
end
|
||||||
@ -86,7 +87,7 @@ Service AddOperationToLot(LotId, OperationId, PrescribedSequence, UserId)
|
|||||||
ErrorMessage = 'Not allowed to add new operations prior to current operation'
|
ErrorMessage = 'Not allowed to add new operations prior to current operation'
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'User ' : UserId : ' does not have permission to add operations to lots.'
|
ErrorMessage = 'User ' : UserId : ' does not have permission to modify lots.'
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Invalid operation sequence entered.'
|
ErrorMessage = 'Invalid operation sequence entered.'
|
||||||
@ -102,7 +103,6 @@ Service AddOperationToLot(LotId, OperationId, PrescribedSequence, UserId)
|
|||||||
Response = Operation
|
Response = Operation
|
||||||
end else
|
end else
|
||||||
Error_Services('Add', 'Error in ' : Service : '.' : ErrorMessage)
|
Error_Services('Add', 'Error in ' : Service : '.' : ErrorMessage)
|
||||||
// todo: add logging
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end service
|
end service
|
||||||
@ -114,48 +114,53 @@ Service RemoveLotOperation(LotOperationId, UserId)
|
|||||||
Success = False$
|
Success = False$
|
||||||
|
|
||||||
If RowExists('LOT_OPERATION', LotOperationId) then
|
If RowExists('LOT_OPERATION', LotOperationId) then
|
||||||
LotOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', LotOperationId, True$, 0, False$)
|
If Lot_Services('CanUserModifyLot', UserId) then
|
||||||
LotId = LotOperationRec<LOT_OPERATION_LOT_ID$>
|
LotOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', LotOperationId, True$, 0, False$)
|
||||||
MoveInTime = LotOperationRec<LOT_OPERATION_DATETIME_IN$>
|
LotId = LotOperationRec<LOT_OPERATION_LOT_ID$>
|
||||||
MoveOutTime = LotOperationRec<LOT_OPERATION_DATETIME_OUT$>
|
MoveInTime = LotOperationRec<LOT_OPERATION_DATETIME_IN$>
|
||||||
Sequence = LotOperationRec<LOT_OPERATION_OPERATION_SEQUENCE$>
|
MoveOutTime = LotOperationRec<LOT_OPERATION_DATETIME_OUT$>
|
||||||
OperationId = LotOperationRec<LOT_OPERATION_OPERATION_ID$>
|
Sequence = LotOperationRec<LOT_OPERATION_OPERATION_SEQUENCE$>
|
||||||
OperationClass = XLATE('OPERATION', OperationId, OPERATION_CLASS_ID$, 'X')
|
OperationId = LotOperationRec<LOT_OPERATION_OPERATION_ID$>
|
||||||
If OperationClass NE 'RTF_DEFAULT' AND OperationClass NE 'RTF_DEFAULT_END' then
|
OperationClass = XLATE('OPERATION', OperationId, OPERATION_CLASS_ID$, 'X')
|
||||||
If MoveInTime EQ '' AND MoveOutTime EQ '' then
|
If OperationClass NE 'RTF_DEFAULT' AND OperationClass NE 'RTF_DEFAULT_END' then
|
||||||
LotOperationRec<LOT_OPERATION_LOT_ID$> = '';//Nulling this value out should disassociated the lot operation record from the lot.
|
If MoveInTime EQ '' AND MoveOutTime EQ '' then
|
||||||
Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationId, LotOperationRec)
|
LotOperationRec<LOT_OPERATION_LOT_ID$> = '';//Nulling this value out should disassociated the lot operation record from the lot.
|
||||||
If Error_Services('NoError') then
|
Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationId, LotOperationRec)
|
||||||
Lot_Operation_Services('UpdateLotOperationSequence', LotId, Sequence)
|
|
||||||
If Error_Services('NoError') then
|
If Error_Services('NoError') then
|
||||||
Success = True$
|
Lot_Operation_Services('UpdateLotOperationSequence', LotId, Sequence)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
Success = True$
|
||||||
|
end else
|
||||||
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
|
end
|
||||||
|
OperationDesc = XLATE('OPERATION', OperationId, OPERATION_OPERATION_DESCRIPTION$, 'X')
|
||||||
|
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'REMOVE_LOT_OPERATION', 'Removed operation ' : Quote(OperationDesc) : ' from lot.', '', UserId)
|
||||||
end else
|
end else
|
||||||
ErrorMessage = Error_Services('GetMessage')
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
end
|
end
|
||||||
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'REMOVE_LOT_OPERATION', 'Removed operation ' : OperationId : ' from lot.', '', UserId)
|
|
||||||
end else
|
end else
|
||||||
ErrorMessage = Error_Services('GetMessage')
|
ErrorMessage = 'Lot has already started processing on operation ' : OperationId
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Lot has already started processing on operation ' : OperationId
|
ErrorMessage = 'Unable to remove default operations.'
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Unable to remove default operations.'
|
ErrorMessage = 'User ' : UserId : ' does not have permission modify lots.'
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Lot Operation record not found'
|
ErrorMessage = 'Lot Operation record not found'
|
||||||
end
|
end
|
||||||
|
|
||||||
If ErrorMessage NE '' then
|
If ErrorMessage NE '' then
|
||||||
Error_Services('Add', 'Error in service ': Service : ' : ' : ErrorMessage)
|
Error_Services('Add', ErrorMessage)
|
||||||
end
|
end
|
||||||
|
|
||||||
Response = Success
|
Response = Success
|
||||||
|
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
Service UpdateLotOperationSequence(LotId, StartSequence)
|
Service UpdateLotOperationSequence(LotId, StartSequence)
|
||||||
|
|
||||||
ErrorMessage = ''
|
ErrorMessage = ''
|
||||||
If StartSequence EQ '' then
|
If StartSequence EQ '' then
|
||||||
StartSequence = 1
|
StartSequence = 1
|
||||||
@ -189,17 +194,6 @@ Service UpdateLotOperationSequence(LotId, StartSequence)
|
|||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
Service ModifyLotOperationSequence(LotOperationId, NewSequence, UserId)
|
|
||||||
|
|
||||||
ErrorMessage = ''
|
|
||||||
|
|
||||||
If ErrorMessage NE '' then
|
|
||||||
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
end service
|
|
||||||
|
|
||||||
Service GetAvailableSequences(LotId)
|
Service GetAvailableSequences(LotId)
|
||||||
AvailableSequences = ''
|
AvailableSequences = ''
|
||||||
|
|
||||||
@ -211,9 +205,7 @@ Service GetAvailableSequences(LotId)
|
|||||||
OperationClass = Database_Services('ReadDataColumn', 'OPERATION', OperationId, OPERATION_CLASS_ID$)
|
OperationClass = Database_Services('ReadDataColumn', 'OPERATION', OperationId, OPERATION_CLASS_ID$)
|
||||||
StartDtm = LotOperationRec<LOT_OPERATION_DATETIME_IN$>
|
StartDtm = LotOperationRec<LOT_OPERATION_DATETIME_IN$>
|
||||||
If StartDTM EQ '' then
|
If StartDTM EQ '' then
|
||||||
If OperationClass NE 'RTF_DEFAULT' then
|
AvailableSequences<1, -1> = Sequence + 1
|
||||||
AvailableSequences<1, -1> = Sequence + 1
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
Next LotOperationId
|
Next LotOperationId
|
||||||
end
|
end
|
||||||
@ -221,30 +213,6 @@ Service GetAvailableSequences(LotId)
|
|||||||
Response = AvailableSequences
|
Response = AvailableSequences
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
Service AddSpecsToLotOperation(LotOperationId)
|
|
||||||
|
|
||||||
end service
|
|
||||||
|
|
||||||
Service CanUserAddLotOperation(UserId)
|
|
||||||
|
|
||||||
If UserId NE '' then
|
|
||||||
Begin Case
|
|
||||||
Case MemberOf(UserId, 'LEAD')
|
|
||||||
Response = True$
|
|
||||||
Case MemberOf(UserId, 'SUPERVISOR')
|
|
||||||
Response = True$
|
|
||||||
Case MemberOf(UserId, 'ENGINEER')
|
|
||||||
Response = True$
|
|
||||||
Case MemberOf(UserId, 'ENG_TECH')
|
|
||||||
Response = True$
|
|
||||||
Case Otherwise$
|
|
||||||
Response = False$
|
|
||||||
End Case
|
|
||||||
end
|
|
||||||
|
|
||||||
end service
|
|
||||||
|
|
||||||
Service ConvertRecordToJson(LotOperationId)
|
Service ConvertRecordToJson(LotOperationId)
|
||||||
|
|
||||||
JsonString = ''
|
JsonString = ''
|
||||||
@ -258,8 +226,14 @@ Service ConvertRecordToJson(LotOperationId)
|
|||||||
SRP_JSON(objJSON, 'SetValue', 'LotId', LotId, 'String')
|
SRP_JSON(objJSON, 'SetValue', 'LotId', LotId, 'String')
|
||||||
SRP_JSON(objJSON, 'SetValue', 'LegacyLotId', LegacyLotId, 'String')
|
SRP_JSON(objJSON, 'SetValue', 'LegacyLotId', LegacyLotId, 'String')
|
||||||
SRP_JSON(objJSON, 'SetValue', 'OperationId', LotOperationRec<LOT_OPERATION_OPERATION_ID$>, 'String')
|
SRP_JSON(objJSON, 'SetValue', 'OperationId', LotOperationRec<LOT_OPERATION_OPERATION_ID$>, 'String')
|
||||||
SRP_JSON(objJSON, 'SetValue', 'DateTimeIn', OConv(LotOperationRec<LOT_OPERATION_DATETIME_IN$>, 'DT'), 'String')
|
OperationDesc = XLATE('OPERATION', LotOperationRec<LOT_OPERATION_OPERATION_ID$>, OPERATION_OPERATION_DESCRIPTION$, 'X')
|
||||||
SRP_JSON(objJSON, 'SetValue', 'DateTimeOut', OConv(LotOperationRec<LOT_OPERATION_DATETIME_OUT$>, 'DT'), 'String')
|
SRP_JSON(objJSON, 'SetValue', 'Description', OperationDesc, 'String')
|
||||||
|
OperationClass = XLATE('OPERATION', LotOperationRec<LOT_OPERATION_OPERATION_ID$>, OPERATION_CLASS_ID$, 'X')
|
||||||
|
SRP_JSON(objJSON, 'SetValue', 'OperationClass', OperationClass)
|
||||||
|
DatetimeIn = Date_Services('ConvertDateTimeToISO8601', LotOperationRec<LOT_OPERATION_DATETIME_IN$>)
|
||||||
|
SRP_JSON(objJSON, 'SetValue', 'DateTimeIn', DatetimeIn)
|
||||||
|
DatetimeOut = Date_Services('ConvertDateTimeToISO8601', LotOperationRec<LOT_OPERATION_DATETIME_OUT$>)
|
||||||
|
SRP_JSON(objJSON, 'SetValue', 'DateTimeOut', DatetimeOut)
|
||||||
EquipmentId = LotOperationRec<LOT_OPERATION_EQUIPMENT_ID$>
|
EquipmentId = LotOperationRec<LOT_OPERATION_EQUIPMENT_ID$>
|
||||||
SRP_JSON(objJSON, 'SetValue', 'EquipmentId', EquipmentId)
|
SRP_JSON(objJSON, 'SetValue', 'EquipmentId', EquipmentId)
|
||||||
SRP_JSON(objJSON, 'SetValue', 'WaferInQty', LotOperationRec<LOT_OPERATION_WAFER_IN_QTY$>, 'Number')
|
SRP_JSON(objJSON, 'SetValue', 'WaferInQty', LotOperationRec<LOT_OPERATION_WAFER_IN_QTY$>, 'Number')
|
||||||
@ -267,8 +241,10 @@ Service ConvertRecordToJson(LotOperationId)
|
|||||||
SRP_JSON(objJSON, 'SetValue', 'OperatorInId', LotOperationRec<LOT_OPERATION_OPERATOR_IN_ID$>)
|
SRP_JSON(objJSON, 'SetValue', 'OperatorInId', LotOperationRec<LOT_OPERATION_OPERATOR_IN_ID$>)
|
||||||
SRP_JSON(objJSON, 'SetValue', 'OperatorOutId', LotOperationRec<LOT_OPERATION_OPERATOR_OUT_ID$>)
|
SRP_JSON(objJSON, 'SetValue', 'OperatorOutId', LotOperationRec<LOT_OPERATION_OPERATOR_OUT_ID$>)
|
||||||
SRP_JSON(objJSON, 'SetValue', 'OperationSequence', LotOperationRec<LOT_OPERATION_OPERATION_SEQUENCE$>)
|
SRP_JSON(objJSON, 'SetValue', 'OperationSequence', LotOperationRec<LOT_OPERATION_OPERATION_SEQUENCE$>)
|
||||||
SRP_JSON(objJSON, 'SetValue', 'DateTimeStart', OConv(LotOperationRec<LOT_OPERATION_DATETIME_START$>, 'DT'), 'String')
|
DatetimeStart = Date_Services('ConvertDateTimeToISO8601', LotOperationRec<LOT_OPERATION_DATETIME_START$>)
|
||||||
SRP_JSON(objJSON, 'SetValue', 'DateTimeStop', OConv(LotOperationRec<LOT_OPERATION_DATETIME_STOP$>, 'DT'), 'String')
|
SRP_JSON(objJSON, 'SetValue', 'DateTimeStart', DatetimeStart)
|
||||||
|
DatetimeStop = Date_Services('ConvertDateTimeToISO8601', LotOperationRec<LOT_OPERATION_DATETIME_STOP$>)
|
||||||
|
SRP_JSON(objJSON, 'SetValue', 'DateTimeStop', DatetimeStop)
|
||||||
SRP_JSON(objJSON, 'SetValue', 'MetTestId', LotOperationRec<LOT_OPERATION_MET_TEST_ID$>)
|
SRP_JSON(objJSON, 'SetValue', 'MetTestId', LotOperationRec<LOT_OPERATION_MET_TEST_ID$>)
|
||||||
SRP_JSON(objJSON, 'SetValue', 'CleanId', LotOperationRec<LOT_OPERATION_CLEAN_ID$>)
|
SRP_JSON(objJSON, 'SetValue', 'CleanId', LotOperationRec<LOT_OPERATION_CLEAN_ID$>)
|
||||||
SRP_JSON(objJSON, 'SetValue', 'PackagingId', LotOperationRec<LOT_OPERATION_PACKAGING_ID$>)
|
SRP_JSON(objJSON, 'SetValue', 'PackagingId', LotOperationRec<LOT_OPERATION_PACKAGING_ID$>)
|
||||||
@ -278,7 +254,22 @@ Service ConvertRecordToJson(LotOperationId)
|
|||||||
SRP_JSON(objJson, 'SetValue', 'PackagingRequired', LotOperationRec<LOT_OPERATION_PACKAGING_REQUIRED$>, 'Boolean')
|
SRP_JSON(objJson, 'SetValue', 'PackagingRequired', LotOperationRec<LOT_OPERATION_PACKAGING_REQUIRED$>, 'Boolean')
|
||||||
SRP_JSON(objJson, 'SetValue', 'CleanRequired', LotOperationRec<LOT_OPERATION_CLEAN_REQUIRED$>, 'Boolean')
|
SRP_JSON(objJson, 'SetValue', 'CleanRequired', LotOperationRec<LOT_OPERATION_CLEAN_REQUIRED$>, 'Boolean')
|
||||||
SRP_JSON(objJson, 'SetValue', 'WaferCounterRequired', LotOperationRec<LOT_OPERATION_WAFER_COUNTER_REQUIRED$>, 'Boolean')
|
SRP_JSON(objJson, 'SetValue', 'WaferCounterRequired', LotOperationRec<LOT_OPERATION_WAFER_COUNTER_REQUIRED$>, 'Boolean')
|
||||||
|
PSNo = Xlate('LOT', LotId, LOT_PROD_SPEC_ID$, 'X')
|
||||||
|
RecipeToolInfo = PSN_Services('GetAllMetrologyRecipes', PSNo, True$, True$, True$, True$)
|
||||||
|
objRecipeInfo = ''
|
||||||
|
If SRP_Json(objRecipeInfo, 'New', 'Array') then
|
||||||
|
for each RecipeLine in RecipeToolInfo using @FM
|
||||||
|
If SRP_Json(objRecipeLine, 'New', 'Object') then
|
||||||
|
SRP_Json(objRecipeLine, 'SetValue', 'ToolClass', RecipeLine<1,1>, 'String')
|
||||||
|
SRP_Json(objRecipeLine, 'SetValue', 'Recipe', RecipeLine<1,2>, 'String')
|
||||||
|
SRP_Json(objRecipeLine, 'SetValue', 'Stage', RecipeLine<1,3>, 'String')
|
||||||
|
SRP_Json(objRecipeInfo, 'Add', objRecipeLine)
|
||||||
|
SRP_Json(objRecipeLine, 'Release')
|
||||||
|
end
|
||||||
|
Next RecipeLine
|
||||||
|
SRP_Json(objJSON, 'Set', 'RecipeInfo', objRecipeInfo)
|
||||||
|
SRP_Json(objRecipeInfo, 'Release')
|
||||||
|
end
|
||||||
SRP_JSON(objJSON, 'SetValue', 'OperationType', LotOperationRec<LOT_OPERATION_OPERATION_TYPE$>)
|
SRP_JSON(objJSON, 'SetValue', 'OperationType', LotOperationRec<LOT_OPERATION_OPERATION_TYPE$>)
|
||||||
//Add OPERATION Object
|
//Add OPERATION Object
|
||||||
OperationJson = Operation_Services('ConvertRecordToJSON', LotOperationRec<LOT_OPERATION_OPERATION_ID$>)
|
OperationJson = Operation_Services('ConvertRecordToJSON', LotOperationRec<LOT_OPERATION_OPERATION_ID$>)
|
||||||
@ -302,7 +293,7 @@ Service ConvertRecordToJson(LotOperationId)
|
|||||||
end
|
end
|
||||||
|
|
||||||
//Add Available Met Test Record
|
//Add Available Met Test Record
|
||||||
AvailMetTestIds = Met_Test_Services('GetMetTests', LotId, LegacyLotId, '', EquipmentId, True$)
|
AvailMetTestIds = Met_Test_Services('GetMetTests', LotId, LegacyLotId, '', '', True$)
|
||||||
objAvailMetTest = ''
|
objAvailMetTest = ''
|
||||||
If SRP_Json(objAvailMetTest, 'New', 'Array') then
|
If SRP_Json(objAvailMetTest, 'New', 'Array') then
|
||||||
for each MetTestId in AvailMetTestIds using @VM
|
for each MetTestId in AvailMetTestIds using @VM
|
||||||
@ -316,8 +307,6 @@ Service ConvertRecordToJson(LotOperationId)
|
|||||||
SRP_Json(objAvailMetTest, 'Release')
|
SRP_Json(objAvailMetTest, 'Release')
|
||||||
end
|
end
|
||||||
//Add in relevant recipes
|
//Add in relevant recipes
|
||||||
//OperationType = LotOperationRec<LOT_OPERATION_OPERATION_TYPE$>
|
|
||||||
//MetTestTypeRequired = LotOperationRec<LOT_OPERATION_MET_TEST_TYPE_REQUIRED$>
|
|
||||||
Recipes = ''
|
Recipes = ''
|
||||||
ShowThickRecipes = False$
|
ShowThickRecipes = False$
|
||||||
ShowResRecipes = False$
|
ShowResRecipes = False$
|
||||||
@ -340,7 +329,7 @@ Service ConvertRecordToJson(LotOperationId)
|
|||||||
ShowCleanRecipes = True$
|
ShowCleanRecipes = True$
|
||||||
end
|
end
|
||||||
ProdSpecNo = XLATE('LOT', LotId, LOT_PROD_SPEC_ID$, 'X')
|
ProdSpecNo = XLATE('LOT', LotId, LOT_PROD_SPEC_ID$, 'X')
|
||||||
Recipes = PSN_Services('GetAllMetrologoyRecipes', ProdSpecNo, ShowSurfscanRecipes, ShowCleanRecipes, ShowResRecipes, ShowThickRecipes)
|
Recipes = PSN_Services('GetAllMetrologyRecipes', ProdSpecNo, ShowSurfscanRecipes, ShowCleanRecipes, ShowResRecipes, ShowThickRecipes)
|
||||||
If SRP_JSON(objRecipes, 'New', 'Array') then
|
If SRP_JSON(objRecipes, 'New', 'Array') then
|
||||||
for each Recipe in Recipes using @FM
|
for each Recipe in Recipes using @FM
|
||||||
//ToolClass : @VM : Recipe : @VM : Stage
|
//ToolClass : @VM : Recipe : @VM : Stage
|
||||||
@ -358,9 +347,8 @@ Service ConvertRecordToJson(LotOperationId)
|
|||||||
SRP_JSON(objJSON, 'Set', 'RecipeParams', objRecipes)
|
SRP_JSON(objJSON, 'Set', 'RecipeParams', objRecipes)
|
||||||
SRP_JSON(objRecipes, 'Release')
|
SRP_JSON(objRecipes, 'Release')
|
||||||
end
|
end
|
||||||
JsonString = SRP_JSON(objJSON, 'Stringify', 'Styled')
|
JsonString = SRP_JSON(objJSON, 'Stringify', 'Fast')
|
||||||
SRP_JSON(objJSON, 'Release')
|
SRP_JSON(objJSON, 'Release')
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Response = JsonString
|
Response = JsonString
|
||||||
@ -370,12 +358,6 @@ end service
|
|||||||
|
|
||||||
Service StartLotOperation(LotOperationId, UserId)
|
Service StartLotOperation(LotOperationId, UserId)
|
||||||
|
|
||||||
//1. Validate that it can be moved into the operation passed in.
|
|
||||||
|
|
||||||
//2. Move in the lot
|
|
||||||
//3. Return true is move in successfully
|
|
||||||
//4. Return false if error moving in
|
|
||||||
|
|
||||||
ErrorMessage = ''
|
ErrorMessage = ''
|
||||||
|
|
||||||
If RowExists('LOT_OPERATION', LotOperationId) then
|
If RowExists('LOT_OPERATION', LotOperationId) then
|
||||||
@ -414,11 +396,8 @@ Service StartLotOperation(LotOperationId, UserId)
|
|||||||
end service
|
end service
|
||||||
|
|
||||||
Service CompleteLotOperation(LotOperationId, UserId)
|
Service CompleteLotOperation(LotOperationId, UserId)
|
||||||
|
|
||||||
//1. Validate that the lot is moved into the operation
|
|
||||||
//2. Validate that the lot
|
|
||||||
ErrorMessage = ''
|
ErrorMessage = ''
|
||||||
|
|
||||||
If RowExists('LOT_OPERATION', LotOperationId) then
|
If RowExists('LOT_OPERATION', LotOperationId) then
|
||||||
If RowExists('LSL_USERS', UserId) then
|
If RowExists('LSL_USERS', UserId) then
|
||||||
//We can also add additional checks like security checks, training checks, etc here if needed.
|
//We can also add additional checks like security checks, training checks, etc here if needed.
|
||||||
@ -436,13 +415,15 @@ Service CompleteLotOperation(LotOperationId, UserId)
|
|||||||
ErrorMessage = Error_Services('GetMessage')
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Lot Operation has not finished processing and cannot be moved out.'
|
ErrorMessage = 'Lot Operation has not finished processing and cannot be moved out.'
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Lot is already moved into this operation.'
|
ErrorMessage = 'Cannot complete operation because lot is not currently moved in.'
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
|
CurrOperationId = Xlate('LOT_OPERATION', LotCurrentLotOpId, LOT_OPERATION_OPERATION_ID$, 'X')
|
||||||
|
CurrOperationDesc = Xlate('OPERATION', CurrOperationId, OPERATION_OPERATION_DESCRIPTION$, 'X')
|
||||||
|
ErrorMessage = 'Cannot complete operation. Lot is currently at ' : CurrOperationDesc
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Invalid user passed to routine.'
|
ErrorMessage = 'Invalid user passed to routine.'
|
||||||
@ -452,10 +433,10 @@ Service CompleteLotOperation(LotOperationId, UserId)
|
|||||||
end
|
end
|
||||||
|
|
||||||
If ErrorMessage EQ '' then
|
If ErrorMessage EQ '' then
|
||||||
Response = True$
|
Response = True$
|
||||||
end else
|
end else
|
||||||
Response = False$
|
Response = False$
|
||||||
Error_Services('Add', 'Error in ' : Service : '. ' : ErrorMessage)
|
Error_Services('Add', ErrorMessage)
|
||||||
end
|
end
|
||||||
|
|
||||||
end service
|
end service
|
||||||
@ -472,14 +453,14 @@ Service ValidateLotOperation(LotOperationId)
|
|||||||
PackagingRequired = LotOperationRec<LOT_OPERATION_PACKAGING_REQUIRED$>
|
PackagingRequired = LotOperationRec<LOT_OPERATION_PACKAGING_REQUIRED$>
|
||||||
CleanRequired = LotOperationRec<LOT_OPERATION_CLEAN_REQUIRED$>
|
CleanRequired = LotOperationRec<LOT_OPERATION_CLEAN_REQUIRED$>
|
||||||
WaferCountRequired = LotOperationRec<LOT_OPERATION_WAFER_COUNTER_REQUIRED$>
|
WaferCountRequired = LotOperationRec<LOT_OPERATION_WAFER_COUNTER_REQUIRED$>
|
||||||
|
OperationClass = XLATE('OPERATION', OperationId, OPERATION_CLASS_ID$, 'X')
|
||||||
If MetTestRequired then
|
If MetTestRequired then
|
||||||
MetTestsInSpec = True$
|
MetTestsInSpec = True$
|
||||||
AssociatedMetTestIds = LotOperationRec<LOT_OPERATION_MET_TEST_ID$>
|
AssociatedMetTestIds = LotOperationRec<LOT_OPERATION_MET_TEST_ID$>
|
||||||
If AssociatedMetTestIds NE '' then
|
If AssociatedMetTestIds NE '' then
|
||||||
for each MetTestId in AssociatedMetTestIds using @VM
|
for each MetTestId in AssociatedMetTestIds using @VM
|
||||||
MetTestOoS = Database_Services('ReadDataColumn', 'MET_TEST', MetTestId, MET_TEST.OUT_OF_SPEC$, True$, 0, False)
|
MetTestOoS = Database_Services('ReadDataColumn', 'MET_TEST', MetTestId, MET_TEST.OUT_OF_SPEC$, True$, 0, False)
|
||||||
If MetTestOoS then
|
If MetTestOoS AND OperationClass NE 'RTF' AND OperationClass NE 'RTF_DEFAULT' then
|
||||||
//ToDo Check that the met tests meet the requirements.
|
|
||||||
MetTestsInSpec = False$
|
MetTestsInSpec = False$
|
||||||
ErrorMessage = 'An associated Met test record is out of spec.'
|
ErrorMessage = 'An associated Met test record is out of spec.'
|
||||||
end
|
end
|
||||||
@ -490,14 +471,29 @@ Service ValidateLotOperation(LotOperationId)
|
|||||||
ErrorMessage = 'Met tests are required and none are assigned.'
|
ErrorMessage = 'Met tests are required and none are assigned.'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
If PackagingRequired then
|
If PackagingRequired AND IsValid then
|
||||||
|
AssociatedPackagingIds = LotOperationRec<LOT_OPERATION_PACKAGING_ID$>
|
||||||
|
If AssociatedPackagingIds NE '' then
|
||||||
|
|
||||||
|
end else
|
||||||
|
IsValid = False$
|
||||||
|
end
|
||||||
end
|
end
|
||||||
If CleanRequired then
|
If CleanRequired AND IsValid then
|
||||||
|
AssociatedCleanIds = LotOperationRec<LOT_OPERATION_CLEAN_ID$>
|
||||||
|
If AssociatedCleanIds NE '' then
|
||||||
|
IsValid = True$
|
||||||
|
end else
|
||||||
|
IsValid = False$
|
||||||
|
end
|
||||||
end
|
end
|
||||||
If WaferCountRequired then
|
If WaferCountRequired AND IsValid then
|
||||||
|
AssociatedWaferCountIds = LotOperationRec<LOT_OPERATION_WAFER_COUNTER_ID$>
|
||||||
|
If AssociatedWaferCountIds NE '' then
|
||||||
|
IsValid = True$
|
||||||
|
end else
|
||||||
|
IsValid = False$
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Lot Operation not found'
|
ErrorMessage = 'Lot Operation not found'
|
||||||
@ -509,27 +505,3 @@ Service ValidateLotOperation(LotOperationId)
|
|||||||
Response = IsValid
|
Response = IsValid
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
Service ValidateFQA(LotOperationId)
|
|
||||||
|
|
||||||
Response = False$
|
|
||||||
LotOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', LotOperationId, True$, 0, False$)
|
|
||||||
LotId = LotOperationRec<LOT_OPERATION_LOT_ID$>
|
|
||||||
OperationStartDtm = LotOperationRec<LOT_OPERATION_DATETIME_IN$>
|
|
||||||
RelevantMetTests = ''
|
|
||||||
MetTests = Met_Test_Services('GetMetTestsByLotId', LotId)
|
|
||||||
For each MetTestId in MetTests using @VM
|
|
||||||
ThisMetTestRec = Database_Services('ReadDataRow', 'MET_TEST', MetTestId, True$, 0, False$)
|
|
||||||
|
|
||||||
Next MetTestId
|
|
||||||
|
|
||||||
end service
|
|
||||||
|
|
||||||
Service AssociateClean(LotOperationId, CleanId, UserId)
|
|
||||||
|
|
||||||
end service
|
|
||||||
|
|
||||||
Service GetFinalQAOperationJson(LotId, Stage)
|
|
||||||
|
|
||||||
end service
|
|
||||||
|
|
||||||
|
@ -46,21 +46,25 @@ Compile function Lot_Services(@Service, @Params)
|
|||||||
|
|
||||||
***********************************************************************************************************************/
|
***********************************************************************************************************************/
|
||||||
#pragma precomp SRP_PreCompiler
|
#pragma precomp SRP_PreCompiler
|
||||||
$Insert SERVICE_SETUP
|
|
||||||
$Insert APP_INSERTS
|
Declare function TEST_WAFER_PROD_SERVICES, SRP_Datetime, Datetime, Database_Services, Lot_Services, Error_Services, RTI_CREATEGUID
|
||||||
|
Declare function SRP_Array, SRP_Json, Environment_Services, Logging_Services, MemberOf, Lot_Event_Services, GetTickCount, Lot_Operation_Services
|
||||||
|
Declare function PSN_Services, Return_To_Fab_Services
|
||||||
|
Declare subroutine Database_Services, Btree.Extract, Lot_Services, Error_Services, Labeling_Services, SRP_Json, Logging_Services
|
||||||
|
Declare subroutine SRP_Run_Command, Service_Services, obj_notes, Lot_Event_Services, Mona_Services
|
||||||
|
|
||||||
|
$insert APP_INSERTS
|
||||||
$Insert LOT_EQUATES
|
$Insert LOT_EQUATES
|
||||||
$Insert TEST_WAFER_PROD_EQUATES
|
$Insert TEST_WAFER_PROD_EQUATES
|
||||||
$Insert LOT_OPERATION_EQUATES
|
$Insert Lot_Operation_Equates
|
||||||
$Insert PRODUCT_OPERATION_EQUATES
|
$Insert PRODUCT_OPERATION_EQUATES
|
||||||
$Insert LOT_EVENT_EQUATES
|
$Insert LOT_EVENT_EQUATES
|
||||||
$Insert NOTIFICATION_EQUATES
|
$Insert NOTIFICATION_EQUATES
|
||||||
$Insert VOIDED_LOT_EQUATES
|
$Insert VOIDED_LOT_EQUATES
|
||||||
$Insert IFX_EQUATES
|
$Insert RDS_EQUATES
|
||||||
|
$Insert WO_LOG_EQUATES
|
||||||
Declare function TEST_WAFER_PROD_SERVICES, SRP_Datetime, Datetime, Database_Services, Lot_Services, Error_Services, RTI_CREATEGUID
|
$Insert PROD_VER_EQUATES
|
||||||
Declare function SRP_Array, SRP_Json, Environment_Services, Logging_Services, MemberOf, Lot_Event_Services, GetTickCount
|
$Insert OPERATION_EQUATES
|
||||||
Declare subroutine Database_Services, Btree.Extract, Lot_Services, Error_Services, Labeling_Services, SRP_Json, Logging_Services
|
|
||||||
Declare subroutine SRP_Run_Command, Service_Services, obj_notes, Lot_Event_Services, Mona_Services
|
|
||||||
|
|
||||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Lot'
|
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Lot'
|
||||||
LogDate = Oconv(Date(), 'D4/')
|
LogDate = Oconv(Date(), 'D4/')
|
||||||
@ -77,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'
|
||||||
objLotRunLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ',', Headers, '', False$, False$)
|
objRunLog = 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'
|
||||||
@ -91,8 +95,9 @@ LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' T
|
|||||||
Headers = 'Logging DTM' : @FM : 'Lot Id' : @FM : 'Operator' : @FM : 'Message'
|
Headers = 'Logging DTM' : @FM : 'Lot Id' : @FM : 'Operator' : @FM : 'Message'
|
||||||
objLotClosureLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ',', Headers, '', False$, False$)
|
objLotClosureLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ',', Headers, '', False$, False$)
|
||||||
|
|
||||||
Options EVENT_TYPES = 'MOVE_IN', 'MOVE_OUT', 'HOLD_ON', 'HOLD_OFF', 'REDUCE_WAFER_QTY', 'BONUS_WAFER_QTY', 'COMMENT', 'LOCATION', 'LOAD', 'UNSIGN_LOAD', 'TW_USE', 'CLOSE', 'SIGN_FQA', 'UNSIGN_FQA'
|
Options EVENT_TYPES = 'MOVE_IN', 'MOVE_OUT', 'HOLD_ON', 'HOLD_OFF', 'REDUCE_WAFER_QTY', 'BONUS_WAFER_QTY', 'COMMENT', 'LOCATION', 'LOAD', 'UNSIGN_LOAD', 'TW_USE', 'CLOSE', 'SIGN_FQA', 'UNSIGN_FQA', 'SYSTEM_COMMENT'
|
||||||
Options LOT_TYPES = 'TW', 'RDS', 'WM_OUT', 'WM_IN', 'WO_MAT', 'LOT'
|
Options LOT_TYPES = 'TW', 'RDS', 'WM_OUT', 'WM_IN', 'WO_MAT', 'LOT'
|
||||||
|
Options LEGACY_LOT_TYPES = 'RDS', 'WM_OUT', 'WM_IN', 'WO_MAT'
|
||||||
|
|
||||||
IsProd = Environment_Services('IsProd')
|
IsProd = Environment_Services('IsProd')
|
||||||
If IsProd EQ True$ then
|
If IsProd EQ True$ then
|
||||||
@ -177,71 +182,112 @@ Service GenerateNewLotId(LotType)
|
|||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
Service GetLotIdByLegacyLotIdAndType(LegacyLotId, LegacyLotType=LEGACY_LOT_TYPES)
|
||||||
Service GetLotIdByLegacyLotIdAndType(LegacyLotId, LegacyLotType)
|
StartTick = GetTickCount()
|
||||||
|
|
||||||
StartTick = GetTickCount()
|
|
||||||
MetricName = 'GetLotIdByLegacyLotIdAndType'
|
MetricName = 'GetLotIdByLegacyLotIdAndType'
|
||||||
|
|
||||||
ErrorMsg = ''
|
ErrorMsg = ''
|
||||||
Open 'DICT.LOT' to DictLot then
|
Open 'DICT.LOT' to DictLot then
|
||||||
SearchString = ''
|
|
||||||
SearchString := 'LEGACY_LOT_ID':@VM:LegacyLotId:@FM
|
SearchString = ''
|
||||||
SearchString := 'TYPE':@VM:LegacyLotType:@FM
|
SearchString := 'LEGACY_LOT_ID':@VM:LegacyLotId:@FM
|
||||||
LotIdKeys = ''
|
SearchString := 'LEGACY_LOT_TYPE':@VM:LegacyLotType:@FM
|
||||||
Btree.Extract(SearchString, 'LOT', DictLot, LotIdKeys, '', '')
|
LotIdKeys = ''
|
||||||
ErrCode = ''
|
Btree.Extract(SearchString, 'LOT', DictLot, LotIdKeys, '', '')
|
||||||
IF Get_Status(ErrCode) then
|
ErrCode = ''
|
||||||
ErrorMsg = 'Error in ':Service:' service. Error calling Btree.Extract. Error code ':ErrCode:'.'
|
IF Get_Status(ErrCode) then
|
||||||
end else
|
ErrorMsg = 'Error in ':Service:' service. Error calling Btree.Extract. Error code ':ErrCode:'.'
|
||||||
Response = LotIdKeys<1,1>
|
end else
|
||||||
end
|
Response = LotIdKeys<1,1>
|
||||||
end else
|
end
|
||||||
ErrorMsg = 'Error in ':Service:' service. Error opening LOT dictionary.'
|
|
||||||
end
|
end else
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. Error opening LOT dictionary.'
|
||||||
EndTick = GetTickCount()
|
end
|
||||||
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
|
||||||
|
EndTick = GetTickCount()
|
||||||
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
|
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
||||||
|
|
||||||
|
If ErrorMsg NE '' then
|
||||||
|
Error_Services('Add', ErrorMsg)
|
||||||
|
end
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
Service CreateNewLot(LotType, ProdName, LotQty, VendorPartNo, VendorLotNo, VendorCode, Username, PrinterID, LotId)
|
Service CreateNewLot(LotType, ProdName, LotQty, VendorPartNo, VendorLotNo, VendorCode, Username, PrinterID, LegacyLotId)
|
||||||
|
|
||||||
StartTick = GetTickCount()
|
StartTick = GetTickCount()
|
||||||
MetricName = 'CreateNewLot'
|
MetricName = 'CreateNewLot'
|
||||||
|
|
||||||
CreatedLotNumber = ''
|
CreatedLotNumber = ''
|
||||||
ErrorMessage = ''
|
ErrorMessage = ''
|
||||||
Begin Case
|
Begin Case
|
||||||
Case LotType EQ 'RDS' OR LotType EQ 'WM_IN' OR LotType EQ 'WM_OUT' OR LotType EQ 'WO_MAT'
|
Case LotType EQ 'RDS' OR LotType EQ 'WM_IN' OR LotType EQ 'WM_OUT' OR LotType EQ 'WO_MAT'
|
||||||
// Case statement for legacy lot entity types
|
If LegacyLotId NE '' then
|
||||||
NewLotId = Lot_Services('GenerateNewLotId', LotType)
|
LegacyLotType = LotType
|
||||||
If NewLotId NE '' then
|
LotId = Lot_Services('GetLotIdByLegacyLotIdAndType', LegacyLotId, LegacyLotType)
|
||||||
If RowExists('LOT', NewLotId) NE False$ then
|
If LotId EQ '' then
|
||||||
LotRec = ''
|
LotType = 'PROD'
|
||||||
LotRec<LOT_TYPE$> = LotType
|
// Case statement for legacy lot entity types
|
||||||
LotRec<LOT_PROD_ID$> = ''
|
NewLotId = Lot_Services('GenerateNewLotId', LegacyLotType)
|
||||||
LotRec<LOT_ORIG_WAFER_QTY$> = LotQty
|
If NewLotId NE '' then
|
||||||
LotRec<LOT_WAFER_QTY$> = LotQty
|
If RowExists('LOT', NewLotId) NE False$ then
|
||||||
LotRec<LOT_VENDOR_PART_NO$> = VendorPartNo
|
WoNo = ''
|
||||||
LotRec<LOT_VENDOR_LOT_NO$> = VendorLotNo
|
EpiPartNo = ''
|
||||||
LotRec<LOT_VENDOR_CODE$> = VendorCode
|
ProdVerNo = ''
|
||||||
LotRec<LOT_LEGACY_LOT_ID$> = LotId
|
Begin Case
|
||||||
Database_Services('WriteDataRow', 'LOT', NewLotId, LotRec)
|
Case LegacyLotType EQ 'RDS'
|
||||||
If Error_Services('HasError') then
|
WoNo = XLATE('RDS', LegacyLotId, RDS_WO$, 'X')
|
||||||
ErrorMessage = 'Error in ':Service:' service. ':Error_Services('GetMessage')
|
Case LegacyLotType EQ 'WM_IN' OR LegacyLotType EQ 'WM_OUT' OR LegacyLotType EQ 'WO_MAT'
|
||||||
end else
|
WoNo = Field(LegacyLotId, '*', 1)
|
||||||
CreatedLotNumber = NewLotId
|
End Case
|
||||||
end
|
|
||||||
end else
|
ProdVerNo = XLATE('WO_LOG', WoNo, WO_LOG_PROD_VER_NO$, 'X')
|
||||||
ErrorMessage = 'Error in ':Service:' service. LOT record "':NewLotId:'" already exists.'
|
EpiPartNo = XLATE('WO_LOG', WoNo, WO_LOG_EPI_PART_NO$, 'X')
|
||||||
end
|
ProdId = EpiPartNo : '*' : ProdVerNo
|
||||||
end else
|
ProdSpecId = XLATE('WO_LOG', WoNo, WO_LOG_PROD_SPEC_ID$, 'X')
|
||||||
ErrorMessage = 'Error in ':Service:' service. No lot ID passed in.'
|
If ProdSpecId EQ '' then
|
||||||
end
|
Begin Case
|
||||||
Case LotType EQ 'TW'
|
Case LegacyLotType EQ 'RDS'
|
||||||
|
ProdSpecId = XLATE('RDS', LegacyLotId, RDS_PROD_SPEC_ID$, 'X')
|
||||||
|
Case Otherwise$
|
||||||
|
ProdSpecId = XLATE('PROD_VER', ProdVerNo, PROD_VER_PROC_STEP_PSN$, 'X')
|
||||||
|
End Case
|
||||||
|
end
|
||||||
|
If Not(RowExists('PRODUCT', ProdId)) then ProdId = ''
|
||||||
|
LotRec = ''
|
||||||
|
LotRec<LOT_TYPE$> = 'PROD'
|
||||||
|
LotRec<LOT_PROD_ID$> = ProdId
|
||||||
|
LotRec<LOT_ORIG_WAFER_QTY$> = LotQty
|
||||||
|
LotRec<LOT_WAFER_QTY$> = LotQty
|
||||||
|
LotRec<LOT_VENDOR_PART_NO$> = VendorPartNo
|
||||||
|
LotRec<LOT_VENDOR_LOT_NO$> = VendorLotNo
|
||||||
|
LotRec<LOT_VENDOR_CODE$> = VendorCode
|
||||||
|
LotRec<LOT_LEGACY_LOT_ID$> = LegacyLotId
|
||||||
|
LotRec<LOT_LEGACY_LOT_TYPE$> = LegacyLotType
|
||||||
|
LotRec<LOT_WO_LOG_ID$> = WONo
|
||||||
|
LotRec<LOT_PROD_SPEC_ID$> = ProdSpecId
|
||||||
|
LotRec<LOT_EPI_PART_NO$> = EpiPartNo
|
||||||
|
LotRec<LOT_PROD_VER_NO$> = ProdVerNo
|
||||||
|
Database_Services('WriteDataRow', 'LOT', NewLotId, LotRec)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
CreatedLotNumber = NewLotId
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Error in ':Service:' service. ':Error_Services('GetMessage')
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Error in ':Service:' service. Failed to generate new LOT id. LOT record "':NewLotId:'" already exists.'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Error in ':Service:' service. Failed to generate new LOT id.'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Error in ':Service:' service. Lot Id ':LotId:' already exists for LegacyLotId ':LegacyLotId:'.'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Error in ':Service:' service. Null LegacyLotId passed in.'
|
||||||
|
end
|
||||||
|
Case LotType EQ 'TW'
|
||||||
If ProdName NE '' then
|
If ProdName NE '' then
|
||||||
TWProdID = Test_Wafer_Prod_Services('GetTestWaferProdIDsByPartName', ProdName)
|
TWProdID = Test_Wafer_Prod_Services('GetTestWaferProdIDsByPartName', ProdName)
|
||||||
If TWProdID NE '' then
|
If TWProdID NE '' then
|
||||||
@ -536,41 +582,45 @@ end service
|
|||||||
|
|
||||||
|
|
||||||
Service CreateInitialLotOperationRecords(LotId)
|
Service CreateInitialLotOperationRecords(LotId)
|
||||||
|
ErrorMessage = ''
|
||||||
ErrorMessage = ''
|
If LotId NE '' then
|
||||||
If LotId NE '' then
|
LotRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
||||||
LotRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
LotType = LotRec<LOT_TYPE$>
|
||||||
LotType = LotRec<LOT_TYPE$>
|
ProdId = LotRec<LOT_PROD_ID$>
|
||||||
ProdId = LotRec<LOT_PROD_ID$>
|
ThisInitialProdOperations = Lot_Services('GetPrescribedOperationsByProdId', ProdId, LotType)
|
||||||
ThisInitialProdOperations = Lot_Services('GetPrescribedOperationsByProdId', ProdId, LotType)
|
If Error_Services('NoError') AND ThisInitialProdOperations NE '' then
|
||||||
If Error_Services('NoError') AND ThisInitialProdOperations NE '' then
|
For each ProdOperation in ThisInitialProdOperations using @VM
|
||||||
For each ProdOperation in ThisInitialProdOperations using @VM
|
|
||||||
ProdOperationRec = Database_Services('ReadDataRow', 'PRODUCT_OPERATION', ProdOperation)
|
ProdOperationRec = Database_Services('ReadDataRow', 'PRODUCT_OPERATION', ProdOperation)
|
||||||
OperationID = ProdOperationRec<PRODUCT_OPERATION_OPERATION_ID$>
|
OperationID = ProdOperationRec<PRODUCT_OPERATION_OPERATION_ID$>
|
||||||
OperationSequence = ProdOperationRec<PRODUCT_OPERATION_OPERATION_SEQUENCE$>
|
OperationSequence = ProdOperationRec<PRODUCT_OPERATION_OPERATION_SEQUENCE$>
|
||||||
LotOperationRecID = Rti_Createguid()
|
|
||||||
If Not(RowExists('LOT_OPERATION', LotOperationRecID)) then
|
LotOperationRecID = Rti_Createguid()
|
||||||
LotOperationRec = ''
|
If Not(RowExists('LOT_OPERATION', LotOperationRecID)) then
|
||||||
LotOperationRec<LOT_OPERATION_LOT_ID$> = LotId
|
LotOperationRec = ''
|
||||||
LotOperationRec<LOT_OPERATION_OPERATION_ID$> = OperationID
|
LotOperationRec<LOT_OPERATION_LOT_ID$> = LotId
|
||||||
LotOperationRec<LOT_OPERATION_OPERATION_SEQUENCE$> = OperationSequence
|
LotOperationRec<LOT_OPERATION_OPERATION_ID$> = OperationID
|
||||||
LotOperationRec<LOT_OPERATION_REWORK$> = False$
|
LotOperationRec<LOT_OPERATION_OPERATION_SEQUENCE$> = OperationSequence
|
||||||
Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationRecId, LotOperationRec)
|
LotOperationRec<LOT_OPERATION_REWORK$> = False$
|
||||||
TestRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationRecId, LotOperationRec)
|
||||||
end else
|
If Error_Services('HasError') then
|
||||||
ErrorMessage = 'Error in ':Service:' service. Lot Operation already existed, cannot overwrite.'
|
ErrorMessage = 'Error Writing Lot Operation Record.'
|
||||||
end
|
end
|
||||||
Next Operation
|
end else
|
||||||
end else
|
ErrorMessage = 'Lot Operation already existed, cannot overwrite'
|
||||||
ErrorMessage = 'Error in ':Service:' service. Error getting prescribed operations for lot# ' : LotId
|
end
|
||||||
end
|
Next Operation
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error in ':Service:' service. Null LotID passed into service.'
|
ErrorMessage = 'Error getting prescribed operations for lot# ' : LotId
|
||||||
end
|
end
|
||||||
If ErrorMessage NE '' then Error_Services('Add', ErrorMessage)
|
|
||||||
|
|
||||||
end service
|
|
||||||
|
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Lot ID was null'
|
||||||
|
end
|
||||||
|
If ErrorMessage NE '' then
|
||||||
|
Error_Services('Add', ErrorMessage)
|
||||||
|
end
|
||||||
|
end service
|
||||||
|
|
||||||
// Returns a @FM delimited list of operations in sequence
|
// Returns a @FM delimited list of operations in sequence
|
||||||
Service GetLotOperationSequence(LotId)
|
Service GetLotOperationSequence(LotId)
|
||||||
@ -604,9 +654,10 @@ end service
|
|||||||
|
|
||||||
Service GetLotCurrOperationId(LotId)
|
Service GetLotCurrOperationId(LotId)
|
||||||
|
|
||||||
StartTick = GetTickCount()
|
ErrorMsg = ''
|
||||||
MetricName = 'GetLotCurrOperationId'
|
StartTick = GetTickCount()
|
||||||
ErrorMsg = ''
|
MetricName = 'GetLotCurrOperationId'
|
||||||
|
|
||||||
CurrOperation = ''
|
CurrOperation = ''
|
||||||
If LotID NE '' then
|
If LotID NE '' then
|
||||||
// Get them in sequence first
|
// Get them in sequence first
|
||||||
@ -1022,126 +1073,145 @@ end service
|
|||||||
|
|
||||||
|
|
||||||
Service ConvertLotRecordToJson(LotId, ItemURL, CurrUser, FullObject=BOOLEAN)
|
Service ConvertLotRecordToJson(LotId, ItemURL, CurrUser, FullObject=BOOLEAN)
|
||||||
|
|
||||||
ErrorMessage = ''
|
ErrorMessage = ''
|
||||||
JsonString = ''
|
JsonString = ''
|
||||||
If FullObject EQ '' then FullObject = True$
|
If FullObject EQ '' then
|
||||||
If RowExists('LOT', LotId) then
|
FullObject = True$
|
||||||
objJSON = ''
|
end
|
||||||
If SRP_JSON(objJSON, 'New', 'Object') then
|
If RowExists('LOT', LotId) then
|
||||||
LotRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
objJSON = ''
|
||||||
If Error_Services('NoError') then
|
If SRP_JSON(objJSON, 'New', 'Object') then
|
||||||
If SRP_JSON(objLot, 'New', 'Object') then
|
LotRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
||||||
SRP_JSON(objLot, 'SetValue', 'LotId', LotId)
|
If Error_Services('NoError') then
|
||||||
SRP_JSON(objLot, 'SetValue', 'Type', LotRec<LOT_TYPE$>)
|
If SRP_JSON(objLot, 'New', 'Object') then
|
||||||
SRP_JSON(objLot, 'SetValue', 'ProdId', LotRec<LOT_PROD_ID$>)
|
|
||||||
Begin Case
|
SRP_JSON(objLot, 'SetValue', 'LotId', LotId)
|
||||||
Case LotRec<LOT_TYPE$> = 'TW'
|
SRP_JSON(objLot, 'SetValue', 'LegacyLotId', LotRec<LOT_LEGACY_LOT_ID$>, 'String')
|
||||||
ProdName = XLATE('TEST_WAFER_PROD', LotRec<LOT_PROD_ID$>, TEST_WAFER_PROD_PART_NAME$, 'X')
|
SRP_JSON(objLot, 'SetValue', 'LegacyLotType', LotRec<LOT_LEGACY_LOT_TYPE$>, 'String')
|
||||||
Case Otherwise$
|
CanUserModifyLot = Lot_Services('CanUserModifyLot', CurrUser)
|
||||||
ProdName = ''
|
SRP_JSON(objLot, 'SetValue', 'CanUserModifyLot', CanUserModifyLot, 'Boolean')
|
||||||
End Case
|
SRP_JSON(objLot, 'SetValue', 'WorkOrderNo', LotRec<LOT_WO_LOG_ID$>, 'String')
|
||||||
SRP_JSON(objLot, 'SetValue', 'ProdName', ProdName)
|
SRP_JSON(objLot, 'SetValue', 'EpiPartNo', LotRec<LOT_EPI_PART_NO$>, 'String')
|
||||||
SRP_JSON(objLot, 'SetValue', 'OrigWaferQty', LotRec<LOT_ORIG_WAFER_QTY$>)
|
SRP_JSON(objLot, 'SetValue', 'Type', LotRec<LOT_TYPE$>)
|
||||||
SRP_JSON(objLot, 'SetValue', 'WaferQty', LotRec<LOT_WAFER_QTY$>)
|
SRP_JSON(objLot, 'SetValue', 'ProdId', LotRec<LOT_PROD_ID$>)
|
||||||
SRP_JSON(objLot, 'SetValue', 'VendorPartNo', LotRec<LOT_VENDOR_PART_NO$>)
|
ProdSpecNo = LotRec<LOT_PROD_SPEC_ID$>
|
||||||
SRP_JSON(objLot, 'SetValue', 'VendorLotNo', LotRec<LOT_VENDOR_LOT_NO$>)
|
SRP_JSON(objLot, 'SetValue', 'ProdSpecNo', ProdSpecNo, 'String')
|
||||||
SRP_JSON(objLot, 'SetValue', 'Vendor', LotRec<LOT_VENDOR_CODE$>)
|
Begin Case
|
||||||
CurrOperation = Lot_Services('GetLotCurrOperationId', LotId)
|
Case LotRec<LOT_TYPE$> = 'TW'
|
||||||
CurrOperation = XLATE('LOT_OPERATION', CurrOperation, LOT_OPERATION_OPERATION_ID$, 'X')
|
ProdName = XLATE('TEST_WAFER_PROD', LotRec<LOT_PROD_ID$>, TEST_WAFER_PROD_PART_NAME$, 'X')
|
||||||
SRP_JSON(objLot, 'SetValue', 'CurrOperation', CurrOperation)
|
Case Otherwise$
|
||||||
MostRecentEventId = LotRec<LOT_MOST_RECENT_LOT_EVENT_ID$>
|
ProdName = ''
|
||||||
MostRecentEventDtmIConv = Xlate('LOT_EVENT', MostRecentEventId, LOT_EVENT_EVENT_DATETIME$, 'X')
|
End Case
|
||||||
MostRecentEventDtmOConv = OConv(MostRecentEventDtmIConv, 'DT')
|
SRP_JSON(objLot, 'SetValue', 'ProdName', ProdName)
|
||||||
SRP_JSON(objLot, 'SetValue', 'MostRecentEventDateTime', MostRecentEventDtmOConv)
|
SRP_JSON(objLot, 'SetValue', 'OrigWaferQty', LotRec<LOT_ORIG_WAFER_QTY$>)
|
||||||
If FullObject then
|
SRP_JSON(objLot, 'SetValue', 'WaferQty', LotRec<LOT_WAFER_QTY$>)
|
||||||
// Events Array
|
SRP_JSON(objLot, 'SetValue', 'VendorPartNo', LotRec<LOT_VENDOR_PART_NO$>)
|
||||||
EventsArrayJson = ''
|
SRP_JSON(objLot, 'SetValue', 'VendorLotNo', LotRec<LOT_VENDOR_LOT_NO$>)
|
||||||
If SRP_Json(EventsArrayJson, 'New', 'Array') then
|
SRP_JSON(objLot, 'SetValue', 'Vendor', LotRec<LOT_VENDOR_CODE$>)
|
||||||
LotEventKeys = Lot_Event_Services('GetLotEventsInSequence', LotId)
|
CurrLotOperationId = Lot_Services('GetLotCurrOperationId', LotId)
|
||||||
for each LotEventKey in LotEventKeys using @FM
|
CurrOperation = XLATE('LOT_OPERATION', CurrLotOperationId, LOT_OPERATION_OPERATION_ID$, 'X')
|
||||||
objEvent = ''
|
CurrOperationDesc = XLATE('OPERATION', CurrOperation, OPERATION_OPERATION_DESCRIPTION$, 'X')
|
||||||
EventRec = Database_Services('ReadDataRow', 'LOT_EVENT', LotEventKey)
|
SRP_JSON(objLot, 'SetValue', 'CurrLotOperationId', CurrLotOperationId)
|
||||||
If SRP_Json(objEvent, 'New', 'Object') then
|
SRP_JSON(objLot, 'SetValue', 'CurrOperation', CurrOperation)
|
||||||
SRP_JSON(objEvent, 'SetValue', 'LotEventId', LotEventKey)
|
SRP_JSON(objLot, 'SetValue', 'CurrOperationDesc', CurrOperationDesc, 'String')
|
||||||
SRP_JSON(objEvent, 'SetValue', 'LotId', EventRec<LOT_EVENT_LOT_ID$>)
|
MostRecentEventId = LotRec<LOT_MOST_RECENT_LOT_EVENT_ID$>
|
||||||
SRP_JSON(objEvent, 'SetValue', 'LotEventType', EventRec<LOT_EVENT_LOT_EVENT_TYPE$>)
|
MostRecentEventDtmIConv = Xlate('LOT_EVENT', MostRecentEventId, LOT_EVENT_EVENT_DATETIME$, 'X')
|
||||||
SRP_JSON(objEvent, 'SetValue', 'EventDatetime', OConv(EventRec<LOT_EVENT_EVENT_DATETIME$>, 'DT'))
|
MostRecentEventDtmOConv = OConv(MostRecentEventDtmIConv, 'DT')
|
||||||
SRP_JSON(objEvent, 'SetValue', 'EventNote', EventRec<LOT_EVENT_EVENT_NOTE$>)
|
SRP_JSON(objLot, 'SetValue', 'MostRecentEventDateTime', MostRecentEventDtmOConv)
|
||||||
SRP_JSON(objEvent, 'SetValue', 'EquipmentId', EventRec<LOT_EVENT_EQUIPMENT_ID$>)
|
if LotRec<LOT_LEGACY_LOT_ID$> NE '' then
|
||||||
SRP_JSON(objEvent, 'SetValue', 'EventReduceWaferQty', EventRec<LOT_EVENT_EVENT_REDUCE_WAFER_QTY$>)
|
ActiveRTFId = Return_To_Fab_Services('GetOpenReturnToFabRecordIdByCassId', LotRec<LOT_LEGACY_LOT_ID$>)
|
||||||
SRP_JSON(objEvent, 'SetValue', 'EventBonusWaferQty', EventRec<LOT_EVENT_EVENT_BONUS_WAFER_QTY$>)
|
end else
|
||||||
SRP_JSON(objEvent, 'SetValue', 'EventBeginWaferQty', EventRec<LOT_EVENT_EVENT_BEGIN_WAFER_QTY$>)
|
ActiveRTFId = Return_To_Fab_Services('GetOpenReturnToFabRecordIdByCassId', LotId)
|
||||||
SRP_JSON(objEvent, 'SetValue', 'EventEndWaferQty', EventRec<LOT_EVENT_EVENT_END_WAFER_QTY$>)
|
end
|
||||||
SRP_JSON(objEvent, 'SetValue', 'EventOperationId', EventRec<LOT_EVENT_EVENT_OPERATION_ID$>)
|
SRP_JSON(objLot, 'SetValue', 'ActiveRTFId', ActiveRTFId, 'String')
|
||||||
SRP_JSON(objEvent, 'SetValue', 'EventOperatorId', EventRec<LOT_EVENT_EVENT_OPERATOR_ID$>)
|
If FullObject then
|
||||||
SRP_JSON(objEvent, 'SetValue', 'Sequence', EventRec<LOT_EVENT_SEQUENCE$>)
|
//Events Array
|
||||||
SRP_JSON(EventsArrayJson, 'Add', objEvent)
|
EventsArrayJson = ''
|
||||||
SRP_JSON(objEvent, 'Release')
|
If SRP_Json(EventsArrayJson, 'New', 'Array') then
|
||||||
end
|
LotEventKeys = Lot_Event_Services('GetLotEventsInSequence', LotId)
|
||||||
Next LotEventKey
|
for each LotEventKey in LotEventKeys using @FM
|
||||||
SRP_JSON(objLot, 'Set', 'LotEvents', EventsArrayJson)
|
objEvent = ''
|
||||||
SRP_JSON(EventsArrayJson, 'Release')
|
EventRec = Database_Services('ReadDataRow', 'LOT_EVENT', LotEventKey)
|
||||||
end else
|
If SRP_Json(objEvent, 'New', 'Object') then
|
||||||
ErrorMessage = 'Error Creating Events JSON Array'
|
SRP_JSON(objEvent, 'SetValue', 'LotEventId', LotEventKey)
|
||||||
end
|
SRP_JSON(objEvent, 'SetValue', 'LotId', EventRec<LOT_EVENT_LOT_ID$>)
|
||||||
// Operations Array
|
SRP_JSON(objEvent, 'SetValue', 'LotEventType', EventRec<LOT_EVENT_LOT_EVENT_TYPE$>)
|
||||||
OperationsArrayJson = ''
|
SRP_JSON(objEvent, 'SetValue', 'EventDatetime', OConv(EventRec<LOT_EVENT_EVENT_DATETIME$>, 'DT'))
|
||||||
If SRP_Json(OperationsArrayJson, 'New', 'Array') then
|
SRP_JSON(objEvent, 'SetValue', 'EventNote', EventRec<LOT_EVENT_EVENT_NOTE$>)
|
||||||
LotOperationKeys = Lot_Services('GetLotOperationSequence', LotId)
|
SRP_JSON(objEvent, 'SetValue', 'EquipmentId', EventRec<LOT_EVENT_EQUIPMENT_ID$>)
|
||||||
for each LotOperationKey in LotOperationKeys using @FM
|
SRP_JSON(objEvent, 'SetValue', 'EventReduceWaferQty', EventRec<LOT_EVENT_EVENT_REDUCE_WAFER_QTY$>)
|
||||||
objOperation = ''
|
SRP_JSON(objEvent, 'SetValue', 'EventBonusWaferQty', EventRec<LOT_EVENT_EVENT_BONUS_WAFER_QTY$>)
|
||||||
OperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', LotOperationKey)
|
SRP_JSON(objEvent, 'SetValue', 'EventBeginWaferQty', EventRec<LOT_EVENT_EVENT_BEGIN_WAFER_QTY$>)
|
||||||
If SRP_Json(objOperation, 'New', 'Object') then
|
SRP_JSON(objEvent, 'SetValue', 'EventEndWaferQty', EventRec<LOT_EVENT_EVENT_END_WAFER_QTY$>)
|
||||||
SRP_JSON(objOperation, 'SetValue', 'LotOperationId', LotOperationKey)
|
SRP_JSON(objEvent, 'SetValue', 'EventOperationId', EventRec<LOT_EVENT_EVENT_OPERATION_ID$>)
|
||||||
SRP_JSON(objOperation, 'SetValue', 'LotId', OperationRec<LOT_OPERATION_LOT_ID$>)
|
SRP_JSON(objEvent, 'SetValue', 'EventOperatorId', EventRec<LOT_EVENT_EVENT_OPERATOR_ID$>)
|
||||||
SRP_JSON(objOperation, 'SetValue', 'OperationId', OperationRec<LOT_OPERATION_OPERATION_ID$>)
|
SRP_JSON(objEvent, 'SetValue', 'Sequence', EventRec<LOT_EVENT_SEQUENCE$>)
|
||||||
SRP_JSON(objOperation, 'SetValue', 'DatetimeIn', OConv(OperationRec<LOT_OPERATION_DATETIME_IN$>, 'DT'))
|
SRP_JSON(EventsArrayJson, 'Add', objEvent)
|
||||||
SRP_JSON(objOperation, 'SetValue', 'DatetimeOut', Oconv(OperationRec<LOT_OPERATION_DATETIME_OUT$>, 'DT'))
|
SRP_JSON(objEvent, 'Release')
|
||||||
SRP_JSON(objOperation, 'SetValue', 'EquipmentId', OperationRec<LOT_OPERATION_EQUIPMENT_ID$>)
|
end
|
||||||
SRP_JSON(objOperation, 'SetValue', 'WaferInQty', OperationRec<LOT_OPERATION_WAFER_IN_QTY$>)
|
Next LotEventKey
|
||||||
SRP_JSON(objOperation, 'SetValue', 'WaferOutQty', OperationRec<LOT_OPERATION_WAFER_OUT_QTY$>)
|
SRP_JSON(objLot, 'Set', 'LotEvents', EventsArrayJson)
|
||||||
SRP_JSON(objOperation, 'SetValue', 'OperatorInId', OperationRec<LOT_OPERATION_OPERATOR_IN_ID$>)
|
SRP_JSON(EventsArrayJson, 'Release')
|
||||||
SRP_JSON(objOperation, 'SetValue', 'OperatorOutId', OperationRec<LOT_OPERATION_OPERATOR_OUT_ID$>)
|
end else
|
||||||
SRP_JSON(objOperation, 'SetValue', 'OperationSequence', OperationRec<LOT_OPERATION_OPERATION_SEQUENCE$>)
|
ErrorMessage = 'Error Creating Events JSON Array'
|
||||||
SRP_JSON(objOperation, 'SetValue', 'Rework', OperationRec<LOT_OPERATION_REWORK$>)
|
end
|
||||||
SRP_JSON(objOperation, 'SetValue', 'DatetimeStart', OConv(OperationRec<LOT_OPERATION_DATETIME_START$>, 'DT'))
|
OperationsArrayJson = ''
|
||||||
SRP_JSON(objOperation, 'SetValue', 'DatetimeStop', OConv(OperationRec<LOT_OPERATION_DATETIME_STOP$>, 'DT'))
|
If SRP_Json(OperationsArrayJson, 'New', 'Array') then
|
||||||
SRP_JSON(OperationsArrayJson, 'Add', objOperation)
|
LotOperationKeys = Lot_Services('GetLotOperationSequence', LotId)
|
||||||
SRP_JSON(objOperation, 'Release')
|
for each LotOperationKey in LotOperationKeys using @FM
|
||||||
end
|
ThisLotOperationJsonString = Lot_Operation_Services('ConvertRecordToJson', LotOperationKey)
|
||||||
|
If SRP_Json(objLotOperation, 'PARSE', ThisLotOperationJsonString) EQ '' then
|
||||||
Next LotOperationKey
|
SRP_Json(OperationsArrayJson, 'Add', objLotOperation)
|
||||||
SRP_JSON(objLot, 'Set', 'LotOperations', OperationsArrayJson)
|
SRP_Json(objLotOperation, 'Release')
|
||||||
SRP_JSON(OperationsArrayJson, 'Release')
|
end
|
||||||
end else
|
Next LotOperationKey
|
||||||
ErrorMessage = 'Error Creating Operations JSON Array'
|
SRP_JSON(objLot, 'Set', 'LotOperations', OperationsArrayJson)
|
||||||
end
|
SRP_JSON(OperationsArrayJson, 'Release')
|
||||||
end
|
Recipes = PSN_Services('GetAllMetrologyRecipes', ProdSpecNo, True$, True$, True$, True$)
|
||||||
|
//Add in all lot recipe parameters
|
||||||
SRP_JSON(objJSON, 'Set', 'Lot', objLot)
|
If SRP_JSON(objRecipes, 'New', 'Array') then
|
||||||
SRP_JSON(objLot, 'Release')
|
for each Recipe in Recipes using @FM
|
||||||
end else
|
//ToolClass : @VM : Recipe : @VM : Stage
|
||||||
ErrorMessage = 'Error creating new Lot Json Object'
|
ToolClass = Recipe<1,1>
|
||||||
end
|
RecipeName = Recipe<1,2>
|
||||||
end else
|
Stage = Recipe<1,3>
|
||||||
ErrorMessage = 'Error reading ':LotId:' from lot table.'
|
If SRP_JSON(objRecipe, 'New', 'Object') then
|
||||||
end
|
SRP_JSON(objRecipe, 'SetValue', 'ToolClass', ToolClass, 'String')
|
||||||
JsonString = SRP_JSON(objJSON, 'Stringify', 'Styled')
|
SRP_JSON(objRecipe, 'SetValue', 'RecipeName', RecipeName, 'String')
|
||||||
SRP_JSON(objJSON, 'Release')
|
SRP_JSON(objRecipe, 'SetValue', 'StageName', Stage, 'String')
|
||||||
end else
|
SRP_JSON(objRecipes, 'Add', objRecipe)
|
||||||
ErrorMessage = 'Error creating new Json Object'
|
SRP_JSON(objRecipe, 'Release')
|
||||||
end
|
end
|
||||||
end else
|
Next Recipe
|
||||||
ErrorMessage = 'Invalid or null lot number passed to routine.'
|
SRP_JSON(objLot, 'Set', 'AllRecipes', objRecipes)
|
||||||
end
|
SRP_JSON(objRecipes, 'Release')
|
||||||
|
end
|
||||||
If ErrorMessage EQ '' then
|
end else
|
||||||
Response = JsonString
|
ErrorMessage = 'Error Creating Operations JSON Array'
|
||||||
end else
|
end
|
||||||
Error_Services('Add', ErrorMessage)
|
end
|
||||||
end
|
SRP_JSON(objJSON, 'Set', 'Lot', objLot)
|
||||||
|
SRP_JSON(objLot, 'Release')
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Error creating new Lot Json Object'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Error reading ':LotId:' from lot table.'
|
||||||
|
end
|
||||||
|
JsonString = SRP_JSON(objJSON, 'Stringify', 'Styled')
|
||||||
|
SRP_JSON(objJSON, 'Release')
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Error creating new Json Object'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Invalid or null lot number passed to routine.'
|
||||||
|
end
|
||||||
|
If ErrorMessage NE '' then
|
||||||
|
Error_Services('Add', ErrorMessage)
|
||||||
|
end
|
||||||
|
Response = JsonString
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
@ -1339,7 +1409,7 @@ Service ReduceLotWaferCount(LotId, ReductionQty, OperatorId)
|
|||||||
// Write Lot Event
|
// Write Lot Event
|
||||||
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'REDUCE_WAFER_QTY', 'Reduced wafer count by ' : ReductionQty, '', OperatorId, False$, '')
|
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'REDUCE_WAFER_QTY', 'Reduced wafer count by ' : ReductionQty, '', OperatorId, False$, '')
|
||||||
if LotNewWfrQty EQ 0 AND LotType EQ 'TW' then
|
if LotNewWfrQty EQ 0 AND LotType EQ 'TW' then
|
||||||
ServiceParms = 'AutoCloseTestWaferLot' : SD$ : LotId : SD$ : 'SYSTEM'
|
ServiceParms = 'AutoCloseTestWaferLot' : @VM : LotId : @VM : 'SYSTEM'
|
||||||
Service_Services('PostProcedure', 'LOT_SERVICES', ServiceParms)
|
Service_Services('PostProcedure', 'LOT_SERVICES', ServiceParms)
|
||||||
If Error_Services('HasError') then
|
If Error_Services('HasError') then
|
||||||
Recipients = Xlate('NOTIFICATION', 'FI_SUPPORT', NOTIFICATION_USER_ID$, 'X')
|
Recipients = Xlate('NOTIFICATION', 'FI_SUPPORT', NOTIFICATION_USER_ID$, 'X')
|
||||||
@ -1509,12 +1579,38 @@ Service CreateNewVoidedLotRecord(LotId, LegacyLotId, LotType=LOT_TYPES, Username
|
|||||||
|
|
||||||
EndTick = GetTickCount()
|
EndTick = GetTickCount()
|
||||||
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
||||||
|
|
||||||
|
|
||||||
If ErrorMessage NE '' then Error_Services('Add', ErrorMessage)
|
If ErrorMessage NE '' then Error_Services('Add', ErrorMessage)
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
Service CanUserModifyLot(UserId)
|
||||||
|
|
||||||
|
Begin Case
|
||||||
|
|
||||||
|
Case MemberOf(UserId, 'OI_ADMIN')
|
||||||
|
Response = true$
|
||||||
|
Case MemberOf(UserId, 'ENGINEERING')
|
||||||
|
Response = true$
|
||||||
|
Case MemberOf(UserId, 'ENG_TECH')
|
||||||
|
Response = true$
|
||||||
|
Case MemberOf(UserId, 'SUPERVISOR')
|
||||||
|
Response = true$
|
||||||
|
Case MemberOf(UserId, 'LEAD')
|
||||||
|
Response = true$
|
||||||
|
Case UserId EQ 'SYSTEM'
|
||||||
|
Response = true$
|
||||||
|
Case Otherwise$
|
||||||
|
Response = false$
|
||||||
|
|
||||||
|
End Case
|
||||||
|
|
||||||
|
end service
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
// Internal GoSubs
|
// Internal GoSubs
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -132,4 +132,3 @@ CreateHALItem:
|
|||||||
end
|
end
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
98
LSL2/STPROC/METTESTS_API.txt
Normal file
98
LSL2/STPROC/METTESTS_API.txt
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
Function Mettests_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 : Mettests_API
|
||||||
|
|
||||||
|
Description : API logic for the Mettests 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 Mettests[.ID.[<Property>]]
|
||||||
|
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
||||||
|
Examples:
|
||||||
|
- Mettests.POST
|
||||||
|
- Mettests.ID.PUT
|
||||||
|
- Mettests.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)
|
||||||
|
05/20/25 xxx Original programmer.
|
||||||
|
|
||||||
|
***********************************************************************************************************************/
|
||||||
|
|
||||||
|
#pragma precomp SRP_PreCompiler
|
||||||
|
|
||||||
|
$insert APP_INSERTS
|
||||||
|
$insert API_SETUP
|
||||||
|
$insert HTTP_INSERTS
|
||||||
|
|
||||||
|
Declare function Met_Test_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 mettests.ID.HEAD
|
||||||
|
API mettests.ID.GET
|
||||||
|
|
||||||
|
// Return JSON payload containing RDS record details
|
||||||
|
StatusCode = 200
|
||||||
|
GoSub CreateHALItem
|
||||||
|
|
||||||
|
end api
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Internal GoSubs
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
// CreateHALItem
|
||||||
|
//
|
||||||
|
// Creates a HAL+JSON object based on the OpenInsight data row representation of the scan.
|
||||||
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
CreateHALItem:
|
||||||
|
|
||||||
|
MetTestId = EndpointSegment
|
||||||
|
MetTestJSON = Met_Test_Services('ConvertRecordToJSON', MetTestId, '', FullEndpointURL)
|
||||||
|
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
|
HTTP_Services('SetResponseBody', MetTestJSON, False$, 'application/hal+json')
|
||||||
|
If Assigned(Message) then
|
||||||
|
HTTP_Services('SetResponseStatus', StatusCode, Message)
|
||||||
|
end else
|
||||||
|
HTTP_Services('SetResponseStatus', StatusCode)
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
Message = Error_Services('GetMessage')
|
||||||
|
HTTP_Services('SetResponseStatus', 500, 'Error in the ' : CurrentAPI : ' API. Message: ': Message)
|
||||||
|
end
|
||||||
|
|
||||||
|
return
|
257
LSL2/STPROC/MET_TEST_ACTIONS.txt
Normal file
257
LSL2/STPROC/MET_TEST_ACTIONS.txt
Normal file
@ -0,0 +1,257 @@
|
|||||||
|
Function MET_TEST_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 : Met_Test_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)
|
||||||
|
05/14/25 djs Original programmer.
|
||||||
|
|
||||||
|
***********************************************************************************************************************/
|
||||||
|
|
||||||
|
#pragma precomp SRP_PreCompiler
|
||||||
|
|
||||||
|
$Insert FILE.SYSTEM.EQUATES
|
||||||
|
$Insert ACTION_SETUP
|
||||||
|
$Insert APP_INSERTS
|
||||||
|
$Insert MET_TEST_EQUATES
|
||||||
|
$Insert MET_TEST_DATA_EQUATES
|
||||||
|
$Insert MET_TEST_INSERTS
|
||||||
|
$Insert DICT_EQUATES
|
||||||
|
|
||||||
|
Declare function Database_Services, SRP_Array, Read_Column
|
||||||
|
Declare subroutine Database_Services, RTI_Xlate_Controller
|
||||||
|
|
||||||
|
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$
|
||||||
|
|
||||||
|
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:
|
||||||
|
|
||||||
|
MetTestDataIds = {MET_TEST_DATA_IDS}
|
||||||
|
If MetTestDataIds NE '' then
|
||||||
|
// Evaluate if MET_TEST is out of spec
|
||||||
|
RTI_Xlate_Controller('DisableCache')
|
||||||
|
For PropertyIndex = 1 to NUM_PROPERTIES$
|
||||||
|
MetTestOutofSpec = (Sum(Xlate('MET_TEST_DATA', MetTestDataIds, "PROPERTY_":PropertyIndex:'_OUT_OF_SPEC', 'X')) GT 0)
|
||||||
|
Until MetTestOutofSpec
|
||||||
|
Next PropertyIndex
|
||||||
|
Record<MET_TEST.OUT_OF_SPEC$> = MetTestOutofSpec
|
||||||
|
// Evaluate if MET_TEST is complete (all required data has been recorded)
|
||||||
|
// If Sample Size set, then each defined property should have that number of related data points (MET_TEST_DATA) records.
|
||||||
|
// If Sample Size is not set, then each defined property should have at least one related data point (MET_TEST_DATA) record.
|
||||||
|
MetComplete = True$
|
||||||
|
SampleSize = {SAMPLE_SIZE}
|
||||||
|
If SampleSize EQ '' then SampleSize = 1
|
||||||
|
For PropertyIndex = 1 to NUM_PROPERTIES$
|
||||||
|
PropColNo = Xlate('DICT.MET_TEST', 'PROPERTY_':PropertyIndex, DICT_COLUMN_NO$, 'X')
|
||||||
|
If (Record<PropColNo> NE '') then
|
||||||
|
// Property is defined, check if number of data points matches SAMPLE_SIZE
|
||||||
|
PropVals = Xlate('MET_TEST_DATA', MetTestDataIds, 'PROPERTY_':PropertyIndex:'_VALUE', 'X')
|
||||||
|
PropVals = SRP_Array('Clean', PropVals, 'Trim')
|
||||||
|
MetComplete = (DCount(PropVals, @VM) GE SampleSize)
|
||||||
|
end
|
||||||
|
Until Not(MetComplete)
|
||||||
|
Next PropertyIndex
|
||||||
|
Record<MET_TEST.COMPLETE$> = MetComplete
|
||||||
|
RTI_Xlate_Controller('EnableCache')
|
||||||
|
end else
|
||||||
|
Record<MET_TEST.OUT_OF_SPEC$> = False$
|
||||||
|
Record<MET_TEST.COMPLETE$> = False$
|
||||||
|
end
|
||||||
|
SaveRecord = Record
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
WRITE_RECORD:
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
DELETE_RECORD_PRE:
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
DELETE_RECORD:
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
276
LSL2/STPROC/MET_TEST_DATA_ACTIONS.txt
Normal file
276
LSL2/STPROC/MET_TEST_DATA_ACTIONS.txt
Normal file
@ -0,0 +1,276 @@
|
|||||||
|
Function MET_TEST_DATA_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 : Met_Test_Data_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)
|
||||||
|
05/14/25 djs Original programmer.
|
||||||
|
|
||||||
|
***********************************************************************************************************************/
|
||||||
|
|
||||||
|
#pragma precomp SRP_PreCompiler
|
||||||
|
|
||||||
|
$Insert FILE.SYSTEM.EQUATES
|
||||||
|
$Insert ACTION_SETUP
|
||||||
|
$Insert APP_INSERTS
|
||||||
|
$Insert MET_TEST_EQUATES
|
||||||
|
$Insert MET_TEST_DATA_EQUATES
|
||||||
|
$Insert MET_TEST_INSERTS
|
||||||
|
$Insert DICT_EQUATES
|
||||||
|
|
||||||
|
Declare function Database_Services
|
||||||
|
Declare subroutine Database_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$
|
||||||
|
|
||||||
|
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:
|
||||||
|
|
||||||
|
// Validate Property Values against specs defined in MET_TEST parent record
|
||||||
|
MetTestId = {MET_TEST_ID}
|
||||||
|
If MetTestId NE '' then
|
||||||
|
MetTestRec = Database_Services('ReadDataRow', 'MET_TEST', MetTestId)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
MetTestOutofSpecOrig = MetTestRec<MET_TEST.OUT_OF_SPEC$>
|
||||||
|
MetTestOutofSpec = False$
|
||||||
|
For PropertyIndex = 1 to NUM_PROPERTIES$
|
||||||
|
PropOutofSpec = False$
|
||||||
|
Prop = Xlate('MET_TEST', MetTestId, 'PROPERTY_':PropertyIndex, 'X')
|
||||||
|
If Prop NE '' then
|
||||||
|
PropMin = Xlate('MET_TEST', MetTestId, 'PROPERTY_':PropertyIndex:'_SPEC_MIN', 'X')
|
||||||
|
PropMax = Xlate('MET_TEST', MetTestId, 'PROPERTY_':PropertyIndex:'_SPEC_MAX', 'X')
|
||||||
|
PropValColNo = Xlate('DICT.MET_TEST_DATA', 'PROPERTY_':PropertyIndex:'_VALUE', DICT_COLUMN_NO$, 'X')
|
||||||
|
PropVal = Record<PropValColNo>
|
||||||
|
Begin Case
|
||||||
|
|
||||||
|
Case (PropVal EQ '')
|
||||||
|
PropOutofSpec = False$
|
||||||
|
|
||||||
|
Case ( (PropMin NE '') and (PropMax NE '') )
|
||||||
|
|
||||||
|
PropOutofSpec = ( (PropVal LT PropMin) or (PropVal GT PropMax) )
|
||||||
|
|
||||||
|
Case (PropMin NE '')
|
||||||
|
|
||||||
|
PropOutofSpec = (PropVal LT PropMin)
|
||||||
|
|
||||||
|
Case (PropMax NE '')
|
||||||
|
|
||||||
|
PropOutofSpec = (PropVal GT PropMax)
|
||||||
|
|
||||||
|
Case (Prop EQ 'SURFACE_SCAN_SORT')
|
||||||
|
PropOutofSpec = Not((PropVal _EQC 'PASS'))
|
||||||
|
|
||||||
|
Case Otherwise$
|
||||||
|
Null
|
||||||
|
|
||||||
|
End Case
|
||||||
|
PropOOSColNo = Xlate('DICT.MET_TEST_DATA', 'PROPERTY_':PropertyIndex:'_OUT_OF_SPEC', DICT_COLUMN_NO$, 'X')
|
||||||
|
Record<PropOOSColNo> = PropOutofSpec
|
||||||
|
end
|
||||||
|
If PropOutofSpec then MetTestOutofSpec = True$
|
||||||
|
Next PropertyIndex
|
||||||
|
SaveRecord = Record
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
WRITE_RECORD:
|
||||||
|
|
||||||
|
// Trigger MET_TEST_ACTIONS to re-evaluate if the entire MET_TEST record is in spec and comlete
|
||||||
|
MetTestRec = Database_Services('ReadDataRow', 'MET_TEST', {MET_TEST_ID})
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
Database_Services('WriteDataRow', 'MET_TEST', {MET_TEST_ID}, MetTestRec, True$, False$, False$)
|
||||||
|
end
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
DELETE_RECORD_PRE:
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
DELETE_RECORD:
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
|
1254
LSL2/STPROC/MET_TEST_SERVICES.txt
Normal file
1254
LSL2/STPROC/MET_TEST_SERVICES.txt
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,138 +1,137 @@
|
|||||||
Function Monaengines_API(@API)
|
Function Monaengines_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
|
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.
|
permission from SRP Computer Solutions, Inc.
|
||||||
|
|
||||||
Name : Monaengines_API
|
Name : Monaengines_API
|
||||||
|
|
||||||
Description : API logic for the Monaengines resource.
|
Description : API logic for the Monaengines resource.
|
||||||
|
|
||||||
Notes : All web APIs should include the API_SETUP insert. This will provide several useful variables:
|
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.)
|
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).
|
APIURL - The URL for the API entry point (e.g., api.mysite.com/v1).
|
||||||
FullEndpointURL - The URL submitted by the client, including query params.
|
FullEndpointURL - The URL submitted by the client, including query params.
|
||||||
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
||||||
EndpointSegment - The URL endpoint segment.
|
EndpointSegment - The URL endpoint segment.
|
||||||
ParentURL - The URL path preceeding the current endpoint.
|
ParentURL - The URL path preceeding the current endpoint.
|
||||||
CurrentAPI - The name of this stored procedure.
|
CurrentAPI - The name of this stored procedure.
|
||||||
|
|
||||||
Parameters :
|
Parameters :
|
||||||
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
||||||
- APIPattern must follow this structure Monaengines[.ID.[<Property>]]
|
- APIPattern must follow this structure Monaengines[.ID.[<Property>]]
|
||||||
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
||||||
Examples:
|
Examples:
|
||||||
- Monaengines.POST
|
- Monaengines.POST
|
||||||
- Monaengines.ID.PUT
|
- Monaengines.ID.PUT
|
||||||
- Monaengines.ID.firstName.GET
|
- Monaengines.ID.firstName.GET
|
||||||
Response [out] -- Response to be sent back to the Controller (HTTP_MCP) or requesting procedure. Web API
|
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
|
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
|
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.
|
value is only helpful if the developers want to use it for debug purposes.
|
||||||
|
|
||||||
History : (Date, Initials, Notes)
|
History : (Date, Initials, Notes)
|
||||||
07/17/24 xxx Original programmer.
|
07/17/24 xxx Original programmer.
|
||||||
|
|
||||||
***********************************************************************************************************************/
|
***********************************************************************************************************************/
|
||||||
|
|
||||||
#pragma precomp SRP_PreCompiler
|
#pragma precomp SRP_PreCompiler
|
||||||
|
|
||||||
$insert APP_INSERTS
|
$insert APP_INSERTS
|
||||||
$insert API_SETUP
|
$insert API_SETUP
|
||||||
$insert HTTP_INSERTS
|
$insert HTTP_INSERTS
|
||||||
$insert ENGINE_HEALTH_EQUATES
|
$insert ENGINE_HEALTH_EQUATES
|
||||||
|
|
||||||
Equ Comma$ to ','
|
Equ Comma$ to ','
|
||||||
|
|
||||||
Declare function System_Healthcheck_Services, Environment_Services, Logging_Services
|
Declare function System_Healthcheck_Services, Environment_Services, Logging_Services
|
||||||
Declare subroutine Logging_Services
|
Declare subroutine Logging_Services
|
||||||
|
|
||||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Healthchecks\Engines\MonA'
|
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Healthchecks\Engines\MonA'
|
||||||
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] : ' Mona_Engine_Health_Check_Log.csv'
|
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Mona_Engine_Health_Check_Log.csv'
|
||||||
Headers = 'Logging DTM' : @FM : 'EngineID' : @FM : 'ResponseCode' : @FM : 'Message' : @FM : 'Requester'
|
Headers = 'Logging DTM' : @FM : 'EngineID' : @FM : 'ResponseCode' : @FM : 'Message' : @FM : 'Requester'
|
||||||
objLogMonaEngines = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
|
objLogMonaEngines = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
|
||||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||||
|
|
||||||
GoToAPI else
|
GoToAPI else
|
||||||
// The specific resource endpoint doesn't have a API handler yet.
|
// The specific resource endpoint doesn't have a API handler yet.
|
||||||
HTTP_Services('SetResponseStatus', 200, 'This is a valid endpoint but a web API handler has not yet been created.')
|
HTTP_Services('SetResponseStatus', 200, 'This is a valid endpoint but a web API handler has not yet been created.')
|
||||||
end
|
end
|
||||||
|
|
||||||
Return Response OR ''
|
Return Response OR ''
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Endpoint Handlers
|
// Endpoint Handlers
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
API monaengines.HEAD
|
API monaengines.HEAD
|
||||||
API monaengines.GET
|
API monaengines.GET
|
||||||
|
|
||||||
HTTP_Resource_Services('LoremIpsum')
|
HTTP_Resource_Services('LoremIpsum')
|
||||||
|
|
||||||
end api
|
end api
|
||||||
|
|
||||||
|
|
||||||
API monaengines.ID.HEAD
|
API monaengines.ID.HEAD
|
||||||
API monaengines.ID.GET
|
API monaengines.ID.GET
|
||||||
|
|
||||||
//Returns status of a defined engine
|
//Returns status of a defined engine
|
||||||
EngineID = EndpointSegment
|
EngineID = EndpointSegment
|
||||||
If RowExists('APP_INFO', EngineID) then
|
If RowExists('APP_INFO', EngineID) then
|
||||||
EngineHealthInfo = System_Healthcheck_Services('GetEngineHealthInfo', EngineID)
|
EngineHealthInfo = System_Healthcheck_Services('GetEngineHealthInfo', EngineID)
|
||||||
If Error_Services('NoError') then
|
If Error_Services('NoError') then
|
||||||
Healthy = EngineHealthInfo<ENGINE_HEALTH_HEALTH_STATUS$>
|
Healthy = EngineHealthInfo<ENGINE_HEALTH_HEALTH_STATUS$>
|
||||||
If Healthy then
|
If Healthy then
|
||||||
ResponseCode = 200
|
ResponseCode = 200
|
||||||
Message = 'Engine is healthy'
|
Message = 'Engine is healthy'
|
||||||
HTTP_Services('SetResponseStatus', ResponseCode, Message)
|
HTTP_Services('SetResponseStatus', ResponseCode, Message)
|
||||||
LogData = ''
|
LogData = ''
|
||||||
LogData<1> = LoggingDTM
|
LogData<1> = LoggingDTM
|
||||||
LogData<2> = EngineID
|
LogData<2> = EngineID
|
||||||
LogData<3> = ResponseCode
|
LogData<3> = ResponseCode
|
||||||
LogData<4> = Message
|
LogData<4> = Message
|
||||||
LogData<5> = FullEndpointURL
|
LogData<5> = FullEndpointURL
|
||||||
Logging_Services('AppendLog', objLogMonaEngines, LogData, @RM, @FM)
|
Logging_Services('AppendLog', objLogMonaEngines, LogData, @RM, @FM)
|
||||||
end else
|
end else
|
||||||
ResponseCode = 418
|
ResponseCode = 418
|
||||||
Message = 'Engine is unhealthy.'
|
Message = 'Engine is unhealthy.'
|
||||||
HTTP_Services('SetResponseStatus', ResponseCode, Message)
|
HTTP_Services('SetResponseStatus', ResponseCode, Message)
|
||||||
LogData = ''
|
LogData = ''
|
||||||
LogData<1> = LoggingDTM
|
LogData<1> = LoggingDTM
|
||||||
LogData<2> = EngineID
|
LogData<2> = EngineID
|
||||||
LogData<3> = ResponseCode
|
LogData<3> = ResponseCode
|
||||||
LogData<4> = Message
|
LogData<4> = Message
|
||||||
LogData<5> = FullEndpointURL
|
LogData<5> = FullEndpointURL
|
||||||
Logging_Services('AppendLog', objLogMonaEngines, LogData, @RM, @FM)
|
Logging_Services('AppendLog', objLogMonaEngines, LogData, @RM, @FM)
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
ResponseCode = 500
|
ResponseCode = 500
|
||||||
Message = Error_Services('GetMessage')
|
Message = Error_Services('GetMessage')
|
||||||
HTTP_Services('SetResponseStatus', ResponseCode, Message)
|
HTTP_Services('SetResponseStatus', ResponseCode, Message)
|
||||||
LogData = ''
|
LogData = ''
|
||||||
LogData<1> = LoggingDTM
|
LogData<1> = LoggingDTM
|
||||||
LogData<2> = EngineID
|
LogData<2> = EngineID
|
||||||
LogData<3> = ResponseCode
|
LogData<3> = ResponseCode
|
||||||
LogData<4> = Message
|
LogData<4> = Message
|
||||||
LogData<5> = FullEndpointURL
|
LogData<5> = FullEndpointURL
|
||||||
Logging_Services('AppendLog', objLogMonaEngines, LogData, @RM, @FM)
|
Logging_Services('AppendLog', objLogMonaEngines, LogData, @RM, @FM)
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
ResponseCode = 404
|
ResponseCode = 404
|
||||||
Message = 'Invalid Engine ID'
|
Message = 'Invalid Engine ID'
|
||||||
HTTP_Services('SetResponseStatus', ResponseCode, 'Invalid Engine ID.')
|
HTTP_Services('SetResponseStatus', ResponseCode, 'Invalid Engine ID.')
|
||||||
LogData = ''
|
LogData = ''
|
||||||
LogData<1> = LoggingDTM
|
LogData<1> = LoggingDTM
|
||||||
LogData<2> = EngineID
|
LogData<2> = EngineID
|
||||||
LogData<3> = ResponseCode
|
LogData<3> = ResponseCode
|
||||||
LogData<4> = Message
|
LogData<4> = Message
|
||||||
LogData<5> = FullEndpointURL
|
LogData<5> = FullEndpointURL
|
||||||
Logging_Services('AppendLog', objLogMonaEngines, LogData, @RM, @FM)
|
Logging_Services('AppendLog', objLogMonaEngines, LogData, @RM, @FM)
|
||||||
end
|
end
|
||||||
|
|
||||||
end api
|
end api
|
||||||
|
|
||||||
|
@ -1,64 +1,63 @@
|
|||||||
Function Mona_API(@API)
|
Function Mona_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
|
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.
|
permission from SRP Computer Solutions, Inc.
|
||||||
|
|
||||||
Name : Mona_API
|
Name : Mona_API
|
||||||
|
|
||||||
Description : API logic for the Mona resource.
|
Description : API logic for the Mona resource.
|
||||||
|
|
||||||
Notes : All web APIs should include the API_SETUP insert. This will provide several useful variables:
|
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.)
|
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).
|
APIURL - The URL for the API entry point (e.g., api.mysite.com/v1).
|
||||||
FullEndpointURL - The URL submitted by the client, including query params.
|
FullEndpointURL - The URL submitted by the client, including query params.
|
||||||
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
||||||
EndpointSegment - The URL endpoint segment.
|
EndpointSegment - The URL endpoint segment.
|
||||||
ParentURL - The URL path preceeding the current endpoint.
|
ParentURL - The URL path preceeding the current endpoint.
|
||||||
CurrentAPI - The name of this stored procedure.
|
CurrentAPI - The name of this stored procedure.
|
||||||
|
|
||||||
Parameters :
|
Parameters :
|
||||||
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
||||||
- APIPattern must follow this structure Mona[.ID.[<Property>]]
|
- APIPattern must follow this structure Mona[.ID.[<Property>]]
|
||||||
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
||||||
Examples:
|
Examples:
|
||||||
- Mona.POST
|
- Mona.POST
|
||||||
- Mona.ID.PUT
|
- Mona.ID.PUT
|
||||||
- Mona.ID.firstName.GET
|
- Mona.ID.firstName.GET
|
||||||
Response [out] -- Response to be sent back to the Controller (HTTP_MCP) or requesting procedure. Web API
|
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
|
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
|
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.
|
value is only helpful if the developers want to use it for debug purposes.
|
||||||
|
|
||||||
History : (Date, Initials, Notes)
|
History : (Date, Initials, Notes)
|
||||||
07/17/24 xxx Original programmer.
|
07/17/24 xxx Original programmer.
|
||||||
|
|
||||||
***********************************************************************************************************************/
|
***********************************************************************************************************************/
|
||||||
|
|
||||||
#pragma precomp SRP_PreCompiler
|
#pragma precomp SRP_PreCompiler
|
||||||
|
|
||||||
$insert APP_INSERTS
|
$insert APP_INSERTS
|
||||||
$insert API_SETUP
|
$insert API_SETUP
|
||||||
$insert HTTP_INSERTS
|
$insert HTTP_INSERTS
|
||||||
|
|
||||||
GoToAPI else
|
GoToAPI else
|
||||||
// The specific resource endpoint doesn't have a API handler yet.
|
// The specific resource endpoint doesn't have a API handler yet.
|
||||||
HTTP_Services('SetResponseStatus', 200, 'This is a valid endpoint but a web API handler has not yet been created.')
|
HTTP_Services('SetResponseStatus', 200, 'This is a valid endpoint but a web API handler has not yet been created.')
|
||||||
end
|
end
|
||||||
|
|
||||||
Return Response OR ''
|
Return Response OR ''
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Endpoint Handlers
|
// Endpoint Handlers
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
API mona.HEAD
|
API mona.HEAD
|
||||||
API mona.GET
|
API mona.GET
|
||||||
|
|
||||||
HTTP_Resource_Services('LoremIpsum')
|
HTTP_Resource_Services('LoremIpsum')
|
||||||
|
|
||||||
end api
|
end api
|
||||||
|
|
||||||
|
@ -190,9 +190,3 @@ return
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -212,7 +212,7 @@ Event EDL_TRILAM_SCAN.LOSTFOCUS(Flag, FocusID)
|
|||||||
end event
|
end event
|
||||||
|
|
||||||
Event EDL_PASSWORD_SCAN.LOSTFOCUS(Flag, FocusID)
|
Event EDL_PASSWORD_SCAN.LOSTFOCUS(Flag, FocusID)
|
||||||
|
|
||||||
If Flag EQ 1 then
|
If Flag EQ 1 then
|
||||||
ScanData = Get_Property(CtrlEntID, 'TEXT')
|
ScanData = Get_Property(CtrlEntID, 'TEXT')
|
||||||
If ScanData NE '' then
|
If ScanData NE '' then
|
||||||
@ -300,3 +300,5 @@ SetDelay:
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
130
LSL2/STPROC/OPERATION_API.txt
Normal file
130
LSL2/STPROC/OPERATION_API.txt
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
Function Operation_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 : Operation_API
|
||||||
|
|
||||||
|
Description : API logic for the Operation 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 Operation[.ID.[<Property>]]
|
||||||
|
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
||||||
|
Examples:
|
||||||
|
- Operation.POST
|
||||||
|
- Operation.ID.PUT
|
||||||
|
- Operation.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)
|
||||||
|
05/19/25 xxx Original programmer.
|
||||||
|
|
||||||
|
***********************************************************************************************************************/
|
||||||
|
|
||||||
|
#pragma precomp SRP_PreCompiler
|
||||||
|
|
||||||
|
Declare function OI_Wizard_Services, Operation_Services, Clean_Services, Lot_Operation_Services
|
||||||
|
|
||||||
|
$insert APP_INSERTS
|
||||||
|
$insert API_SETUP
|
||||||
|
$insert HTTP_INSERTS
|
||||||
|
|
||||||
|
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 operation.HEAD
|
||||||
|
API operation.GET
|
||||||
|
|
||||||
|
JSONCollection = ''
|
||||||
|
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
|
||||||
|
Body = HTTP_Services('GetHTTPGetString')
|
||||||
|
If Body NE '' then
|
||||||
|
RequestJson = HTTP_Services('DecodePercentString', Body)
|
||||||
|
ClassFilter = Http_Services('GetQueryField', 'Class')
|
||||||
|
ActiveFilter = Http_Services('GetQueryField', 'Active')
|
||||||
|
LotId = Http_Services('GetQueryField', 'LotId')
|
||||||
|
Operations = Operation_Services('GetOperations', ClassFilter, ActiveFilter)
|
||||||
|
|
||||||
|
objJSONResponse = ''
|
||||||
|
If SRP_Json(objJSONResponse, 'New', 'Object') then
|
||||||
|
//Available Operations
|
||||||
|
If SRP_Json(objOperations, 'New', 'Array') then
|
||||||
|
for each Operation in Operations using @VM
|
||||||
|
OperationJSONString = Operation_Services('ConvertRecordToJSON', Operation)
|
||||||
|
objOperation = ''
|
||||||
|
If SRP_Json(objOperation, 'Parse', OperationJSONString) EQ '' then
|
||||||
|
SRP_Json(objOperations, 'Add', objOperation)
|
||||||
|
SRP_Json(objOperation, 'Release')
|
||||||
|
end
|
||||||
|
Next Operation
|
||||||
|
SRP_Json(objJsonResponse, 'Set', 'Operations', objOperations)
|
||||||
|
SRP_Json(objOperations, 'Release')
|
||||||
|
end else
|
||||||
|
Error_Services('Add', 'Error when creating Operation array in JSON response.')
|
||||||
|
end
|
||||||
|
//Available Sequences
|
||||||
|
Sequences = Lot_Operation_Services('GetAvailableSequences', LotId)
|
||||||
|
If SRP_Json(objSequences, 'New', 'Array') then
|
||||||
|
for each Sequence in Sequences using @VM
|
||||||
|
SRP_Json(objSequences, 'AddValue', Sequence, 'Number')
|
||||||
|
Next Sequence
|
||||||
|
SRP_Json(objJsonResponse, 'Set', 'AvailableSequences', objSequences)
|
||||||
|
SRP_Json(objSequences, 'Release')
|
||||||
|
end else
|
||||||
|
Error_Services('Add', 'Error when creating Operation array in JSON response.')
|
||||||
|
end
|
||||||
|
JsonResponse = SRP_Json(objJsonResponse, 'Stringify', 'Styled')
|
||||||
|
SRP_Json(objJsonResponse, 'Release')
|
||||||
|
end else
|
||||||
|
Error_Services('Add', 'Error when creating JSON response.')
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
Error_Services('Add', 'No body was sent with the request.')
|
||||||
|
end
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
HTTP_Services('SetResponseStatus', 201, 'Success')
|
||||||
|
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
|
HTTP_Services('SetResponseBody', JsonResponse, False$, 'application/hal+json')
|
||||||
|
end else
|
||||||
|
HTTP_Services('SetResponseStatus', 400, Error_Services('GetMessage'))
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
HTTP_Services('SetResponseStatus', 401, 'Invalid session. Reauthentication required.')
|
||||||
|
end
|
||||||
|
|
||||||
|
end api
|
21
LSL2/STPROC/OPERATION_EQUATES.txt
Normal file
21
LSL2/STPROC/OPERATION_EQUATES.txt
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
compile insert OPERATION_EQUATES
|
||||||
|
/*----------------------------------------
|
||||||
|
Author : Table Create Insert Routine
|
||||||
|
Written : 29/05/2025
|
||||||
|
Description : Insert for Table OPERATION
|
||||||
|
----------------------------------------*/
|
||||||
|
#ifndef __OPERATION_EQUATES__
|
||||||
|
#define __OPERATION_EQUATES__
|
||||||
|
|
||||||
|
equ OPERATION_ACTIVE$ to 1
|
||||||
|
equ OPERATION_CLASS_ID$ to 2
|
||||||
|
equ OPERATION_OPERATION_DESCRIPTION$ to 3
|
||||||
|
equ OPERATION_TYPE$ to 4
|
||||||
|
equ OPERATION_REWORK$ to 5
|
||||||
|
equ OPERATION_MET_TEST_TYPE_REQUIRED$ to 6
|
||||||
|
equ OPERATION_MET_TEST_REQUIRED$ to 7
|
||||||
|
equ OPERATION_PACKAGING_REQUIRED$ to 8
|
||||||
|
equ OPERATION_CLEAN_REQUIRED$ to 9
|
||||||
|
equ OPERATION_WAFER_COUNTER_REQUIRED$ to 10
|
||||||
|
|
||||||
|
#endif
|
57
LSL2/STPROC/OPERATION_SERVICES.txt
Normal file
57
LSL2/STPROC/OPERATION_SERVICES.txt
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
Compile function Operation_Services(@Service, @Params)
|
||||||
|
#pragma precomp SRP_PreCompiler
|
||||||
|
|
||||||
|
Declare function Database_Services, SRP_Json
|
||||||
|
Declare subroutine Database_Services, SRP_Json, Btree.Extract
|
||||||
|
|
||||||
|
$insert LOGICAL
|
||||||
|
$Insert OPERATION_EQUATES
|
||||||
|
|
||||||
|
Options OPERATION_TYPE = 'CLEAN', 'THICK_METROLOGY', 'RES_METROLOGY', 'SURFACE_METROLOGY', 'VISUAL_INSPECTION', 'PACKAGING'
|
||||||
|
|
||||||
|
GoToService
|
||||||
|
|
||||||
|
Return Response or ""
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// SERVICES
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Service ConvertRecordToJson(OperationId)
|
||||||
|
|
||||||
|
JsonString = ''
|
||||||
|
objJSON = ''
|
||||||
|
OperationRec = Database_Services('ReadDataRow', 'OPERATION', OperationId, True$, 0, False$)
|
||||||
|
If SRP_JSON(objJSON, 'New', 'Object') then
|
||||||
|
SRP_JSON(objJSON, 'SetValue', 'OperationId', OperationId)
|
||||||
|
SRP_JSON(objJSON, 'SetValue', 'Active', OperationRec<OPERATION_ACTIVE$>, 'Boolean')
|
||||||
|
SRP_JSON(objJSON, 'SetValue', 'ClassId', OperationRec<OPERATION_CLASS_ID$>, 'String')
|
||||||
|
SRP_JSON(objJSON, 'SetValue', 'Description', OperationRec<OPERATION_OPERATION_DESCRIPTION$>, 'String')
|
||||||
|
SRP_JSON(objJSON, 'SetValue', 'Type', OperationRec<OPERATION_TYPE$>, 'String')
|
||||||
|
JsonString = SRP_JSON(objJSON, 'Stringify', 'Styled')
|
||||||
|
SRP_JSON(objJSON, 'Release')
|
||||||
|
end
|
||||||
|
|
||||||
|
Response = JsonString
|
||||||
|
|
||||||
|
End Service
|
||||||
|
|
||||||
|
Service GetOperations(Class, ActiveFlag)
|
||||||
|
|
||||||
|
ErrorMessage = ''
|
||||||
|
RTFOperationKeys = ''
|
||||||
|
|
||||||
|
Open 'DICT.OPERATION' to DICT then
|
||||||
|
SearchString = 'CLASS_ID':@VM:Class:@FM
|
||||||
|
SearchString := 'ACTIVE':@VM:True$:@FM
|
||||||
|
Option = ''
|
||||||
|
Flag = ''
|
||||||
|
Btree.Extract(SearchString, 'OPERATION', DICT, RTFOperationKeys, Option, Flag)
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Error opening OPERATION table dictionary.'
|
||||||
|
end
|
||||||
|
|
||||||
|
Response = RTFOperationKeys
|
||||||
|
|
||||||
|
end service
|
||||||
|
|
@ -32,11 +32,24 @@ $insert SCANS_EQUATES
|
|||||||
$insert APP_INSERTS
|
$insert APP_INSERTS
|
||||||
$insert WO_MAT_EQUATES
|
$insert WO_MAT_EQUATES
|
||||||
$insert NOTIFICATION_EQU
|
$insert NOTIFICATION_EQU
|
||||||
|
$insert PACKAGING_EQUATES
|
||||||
|
$insert LOT_OPERATION_EQUATES
|
||||||
|
$Insert LOT_EQUATES
|
||||||
|
|
||||||
Declare function Scan_Services, Memory_Services, Database_Services, SRP_JSON, RTI_CreateGUID, Memberof
|
Declare function Scan_Services, Memory_Services, Database_Services, SRP_JSON, RTI_CreateGUID, Memberof
|
||||||
Declare function Get_Property, RDS_Services, EpiPro_Services, DateTime, Signature_Services
|
Declare function Get_Property, RDS_Services, EpiPro_Services, DateTime, Signature_Services, Packaging_Services
|
||||||
|
Declare function Lot_Services, Environment_Services, Logging_Services
|
||||||
Declare subroutine Scan_Services, Memory_Services, Database_Services, SRP_JSON, Security_Services, obj_Notes
|
Declare subroutine Scan_Services, Memory_Services, Database_Services, SRP_JSON, Security_Services, obj_Notes
|
||||||
Declare subroutine obj_WO_Mat_Log, obj_WO_Mat, Set_Status, SAP_Services, Rds_Services, Wm_Out_Services, Hold_Services
|
Declare subroutine obj_WO_Mat_Log, obj_WO_Mat, Set_Status, SAP_Services, Rds_Services, Wm_Out_Services, Hold_Services
|
||||||
|
Declare subroutine Lot_Event_Services, Lot_Services, Packaging_Services, Logging_Services
|
||||||
|
|
||||||
|
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Packaging'
|
||||||
|
LogDate = Oconv(Date(), 'D4/')
|
||||||
|
LogTime = Oconv(Time(), 'MTS')
|
||||||
|
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||||
|
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Packaging Log.csv'
|
||||||
|
Headers = 'Logging DTM' : @FM : 'Message'
|
||||||
|
objLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
|
||||||
|
|
||||||
GoToService else
|
GoToService else
|
||||||
Error_Services('Add', Service : ' is not a valid service request within the ' : ServiceModule : ' module.')
|
Error_Services('Add', Service : ' is not a valid service request within the ' : ServiceModule : ' module.')
|
||||||
@ -62,6 +75,7 @@ Service CompletePackaging(CassetteID, OperatorID, BaggerIdentifier)
|
|||||||
|
|
||||||
RDSKey = CassetteID
|
RDSKey = CassetteID
|
||||||
WMOKey = CassetteID
|
WMOKey = CassetteID
|
||||||
|
LotId = ''
|
||||||
Convert '.' to '*' in WMOKey
|
Convert '.' to '*' in WMOKey
|
||||||
CommentEntity = ''
|
CommentEntity = ''
|
||||||
Begin Case
|
Begin Case
|
||||||
@ -70,11 +84,13 @@ Service CompletePackaging(CassetteID, OperatorID, BaggerIdentifier)
|
|||||||
WOMatKey = Xlate('RDS', RDSKey, 'WO', 'X')
|
WOMatKey = Xlate('RDS', RDSKey, 'WO', 'X')
|
||||||
WOMatKey = WoMatKey:'*':Xlate('RDS', RDSKey, 'CASS_NO', 'X')
|
WOMatKey = WoMatKey:'*':Xlate('RDS', RDSKey, 'CASS_NO', 'X')
|
||||||
CommentEntity = 'RDS'
|
CommentEntity = 'RDS'
|
||||||
|
LotId = Lot_Services('GetLotIdByLegacyLotIdAndType', RDSKey, 'RDS')
|
||||||
|
|
||||||
Case RowExists('WM_OUT', WMOKey) EQ True$
|
Case RowExists('WM_OUT', WMOKey) EQ True$
|
||||||
// WM_OUT key
|
// WM_OUT key
|
||||||
WOMatKey = Xlate('WM_OUT', WMOKey, 'WO_MAT_KEY', 'X')
|
WOMatKey = Xlate('WM_OUT', WMOKey, 'WO_MAT_KEY', 'X')
|
||||||
CommentEntity = 'WM_OUT'
|
CommentEntity = 'WM_OUT'
|
||||||
|
LotId = Lot_Services('GetLotIdByLegacyLotIdAndType', WMOKey, 'WM_OUT')
|
||||||
|
|
||||||
Case RowExists('WO_MAT', CassetteID) EQ True$
|
Case RowExists('WO_MAT', CassetteID) EQ True$
|
||||||
// WO_MAT key
|
// WO_MAT key
|
||||||
@ -126,7 +142,7 @@ Service CompletePackaging(CassetteID, OperatorID, BaggerIdentifier)
|
|||||||
WOMLParms := ToolID
|
WOMLParms := ToolID
|
||||||
|
|
||||||
obj_WO_Mat_Log('Create',WOMLParms)
|
obj_WO_Mat_Log('Create',WOMLParms)
|
||||||
errCode = ''
|
errCode = ''
|
||||||
IF Get_Status(errCode) THEN
|
IF Get_Status(errCode) THEN
|
||||||
swap @SVM with CRLF$ in errCode
|
swap @SVM with CRLF$ in errCode
|
||||||
ErrorMsg = 'Errors calling obj_WO_Mat_Log("Create"). Error code: ':errCode:', Len(errCode)=':Len(errCode)
|
ErrorMsg = 'Errors calling obj_WO_Mat_Log("Create"). Error code: ':errCode:', Len(errCode)=':Len(errCode)
|
||||||
@ -138,6 +154,24 @@ Service CompletePackaging(CassetteID, OperatorID, BaggerIdentifier)
|
|||||||
// Add CassComp transaction to SAP queue
|
// Add CassComp transaction to SAP queue
|
||||||
SAPBatchNo = Xlate('WO_MAT', WOMatKey, 'SAP_BATCH_NO', 'X')
|
SAPBatchNo = Xlate('WO_MAT', WOMatKey, 'SAP_BATCH_NO', 'X')
|
||||||
If SAPBatchNo EQ '' then SAP_Services('AddCassCompTransaction', WOMatKey)
|
If SAPBatchNo EQ '' then SAP_Services('AddCassCompTransaction', WOMatKey)
|
||||||
|
|
||||||
|
//Handle NG lot functions.
|
||||||
|
If LotId NE '' then
|
||||||
|
NewPackRecId = Packaging_Services('CreatePackagingRecord', LotId, UserID, ToolID)
|
||||||
|
CurrOperationId = Lot_Services('GetLotCurrOperationId', LotId)
|
||||||
|
If CurrOperationId NE '' then
|
||||||
|
Packaging_Services('AddPackToLotOperation', CurrOperationId, NewPackRecId, UserID)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
Lot_Services('MoveOutLot', LotId, UserId)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
If Error_Services('HasError') then
|
||||||
|
//Remove any error messages as a result of NG Lot functions. At the moment we don't want them interrupting production when they occur.
|
||||||
|
Error_Services('Clear')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -664,3 +698,72 @@ Service ProcessScanData(ScanData, ScanType = SCAN_TYPES, Param1, Param2, Param3)
|
|||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
Service CreatePackagingRecord(LotId, UserId, EqpId)
|
||||||
|
|
||||||
|
NewRecId = ''
|
||||||
|
ErrorMessage = ''
|
||||||
|
|
||||||
|
If RowExists('LOT', LotId) then
|
||||||
|
NewRecId = RTI_CreateGuid()
|
||||||
|
TransDtm = Datetime()
|
||||||
|
NewPackagingRec = ''
|
||||||
|
NewPackagingRec<PACKAGING_LOT_ID$> = LotId
|
||||||
|
NewPackagingRec<PACKAGING_COMPLETE$> = True$
|
||||||
|
NewPackagingRec<PACKAGING_COMPLETE_DTM$> = TransDtm
|
||||||
|
Database_Services('WriteDataRow', 'PACKAGING', NewRecId, NewPackagingRec, True$, 0, False$)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
Lot_Event_Services('CreateLotEvent', LotId, TransDtm, 'PACKAGING', 'Lot Packaged.', EqpId, UserId)
|
||||||
|
end else
|
||||||
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'LOT: ' LotId : ' not found'
|
||||||
|
end
|
||||||
|
If ErrorMessage NE '' then
|
||||||
|
LogData = ''
|
||||||
|
LogData<1> = LoggingDTM
|
||||||
|
LogData<2> = Error_Services('GetMessage')
|
||||||
|
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
|
||||||
|
Error_Services('Clear')
|
||||||
|
end
|
||||||
|
|
||||||
|
Response = NewRecId
|
||||||
|
|
||||||
|
end service
|
||||||
|
|
||||||
|
Service AddPackToLotOperation(LotOperationId, PackagingId, UserId)
|
||||||
|
|
||||||
|
ErrorMessage = ''
|
||||||
|
|
||||||
|
If RowExists('LOT_OPERATION', LotOperationId) then
|
||||||
|
If RowExists('LSL_USERS', UserId) then
|
||||||
|
//Can add user group check here.
|
||||||
|
LotOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', LotOperationId, True$, 0, False$)
|
||||||
|
LotId = LotOperationRec<LOT_OPERATION_LOT_ID$>
|
||||||
|
ExistingPackId = LotOperationRec<LOT_OPERATION_PACKAGING_ID$>
|
||||||
|
If ExistingPackId EQ '' then
|
||||||
|
LotOperationRec<LOT_OPERATION_PACKAGING_ID$> = PackagingId
|
||||||
|
Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationId, LotOperationRec)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
TransDtm = Datetime()
|
||||||
|
Lot_Event_Services('CreateLotEvent', LotId, TransDtm, 'COMMENT', 'PACKAGING record added to operation.', '', UserId)
|
||||||
|
end else
|
||||||
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'A pack scan already exists for the lot operation. Please remove the pack before adding a new one.'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'USER ID: ' UserId : ' not found.'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'LOT_OPERATION: ' LotOperationId : ' not found.'
|
||||||
|
end
|
||||||
|
If ErrorMessage NE '' then
|
||||||
|
Error_Services('Add', ErrorMessage)
|
||||||
|
end
|
||||||
|
|
||||||
|
end service
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,79 +1,78 @@
|
|||||||
Function Pm_API(@API)
|
Function Pm_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
|
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.
|
permission from SRP Computer Solutions, Inc.
|
||||||
|
|
||||||
Name : Pm_API
|
Name : Pm_API
|
||||||
|
|
||||||
Description : API logic for the Pm resource.
|
Description : API logic for the Pm resource.
|
||||||
|
|
||||||
Notes : All web APIs should include the API_SETUP insert. This will provide several useful variables:
|
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.)
|
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).
|
APIURL - The URL for the API entry point (e.g., api.mysite.com/v1).
|
||||||
FullEndpointURL - The URL submitted by the client, including query params.
|
FullEndpointURL - The URL submitted by the client, including query params.
|
||||||
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
||||||
EndpointSegment - The URL endpoint segment.
|
EndpointSegment - The URL endpoint segment.
|
||||||
ParentURL - The URL path preceeding the current endpoint.
|
ParentURL - The URL path preceeding the current endpoint.
|
||||||
CurrentAPI - The name of this stored procedure.
|
CurrentAPI - The name of this stored procedure.
|
||||||
|
|
||||||
Parameters :
|
Parameters :
|
||||||
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
||||||
- APIPattern must follow this structure Pm[.ID.[<Property>]]
|
- APIPattern must follow this structure Pm[.ID.[<Property>]]
|
||||||
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
||||||
Examples:
|
Examples:
|
||||||
- Pm.POST
|
- Pm.POST
|
||||||
- Pm.ID.PUT
|
- Pm.ID.PUT
|
||||||
- Pm.ID.firstName.GET
|
- Pm.ID.firstName.GET
|
||||||
Response [out] -- Response to be sent back to the Controller (HTTP_MCP) or requesting procedure. Web API
|
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
|
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
|
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.
|
value is only helpful if the developers want to use it for debug purposes.
|
||||||
|
|
||||||
History : (Date, Initials, Notes)
|
History : (Date, Initials, Notes)
|
||||||
06/05/24 xxx Original programmer.
|
06/05/24 xxx Original programmer.
|
||||||
|
|
||||||
***********************************************************************************************************************/
|
***********************************************************************************************************************/
|
||||||
|
|
||||||
#pragma precomp SRP_PreCompiler
|
#pragma precomp SRP_PreCompiler
|
||||||
|
|
||||||
$insert APP_INSERTS
|
$insert APP_INSERTS
|
||||||
$insert API_SETUP
|
$insert API_SETUP
|
||||||
$insert HTTP_INSERTS
|
$insert HTTP_INSERTS
|
||||||
|
|
||||||
GoToAPI else
|
GoToAPI else
|
||||||
// The specific resource endpoint doesn't have a API handler yet.
|
// 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.')
|
HTTP_Services('SetResponseStatus', 204, 'This is a valid endpoint but a web API handler has not yet been created.')
|
||||||
end
|
end
|
||||||
|
|
||||||
Return Response OR ''
|
Return Response OR ''
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Endpoint Handlers
|
// Endpoint Handlers
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
API pm.HEAD
|
API pm.HEAD
|
||||||
API pm.GET
|
API pm.GET
|
||||||
|
|
||||||
HTTP_Resource_Services('LoremIpsum')
|
HTTP_Resource_Services('LoremIpsum')
|
||||||
|
|
||||||
end api
|
end api
|
||||||
|
|
||||||
|
|
||||||
API pm.ID.HEAD
|
API pm.ID.HEAD
|
||||||
API pm.ID.GET
|
API pm.ID.GET
|
||||||
|
|
||||||
HTTP_Resource_Services('LoremIpsum')
|
HTTP_Resource_Services('LoremIpsum')
|
||||||
|
|
||||||
end api
|
end api
|
||||||
|
|
||||||
|
|
||||||
API pm.ID.POST
|
API pm.ID.POST
|
||||||
|
|
||||||
HTTP_Resource_Services('LoremIpsum')
|
HTTP_Resource_Services('LoremIpsum')
|
||||||
|
|
||||||
end api
|
end api
|
||||||
|
|
||||||
|
@ -1,64 +1,63 @@
|
|||||||
Function Pm_spec_API(@API)
|
Function Pm_spec_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
|
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.
|
permission from SRP Computer Solutions, Inc.
|
||||||
|
|
||||||
Name : Pm_spec_API
|
Name : Pm_spec_API
|
||||||
|
|
||||||
Description : API logic for the Pm_spec resource.
|
Description : API logic for the Pm_spec resource.
|
||||||
|
|
||||||
Notes : All web APIs should include the API_SETUP insert. This will provide several useful variables:
|
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.)
|
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).
|
APIURL - The URL for the API entry point (e.g., api.mysite.com/v1).
|
||||||
FullEndpointURL - The URL submitted by the client, including query params.
|
FullEndpointURL - The URL submitted by the client, including query params.
|
||||||
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
||||||
EndpointSegment - The URL endpoint segment.
|
EndpointSegment - The URL endpoint segment.
|
||||||
ParentURL - The URL path preceeding the current endpoint.
|
ParentURL - The URL path preceeding the current endpoint.
|
||||||
CurrentAPI - The name of this stored procedure.
|
CurrentAPI - The name of this stored procedure.
|
||||||
|
|
||||||
Parameters :
|
Parameters :
|
||||||
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
||||||
- APIPattern must follow this structure Pm_spec[.ID.[<Property>]]
|
- APIPattern must follow this structure Pm_spec[.ID.[<Property>]]
|
||||||
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
||||||
Examples:
|
Examples:
|
||||||
- Pm_spec.POST
|
- Pm_spec.POST
|
||||||
- Pm_spec.ID.PUT
|
- Pm_spec.ID.PUT
|
||||||
- Pm_spec.ID.firstName.GET
|
- Pm_spec.ID.firstName.GET
|
||||||
Response [out] -- Response to be sent back to the Controller (HTTP_MCP) or requesting procedure. Web API
|
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
|
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
|
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.
|
value is only helpful if the developers want to use it for debug purposes.
|
||||||
|
|
||||||
History : (Date, Initials, Notes)
|
History : (Date, Initials, Notes)
|
||||||
06/05/24 xxx Original programmer.
|
06/05/24 xxx Original programmer.
|
||||||
|
|
||||||
***********************************************************************************************************************/
|
***********************************************************************************************************************/
|
||||||
|
|
||||||
#pragma precomp SRP_PreCompiler
|
#pragma precomp SRP_PreCompiler
|
||||||
|
|
||||||
$insert APP_INSERTS
|
$insert APP_INSERTS
|
||||||
$insert API_SETUP
|
$insert API_SETUP
|
||||||
$insert HTTP_INSERTS
|
$insert HTTP_INSERTS
|
||||||
|
|
||||||
GoToAPI else
|
GoToAPI else
|
||||||
// The specific resource endpoint doesn't have a API handler yet.
|
// 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.')
|
HTTP_Services('SetResponseStatus', 204, 'This is a valid endpoint but a web API handler has not yet been created.')
|
||||||
end
|
end
|
||||||
|
|
||||||
Return Response OR ''
|
Return Response OR ''
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Endpoint Handlers
|
// Endpoint Handlers
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
API pm_spec.HEAD
|
API pm_spec.HEAD
|
||||||
API pm_spec.GET
|
API pm_spec.GET
|
||||||
|
|
||||||
HTTP_Resource_Services('LoremIpsum')
|
HTTP_Resource_Services('LoremIpsum')
|
||||||
|
|
||||||
end api
|
end api
|
||||||
|
|
||||||
|
@ -102,5 +102,3 @@ CreateHALItem:
|
|||||||
end
|
end
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,9 +35,11 @@ $Insert RDS_TEST_EQUATES
|
|||||||
$Insert RDS_TEST_PROP_EQUATES
|
$Insert RDS_TEST_PROP_EQUATES
|
||||||
$Insert PRS_LAYER_EQU
|
$Insert PRS_LAYER_EQU
|
||||||
|
|
||||||
|
Options SpecTypes = 'CLEAN', 'SURFSCAN', 'THICK', 'THICKA', 'RES', 'SRES', 'CRES', 'CONC'
|
||||||
|
|
||||||
Declare function Database_Services, Psn_Services, obj_Prod_Spec, Error_Services, SRP_JSON, Cust_Epi_Part_Services
|
Declare function Database_Services, Psn_Services, obj_Prod_Spec, Error_Services, SRP_JSON, Cust_Epi_Part_Services
|
||||||
Declare function Prod_Ver_Services, PRS_Stage_Services
|
Declare function Prod_Ver_Services, PRS_Stage_Services, SRP_Array
|
||||||
Declare subroutine Database_Services, Psn_Services, Error_Services, SRP_JSON
|
Declare subroutine Database_Services, Psn_Services, Error_Services, SRP_JSON, Extract_Si_Keys
|
||||||
|
|
||||||
GoToService else
|
GoToService else
|
||||||
Error_Services('Add', Service : ' is not a valid service request within the ' : ServiceModule : ' services module.')
|
Error_Services('Add', Service : ' is not a valid service request within the ' : ServiceModule : ' services module.')
|
||||||
@ -72,6 +74,216 @@ Service InitializeCritParams(PSNo)
|
|||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
|
Service GetRecipes(PSNo)
|
||||||
|
|
||||||
|
ErrorMsg = ''
|
||||||
|
Recipes = ''
|
||||||
|
If PSNo NE '' then
|
||||||
|
If RowExists('PROD_SPEC', PSNo) then
|
||||||
|
PropKeys = ''
|
||||||
|
Extract_Si_Keys('PRS_PROP', 'PS_NO', PSNo, PropKeys)
|
||||||
|
Recipes = Xlate('PRS_PROP', PropKeys, 'MET_RECIPE', 'X')
|
||||||
|
PRSStageKeys = ''
|
||||||
|
Extract_Si_Keys('PRS_STAGE', 'PS_NO', PSNo, PRSStageKeys)
|
||||||
|
Recipes<0, -1> = Xlate('PRS_STAGE', PRSStageKeys, 'MET_RECIPE', 'X')
|
||||||
|
Recipes<0, -1> = Xlate('PRS_STAGE', PRSStageKeys, 'SURFSCAN_RECIPE', 'X')
|
||||||
|
Recipes<0, -1> = @VM : Xlate('PRS_STAGE', PRSStageKeys, 'CLEAN_RECIPE', 'X')
|
||||||
|
Recipes = SRP_Array('Clean', Recipes, 'TrimAndMakeUnique', @VM)
|
||||||
|
end else
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. PROD_SPEC record "':PSNo:'" does not exist.'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. Null PSNo passed into service.'
|
||||||
|
end
|
||||||
|
|
||||||
|
If ErrorMsg EQ '' then
|
||||||
|
Response = Recipes
|
||||||
|
end else
|
||||||
|
Error_Services('Add', ErrorMsg)
|
||||||
|
end
|
||||||
|
|
||||||
|
end service
|
||||||
|
|
||||||
|
Service GetAllMetrologyRecipes(PSNo, GetSurfscan, GetClean, GetRes, GetThick)
|
||||||
|
|
||||||
|
Recipes = ''
|
||||||
|
If GetSurfscan EQ '' then GetSurfscan = True$
|
||||||
|
If GetClean EQ '' then GetClean = True$
|
||||||
|
If GetRes EQ '' then GetRes = True$
|
||||||
|
If GetThick EQ '' then GetThick = True$
|
||||||
|
|
||||||
|
If GetSurfscan then Recipes := PSN_Services('GetSurfscanRecipes', PSNo) : @FM
|
||||||
|
If GetClean then Recipes := PSN_Services('GetCleanRecipes', PSNo) :@FM
|
||||||
|
If GetRes then Recipes := PSN_Services('GetResRecipes', PSNo) :@FM
|
||||||
|
If GetThick then Recipes := PSN_Services('GetThicknessRecipes', PSNo)
|
||||||
|
|
||||||
|
Recipes = SRP_Array('Clean', Recipes, 'TrimAndMakeUnique', @FM)
|
||||||
|
Response = Recipes
|
||||||
|
|
||||||
|
end service
|
||||||
|
|
||||||
|
Service GetSurfscanRecipes(PSNo)
|
||||||
|
|
||||||
|
Recipes = ''
|
||||||
|
If PSNo NE '' then
|
||||||
|
If RowExists('PROD_SPEC', PSNo) then
|
||||||
|
PropKeys = ''
|
||||||
|
Extract_Si_Keys('PRS_PROP', 'PS_NO', PSNo, PropKeys)
|
||||||
|
PRSStageKeys = ''
|
||||||
|
Extract_Si_Keys('PRS_STAGE', 'PS_NO', PSNo, PRSStageKeys)
|
||||||
|
for each PRSStageKey in PRSStageKeys using @VM setting pPos
|
||||||
|
Stage = Xlate('PRS_STAGE', PRSStageKey, 'STAGE', 'X')
|
||||||
|
TencorRecipes = Xlate('PRS_STAGE', PRSStageKey, 'SURFSCAN_RECIPE', 'X')
|
||||||
|
for each Recipe in TencorRecipes using @VM
|
||||||
|
ToolClass = 'TENCOR'
|
||||||
|
Recipes<-1> = ToolClass : @VM : Recipe : @VM : Stage
|
||||||
|
Next TencorRecipe
|
||||||
|
Next PRSStageKey
|
||||||
|
Recipes = SRP_Array('Clean', Recipes, 'TrimAndMakeUnique', @FM)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
Response = Recipes
|
||||||
|
|
||||||
|
end service
|
||||||
|
|
||||||
|
Service GetCleanRecipes(PSNo)
|
||||||
|
|
||||||
|
Recipes = ''
|
||||||
|
If PSNo NE '' then
|
||||||
|
If RowExists('PROD_SPEC', PSNo) then
|
||||||
|
PropKeys = ''
|
||||||
|
Extract_Si_Keys('PRS_PROP', 'PS_NO', PSNo, PropKeys)
|
||||||
|
PRSStageKeys = ''
|
||||||
|
Extract_Si_Keys('PRS_STAGE', 'PS_NO', PSNo, PRSStageKeys)
|
||||||
|
for each PRSStageKey in PRSStageKeys using @VM setting pPos
|
||||||
|
Stage = Xlate('PRS_STAGE', PRSStageKey, 'STAGE', 'X')
|
||||||
|
CleanRecipes = Xlate('PRS_STAGE', PRSStageKey, 'CLEAN_RECIPE', 'X')
|
||||||
|
for each Recipe in CleanRecipes using @VM
|
||||||
|
ToolClass = 'CLEAN'
|
||||||
|
Recipes<-1> = ToolClass : @VM : Recipe : @VM : Stage
|
||||||
|
Next TencorRecipe
|
||||||
|
Next PRSStageKey
|
||||||
|
Recipes = SRP_Array('Clean', Recipes, 'TrimAndMakeUnique', @FM)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
Response = Recipes
|
||||||
|
|
||||||
|
end service
|
||||||
|
|
||||||
|
Service GetThicknessRecipes(PSNo)
|
||||||
|
|
||||||
|
ErrorMsg = ''
|
||||||
|
Recipes = ''
|
||||||
|
If PSNo NE '' then
|
||||||
|
If RowExists('PROD_SPEC', PSNo) then
|
||||||
|
//First get QA Recipes
|
||||||
|
PropKeys = ''
|
||||||
|
Extract_Si_Keys('PRS_PROP', 'PS_NO', PSNo, PropKeys)
|
||||||
|
Recipes = ''
|
||||||
|
PRSStageKeys = ''
|
||||||
|
Extract_Si_Keys('PRS_STAGE', 'PS_NO', PSNo, PRSStageKeys)
|
||||||
|
for each PRSStageKey in PRSStageKeys using @VM setting pPos
|
||||||
|
Stage = Xlate('PRS_STAGE', PRSStageKey, 'STAGE', 'X')
|
||||||
|
PRSStageRecipes = Xlate('PRS_STAGE', PRSStageKey, 'MET_RECIPE', 'X')
|
||||||
|
for each PRSStageRecipe in PRSStageRecipes using @VM setting rPos
|
||||||
|
PropType = Xlate('PRS_STAGE', PRSStageKey, 'MET_PROP', 'X')<1, rPos>
|
||||||
|
If PropType EQ 'THICK' OR PropType EQ 'THICKA' then
|
||||||
|
Recipe = PRSStageRecipe
|
||||||
|
ToolClass = 'FTIR'
|
||||||
|
Recipes<-1> = ToolClass : @VM : Recipe : @VM : Stage
|
||||||
|
end
|
||||||
|
Next PRSStageRecipe
|
||||||
|
Next PRSStageKey
|
||||||
|
//Next get Rathole recipes
|
||||||
|
SpecEpiData = XLATE('PROD_SPEC', PSNo, 'SPEC_EPI', 'X')
|
||||||
|
swap @VM with @FM in SpecEpiData
|
||||||
|
swap '~' with @VM in SpecEpiData
|
||||||
|
ThicknessData = SpecEpiData<13>
|
||||||
|
ToolClass = ThicknessData<1, 1>
|
||||||
|
Recipe = ThicknessData<1, 3>
|
||||||
|
Stage = 'RDS_TEST'
|
||||||
|
If ToolClass EQ 'FTIR' OR ToolClass EQ 'ADE' then
|
||||||
|
Recipes<-1> = ToolClass : @VM : Recipe : @VM : Stage
|
||||||
|
end
|
||||||
|
// Remove any duplicate entries
|
||||||
|
Recipes = SRP_Array('Clean', Recipes, 'TrimAndMakeUnique', @FM)
|
||||||
|
end else
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. PROD_SPEC record "':PSNo:'" does not exist.'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. Null PSNo passed into service.'
|
||||||
|
end
|
||||||
|
|
||||||
|
If ErrorMsg EQ '' then
|
||||||
|
Response = Recipes
|
||||||
|
end else
|
||||||
|
Error_Services('Add', ErrorMsg)
|
||||||
|
end
|
||||||
|
|
||||||
|
end service
|
||||||
|
|
||||||
|
Service GetResRecipes(PSNo)
|
||||||
|
|
||||||
|
ErrorMsg = ''
|
||||||
|
Recipes = ''
|
||||||
|
If PSNo NE '' then
|
||||||
|
If RowExists('PROD_SPEC', PSNo) then
|
||||||
|
//First get QA Recipes
|
||||||
|
PropKeys = ''
|
||||||
|
Extract_Si_Keys('PRS_PROP', 'PS_NO', PSNo, PropKeys)
|
||||||
|
Recipes = ''
|
||||||
|
PRSStageKeys = ''
|
||||||
|
Extract_Si_Keys('PRS_STAGE', 'PS_NO', PSNo, PRSStageKeys)
|
||||||
|
for each PRSStageKey in PRSStageKeys using @VM setting pPos
|
||||||
|
Stage = Xlate('PRS_STAGE', PRSStageKey, 'STAGE', 'X')
|
||||||
|
PRSStageRecipes = Xlate('PRS_STAGE', PRSStageKey, 'MET_RECIPE', 'X')
|
||||||
|
for each PRSStageRecipe in PRSStageRecipes using @VM setting rPos
|
||||||
|
PropType = Xlate('PRS_STAGE', PRSStageKey, 'MET_PROP', 'X')<1, rPos>
|
||||||
|
ToolClass = Xlate('PRS_STAGE', PRSStageKey, 'MET_TOOL_CLASS', 'X')<1, rPos>
|
||||||
|
If PropType EQ 'RES' OR PropType EQ 'SRES' OR PropType EQ 'CRES' OR PropType EQ 'CONC' then
|
||||||
|
Recipe = PRSStageRecipe
|
||||||
|
ToolClass = ToolClass
|
||||||
|
Recipes<-1> = ToolClass : @VM : Recipe : @VM : Stage
|
||||||
|
end
|
||||||
|
Next PRSStageRecipe
|
||||||
|
Next PRSStageKey
|
||||||
|
//Next get Rathole recipes
|
||||||
|
Stage = 'RDS_TEST'
|
||||||
|
SpecEpiData = XLATE('PROD_SPEC', PSNo, 'SPEC_EPI', 'X')
|
||||||
|
swap @VM with @FM in SpecEpiData
|
||||||
|
swap '~' with @VM in SpecEpiData
|
||||||
|
ResData1 = SpecEpiData<19>
|
||||||
|
|
||||||
|
If ResData1 NE '' then
|
||||||
|
ToolClass = ResData1<1, 1>
|
||||||
|
Recipe = ResData1<1, 3>
|
||||||
|
Recipes<-1> = ToolClass : @VM : Recipe : @VM : Stage
|
||||||
|
end
|
||||||
|
|
||||||
|
ResData2 = SpecEpiData<14>
|
||||||
|
If ResData2 NE '' then
|
||||||
|
ToolClass = ResData2<1, 1>
|
||||||
|
Recipe = ResData2<1, 3>
|
||||||
|
Recipes<-1> = ToolClass : @VM : Recipe : @VM : Stage
|
||||||
|
end
|
||||||
|
|
||||||
|
// Remove any duplicate entries
|
||||||
|
Recipes = SRP_Array('Clean', Recipes, 'TrimAndMakeUnique', @FM)
|
||||||
|
end else
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. PROD_SPEC record "':PSNo:'" does not exist.'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. Null PSNo passed into service.'
|
||||||
|
end
|
||||||
|
|
||||||
|
If ErrorMsg EQ '' then
|
||||||
|
Response = Recipes
|
||||||
|
end else
|
||||||
|
Error_Services('Add', ErrorMsg)
|
||||||
|
end
|
||||||
|
|
||||||
|
end service
|
||||||
|
|
||||||
Service CheckPSNStages(PSNo, Stage)
|
Service CheckPSNStages(PSNo, Stage)
|
||||||
|
|
||||||
Begin Case
|
Begin Case
|
||||||
@ -950,3 +1162,8 @@ CheckAdHoc:
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,106 +1,105 @@
|
|||||||
Function Reactorloadings_API(@API)
|
Function Reactorloadings_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
|
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.
|
permission from SRP Computer Solutions, Inc.
|
||||||
|
|
||||||
Name : Reactorloadings_API
|
Name : Reactorloadings_API
|
||||||
|
|
||||||
Description : API logic for the Reactorloadings resource.
|
Description : API logic for the Reactorloadings resource.
|
||||||
|
|
||||||
Notes : All web APIs should include the API_SETUP insert. This will provide several useful variables:
|
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.)
|
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).
|
APIURL - The URL for the API entry point (e.g., api.mysite.com/v1).
|
||||||
FullEndpointURL - The URL submitted by the client, including query params.
|
FullEndpointURL - The URL submitted by the client, including query params.
|
||||||
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
||||||
EndpointSegment - The URL endpoint segment.
|
EndpointSegment - The URL endpoint segment.
|
||||||
ParentURL - The URL path preceeding the current endpoint.
|
ParentURL - The URL path preceeding the current endpoint.
|
||||||
CurrentAPI - The name of this stored procedure.
|
CurrentAPI - The name of this stored procedure.
|
||||||
|
|
||||||
Parameters :
|
Parameters :
|
||||||
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
||||||
- APIPattern must follow this structure Reactorloadings[.ID.[<Property>]]
|
- APIPattern must follow this structure Reactorloadings[.ID.[<Property>]]
|
||||||
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
||||||
Examples:
|
Examples:
|
||||||
- Reactorloadings.POST
|
- Reactorloadings.POST
|
||||||
- Reactorloadings.ID.PUT
|
- Reactorloadings.ID.PUT
|
||||||
- Reactorloadings.ID.firstName.GET
|
- Reactorloadings.ID.firstName.GET
|
||||||
Response [out] -- Response to be sent back to the Controller (HTTP_MCP) or requesting procedure. Web API
|
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
|
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
|
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.
|
value is only helpful if the developers want to use it for debug purposes.
|
||||||
|
|
||||||
History : (Date, Initials, Notes)
|
History : (Date, Initials, Notes)
|
||||||
05/22/24 xxx Original programmer.
|
05/22/24 xxx Original programmer.
|
||||||
|
|
||||||
***********************************************************************************************************************/
|
***********************************************************************************************************************/
|
||||||
|
|
||||||
#pragma precomp SRP_PreCompiler
|
#pragma precomp SRP_PreCompiler
|
||||||
|
|
||||||
Declare function Oi_Wizard_Services, Memberof, Oi_Wizard_Services
|
Declare function Oi_Wizard_Services, Memberof, Oi_Wizard_Services
|
||||||
Declare subroutine Reactor_Services, Oi_Wizard_Services
|
Declare subroutine Reactor_Services, Oi_Wizard_Services
|
||||||
|
|
||||||
$insert APP_INSERTS
|
$insert APP_INSERTS
|
||||||
$insert API_SETUP
|
$insert API_SETUP
|
||||||
$insert HTTP_INSERTS
|
$insert HTTP_INSERTS
|
||||||
|
|
||||||
GoToAPI else
|
GoToAPI else
|
||||||
// The specific resource endpoint doesn't have a API handler yet.
|
// 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.')
|
HTTP_Services('SetResponseStatus', 204, 'This is a valid endpoint but a web API handler has not yet been created.')
|
||||||
end
|
end
|
||||||
|
|
||||||
Return Response OR ''
|
Return Response OR ''
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Endpoint Handlers
|
// Endpoint Handlers
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
API reactorloadings.POST
|
API reactorloadings.POST
|
||||||
OIWizardID = ''
|
OIWizardID = ''
|
||||||
CurrUser = ''
|
CurrUser = ''
|
||||||
Cookies = HTTP_Services('GetHTTPCookie')
|
Cookies = HTTP_Services('GetHTTPCookie')
|
||||||
For each Cookie in Cookies using ';'
|
For each Cookie in Cookies using ';'
|
||||||
Key = Trim(Field(Cookie, '=', 1))
|
Key = Trim(Field(Cookie, '=', 1))
|
||||||
If Key EQ 'sessionID' then
|
If Key EQ 'sessionID' then
|
||||||
OIWizardID = Field(Cookie, '=', 2)
|
OIWizardID = Field(Cookie, '=', 2)
|
||||||
end
|
end
|
||||||
Next Cookie
|
Next Cookie
|
||||||
|
|
||||||
If OIWizardID NE '' then
|
If OIWizardID NE '' then
|
||||||
// Call validate session to extend session expiry
|
// Call validate session to extend session expiry
|
||||||
OI_Wizard_Services('ValidateSession', OIWizardID)
|
OI_Wizard_Services('ValidateSession', OIWizardID)
|
||||||
CurrUser = Xlate('OI_WIZARD', OIWizardID, 'EMPLOYEE_ID', 'X')
|
CurrUser = Xlate('OI_WIZARD', OIWizardID, 'EMPLOYEE_ID', 'X')
|
||||||
end
|
end
|
||||||
|
|
||||||
ValidSession = OI_Wizard_Services('ValidateSession', OIWizardID)
|
ValidSession = OI_Wizard_Services('ValidateSession', OIWizardID)
|
||||||
|
|
||||||
If ValidSession then
|
If ValidSession then
|
||||||
If Memberof(CurrUser, 'OI_ADMIN') OR Memberof(CurrUser, 'LEAD') OR Memberof(CurrUser, 'SUPERVISOR') then
|
If Memberof(CurrUser, 'OI_ADMIN') OR Memberof(CurrUser, 'LEAD') OR Memberof(CurrUser, 'SUPERVISOR') then
|
||||||
Body = HTTP_Services('GetHTTPPostString', True$)
|
Body = HTTP_Services('GetHTTPPostString', True$)
|
||||||
// The POST string will have been encoded so use percent (URL) decoding.
|
// The POST string will have been encoded so use percent (URL) decoding.
|
||||||
DecodedJSON = HTTP_Services('DecodePercentString', Body)
|
DecodedJSON = HTTP_Services('DecodePercentString', Body)
|
||||||
If SRP_JSON(objBody, 'Parse', Body) EQ '' then
|
If SRP_JSON(objBody, 'Parse', Body) EQ '' then
|
||||||
rdsNo = SRP_JSON(objBody, 'GetValue', 'rdsNo')
|
rdsNo = SRP_JSON(objBody, 'GetValue', 'rdsNo')
|
||||||
reactorNo = SRP_JSON(objBody, 'GetValue', 'reactorNo')
|
reactorNo = SRP_JSON(objBody, 'GetValue', 'reactorNo')
|
||||||
SRP_JSON(objBody, 'Release')
|
SRP_JSON(objBody, 'Release')
|
||||||
end
|
end
|
||||||
|
|
||||||
Reactor_Services('RemoveRDSFromReactorLoad', rdsNo, reactorNo, CurrUser)
|
Reactor_Services('RemoveRDSFromReactorLoad', rdsNo, reactorNo, CurrUser)
|
||||||
If Error_Services('NoError') then
|
If Error_Services('NoError') then
|
||||||
HTTP_Services('SetResponseStatus', 200, 'RDS Successfully removed.')
|
HTTP_Services('SetResponseStatus', 200, 'RDS Successfully removed.')
|
||||||
end else
|
end else
|
||||||
ErrCode = Error_Services('GetMessage')
|
ErrCode = Error_Services('GetMessage')
|
||||||
HTTP_Services('SetResponseStatus', 500, ErrCode)
|
HTTP_Services('SetResponseStatus', 500, ErrCode)
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
HTTP_Services('SetResponseStatus', 503, 'User is not authorized!')
|
HTTP_Services('SetResponseStatus', 503, 'User is not authorized!')
|
||||||
end
|
end
|
||||||
End else
|
End else
|
||||||
HTTP_Services('SetResponseStatus', 401, 'User must be signed in to access this resource.')
|
HTTP_Services('SetResponseStatus', 401, 'User must be signed in to access this resource.')
|
||||||
end
|
end
|
||||||
|
|
||||||
end api
|
end api
|
||||||
|
|
||||||
|
@ -260,5 +260,3 @@ API reactorlogs.ID.nicaoverride.PUT
|
|||||||
HTTP_Resource_Services('LoremIpsum')
|
HTTP_Resource_Services('LoremIpsum')
|
||||||
|
|
||||||
end api
|
end api
|
||||||
|
|
||||||
|
|
||||||
|
@ -259,5 +259,3 @@ CreateHALCollection:
|
|||||||
end
|
end
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,64 +1,63 @@
|
|||||||
Function Remotehealthcheck_API(@API)
|
Function Remotehealthcheck_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
|
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.
|
permission from SRP Computer Solutions, Inc.
|
||||||
|
|
||||||
Name : Remotehealthcheck_API
|
Name : Remotehealthcheck_API
|
||||||
|
|
||||||
Description : API logic for the Remotehealthcheck resource.
|
Description : API logic for the Remotehealthcheck resource.
|
||||||
|
|
||||||
Notes : All web APIs should include the API_SETUP insert. This will provide several useful variables:
|
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.)
|
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).
|
APIURL - The URL for the API entry point (e.g., api.mysite.com/v1).
|
||||||
FullEndpointURL - The URL submitted by the client, including query params.
|
FullEndpointURL - The URL submitted by the client, including query params.
|
||||||
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
||||||
EndpointSegment - The URL endpoint segment.
|
EndpointSegment - The URL endpoint segment.
|
||||||
ParentURL - The URL path preceeding the current endpoint.
|
ParentURL - The URL path preceeding the current endpoint.
|
||||||
CurrentAPI - The name of this stored procedure.
|
CurrentAPI - The name of this stored procedure.
|
||||||
|
|
||||||
Parameters :
|
Parameters :
|
||||||
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
||||||
- APIPattern must follow this structure Remotehealthcheck[.ID.[<Property>]]
|
- APIPattern must follow this structure Remotehealthcheck[.ID.[<Property>]]
|
||||||
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
||||||
Examples:
|
Examples:
|
||||||
- Remotehealthcheck.POST
|
- Remotehealthcheck.POST
|
||||||
- Remotehealthcheck.ID.PUT
|
- Remotehealthcheck.ID.PUT
|
||||||
- Remotehealthcheck.ID.firstName.GET
|
- Remotehealthcheck.ID.firstName.GET
|
||||||
Response [out] -- Response to be sent back to the Controller (HTTP_MCP) or requesting procedure. Web API
|
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
|
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
|
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.
|
value is only helpful if the developers want to use it for debug purposes.
|
||||||
|
|
||||||
History : (Date, Initials, Notes)
|
History : (Date, Initials, Notes)
|
||||||
07/17/24 xxx Original programmer.
|
07/17/24 xxx Original programmer.
|
||||||
|
|
||||||
***********************************************************************************************************************/
|
***********************************************************************************************************************/
|
||||||
|
|
||||||
#pragma precomp SRP_PreCompiler
|
#pragma precomp SRP_PreCompiler
|
||||||
|
|
||||||
$insert APP_INSERTS
|
$insert APP_INSERTS
|
||||||
$insert API_SETUP
|
$insert API_SETUP
|
||||||
$insert HTTP_INSERTS
|
$insert HTTP_INSERTS
|
||||||
|
|
||||||
GoToAPI else
|
GoToAPI else
|
||||||
// The specific resource endpoint doesn't have a API handler yet.
|
// The specific resource endpoint doesn't have a API handler yet.
|
||||||
HTTP_Services('SetResponseStatus', 200, 'This is a valid endpoint but a web API handler has not yet been created.')
|
HTTP_Services('SetResponseStatus', 200, 'This is a valid endpoint but a web API handler has not yet been created.')
|
||||||
end
|
end
|
||||||
|
|
||||||
Return Response OR ''
|
Return Response OR ''
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Endpoint Handlers
|
// Endpoint Handlers
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
API remotehealthcheck.HEAD
|
API remotehealthcheck.HEAD
|
||||||
API remotehealthcheck.GET
|
API remotehealthcheck.GET
|
||||||
|
|
||||||
HTTP_Resource_Services('LoremIpsum')
|
HTTP_Resource_Services('LoremIpsum')
|
||||||
|
|
||||||
end api
|
end api
|
||||||
|
|
||||||
|
@ -233,5 +233,3 @@ API reports.GET
|
|||||||
HTTP_Resource_Services('LoremIpsum')
|
HTTP_Resource_Services('LoremIpsum')
|
||||||
|
|
||||||
end api
|
end api
|
||||||
|
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ API returntofab.ID.GET
|
|||||||
UserId = Xlate('OI_WIZARD', OIWizardID, 'EMPLOYEE_ID', 'X')
|
UserId = Xlate('OI_WIZARD', OIWizardID, 'EMPLOYEE_ID', 'X')
|
||||||
RTFId = EndpointSegment
|
RTFId = EndpointSegment
|
||||||
If Error_Services('NoError') AND RTFId NE '' then
|
If Error_Services('NoError') AND RTFId NE '' then
|
||||||
RTFJson = Return_To_Fab_Services('ConvertReturnToFabRecordToJSON', RTFId)
|
RTFJson = Return_To_Fab_Services('ConvertReturnToFabRecordToJSON', RTFId, UserId)
|
||||||
If Error_Services('NoError') then
|
If Error_Services('NoError') then
|
||||||
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
HTTP_Services('SetResponseBody', RTFJson, False$, 'application/hal+json')
|
HTTP_Services('SetResponseBody', RTFJson, False$, 'application/hal+json')
|
||||||
@ -247,7 +247,6 @@ end api
|
|||||||
|
|
||||||
API returntofab.reportopenforms.HEAD
|
API returntofab.reportopenforms.HEAD
|
||||||
API returntofab.reportopenforms.GET
|
API returntofab.reportopenforms.GET
|
||||||
|
|
||||||
OIWizardID = ''
|
OIWizardID = ''
|
||||||
Cookies = HTTP_Services('GetHTTPCookie')
|
Cookies = HTTP_Services('GetHTTPCookie')
|
||||||
For each Cookie in Cookies using ';'
|
For each Cookie in Cookies using ';'
|
||||||
@ -258,29 +257,19 @@ API returntofab.reportopenforms.GET
|
|||||||
Next Cookie
|
Next Cookie
|
||||||
|
|
||||||
ValidSession = OI_Wizard_Services('ValidateSession', OIWizardID)
|
ValidSession = OI_Wizard_Services('ValidateSession', OIWizardID)
|
||||||
|
|
||||||
If ValidSession then
|
UserId = Xlate('OI_WIZARD', OIWizardID, 'EMPLOYEE_ID', 'X')
|
||||||
UserId = Xlate('OI_WIZARD', OIWizardID, 'EMPLOYEE_ID', 'X')
|
RTFJson = Return_To_Fab_Services('CreateReturnToFabReportJson', True$)
|
||||||
RTFId = EndpointSegment
|
If RTFJson NE '' then
|
||||||
If Error_Services('NoError') AND RTFId NE '' then
|
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
RTFJson = Return_To_Fab_Services('CreateReturnToFabReportJson', True$)
|
HTTP_Services('SetResponseBody', RTFJson, False$, 'application/hal+json')
|
||||||
If Error_Services('NoError') then
|
If Assigned(Message) then
|
||||||
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
HTTP_Services('SetResponseStatus', 201, Message)
|
||||||
HTTP_Services('SetResponseBody', RTFJson, False$, 'application/hal+json')
|
|
||||||
If Assigned(Message) then
|
|
||||||
HTTP_Services('SetResponseStatus', 201, Message)
|
|
||||||
end else
|
|
||||||
HTTP_Services('SetResponseStatus', 201)
|
|
||||||
end
|
|
||||||
end else
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
end else
|
end else
|
||||||
HTTP_Services('SetResponseStatus', 400, Error_Services('GetMessage'))
|
HTTP_Services('SetResponseStatus', 201)
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
HTTP_Services('SetResponseStatus', 401, 'Invalid session. Reauthentication required.')
|
ErrorMessage = 'Error getting report data.'
|
||||||
end
|
end
|
||||||
|
|
||||||
end api
|
end api
|
||||||
@ -288,7 +277,6 @@ end api
|
|||||||
|
|
||||||
API returntofab.reportallforms.HEAD
|
API returntofab.reportallforms.HEAD
|
||||||
API returntofab.reportallforms.GET
|
API returntofab.reportallforms.GET
|
||||||
|
|
||||||
OIWizardID = ''
|
OIWizardID = ''
|
||||||
Cookies = HTTP_Services('GetHTTPCookie')
|
Cookies = HTTP_Services('GetHTTPCookie')
|
||||||
For each Cookie in Cookies using ';'
|
For each Cookie in Cookies using ';'
|
||||||
@ -303,9 +291,9 @@ API returntofab.reportallforms.GET
|
|||||||
If ValidSession then
|
If ValidSession then
|
||||||
UserId = Xlate('OI_WIZARD', OIWizardID, 'EMPLOYEE_ID', 'X')
|
UserId = Xlate('OI_WIZARD', OIWizardID, 'EMPLOYEE_ID', 'X')
|
||||||
RTFId = EndpointSegment
|
RTFId = EndpointSegment
|
||||||
If Error_Services('NoError') AND RTFId NE '' then
|
If RTFId NE '' then
|
||||||
RTFJson = Return_To_Fab_Services('CreateReturnToFabReportJson', False$)
|
RTFJson = Return_To_Fab_Services('CreateReturnToFabReportJson', False$)
|
||||||
If Error_Services('NoError') then
|
If RTFJson NE '' then
|
||||||
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
HTTP_Services('SetResponseBody', RTFJson, False$, 'application/hal+json')
|
HTTP_Services('SetResponseBody', RTFJson, False$, 'application/hal+json')
|
||||||
If Assigned(Message) then
|
If Assigned(Message) then
|
||||||
@ -314,11 +302,10 @@ API returntofab.reportallforms.GET
|
|||||||
HTTP_Services('SetResponseStatus', 201)
|
HTTP_Services('SetResponseStatus', 201)
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
|
ErrorMessage = 'Error getting report data.'
|
||||||
end
|
end
|
||||||
|
|
||||||
end else
|
end else
|
||||||
HTTP_Services('SetResponseStatus', 400, Error_Services('GetMessage'))
|
HTTP_Services('SetResponseStatus', 400, 'Return To Fab ID was null')
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
HTTP_Services('SetResponseStatus', 401, 'Invalid session. Reauthentication required.')
|
HTTP_Services('SetResponseStatus', 401, 'Invalid session. Reauthentication required.')
|
||||||
@ -370,6 +357,37 @@ CreateResultOptionCollection:
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
CreateOperationOptionCollection:
|
||||||
|
JSONCollection = ''
|
||||||
|
Abort = False$
|
||||||
|
OperationOptions = Return_To_Fab_Services('GetRTFOperationIDs')
|
||||||
|
hJSONCollection = ''
|
||||||
|
If SRP_JSON(hJSONCollection, 'New', 'Object') then
|
||||||
|
hOperationOptionCollection = ''
|
||||||
|
If SRP_JSON(hOperationOptionCollection, 'New', 'Array') then
|
||||||
|
For each OperationOptionId in OperationOptions using @VM setting fPos
|
||||||
|
SRP_Json(hOperationOptionCollection, 'AddValue', OperationOptionId, 'String')
|
||||||
|
Next OperationOptionId
|
||||||
|
SRP_JSON(hJSONCollection, 'Set', 'OperationOptions', hOperationOptionCollection)
|
||||||
|
SRP_JSON(hOperationOptionCollection, 'Release')
|
||||||
|
end
|
||||||
|
JSONCollection = SRP_JSON(hJSONCollection, 'Stringify', 'Fast')
|
||||||
|
SRP_JSON(hJSONCollection, 'Release')
|
||||||
|
end
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
|
HTTP_Services('SetResponseBody', JSONCollection, False$, 'application/hal+json')
|
||||||
|
If Assigned(Message) then
|
||||||
|
HTTP_Services('SetResponseStatus', 201, Message)
|
||||||
|
end else
|
||||||
|
HTTP_Services('SetResponseStatus', 201)
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
Message = Error_Services('GetMessage')
|
||||||
|
HTTP_Services('SetResponseStatus', 500, 'Error in the ' : CurrentAPI : ' API. Message: ': Message)
|
||||||
|
end
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
API returntofab.getreturntofablabelzpl.HEAD
|
API returntofab.getreturntofablabelzpl.HEAD
|
||||||
API returntofab.getreturntofablabelzpl.GET
|
API returntofab.getreturntofablabelzpl.GET
|
||||||
@ -404,3 +422,26 @@ API returntofab.getreturntofablabelzpl.GET
|
|||||||
HTTP_Services('SetResponseStatus', 401, 'Invalid session. Reauthentication required.')
|
HTTP_Services('SetResponseStatus', 401, 'Invalid session. Reauthentication required.')
|
||||||
end
|
end
|
||||||
end api
|
end api
|
||||||
|
|
||||||
|
|
||||||
|
API returntofab.rtfoperations.HEAD
|
||||||
|
API returntofab.rtfoperations.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
|
||||||
|
GoSub CreateOperationOptionCollection
|
||||||
|
end else
|
||||||
|
HTTP_Services('SetResponseStatus', 401, 'Invalid session. Reauthentication required.')
|
||||||
|
end
|
||||||
|
|
||||||
|
end api
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,131 +1,129 @@
|
|||||||
Function Scrubber_pm_API(@API)
|
Function Scrubber_pm_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
|
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.
|
permission from SRP Computer Solutions, Inc.
|
||||||
|
|
||||||
Name : Scrubber_pm_API
|
Name : Scrubber_pm_API
|
||||||
|
|
||||||
Description : API logic for the Scrubber_pm resource.
|
Description : API logic for the Scrubber_pm resource.
|
||||||
|
|
||||||
Notes : All web APIs should include the API_SETUP insert. This will provide several useful variables:
|
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.)
|
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).
|
APIURL - The URL for the API entry point (e.g., api.mysite.com/v1).
|
||||||
FullEndpointURL - The URL submitted by the client, including query params.
|
FullEndpointURL - The URL submitted by the client, including query params.
|
||||||
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
FullEndpointURLNoQuery - The URL submitted by the client, excluding query params.
|
||||||
EndpointSegment - The URL endpoint segment.
|
EndpointSegment - The URL endpoint segment.
|
||||||
ParentURL - The URL path preceeding the current endpoint.
|
ParentURL - The URL path preceeding the current endpoint.
|
||||||
CurrentAPI - The name of this stored procedure.
|
CurrentAPI - The name of this stored procedure.
|
||||||
|
|
||||||
Parameters :
|
Parameters :
|
||||||
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
API [in] -- Web API to process. Format is [APIPattern].[HTTPMethod]:
|
||||||
- APIPattern must follow this structure Scrubber_pm[.ID.[<Property>]]
|
- APIPattern must follow this structure Scrubber_pm[.ID.[<Property>]]
|
||||||
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
- HTTPMethod can be any valid HTTP method, e.g., GET, POST, PUT, DELETE, etc.
|
||||||
Examples:
|
Examples:
|
||||||
- Scrubber_pm.POST
|
- Scrubber_pm.POST
|
||||||
- Scrubber_pm.ID.PUT
|
- Scrubber_pm.ID.PUT
|
||||||
- Scrubber_pm.ID.firstName.GET
|
- Scrubber_pm.ID.firstName.GET
|
||||||
Response [out] -- Response to be sent back to the Controller (HTTP_MCP) or requesting procedure. Web API
|
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
|
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
|
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.
|
value is only helpful if the developers want to use it for debug purposes.
|
||||||
|
|
||||||
History : (Date, Initials, Notes)
|
History : (Date, Initials, Notes)
|
||||||
06/05/24 xxx Original programmer.
|
06/05/24 xxx Original programmer.
|
||||||
|
|
||||||
***********************************************************************************************************************/
|
***********************************************************************************************************************/
|
||||||
|
|
||||||
#pragma precomp SRP_PreCompiler
|
#pragma precomp SRP_PreCompiler
|
||||||
|
|
||||||
Declare Subroutine Pm_Services, Http_Services, Logging_Services
|
Declare Subroutine Pm_Services, Http_Services, Logging_Services
|
||||||
Declare function Error_Services, Logging_Services, Environment_Services, Datetime
|
Declare function Error_Services, Logging_Services, Environment_Services, Datetime
|
||||||
|
|
||||||
$insert APP_INSERTS
|
$insert APP_INSERTS
|
||||||
$insert API_SETUP
|
$insert API_SETUP
|
||||||
$insert HTTP_INSERTS
|
$insert HTTP_INSERTS
|
||||||
|
|
||||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Scrubbers\API'
|
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Scrubbers\API'
|
||||||
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] : ' Tool Log.csv'
|
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Tool Log.csv'
|
||||||
Headers = 'Logging DTM' : @FM : 'ScrubberID' : @FM : 'Notes' : @FM : 'Message'
|
Headers = 'Logging DTM' : @FM : 'ScrubberID' : @FM : 'Notes' : @FM : 'Message'
|
||||||
objLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ',', Headers, '', False$, False$)
|
objLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ',', Headers, '', False$, False$)
|
||||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||||
|
|
||||||
GoToAPI else
|
GoToAPI else
|
||||||
// The specific resource endpoint doesn't have a API handler yet.
|
// 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.')
|
HTTP_Services('SetResponseStatus', 204, 'This is a valid endpoint but a web API handler has not yet been created.')
|
||||||
end
|
end
|
||||||
|
|
||||||
Return Response OR ''
|
Return Response OR ''
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Endpoint Handlers
|
// Endpoint Handlers
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
API scrubber_pm.POST
|
API scrubber_pm.POST
|
||||||
Body = HTTP_Services('GetHTTPPostString')
|
Body = HTTP_Services('GetHTTPPostString')
|
||||||
If Body NE '' then
|
If Body NE '' then
|
||||||
// The POST string will have been encoded so use percent (URL) decoding.
|
// The POST string will have been encoded so use percent (URL) decoding.
|
||||||
PMJson = HTTP_Services('DecodePercentString', Body)
|
PMJson = HTTP_Services('DecodePercentString', Body)
|
||||||
ParseResponse = SRP_JSON(objJson, 'PARSE', PMJson)
|
ParseResponse = SRP_JSON(objJson, 'PARSE', PMJson)
|
||||||
If (ParseResponse EQ '') then
|
If (ParseResponse EQ '') then
|
||||||
EquipmentID = SRP_JSON(objJson, 'GetValue', 'EquipmentId')
|
EquipmentID = SRP_JSON(objJson, 'GetValue', 'EquipmentId')
|
||||||
User = SRP_JSON(objJson, 'GetValue', 'User')
|
User = SRP_JSON(objJson, 'GetValue', 'User')
|
||||||
end else
|
end else
|
||||||
HTTP_Services('SetResponseStatus', 400, 'Unable to parse the JSON data from the request.')
|
HTTP_Services('SetResponseStatus', 400, 'Unable to parse the JSON data from the request.')
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
HTTP_Services('SetResponseStatus', 400, 'JSON object is missing in the body of the request.')
|
HTTP_Services('SetResponseStatus', 400, 'JSON object is missing in the body of the request.')
|
||||||
end
|
end
|
||||||
|
|
||||||
end api
|
end api
|
||||||
|
|
||||||
|
|
||||||
API scrubber_pm.HEAD
|
API scrubber_pm.HEAD
|
||||||
API scrubber_pm.GET
|
API scrubber_pm.GET
|
||||||
|
|
||||||
HTTP_Resource_Services('LoremIpsum')
|
HTTP_Resource_Services('LoremIpsum')
|
||||||
|
|
||||||
end api
|
end api
|
||||||
|
|
||||||
|
|
||||||
API scrubber_pm.ID.HEAD
|
API scrubber_pm.ID.HEAD
|
||||||
API scrubber_pm.ID.GET
|
API scrubber_pm.ID.GET
|
||||||
|
|
||||||
ScrubberID = EndpointSegment
|
ScrubberID = EndpointSegment
|
||||||
IF RowExists('TOOL', ScrubberID) then
|
IF RowExists('TOOL', ScrubberID) then
|
||||||
Pm_Services('CompleteScrubberPM', ScrubberID)
|
Pm_Services('CompleteScrubberPM', ScrubberID)
|
||||||
If Error_Services('HasError') then
|
If Error_Services('HasError') then
|
||||||
ErrMsg = Error_Services('GetMessage')
|
ErrMsg = Error_Services('GetMessage')
|
||||||
HTTP_Services('SetResponseStatus', 500, ErrMsg)
|
HTTP_Services('SetResponseStatus', 500, ErrMsg)
|
||||||
LogData = ''
|
LogData = ''
|
||||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||||
LogData<2> = ScrubberID
|
LogData<2> = ScrubberID
|
||||||
LogData<3> = 'Error'
|
LogData<3> = 'Error'
|
||||||
LogData<4> = ErrMsg
|
LogData<4> = ErrMsg
|
||||||
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
|
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
|
||||||
end else
|
end else
|
||||||
LogData = ''
|
LogData = ''
|
||||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||||
LogData<2> = ScrubberID
|
LogData<2> = ScrubberID
|
||||||
LogData<3> = 'Success'
|
LogData<3> = 'Success'
|
||||||
LogData<4> = 'Scrubber PM Completion was successful'
|
LogData<4> = 'Scrubber PM Completion was successful'
|
||||||
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
|
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
ErrMsg = 'Scrubber does not exist!'
|
ErrMsg = 'Scrubber does not exist!'
|
||||||
HTTP_Services('SetResponseStatus', 500, ErrMsg)
|
HTTP_Services('SetResponseStatus', 500, ErrMsg)
|
||||||
LogData = ''
|
LogData = ''
|
||||||
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
LogData<1> = OConv(Datetime(), 'DT2/^H')
|
||||||
LogData<2> = ScrubberID
|
LogData<2> = ScrubberID
|
||||||
LogData<3> = 'Error'
|
LogData<3> = 'Error'
|
||||||
LogData<4> = ErrMsg
|
LogData<4> = ErrMsg
|
||||||
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
|
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
|
||||||
end
|
end
|
||||||
end api
|
end api
|
||||||
|
|
||||||
|
|
||||||
|
@ -830,8 +830,3 @@ end service
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -110,10 +110,10 @@ end service
|
|||||||
|
|
||||||
|
|
||||||
Service GetTools(ToolClass)
|
Service GetTools(ToolClass)
|
||||||
|
|
||||||
Query = 'SELECT TOOL '
|
Query = 'SELECT TOOL '
|
||||||
If ToolClass NE '' then
|
If ToolClass NE '' then
|
||||||
Query := 'WITH CLASS EQ ':ToolClass:' '
|
Query := 'WITH CLASS EQ ': Quote(ToolClass)
|
||||||
end
|
end
|
||||||
Query := 'BY CLASS BY TOOL_ID'
|
Query := 'BY CLASS BY TOOL_ID'
|
||||||
Set_Status(0)
|
Set_Status(0)
|
||||||
@ -238,6 +238,33 @@ Service ChangeToolMode(ToolID, NewMode, NewReason, CurrUser, ForceModeChange)
|
|||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
|
Service GetNumPoints(ToolClass, ToolPattern)
|
||||||
|
|
||||||
|
ErrorMsg = ''
|
||||||
|
NumPoints = ''
|
||||||
|
If ( (ToolClass NE '') and (ToolPattern NE '') ) then
|
||||||
|
If RowExists('TOOL_CLASS', ToolClass) then
|
||||||
|
ToolPatterns = Xlate('TOOL_CLASS', ToolClass, 'PATTERN', 'X')
|
||||||
|
Locate ToolPattern in ToolPatterns using @VM setting PatternPos then
|
||||||
|
NumPoints = Xlate('TOOL_CLASS', ToolClass, 'PATTERN_SIZE', 'X')<0, PatternPos>
|
||||||
|
end else
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. ToolPattern "':ToolPattern:'" not found in TOOL_CLASS "':ToolClass:'".'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. ToolClass "':ToolClass:'" does not exist.'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMsg = 'Error in ':Service:' service. Null ToolClass or ToolPattern passed into service.'
|
||||||
|
end
|
||||||
|
|
||||||
|
If ErrorMsg EQ '' then
|
||||||
|
Response = NumPoints
|
||||||
|
end else
|
||||||
|
Error_Services('Add', ErrorMsg)
|
||||||
|
end
|
||||||
|
|
||||||
|
end service
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Internal GoSubs
|
// Internal GoSubs
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -329,3 +356,4 @@ return
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -307,3 +307,72 @@ API wafercounter.completewafercount.POST
|
|||||||
HTTP_Services('SetResponseStatus', ResponseCode, ErrorMessage)
|
HTTP_Services('SetResponseStatus', ResponseCode, ErrorMessage)
|
||||||
|
|
||||||
end api
|
end api
|
||||||
|
|
||||||
|
|
||||||
|
API wafercounter.ID.HEAD
|
||||||
|
API wafercounter.ID.GET
|
||||||
|
|
||||||
|
ErrorMessage = ''
|
||||||
|
ResponseCode = ''
|
||||||
|
WaferCounterId = EndPointSegment
|
||||||
|
CassId = ''
|
||||||
|
Body = ''
|
||||||
|
OIWizardID = ''
|
||||||
|
UserId = ''
|
||||||
|
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)
|
||||||
|
CassBarcodeData = ''
|
||||||
|
UserId = Xlate('OI_WIZARD', OIWizardID, OI_WIZARD.EMPLOYEE_ID$, 'X')
|
||||||
|
StatusCode = ''
|
||||||
|
Body = HTTP_Services('GetHTTPPostString', True$)
|
||||||
|
DecodedJSON = HTTP_Services('DecodePercentString', Body)
|
||||||
|
|
||||||
|
//Log Entry into API -
|
||||||
|
LogData = ''
|
||||||
|
LogData<1> = LoggingDTM
|
||||||
|
LogData<2> = UserId
|
||||||
|
LogData<3> = OIWizardId
|
||||||
|
LogData<4> = 'Getting Wafer counter record. Record Id: ' : WaferCounterId
|
||||||
|
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
|
||||||
|
|
||||||
|
If WaferCounterId NE '' then
|
||||||
|
WaferCounterJson = Wafer_Counter_Services('ConvertWaferCounterRecToJson', WaferCounterId)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
HTTP_Services('SetResponseBody', WaferCounterJson)
|
||||||
|
ResponseCode = 200
|
||||||
|
end else
|
||||||
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
|
ResponseCode = 500
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Null wafer counter passed to endpoint.'
|
||||||
|
end
|
||||||
|
|
||||||
|
If ErrorMessage EQ '' then
|
||||||
|
//Log Success
|
||||||
|
LogData = ''
|
||||||
|
LogData<1> = LoggingDTM
|
||||||
|
LogData<2> = UserId
|
||||||
|
LogData<3> = OIWizardId
|
||||||
|
LogData<4> = 'Wafer Counter record successfully returned. Wafer Counter Id: ' : WaferCounterId
|
||||||
|
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
|
||||||
|
end else
|
||||||
|
//Log Failure
|
||||||
|
LogData = ''
|
||||||
|
LogData<1> = LoggingDTM
|
||||||
|
LogData<2> = UserId
|
||||||
|
LogData<3> = OIWizardId
|
||||||
|
LogData<4> = 'Error returning wafer counter record. Wafer Counter Id: ' : WaferCounterId : ' . Error Message: ' : ErrorMessage
|
||||||
|
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
|
||||||
|
end
|
||||||
|
|
||||||
|
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||||
|
HTTP_Services('SetResponseStatus', ResponseCode, ErrorMessage)
|
||||||
|
|
||||||
|
end api
|
||||||
|
@ -34,6 +34,8 @@ $Insert RLIST_EQUATES
|
|||||||
$Insert WAFER_COUNTER_EQUATES
|
$Insert WAFER_COUNTER_EQUATES
|
||||||
$Insert TOOL_EQUATES
|
$Insert TOOL_EQUATES
|
||||||
$Insert TOOL_LOG_EQUATES
|
$Insert TOOL_LOG_EQUATES
|
||||||
|
$Insert LOT_OPERATION_EQUATES
|
||||||
|
$Insert LOT_EQUATES
|
||||||
|
|
||||||
Equ Tab$ to \09\
|
Equ Tab$ to \09\
|
||||||
Equ CRLF$ to \0D0A\
|
Equ CRLF$ to \0D0A\
|
||||||
@ -213,7 +215,7 @@ end service
|
|||||||
|
|
||||||
|
|
||||||
Service GetWaferCounterJSON(WaferSize, ToolLocation, CassID)
|
Service GetWaferCounterJSON(WaferSize, ToolLocation, CassID)
|
||||||
|
|
||||||
If ( (WaferSize NE '') and (ToolLocation NE '') and (CassID NE '') ) then
|
If ( (WaferSize NE '') and (ToolLocation NE '') and (CassID NE '') ) then
|
||||||
URL = 'https://oi-metrology-viewer-prod.mes.infineon.com:4438/api/v1/WaferCounter/{waferSize}/last-quantity-and-slot-map/?area={area}&text={cassID}'
|
URL = 'https://oi-metrology-viewer-prod.mes.infineon.com:4438/api/v1/WaferCounter/{waferSize}/last-quantity-and-slot-map/?area={area}&text={cassID}'
|
||||||
Swap '{waferSize}' with WaferSize in URL
|
Swap '{waferSize}' with WaferSize in URL
|
||||||
@ -226,15 +228,15 @@ Service GetWaferCounterJSON(WaferSize, ToolLocation, CassID)
|
|||||||
If Error_Services('NoError') then
|
If Error_Services('NoError') then
|
||||||
StatusCode = Httpclient_Services('GetResponseStatusCode')
|
StatusCode = Httpclient_Services('GetResponseStatusCode')
|
||||||
If StatusCode NE 200 then
|
If StatusCode NE 200 then
|
||||||
Begin Case
|
Begin Case
|
||||||
Case Response EQ ''
|
Case Response EQ ''
|
||||||
ErrorMsg = 'Unexpected server error.'
|
ErrorMsg = 'Unexpected server error.'
|
||||||
Case Response EQ 'No files!'
|
Case Response EQ 'No files!'
|
||||||
ErrorMsg = 'No data. Please re-seat cassette and try again.'
|
ErrorMsg = 'No data. Please re-seat cassette and try again.'
|
||||||
Case Otherwise$
|
Case Otherwise$
|
||||||
// Use message in response body to populate error services
|
// Use message in response body to populate error services
|
||||||
ErrorMsg = Response
|
ErrorMsg = Response
|
||||||
End Case
|
End Case
|
||||||
Error_Services('Add', ErrorMsg)
|
Error_Services('Add', ErrorMsg)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -244,7 +246,7 @@ end service
|
|||||||
|
|
||||||
|
|
||||||
Service AddScan(LotID, ScanQty, ScanDtm, ScanTool, ScanUser, ScanLocation, WaferMap)
|
Service AddScan(LotID, ScanQty, ScanDtm, ScanTool, ScanUser, ScanLocation, WaferMap)
|
||||||
|
|
||||||
KeyID = RTI_CreateGuid()
|
KeyID = RTI_CreateGuid()
|
||||||
Record = ''
|
Record = ''
|
||||||
Record<WAFER_COUNTER.LOT_ID$> = LotID
|
Record<WAFER_COUNTER.LOT_ID$> = LotID
|
||||||
@ -448,9 +450,9 @@ Service ProcessCass2DBarcode(BarcodeText)
|
|||||||
end
|
end
|
||||||
|
|
||||||
If ErrorMessage EQ '' then
|
If ErrorMessage EQ '' then
|
||||||
Response = CassId : @VM: ExpectedQty : @VM : CassType
|
Response = CassId : @VM: ExpectedQty : @VM : CassType
|
||||||
end else
|
end else
|
||||||
Error_Services('Add', ErrorMessage)
|
Error_Services('Add', ErrorMessage)
|
||||||
end
|
end
|
||||||
|
|
||||||
end service
|
end service
|
||||||
@ -464,16 +466,16 @@ end service
|
|||||||
Service ProcessTool2DBarcode(BarcodeText, CassId, CassType, UserId)
|
Service ProcessTool2DBarcode(BarcodeText, CassId, CassType, UserId)
|
||||||
|
|
||||||
ErrorMessage = ''
|
ErrorMessage = ''
|
||||||
|
|
||||||
If BarcodeText NE '' then
|
If BarcodeText NE '' then
|
||||||
DelimCnt = DCount(BarcodeText, '|')
|
DelimCnt = DCount(BarcodeText, '|')
|
||||||
If DelimCnt EQ 2 then
|
If DelimCnt EQ 2 then
|
||||||
WaferSize = Field(BarcodeText, '|', 1)
|
WaferSize = Field(BarcodeText, '|', 1)
|
||||||
Area = Field(BarcodeText, '|', 2)
|
Area = Field(BarcodeText, '|', 2)
|
||||||
If Environment_Services('IsProd') then
|
If Environment_Services('IsProd') then
|
||||||
WcJson = Wafer_Counter_Services('GetWaferCounterJSON', WaferSize, Area, CassID)
|
WcJson = Wafer_Counter_Services('GetWaferCounterJSON', WaferSize, Area, CassID)
|
||||||
end else
|
end else
|
||||||
WcJson = Wafer_Counter_Services('GetWaferCounterJSONTestData', WaferSize, Area, CassID)
|
WcJson = Wafer_Counter_Services('GetWaferCounterJSONTestData', WaferSize, Area, CassID)
|
||||||
end
|
end
|
||||||
|
|
||||||
If Error_Services('NoError') then
|
If Error_Services('NoError') then
|
||||||
@ -504,13 +506,13 @@ Service ProcessTool2DBarcode(BarcodeText, CassId, CassType, UserId)
|
|||||||
ErrorMessage = 'Invalid tool scan.'
|
ErrorMessage = 'Invalid tool scan.'
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Scan data was null.'
|
ErrorMessage = 'Scan data was null.'
|
||||||
end
|
end
|
||||||
|
|
||||||
If ErrorMessage EQ '' then
|
If ErrorMessage EQ '' then
|
||||||
Response = WaferCounterId
|
Response = WaferCounterId
|
||||||
end else
|
end else
|
||||||
Error_Services('Add', ErrorMessage)
|
Error_Services('Add', ErrorMessage)
|
||||||
end
|
end
|
||||||
|
|
||||||
end service
|
end service
|
||||||
@ -521,15 +523,15 @@ end service
|
|||||||
// Emulates GetWaferCounterJson service.
|
// Emulates GetWaferCounterJson service.
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
Service GetWaferCounterJSONTestData(WaferSize, ToolLocation, CassID)
|
Service GetWaferCounterJSONTestData(WaferSize, ToolLocation, CassID)
|
||||||
|
|
||||||
If ( (WaferSize NE '') and (ToolLocation NE '') and (CassID NE '') ) then
|
If ( (WaferSize NE '') and (ToolLocation NE '') and (CassID NE '') ) then
|
||||||
Response = ''
|
Response = ''
|
||||||
objJson = ''
|
objJson = ''
|
||||||
If SRP_JSON(objJson, 'New', 'Object') then
|
If SRP_JSON(objJson, 'New', 'Object') then
|
||||||
SRP_JSON(objJson, 'SetValue', 'dateTimeFormatted', Datetime(), 'String')
|
SRP_JSON(objJson, 'SetValue', 'dateTimeFormatted', Datetime(), 'String')
|
||||||
SRP_JSON(objJson, 'SetValue', 'equipmentId', 'WC8INCH1', 'String')
|
SRP_JSON(objJson, 'SetValue', 'equipmentId', 'WC8INCH1', 'String')
|
||||||
SRP_JSON(objJson, 'SetValue', 'total', 24, 'Number')
|
SRP_JSON(objJson, 'SetValue', 'total', 25, 'Number')
|
||||||
SRP_JSON(objJson, 'SetValue', 'slotMap', '1111111110111111111111111', 'String')
|
SRP_JSON(objJson, 'SetValue', 'slotMap', '1111111111111111111111111', 'String')
|
||||||
Response = SRP_Json(objJson, 'Stringify', 'Styled')
|
Response = SRP_Json(objJson, 'Stringify', 'Styled')
|
||||||
SRP_JSON(objJSON, 'Release')
|
SRP_JSON(objJSON, 'Release')
|
||||||
end
|
end
|
||||||
@ -537,15 +539,15 @@ Service GetWaferCounterJSONTestData(WaferSize, ToolLocation, CassID)
|
|||||||
If Error_Services('NoError') then
|
If Error_Services('NoError') then
|
||||||
StatusCode = 200
|
StatusCode = 200
|
||||||
If StatusCode NE 200 then
|
If StatusCode NE 200 then
|
||||||
Begin Case
|
Begin Case
|
||||||
Case Response EQ ''
|
Case Response EQ ''
|
||||||
ErrorMsg = 'Unexpected server error.'
|
ErrorMsg = 'Unexpected server error.'
|
||||||
Case Response EQ 'No files!'
|
Case Response EQ 'No files!'
|
||||||
ErrorMsg = 'No data. Please re-seat cassette and try again.'
|
ErrorMsg = 'No data. Please re-seat cassette and try again.'
|
||||||
Case Otherwise$
|
Case Otherwise$
|
||||||
// Use message in response body to populate error services
|
// Use message in response body to populate error services
|
||||||
ErrorMsg = Response
|
ErrorMsg = Response
|
||||||
End Case
|
End Case
|
||||||
Error_Services('Add', ErrorMsg)
|
Error_Services('Add', ErrorMsg)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -553,6 +555,181 @@ Service GetWaferCounterJSONTestData(WaferSize, ToolLocation, CassID)
|
|||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
Service ConvertWaferCounterRecToJson(WaferCounterId)
|
||||||
|
|
||||||
|
ErrorMessage = ''
|
||||||
|
If WaferCounterId NE '' then
|
||||||
|
WaferCounterRec = Database_Services('ReadDataRow', 'WAFER_COUNTER', WaferCounterId, True$, 0, False$)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
//Fields within wafer counter rec
|
||||||
|
CassId = WaferCounterRec<WAFER_COUNTER.LOT_ID$>
|
||||||
|
swap '.' with '*' in CassId
|
||||||
|
WaferCount = WaferCounterRec<WAFER_COUNTER.SCAN_QTY$>
|
||||||
|
ScanDtm = WaferCounterRec<WAFER_COUNTER.SCAN_DTM$>
|
||||||
|
ToolID = WaferCounterRec<WAFER_COUNTER.SCAN_TOOL$>
|
||||||
|
WaferMapData = WaferCounterRec<WAFER_COUNTER.SCAN_WAFER_MAP$>
|
||||||
|
swap 1 with 1:@FM in WaferMapData
|
||||||
|
swap 0 with 0:@FM in WaferMapData
|
||||||
|
|
||||||
|
ActualWaferArray = ''
|
||||||
|
for i = 25 to 1 step -1
|
||||||
|
Slot = i
|
||||||
|
WaferPresent = WaferMapData<i>
|
||||||
|
ActualWaferArray<-1, 1> = Slot : @VM : WaferPresent
|
||||||
|
Next i
|
||||||
|
//Fields calculated at runtime.
|
||||||
|
CassType = ''
|
||||||
|
WONo = ''
|
||||||
|
CassNo = ''
|
||||||
|
ExpectedQty = ''
|
||||||
|
Begin Case
|
||||||
|
Case RowExists('RDS', CassId)
|
||||||
|
CassType = 'RDS'
|
||||||
|
WONo = XLATE('RDS', CassId, 'WO', 'X')
|
||||||
|
CassNo = XLATE('RDS', CassId, 'CASS_NO', 'X')
|
||||||
|
ExpectedQty = Xlate('RDS', CassId, 'WFRS_OUT', 'X')
|
||||||
|
Case RowExists('WM_OUT', CassId) OR RowExists('WM_IN', CassId)
|
||||||
|
CassType = 'WM_OUT'
|
||||||
|
WONo = Field(CassId, '*', 1)
|
||||||
|
CassNo = Field(CassId, '*', 3)
|
||||||
|
ExpectedQty = Xlate('WM_OUT', CassId, 'WAFER_CNT', 'X')
|
||||||
|
End Case
|
||||||
|
WoMatKey = WONo : '*' : CassNo
|
||||||
|
|
||||||
|
ExpectedWaferData = Wo_Mat_Services('GetWaferMap', WoMatKey)
|
||||||
|
ExpectedWaferArray = ''
|
||||||
|
for i = 25 to 1 step -1
|
||||||
|
Slot = i
|
||||||
|
WaferPresent = ExpectedWaferData<1, i>
|
||||||
|
ExpectedWaferArray<-1, 1> = Slot : @VM : WaferPresent
|
||||||
|
Next i
|
||||||
|
|
||||||
|
//Constructing the JSON Object
|
||||||
|
objJson = ''
|
||||||
|
If SRP_Json(objJson, 'New', 'Object') then
|
||||||
|
SRP_Json(objJson, 'SetValue', 'WaferCounterId', WaferCounterId, 'String')
|
||||||
|
SRP_Json(objJson, 'SetValue', 'CassId', CassId, 'String')
|
||||||
|
SRP_Json(objJson, 'SetValue', 'CassType', CassType, 'String')
|
||||||
|
SRP_Json(objJson, 'SetValue', 'ExpectedQty', ExpectedQty, 'Number')
|
||||||
|
SRP_Json(objJson, 'SetValue', 'ScanDtm', OConv(ScanDtm, 'DT4/'), 'String')
|
||||||
|
SRP_Json(objJson, 'SetValue', 'ToolId', ToolId, 'String')
|
||||||
|
SRP_Json(objJson, 'SetValue', 'WaferCount', WaferCount, 'Number')
|
||||||
|
|
||||||
|
//Wafer Counter Slot Array
|
||||||
|
objWaferCounterSlotArray = ''
|
||||||
|
IF SRP_Json(objWaferCounterSlotArray, 'New', 'Array') then
|
||||||
|
For each Slot in ActualWaferArray using @FM
|
||||||
|
SlotNo = Slot<1, 1>
|
||||||
|
WaferPresent = Slot<1, 2>
|
||||||
|
//Create the individiual slot object
|
||||||
|
objSlot = ''
|
||||||
|
If SRP_Json(objSlot, 'New', 'Object') then
|
||||||
|
SRP_Json(objSlot, 'SetValue', 'SlotNo', SlotNo, 'Number')
|
||||||
|
SRP_Json(objSlot, 'SetValue', 'WaferPresent', WaferPresent, 'Boolean')
|
||||||
|
SRP_Json(objWaferCounterSlotArray, 'Add', objSlot)
|
||||||
|
SRP_Json(objSlot, 'Release')
|
||||||
|
end
|
||||||
|
Next Slot
|
||||||
|
SRP_Json(objJson, 'Set', 'WaferArray', objWaferCounterSlotArray)
|
||||||
|
SRP_Json(objWaferCounterSlotArray, 'Release')
|
||||||
|
end
|
||||||
|
|
||||||
|
//OpenInsight Expected Slot Array
|
||||||
|
objOISlotArray = ''
|
||||||
|
IF SRP_Json(objOISlotArray, 'New', 'Array') then
|
||||||
|
For each Slot in ExpectedWaferArray using @FM
|
||||||
|
SlotNo = Slot<1, 1>
|
||||||
|
WaferPresent = Slot<1, 2>
|
||||||
|
//Create the individiual slot object
|
||||||
|
objSlot = ''
|
||||||
|
If SRP_Json(objSlot, 'New', 'Object') then
|
||||||
|
SRP_Json(objSlot, 'SetValue', 'SlotNo', SlotNo, 'Number')
|
||||||
|
SRP_Json(objSlot, 'SetValue', 'WaferPresent', WaferPresent, 'Boolean')
|
||||||
|
SRP_Json(objOISlotArray, 'Add', objSlot)
|
||||||
|
SRP_Json(objSlot, 'Release')
|
||||||
|
end
|
||||||
|
Next slot
|
||||||
|
SRP_Json(objJson, 'Set', 'ExpectedWaferArray', objOISlotArray)
|
||||||
|
SRP_Json(objWaferCounterSlotArray, 'Release')
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
Response = SRP_Json(objJson, 'Stringify', 'Styled')
|
||||||
|
SRP_Json(objJson, 'Release')
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Error initializing JSON object'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Error reading wafer counter record. ' : Error_Services('GetMessage')
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Wafer counter id was null.'
|
||||||
|
end
|
||||||
|
|
||||||
|
If ErrorMessage NE '' then
|
||||||
|
Error_Services('Add', ErrorMessage)
|
||||||
|
end
|
||||||
|
|
||||||
|
end service
|
||||||
|
|
||||||
|
Service AssociateWaferCounter(LotOperationId, WaferCounterId, UserId)
|
||||||
|
|
||||||
|
ErrorMessage = ''
|
||||||
|
|
||||||
|
If RowExists('LSL_USERS', UserId) then
|
||||||
|
If RowExists('LOT_OPERATION', LotOperationId) then
|
||||||
|
If RowExists('WAFER_COUNTER', WaferCounterId) then
|
||||||
|
WaferCounterRec = Database_Services('ReadDataRow', 'WAFER_COUNTER', WaferCounterId, True$, 0, False$)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
WaferCounterToolId = WaferCounterRec<WAFER_COUNTER.SCAN_TOOL$>
|
||||||
|
ThisLotOpRec = Database_Services('ReadDataRow', 'LOT_OPERATION', LotOperationId, True$, 0, False$)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
LotId = ThisLotOpRec<LOT_OPERATION_LOT_ID$>
|
||||||
|
If RowExists('LOT', LotId) then
|
||||||
|
ThisWaferCountCassId = WaferCounterRec<WAFER_COUNTER.LOT_ID$>
|
||||||
|
ThisLotId = ThisLotOpRec<LOT_OPERATION_LOT_ID$>
|
||||||
|
LegacyLotType = Xlate('LOT', ThisLotId, LOT_LEGACY_LOT_TYPE$, 'X')
|
||||||
|
LotIdToCompare = ''
|
||||||
|
If LegacyLotType NE '' then
|
||||||
|
LotIdToCompare = Xlate('LOT', ThisLotId, LOT_LEGACY_LOT_ID$, 'X')
|
||||||
|
end else
|
||||||
|
LotIdToCompare = ThisLotId
|
||||||
|
end
|
||||||
|
|
||||||
|
If ThisWaferCountCassId EQ LotIdToCompare then
|
||||||
|
ThisLotOpRec<LOT_OPERATION_WAFER_COUNTER_ID$> = WaferCounterId
|
||||||
|
Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationId, ThisLotOpRec)
|
||||||
|
If Error_Services('NoError') then
|
||||||
|
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'LOG_WAFER_COUNT', 'Wafer Count logged.', WaferCounterToolId, UserId)
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Lot IDs do not match!'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Lot not found.'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = Error_Services('GetMessage')
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Wafer counter record not found.'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'Lot Operation record not found.'
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
ErrorMessage = 'User ID not found.'
|
||||||
|
end
|
||||||
|
|
||||||
|
If ErrorMessage NE '' then
|
||||||
|
Error_Services('Add', ErrorMessage)
|
||||||
|
end
|
||||||
|
|
||||||
|
end service
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Internal GoSubs
|
// Internal GoSubs
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -566,3 +743,5 @@ ClearCursors:
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -149,4 +149,3 @@ CreateHALItem:
|
|||||||
HTTP_Services('SetResponseStatus', 500, 'Error in the ' : CurrentAPI : ' API. Message: ': Message)
|
HTTP_Services('SetResponseStatus', 500, 'Error in the ' : CurrentAPI : ' API. Message: ': Message)
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -120,4 +120,3 @@ CreateHalItem:
|
|||||||
LogData<5> = ResponseMessage
|
LogData<5> = ResponseMessage
|
||||||
Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM)
|
Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
20
LSL2/STPROCINS/CLEAN_EQUATES.txt
Normal file
20
LSL2/STPROCINS/CLEAN_EQUATES.txt
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
compile insert CLEAN_EQUATES
|
||||||
|
/*----------------------------------------
|
||||||
|
Author : Table Create Insert Routine
|
||||||
|
Written : 17/06/2025
|
||||||
|
Description : Insert for Table CLEAN
|
||||||
|
----------------------------------------*/
|
||||||
|
#ifndef __CLEAN_EQUATES__
|
||||||
|
#define __CLEAN_EQUATES__
|
||||||
|
|
||||||
|
equ CLEAN_LOT_ID$ to 1
|
||||||
|
equ CLEAN_TOOL$ to 2
|
||||||
|
equ CLEAN_RECIPE$ to 3
|
||||||
|
equ CLEAN_COMPLETE_DTM$ to 4
|
||||||
|
equ CLEAN_LOT_OPERATION_ID$ to 5
|
||||||
|
equ CLEAN_CLEAN_START_DTM$ to 6
|
||||||
|
equ CLEAN_CLEAN_START_USER_ID$ to 7
|
||||||
|
equ CLEAN_CLEAN_STOP_DTM$ to 8
|
||||||
|
equ CLEAN_CLEAN_STOP_USER_ID$ to 9
|
||||||
|
|
||||||
|
#endif
|
@ -28,6 +28,6 @@ compile insert LOT_EQUATES
|
|||||||
equ LOT_PROD_SPEC_ID$ to 19
|
equ LOT_PROD_SPEC_ID$ to 19
|
||||||
equ LOT_EPI_PART_NO$ to 20
|
equ LOT_EPI_PART_NO$ to 20
|
||||||
equ LOT_PROD_VER_NO$ to 21
|
equ LOT_PROD_VER_NO$ to 21
|
||||||
equ LOT_MET_TEST_IDS$ to 22
|
equ LOT_MET_TEST_IDS$ to 22
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -23,13 +23,13 @@ compile insert LOT_OPERATION_EQUATES
|
|||||||
equ LOT_OPERATION_MET_TEST_ID$ to 14
|
equ LOT_OPERATION_MET_TEST_ID$ to 14
|
||||||
equ LOT_OPERATION_CLEAN_ID$ to 15
|
equ LOT_OPERATION_CLEAN_ID$ to 15
|
||||||
equ LOT_OPERATION_PACKAGING_ID$ to 16
|
equ LOT_OPERATION_PACKAGING_ID$ to 16
|
||||||
equ LOT_OPERATION_WAFER_COUNTER_ID$ to 17
|
equ LOT_OPERATION_WAFER_COUNTER_ID$ to 18
|
||||||
equ LOT_OPERATION_OPERATION_TYPE$ to 18
|
equ LOT_OPERATION_OPERATION_TYPE$ to 19
|
||||||
equ LOT_OPERATION_OPERATION_CLASS$ to 19
|
equ LOT_OPERATION_OPERATION_CLASS$ to 20
|
||||||
equ LOT_OPERATION_MET_TEST_TYPE_REQUIRED$ to 20
|
equ LOT_OPERATION_MET_TEST_TYPE_REQUIRED$ to 21
|
||||||
equ LOT_OPERATION_MET_TEST_REQUIRED$ to 21
|
equ LOT_OPERATION_MET_TEST_REQUIRED$ to 22
|
||||||
equ LOT_OPERATION_PACKAGING_REQUIRED$ to 22
|
equ LOT_OPERATION_PACKAGING_REQUIRED$ to 23
|
||||||
equ LOT_OPERATION_CLEAN_REQUIRED$ to 23
|
equ LOT_OPERATION_CLEAN_REQUIRED$ to 24
|
||||||
equ LOT_OPERATION_WAFER_COUNTER_REQUIRED$ to 24
|
equ LOT_OPERATION_WAFER_COUNTER_REQUIRED$ to 25
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
compile insert METROLOGY_DATA_EXAMPLE_EQUATES
|
|
||||||
/*----------------------------------------
|
|
||||||
Author : Table Create Insert Routine
|
|
||||||
Written : 07/04/2025
|
|
||||||
Description : Insert for Table METROLOGY_DATA_EXAMPLE
|
|
||||||
----------------------------------------*/
|
|
||||||
#ifndef __METROLOGY_DATA_EXAMPLE_EQUATES__
|
|
||||||
#define __METROLOGY_DATA_EXAMPLE_EQUATES__
|
|
||||||
|
|
||||||
equ METROLOGY_DATA_EXAMPLE_INSPECTION_TYPE$ to 1
|
|
||||||
equ METROLOGY_DATA_EXAMPLE_TOOL_ID$ to 2
|
|
||||||
equ METROLOGY_DATA_EXAMPLE_DATA_ENTRY_DTM$ to 3
|
|
||||||
equ METROLOGY_DATA_EXAMPLE_DATA_ENTRY_USER$ to 4
|
|
||||||
equ METROLOGY_DATA_EXAMPLE_RAW_DATA_POINTS$ to 5
|
|
||||||
equ METROLOGY_DATA_EXAMPLE_DATA_AVERAGE$ to 6
|
|
||||||
equ METROLOGY_DATA_EXAMPLE_SPEC_LIMIT_UPPER$ to 7
|
|
||||||
equ METROLOGY_DATA_EXAMPLE_IN_SPEC$ to 8
|
|
||||||
equ METROLOGY_DATA_EXAMPLE_SPEC_LIMIT_LOWER$ to 9
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
|||||||
compile insert MET_TEST_DATA_EQUATES
|
compile insert MET_TEST_DATA_EQUATES
|
||||||
/*----------------------------------------
|
/*----------------------------------------
|
||||||
Author : Table Create Insert Routine
|
Author : Table Create Insert Routine
|
||||||
Written : 16/06/2025
|
|
||||||
Description : Insert for Table MET_TEST_DATA
|
Description : Insert for Table MET_TEST_DATA
|
||||||
----------------------------------------*/
|
----------------------------------------*/
|
||||||
#ifndef __MET_TEST_DATA_EQUATES__
|
#ifndef __MET_TEST_DATA_EQUATES__
|
||||||
@ -41,3 +40,4 @@ compile insert MET_TEST_DATA_EQUATES
|
|||||||
equ MET_TEST_DATA.PROPERTY_15_OUT_OF_SPEC$ to 32
|
equ MET_TEST_DATA.PROPERTY_15_OUT_OF_SPEC$ to 32
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
16
LSL2/STPROCINS/MET_TEST_INSERTS.txt
Normal file
16
LSL2/STPROCINS/MET_TEST_INSERTS.txt
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
compile insert MET_TEST_INSERTS
|
||||||
|
/*----------------------------------------
|
||||||
|
Author : Daniel Stieber
|
||||||
|
Written : 20/05/2025
|
||||||
|
Description : Metadata Insert for
|
||||||
|
MET_TEST system.
|
||||||
|
----------------------------------------*/
|
||||||
|
#ifndef __MET_TEST_INSERTS__
|
||||||
|
#define __MET_TEST_INSERTS__
|
||||||
|
|
||||||
|
Declare subroutine Met_Test_Services
|
||||||
|
Declare function Met_Test_Services
|
||||||
|
|
||||||
|
Equ NUM_PROPERTIES$ to 15
|
||||||
|
|
||||||
|
#endif
|
14
LSL2/STPROCINS/PACKAGING_EQUATES.txt
Normal file
14
LSL2/STPROCINS/PACKAGING_EQUATES.txt
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
compile insert PACKAGING_EQUATES
|
||||||
|
/*----------------------------------------
|
||||||
|
Author : Table Create Insert Routine
|
||||||
|
Written : 16/05/2025
|
||||||
|
Description : Insert for Table PACKAGING
|
||||||
|
----------------------------------------*/
|
||||||
|
#ifndef __PACKAGING_EQUATES__
|
||||||
|
#define __PACKAGING_EQUATES__
|
||||||
|
|
||||||
|
equ PACKAGING_LOT_ID$ to 1
|
||||||
|
equ PACKAGING_COMPLETE$ to 2
|
||||||
|
equ PACKAGING_COMPLETE_DTM$ to 3
|
||||||
|
|
||||||
|
#endif
|
@ -1,7 +1,7 @@
|
|||||||
compile insert PRODUCT_OPERATION_EQUATES
|
compile insert PRODUCT_OPERATION_EQUATES
|
||||||
/*----------------------------------------
|
/*----------------------------------------
|
||||||
Author : Table Create Insert Routine
|
Author : Table Create Insert Routine
|
||||||
Written : 11/10/2024
|
Written : 13/05/2025
|
||||||
Description : Insert for Table PRODUCT_OPERATION
|
Description : Insert for Table PRODUCT_OPERATION
|
||||||
----------------------------------------*/
|
----------------------------------------*/
|
||||||
#ifndef __PRODUCT_OPERATION_EQUATES__
|
#ifndef __PRODUCT_OPERATION_EQUATES__
|
||||||
|
Reference in New Issue
Block a user