Not working in V5 - Occupied Entity

Yes, I know, I did not want to revert it to the “broken” version of Automation, sorry.

Yes, that was part of the issue, so I decided to store it in a Program Setting. At first I was using Local Variables, but could not get it working, so I went to DB settings because it is easy to see the values in the settings. It wasn’t until I found out that the nested settings were not working in the constraints, which was revealed by the Show Message Action. It still has me very puzzled, because I am sure I have done similar nesting in the past.

I will put together steps (rules) to reproduce this.

BTW @emre, the Event for Entity Updated is the one that does not have access to the Entity Name.

It has access to Entity Type, but not the Entity Name itself. This is why I am storing the Table Name when the Entity is selected, or when the Ticket Entity is changed. That way I have access to the Table Name via a Program Setting.

I wanted to use this in the Constraint, but it has no value for some reason:

{SETTING:OStatus_{SETTING:OStatus_Table}}

To reproduce this problem, remove the 2nd Constraint from the following Rule:

These 2 Show Message Actions are in the SAME RULE, as shown above. They both attempt to display the nested Setting {SETTING:OStatus_{SETTING:OStatus_Table}}, but only the 2nd Message contains a value for this Setting…

1 Like

Thank you very much for the explanation. For next update I improved how it resolves nested tags…

1 Like

Hi @QMcKay,

I’m trying to follow your solution above without much luck. There appears to be references to automation commands and actions in your solution which aren’t described here… Is there any chance you can past them here, or do an export of your config ?

The ones i’m referring to specifically are :

Action “Store Occupied Data”
Automation Command “Occupied Status”

Thanks for your help and apologies for the newby question.

That ^ should be self-explanatory. Go to Manage > Automation > Automation Commands and create a button. Map it to whereever you want (ie. Ticket, Under Ticket, Ticket Row2…)

##Occupied Status [no Category] (Automation Command)##

Name: Occupied Status
Category:
Button Header: Switch to\rOccupied
Color:
Font Size: 26
Confirmation: None
Values (0): (none)
Navigation Settings
Symbol:
Image:
Auto Refresh: 0
Tile Cache: 0
Navigation Module:
Nav Module Parameter:
Template: ```

</details>


<details>
<summary><b><u>Mappings</u></b></summary><table><tr><td><b>Terminal</b> </td><td><b>User Role</b> </td><td><b>Department</b> </td><td><b>Ticket Type</b> </td><td><b>Enabled States</b> </td><td><b>Visible States</b> </td><td><b>Visibility</b> </td></tr><tr><td><code>*</code></td><td><code>*</code></td><td><code>*</code></td><td><code>*</code></td><td><code>*</code></td><td><code>*</code></td><td><code>Ticket</code></td></tr></table></details>


----------

[quote="damian, post:24, topic:9765"]
Action "Store Occupied Data"
[/quote]

You need to create this Action.  It is an **`Update Program Setting`** Action.

<img src="/uploads/default/original/3X/0/4/04c37657a52b67c53f25d2cab41544b63bfc047d.png" width="690" height="385">

>##Store Occupied Data `[Update Program Setting]` (Action)##
<table><tr><td><b>Action Name:</b> </td><td><code>Store Occupied Data</code></td></tr><tr><td><b>Action Type:</b> </td><td><code>Update Program Setting</code></td></tr></table>
###Parameters:###
<table><tr><td><b>Setting Name:</b> </td><td><code>[:name]</code></td></tr><tr><td><b>Setting Value:</b> </td><td><code>[:value]</code></td></tr><tr><td><b>Update Type:</b> </td><td><code>Update</code></td></tr><tr><td><b>Is Local:</b> </td><td><code>False</code></td></tr></table>


----------

thanks heaps for that. I’ll give it another try and see how I go.

@QMcKay thanks heaps for your help.

This works really well… One thing I noticed however, is that the configuration you have above does not change the colour of the table once a new order is placed - it remains on the occupied colour, instead of showing the “new order” colour.

So i removed the constraints you added to the “Update New Order Entity Color” rule and left the “State Equals Unpaid” constraint only.

This allows the color to transition from occupied, to new order to bill printed in a more natural fashion.

Thanks again for your help!

@QMcKay one last question for you mate.

I’ve enhanced what you have done here to add in a “reserved state” and created 3 buttons. 1. to set reserved, one to set occupied and one to set as available.

I want to only show these buttons based on the ostatus but the the “visible state” in the automation command doesn’t seem to response to ostatus. I set the ostatus to OStatus=Occupied for the “available” button …

Is there something i’m missing in setting the visibility correctly ?

Have you physically created the ostatus states in settings;states?

yes of course mate, and it all works perfectly, except for the visibility of the buttons.

Show screenshots of your button mappings

Buttons show up when mapping is like this:

However, they disappear when mapping is like this:

Remove the space after the comma:

Status=New,OStatus=Occupied

Still no good unfortunately.

any other ideas @QMcKay ?

Pretty sure it needs to be a ticket state for that to work not an Entity State.

so there is no way to hide these buttons ? It’s actually not really that big a deal, just looks better without the redundant buttons

@damian, if that is true (it makes sense), then you will need to set up an OStatus Ticket State and toggle it at the same time that you update the OStatus Entity State.

Thanks @QMcKay I’ll give that a try.

So i have a fresh install with a blank database been trying to get this to work but for the life of me i cannot. Not really understanding why because there are no other rules that should be affecting it. This seems to be a common problem tho from all the threads ive looked through. Could someone create a how to to explain and create a simple table occupied system. I plan to mainly use this for when a hostess seats a customer at a table before a order is taken. This is a pretty common flow for restaurants here in the US so would be nice to get this to work.