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
| - toolingCompatibilityId | Integer | To change one; None adds one |
| - childToolingAssetId | Integer | The tool the rule is for, or |
| - childAssetTypeId | Integer | every tool of this tooling type |
| - parentAssetId | Integer | A machine the tool fits, or |
| - parentToolingAssetId | Integer | a tool whose pockets it fits, or |
| - parentAssetTypeId | Integer | an asset type it fits (machines or tools of that type) |
| - enabled | Boolean | Default True |
userId Integer: The user making the change
Returns
(toolingCompatibilityId, message): the rule's id and None, or None and why it was refused
Example
ruleInfo = {'childToolingAssetId': 1, 'parentAssetId': 2}
userId = 5
toolingCompatibilityId, message = system.kanoa.tooling.saveCompatibilityRule(ruleInfo, userId)