# system.kanoa.tooling.saveCompatibilityRule(ruleInfo, userId)

Adds a fit rule, or changes one (with toolingCompatibilityId). Give one child and one parent. A machine must use tooling, and be in the tool's site when the tool belongs to one; a parent tool must hold inserts. The same child and parent can't have two rules. Tools already mounted aren't checked again; the rule applies from the next mount.

---

### Parameters

**ruleInfo** `Dictionary`<br />
<table class='dictionaryKeyTable'>
 <tbody>
  <tr><td> - toolingCompatibilityId</td><td>Integer</td><td>To change one; None adds one</td></tr>
  <tr><td> - childToolingAssetId</td><td>Integer</td><td>The tool the rule is for, or</td></tr>
  <tr><td> - childAssetTypeId</td><td>Integer</td><td>every tool of this tooling type</td></tr>
  <tr><td> - parentAssetId</td><td>Integer</td><td>A machine the tool fits, or</td></tr>
  <tr><td> - parentToolingAssetId</td><td>Integer</td><td>a tool whose pockets it fits, or</td></tr>
  <tr><td> - parentAssetTypeId</td><td>Integer</td><td>an asset type it fits (machines or tools of that type)</td></tr>
  <tr><td> - enabled</td><td>Boolean</td><td>Default True</td></tr>
 </tbody>
</table>

**userId** `Integer`: The user making the change<br />

---

### Returns

**(toolingCompatibilityId, message)**: the rule's id and None, or None and why it was refused<br />

---

### Example

```python
ruleInfo = {'childToolingAssetId': 1, 'parentAssetId': 2}
userId = 5
toolingCompatibilityId, message = system.kanoa.tooling.saveCompatibilityRule(ruleInfo, userId)
```
