We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rules = [ # expiration_days < 5 AND current_inventory > 20 { "conditions": { "all": [ { "name": "expiration_days", "operator": "less_than", "value": 5, }, { "name": "current_inventory", "operator": "greater_than", "value": 20, }, ]}, "actions": [ { "name": "put_on_sale", "params": {"sale_percentage": 0.25}, }, ], }, # current_inventory < 5 OR (current_month = "December" AND current_inventory < 20) { "conditions": { "any": [ { "name": "current_inventory", "operator": "less_than", "value": 5, }, ]}, { "all": [ { "name": "current_month", "operator": "equal_to", "value": "December", }, { "name": "current_inventory", "operator": "less_than", "value": 20, } ]}, }, "actions": [ { "name": "order_more", "params":{"number_to_order": 40}, }, ], }]
some syntax alert in the second conditions part. Should the all part be put under the any?
conditions
all
any
The text was updated successfully, but these errors were encountered:
there are extra ',' in the json. try doing it. :P
Sorry, something went wrong.
How do we fix this? I'm not able to figure out nested conditions. @dcosson
@luofanghao try this rule definition and let me know if it works.
[ {"conditions": {"all": [ {"name": "expiration_days", "operator": "less_than", "value": 5 }, {"name": "current_inventory", "operator": "greater_than", "value": 20 } ]}, "actions": [ {"name": "put_on_sale", "params": {"sale_percentage": 0.25} } ] }, {"conditions": {"any": [ {"name": "current_inventory", "operator": "less_than", "value": 5 } ], "all": [ {"name": "current_month", "operator": "equal_to", "value": "December" }, {"name": "current_inventory", "operator": "less_than", "value": 20 } ]} }, {"actions": [ {"name": "order_more", "params": {"number_to_order": 40} } ] }]
No branches or pull requests
some syntax alert in the second
conditions
part. Should theall
part be put under theany
?The text was updated successfully, but these errors were encountered: