system.kanoa.cmms.setWorkOrderCondition(workOrderConditionInfo, userId)
Creates or updates a condition-based trigger for a work order, linking a monitored counter (e.g. a vibration or temperature tag) to a condition definition so that crossing the configured threshold will auto-generate the work order.
All keys in workOrderConditionInfo are required per the source documentation.
Parameters
workOrderConditionInfo Dictionary
| - conditionId | Integer | |
| - counterInfo | String | |
| - lastGeneratedDate | DateTime | |
| - lastGeneratedValue | count | |
| - workOrderConditionId | Integer | Id of the workOrder condition |
| - workOrderId | Integer | Id of the workOrder |
userId Integer:Id of the user executing the function
Returns
workOrderConditionId Integer
message String None if success
Example
workOrderConditionInfo = {
"workOrderConditionId": 0,
"workOrderId": 4521,
"conditionId": 12,
"counterInfo": "VibrationRMS_Pump14",
"lastGeneratedDate": None,
"lastGeneratedValue": 0
}
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
workOrderConditionId, message = system.kanoa.cmms.setWorkOrderCondition(workOrderConditionInfo, userId)
print workOrderConditionId, message