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
Hi Tom
I'm currently working on implementing simple rules engines and considering jexl as a DSL to adopt.
jexl
I found out that some implementations like this provides calling methods with namespace(class names)
So I tried some expressions like FooService.doSomething() or FooService#doSomething()on jexl but it fails.
FooService.doSomething()
FooService#doSomething()
here is the code I tried on runkit
const jexl = require("jexl") const input = { order: { total: 100000, }, coupon: { status: 'ACTIVE' }, } jexl.addFunction('OrderService.discountOrder', (order, rate) => order.total = order.total * (1.0 - rate)) const rules = [ `OrderService.discountOrder(order, 0.2)`, // mutate passed object ] const results = await Promise.all(rules.map(rule => jexl.eval(rule, input))) console.log(results) console.log(input.order)
I guess there're some reserved tokens like defined on grammar.js but is there any way to avoid these behavior or any suggestions to achieve my point?
grammar.js
Thanks.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi Tom
I'm currently working on implementing simple rules engines and considering
jexl
as a DSL to adopt.I found out that some implementations like this provides calling methods with namespace(class names)
So I tried some expressions like
FooService.doSomething()
orFooService#doSomething()
onjexl
but it fails.here is the code I tried on runkit
I guess there're some reserved tokens like defined on
grammar.js
but is there any way to avoid these behavior or any suggestions to achieve my point?Thanks.
The text was updated successfully, but these errors were encountered: