jruizgit / rules

Durable Rules Engine
MIT License
1.14k stars 209 forks source link

Can someone please tell me how to handle null values in durable rules. #394

Open devjain47 opened 1 year ago

mathrep commented 1 month ago

In Python we got None and following worked. `from durable.lang import *

with ruleset('handle_nulls'):

@when_all(m.amount != None)
def check_amount(c):
    print(f"Processing amount: {c.m.amount}")

@when_all(m.amount == None)
def handle_null(c):
    print("Mmessage with None amount.")

post('handle_nulls', { 'amount': None }) post('handle_nulls', { 'amount': 100 })`