If and how to set up Triggers in AutoActions for AA Batches

2 years 6 months ago #326590 by cez
Hello,
I have a request for help in understanding the settings and principles of launching Auto Action Batches in the context of Triggers. If and how to set up Triggers in AutoActions for AA Batches.

Of course, in a small aspect, because the whole thing is described in many places as well as in the not so old Kyle's blog CB Auto Actions 8.1.0, but getting to the point:

Do I understand correctly?
(I will use AA for "regular" Auto Action and AAB for Auto Action Batches)

1. I create an AAB, set conditions and select one or a set of existing AAs to fire - that's clear.

2. My tests show that AAB ignores the Triggers (Global Tab) settings in AA that it has on the list, so I can actually choose any and only the other conditions in AA are taken into account: i.e. Access (Global Tab ) plus the ones from the Condition Tab - request for confirmation, pls.

And now doubts:

3. What about Triggers autoaction_onAction that have Condition [var2_id] = the id of the previous AA, are such actions fired by AAB?

4. It looks like AA Triggers should generally be set because the Internal Action URL for AA Triggers None does not contain a random token. So, theoretically, by id test, such AA without Triggers can be fired by the user? So AA without Triggers, generally only for testing - this is what the info tip suggests. Do I understand correctly?

5. What if I want to create an AAB, which is just to perform a specific set of AA actions on users (eg add selected users +100 points once a day and I have to create such AA)? These AAs don't need the Triggers parameter. But it's better to give them one if the point 4. is true?
But which?

a. Conceived, "finger-typed", non-existent eg "joomla_ nonexistent", does this affect performance?
b. or a specific but real Trigger, hoping that there will never be a situation in which such AA will fire normally without AAB? But which? For example related to the some activity of the administrator?

c. Or is there any other trick or tips for this?

I don't know if I have described my doubts clearly enough? I hope so. Thx.

Please Log in to join the conversation.

2 years 6 months ago #326595 by krileon

2. My tests show that AAB ignores the Triggers (Global Tab) settings in AA that it has on the list

Correct, it will ignore the triggers as a batch is directly executing an auto action. It is not meant to be used with regular triggered auto actions. Ideally auto actions used with batching should leave Triggers as None as you aren't going to have access to any of that triggers variables as that would be impossible given triggers are fired at specific sources in code with specific information at the time they are fired.

so I can actually choose any and only the other conditions in AA are taken into account: i.e. Access (Global Tab ) plus the ones from the Condition Tab - request for confirmation, pls.

Yes, access and conditions will apply normally.

4. It looks like AA Triggers should generally be set because the Internal Action URL for AA Triggers None does not contain a random token. So, theoretically, by id test, such AA without Triggers can be fired by the user? So AA without Triggers, generally only for testing - this is what the info tip suggests. Do I understand correctly?

Auto actions with a trigger selected cannot be directly accessed that's correct. So yes if you don't want to allow auto action guessing your Access or Conditions need to protect against that if setting Triggers to None. You can also use a fake trigger as well (e.g. batchingOnlyAction) that will never fire. The reason None allows direct access is to allow auto actions to act as a web service basically; you can create custom JSON endpoints with it, which will be expanded much further in J4 since J4 officially has web service endpoints now.

5. What if I want to create an AAB, which is just to perform a specific set of AA actions on users (eg add selected users +100 points once a day and I have to create such AA)? These AAs don't need the Triggers parameter. But it's better to give them one if the point 4. is true?
But which?

You could give them a trigger if you like. As explained in my reply to #4 just give them a random made up trigger (e.g. batchingOnlyAction). For batching the trigger is irrelevant. Additionally you could just condition for the batching. Example as follows.

Field: Custom > Value
Custom Value: [var2_id]
Operator: Equal To
Value: BATCH_ID_HERE

var2 in this case is the batch object. Additionally if Triggers is left empty the batching process will pass along a fake trigger. It sets it to "batchBATCH_ID_HERE" so for example "batch1" you can also condition for this as well if you want. Example as follows.

Field: Custom > Value
Custom Value: [trigger]
Operator: Equal To
Value: batchBATCH_ID_HERE

a. Conceived, "finger-typed", non-existent eg "joomla_ nonexistent", does this affect performance?

It will not impact performance.

b. or a specific but real Trigger, hoping that there will never be a situation in which such AA will fire normally without AAB? But which? For example related to the some activity of the administrator?

A made up trigger is fine.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: cez

Please Log in to join the conversation.

2 years 6 months ago - 2 years 6 months ago #326598 by cez
Thanks a lot for the clarification. Your CB AutoAction super plugin offers almost endless possibilities of use. And by the way, maybe it might be worth (sometime) to consider adding an "official fake trigger" like "batchingOnlyAction" to the AA triggers picklist - as an additional alternative to none - if that's not confusing for users, and does not change the direction of development of CB AA. ?

Please Log in to join the conversation.

2 years 6 months ago #326600 by krileon
Will review adding a feature to prevent auto action direct access if set to None. Probably just a simple yes/no toggle only visible if None is set for Triggers.

forge.joomlapolis.com/issues/8730


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.205 seconds

Facebook Twitter LinkedIn