system.kanoa.operators.operatorLogout(sessionInfo, userId)
Logs an operator out of an asset by closing their open mes.operatorAssetSession row (the row where logoutTStamp IS NULL for this userId+assetId pair)
Parameters
sessionInfo Object:
- userId
Integer: the sec.user being logged out - assetId
Integer - tStamp
String
userId Integer: the actor performing this action (used for changedBy audit) - can differ from sessionInfo['userId']
Returns
rowsAffected Integer: records modified - 0 if the user had no open session on this asset, or on failure
message String: None on success, an error message on failure
Example
sessionInfo = {
'userId': 5,
'assetId': 4,
'tStamp': system.date.now()
}
userId = 12
rowsAffected, message = system.kanoa.operators.operatorLogout(sessionInfo, userId)