Chaining autoactions ?

2 months 2 days ago #316438 by activha
Hello

We have an activity auto action which result is outputting an activity with an asset like
hotspot.[var2][cb:if [cb_marketevents]>"0"].event.[cb_marketevents][/cb:if]

Is it possible to chain another auto action which would write this asset somewhere (in another field or a DB table )

How can I structure this ?
2 months 2 days ago #316442 by krileon
autoactions_onAction is fired when an auto action is processed. You can act on it if you need to chain auto actions, but you need to be careful doing this or you'll get stuck in an infinite loop. Specifically you should condition the chained auto action to ensure it's only triggering after your other auto action specifically. This is done using the below condition.

[var2_id] Equal To AUTO_ACTION_ID

Replace AUTO_ACTION_ID with the id of the auto action you want to follow. Below is the full trigger and its variables.

$_PLUGINS->trigger( 'autoactions_onAction', array( &$content, &$autoaction, &$user, &$variables, &$substitutions ) );

Why do you need to store the asset externally though?


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
2 months 2 days ago #316444 by activha

Why do you need to store the asset externally though?


I would like to be able to keep the event number and asset number even if the user deletes the activity. So that we may use it later in other displays.

For instance I'd like to use these to display the event in an our hotspot (referenced as asset) template even if the first activity is deleted, and until the user subscribes to the event

That'a bit complicated
2 months 2 days ago #316447 by krileon
So you want a history of assets encase cb_marketevents field is changed? Sorry, just don't understand what you're trying to do.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
2 months 2 days ago #316448 by activha
A user selects an event in GJ to participate to, this is then stored in [cb_marketevents]

Then this user creates a hotspot and trigger the auto action which creates a new activity item with the asset id as
hotspot.[var2][cb:if [cb_marketevents]>"0"].event.[cb_marketevents][/cb:if]

We want to store somewhere this asset id hotspot.65.event.3 for instance, so that even if the user deletes the activity, we can keep a log of the event associated to the hotspot.

We would like to use this to display the correct event on the correct hotspot page, even if the user chooses the next day another event while creating new hotspots.

If we can achieve this without an external DB that would make things easier for the future and keep standards of CB and hotspots

Hope you get it ?
2 months 2 days ago #316449 by krileon
Sounds like it'd just be better to create the activity entry using the system user functionality instead of the user actually owning the activity so they can't actually delete it. Within CB Activity > Parameters > System you can specify a specific user to act as the owner for system activity and override the username/avatar/url for that system user to display however you like. Next when creating your activity in CB Auto Actions set System to 1 (for yes/enable).


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
Moderators: beatnantkrileon
Time to create page: 0.436 seconds

Facebook Twitter LinkedIn