[New 4.1.42] Execute Automation Command Action

It is a little abstract feature but I’ll try to describe it as simple as I can. In some cases you’ll need to use Constraints setting to be able to decide which action to execute inside a rule. Today I’ve realized we already have this feature. Instead of executing action directly and dealing with Constraints we can execute an Automation Command and use rule constraints instead of action constraint. I still have to test it for few releases to ensure if it can replace action constraints however I wanted to open this topic to hear your possible ideas about that.

2 Likes

More features is always good. More than 1 way to accomplish similar tasks, in fewer steps, or with enhanced flexibility.

I always thought it may be useful to be able to select an Action for execution more than once within a Rule, using Actions constraints (which we already have); this could reduce the number of Rules required. As it stands now, we can only select an Action for execution in the same Rule once.

1 Like

you will not beleive me, but I CANNOT use constrains… I do not know how… maybe if i can read something I may have an idea!

THANKS and sorry,

G.

Seems like you didn’t discovered that gem yet :slight_smile:

While choosing actions (or anything on that chooser dialog) Display All Values command will copy selected items to left side to give you a chance to choose them again. Just hidden to keep novice users safe :slight_smile:

2 Likes

I dont think that is constrains… or I am wrong?

G.

Sorry @gerlandog I missed your question, that was a reply to @QMcKay.

For example your rule contains two actions and you want to execute action #1 if a condition is true or action #2 if it is false. I think I’ve only used it once on all tutorials I’ve posted here and I can’t even remember what was it :slight_smile: I mean not a widely used feature and if we can do same thing with that new action I’ll remove it.

1 Like

I had some situations in wich I think that knowing how to use a constrain would have helped me…
I tought constrains was something like a variable, but never could use them… did not know how… LOL

G.

@gerlandog, here is an example of using constraints on Actions within a Rule, taken from Gift Certificate Tutorial. The Rule is called GC Redeemed (used as Payment) - Update GC Data.

In particular, the last 2 actions in this rule GC Redeemed (used as Payment) - Update GC Data have a constraint to determine whether to refresh the payment screen or close the ticket… only one of the actions will execute because of the constraints on the 2 actions:

Action: Display Payment Screen
Constraint: [:RemainingAmount]>0

Action: Close Ticket
Constraint: [:RemainingAmount]<=0

Action constraints would be very helpful as the if…then…else condition give more flexibility. Can’t wait to see the tutorial. Let me know if now i can test the time range in the action constraint. :wink:

1 Like

Nice @emre… correct, I never discovered that.

I’m going to go through my Rules now, because I know I can reduce the number of Rules by being able to choose Actions more than once and use Action Constraints instead… or is there any reason you can think of not to do it this way?

Choosing same action multiple times might be confusing for new users but I can’t think a reason for you not to use that :slight_smile:

Same thing works everywhere. For example you can add same product to menu multiple times with different settings to create two tea buttons (Tea, Free Tea).

1 Like

Thanks!!!
My problem is exactly that one. LOL. I never knoq what ti put inside the brackets…

Maybe qe should preapare a list with common expressions.

Thanks

G

I don’t think Action constraints support if / else but they do support boolean operators like &&.

Plus, now knowing that I can choose the same action twice within a rule, and use different constraints, that suffices for an if /else scenario.

Let’s say you run a promo for a drink that normally sells for 30, but if they buy 3, we reduce price of the 3rd to 25, and if they buy 4 or more, we reduce price of the 4th (and 5th and 6th, etc) to 20. Using a single Price Change Action that we fire when Order Added event is captured, we could do this:

Action: Price Change
Constraint: {QUANTITY}>2 && {QUANTITY}<4
NewPrice: 25

Action: Price Change
Constraint: {QUANTITY}>=4
NewPrice: 20

NOTE: this is just a theoretical example, it won’t work with the syntax shown

You’ll want to take a look at the following. As mentioned in the post, the settings inside the brackets that you can use depends on the Rule Event.