# 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`<br />
<table class='dictionaryKeyTable'>
	<tbody>
 	<tr><td> - conditionId</td><td>Integer</td><td></td></tr>	
 	<tr><td> - counterInfo</td><td>String</td><td></td></tr>	
 	<tr><td> - lastGeneratedDate</td><td>DateTime</td><td></td></tr>	
 	<tr><td> - lastGeneratedValue</td><td>count</td><td></td></tr>	
 	<tr><td> - workOrderConditionId</td><td>Integer</td><td>Id of the workOrder condition</td></tr>	
 	<tr><td> - workOrderId</td><td>Integer</td><td>Id of the workOrder</td></tr>	
	</tbody>
</table>

**userId** `Integer`:Id of the user executing the function<br />

---
### Returns
**workOrderConditionId** `Integer`<br />
**message** `String` None if success<br />

---
### Example
```python
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
```
