I can’t figure out why this comparison doesn’t work in constraint field.
This rule is called from Ticket Lister Widget (kitchen display), which opens settled ticket, update a ticket state and then close the ticket.
I want to add a new action to this rule which is restricted by this constraint, which this action will only get executed when this TICKET TAG:ORDER exists.
I’m using this expression in the action constraint
‘{TICKET TAG:ORDER}’ != ‘’
so a message is displayed when TICKET TAG:ORDER has a value.
For this particular ticket, the TICKET TAG:ORDER value is 47, which the expression above should test to TRUE and the action executed.
However in my case I think it test to FALSE, and strangely when I change the condition to ‘{TICKET TAG:ORDER}’ == ‘’ , the action gets executed.
I also tried this condition for the same ticket
‘{TICKET TAG:ORDER}’ == ‘47’
and again it tests to FALSE.
As a guess, in V5 - a Rule Actions Constraints are all read at once when the Rule Loads. Therefore the Value of {TICKET TAG:ORDER} is actually blank as “Load Ticket” Action has not fired.
If this is the Case you need to split this Rule into 2 Rules - Load/Open Ticket Rule , then a 2nd new Rule where you can then use that Constraint. I have been driven to near madness on this behavior once or twice
I supposed I didn’t understand you correctly @pauln I followed your suggestion and split the rule into 2
I am guessing when all rules with Automation Command Name matched will get executed in a sequential manner, which rules in higher order will get executed first…etc. Based on that theory I split one rule into rule A and B.
Rule A - Load the ticket then reopen the ticket
Rule B - Update ticket state, display message (with the constraint) then close ticket.
However when I tried invoke these two rules through Ticket Lister Widget, SambaPOS behaved weirdly (No message displayed) and eventually caused SambaPOS to crash.
Umm you used the same “Order Given PHONE” - try calling an Automation Command Executed Action with a 2nd name for Part B - maybe Samba just links them automatically and see them as 1 Rule.
I know we need to do this in V5 when using a “Prompt Question” - you definitely need to test the answer in another Rule else you get this type of behaviour.
EDIT: Is Ticket Tag result Numeric i.e. {TICKET TAG:ORDER} > 0 ?
Could you explain how you structured this? I don’t quite get it.
So the button in Ticket Lister Widget fires one Automation Command event, which the event get picked up by rule A, then rule A calls rule B??
I suppose {TICKET TAG:ORDER} is stored as a string. Having said that the value assigned to {TICKET TAG:ORDER} is a numeric value stored in Program Setting