Help needed with Order States to control Ticket State?

You could script this and use SQL to check states of orders in the ticket get a response from the SQL and execute appropriate actions based on that response. You wont be able to use constraints because it cant loop through orders like that.

Another approach is to simply make closing of ticket manual once all orders served.

Not something that Iā€™m capable then ā€¦ OK it was worth a try ā€¦ what I wanted to do sounded relatively simple ā€¦ but I was wrong ā€¦ it was more belt and braces to avoid mistakes ā€¦ not to worry and thanks for your time

Maybe. It might things simpler.

You can, but it is a bit tricky. Again, the HH/VIP Tutorial does this.

HINT: you need to update the State of the Orders (all of them), being deterministic about the State they should receive (i.e. Served, NotServed, NoChange, or whatever). This effectively cycles through all Orders on the Ticket. Even if the State has not changed, it still triggers an Update Event. Then you capture Order State Updated Event, and perform applicable Actions - those being to re-update the Ticket State based on the Order States.

If you look at HH/VIP, there is a ā€œspecialā€ Order State called ā€œHPā€, which means ā€œHappy Hour Pendingā€. I had to perform this ā€œintermediateā€ State change when adding or removing VIP Entities to the Ticket. The state then gets updated properly to HH, VIP, or ND (no discount). You might need to do something similar.

2 Likes

should the following work as per my original post on this thread

or does the syntax need to be different ?

TIA

Yes that should work.

EDIT: that will not work, because the Left-side Constraints do not exist for that Event. You will need to use equivalent {braces} syntax in your Constraints for the Entity.

cheers :slight_smile: must be something else making it not work - I get confused with what has to be in { } and what doesnā€™t ā€¦ so spend more time wondering if its the syntax ive got wrong or something else

Ok, so that depends on the Rule/Event.

Now that I look at it closer, it might not work. The only time you are allowed to use non-bracketed constraints is on the LEFT side, and they must be available in the chooser. If they are not available in the list on the left, then you need to use the equivalent bracketed syntax.

In this case, you need to remove the Constraint for Entity Type Name, and instead of using Entity Name in the other constraint, you will need to use {ENTITY NAME:Tables}

Brilliant - That works - almost there now with V5 - just got one more thing thatā€™s not working that was :slight_smile: then its time to take it live - thanks for all your help