Xalgorithms / general-examples

A repository used for rule package examples. May eventually contain core rules.
Apache License 2.0
1 stars 2 forks source link

Where's the "a" in the .xalgo rule? #5

Closed jpotvin closed 4 years ago

jpotvin commented 6 years ago

In your updated .xalgo file for the a-plus-b example, where's the "a" that the invoice's "a" would map to? I had "WHEN item == 'a' ... such as: buyer buys item called "a" for $2.00.

karfai commented 6 years ago

"a" is @price.value on line 14. It's also "c".... We can put it somewhere else, if you like, but I think this is good enough.

jpotvin commented 6 years ago

Your current rule would run on EVERY invoice in the CA jurisdiction. I want it to run only when "a" is present. "a" is the name of the item, and its price is "2.00" "b" is the name of the flat fee, and its amount is "3.00"

(Sorry for giving this info bass-ackwards -- I'm actually 'discovering' how to think about this by working on it.)

jpotvin commented 6 years ago

RE: [my comment] "Your current rule would run on EVERY invoice in the CA jurisdiction. I want it to run only when "a" is present.

Is this because FIRST Interlibre checks for all rules in effect for the relevent jurisdictions, and only SECOND checks for applicability?

karfai commented 6 years ago

Yes. That's the search order for rules.