Hotel Rooms (Entity?)

You know you dont need to make automation command (buttons) to go with the execute automation command actions, the action is automatically simulating the button…

As Q said show your questions rule, you just showed the grid rule again…

This might be the problem …

1 Like

I left empty in my setup…

1 Like

That works too.

Empty in the case of this particular Action is the same as “NOT True”, which means False. :stuck_out_tongue_winking_eye:

But be aware, for other actions with True/False parameters are not necessarily like this. Some default to True when left blank.

2 Likes

I was merely pointing out that he had deviated from the screenshot I posted :wink:

1 Like

The True value was listed in the screengrab as I had been trying all combinations of True, False and Null. It just happened to be in that state when I grabbed the image. Any of the three selections makes no difference to the functionality.

This is a screengrab of the Debugger with the Background setting at False.All my Room Entities are currently not ‘Occupied’ therefore the Constraints in Grid Rule prevent the setting of Entity GridBookingNumber and EntityGridBookingBalance values and therefore Jumps straight to the Execute Automation Command Action to start the AskQuestions Rule.

At this point the EntityGridCommandStart AutomationCommand loops and calls itself again and asks again for confirmation. If I were to switch off Confirmation of the Automation Command it goes into an “infinite loop” and SambaPos crashes without any error message. The only way I can break the loop is by selecting No on the Confirmation question.

As mentioned earlier I do not feel the Ask Questions Rule is even being executed as this does not appear on the Debugger Screen.

If I amend the Booking Entity Grid properties to execute ‘RoomEntityGridAskQuestions’ the Ask Question Rule runs and looks OK (Except [:CommandValue] is obviously not set)

Here is the EntityGridAskQuestion Grabs. Note the Contraints are truncated by the ScreenGrab and I will cut and paste my settings below

Constraint 1
‘{REPORT ENTITY DETAIL:EC.Room Status:(EN=[:CommandValue])}’ != ‘Occupied’

Constraint 2
‘{REPORT ENTITY DETAIL:EC.Room Status:(EN=[:CommandValue])}’ == ‘Occupied’ && ‘{CALL:accountinfo.BalanceFromEntityGridBookingNumberSetting()}’ != ‘’ && ‘{CALL:accountinfo.BalanceFromEntityGridBookingNumberSetting()}’ != ‘0.00’

Constraint 3
‘{REPORT ENTITY DETAIL:EC.Room Status:(EN=[:CommandValue])}’ == ‘Occupied’ && (’{CALL:accountinfo.BalanceFromEntityGridBookingNumberSetting()}’ == ‘’ || ‘{CALL:accountinfo.BalanceFromEntityGridBookingNumberSetting()}’ == ‘0.00’)

The full constraints were copied from the detail provided directly by Joe so I am confident these are correct.

They were correct in my setup :wink: but obviously they are dependent on other user selected fields/options etc.

Regrdless either way it’s the looping that’s confusing m and command confirmation??? What do you mean by that? When you say that I get the thought your triggering it from an automation command button not entity grid…

No its just a selection in the Automation Command when it executes. Just a way of confirming to process the Automation Command. I am just using it as a break/process tracking.

OK, found the problem…
You set the [:] name in both the execute automation command action and ask question action to [:AutomationCommandName]…

[:AutomationCommandName] is not good as it is the tag for the command name in rules so although it was showing the custom field with header of AutomationCommandName it was ignoring the value because [:AutomationCommandName] meant the command name the action in the rule was fireing was the command name which triggered the rule, giving you the loop…

Does that make sense?

You need to edit the ask question and the execute anutmation command actions to say have spaces in the header [:] expressions.
This would mean removing and re-saving the the rules.
What would be better would be to create new ask question and execute command actions.
Add those to the rules the number of times needed.
Copy and paste the constrains and expressions then remove the current actions from those rules.

F Me did that take some tinkering to realize that was the issue… The way it still shows the enpty field in the rule but ignores the contents and just uses the rule [:] value… makes sence as to why it does it but dont think it should be allowed/doable.

@emre I think there needs to be some form of validation here so that something like if a generic action [:] expression is used the action instances in the rule screen does not show the usual blank field if it is a valid rule [:] expression…
Say it that way encase there is reason to want to set a rule [:] expression on action rather than in the rule, alternatively I guess valid [:] rule expressions would be disallowed from being used in action fields…
To simplifyso you dont need to read all that, this example results in a infinite loop as [:AutomationCommandName] in the ask question or execute automation command action still displays the open/empty field for the action in the rule but ignores the entered values and uses the [:AutomationCommandName] which for an automation command rule is the command that triggered the rule causing the loop.

1 Like

@JTRTech Thank you very much for testing it and letting me know that. If it is possible and won’t take more than 5 minutes can you please demonstrate that issue in default setup? If it will be hard to reproduce on default setup I’ll try to handle it from your description.

1 Like

Have messaged you with a backup replicating.

Default setup.
One button (Test Loop)
One new action (Ask Question)
Rule firing the question action on Test Loop button/command

Loops due to the [:AutomationCommandName] field on the action which shows the empty filed in the rule as described.

1 Like

Awesome! We’ll warn when an action parameter name matches to a rule constraint name.

2 Likes

Is that on saving the action or the rule?

Yes and blocking save ATM but I’ll change it to a warning that executes as soon as action is added.

Looks like upon saving the Rule. I think it would be better upon saving the Action @emre

1 Like

Would it not be better on the action saving?

lol we can’t determine that. The reason of that issue is action parameter name matches to a rule constraint (parameter) name. If that action used in a rule that does not have “Automation Command Name” parameter there will be no issue.

1 Like

Would it not be better to constrain against all the [:] rule tags as if using variable content you would typically do it in the rule not hard set in the action…

Well we’re reading rule parameter values first (for a reason I don’t remember now)… There might be tons of rules benefiting from that and changing it might break setups. I think giving a warning will be enough.

To be more clear I highlighted the issue. Spaces added to constraint name while preparing it for the screen but it is actually stored without spaces.

2 Likes

Might suggest that ‘Action Field Name’ might make more clear than parameter…

1 Like