Triggers: Auto Live and set future status

Trying to work with triggers at the moment…


What I am trying to acheive is :



++ Send content live when an asset has a status of "Safe edit approved to go live" or "Approved to go live"

++ Set future status of the object to up for review in 6 months.



I have tried, seperate triggers, single triggers with multiple actions, but most of them result in the cron engine locking because of failed tasks…



What would be the best way to acheive these trigger(s)… currently running 3.10.1

For any status change, you probably need to turn on "Ignore Permissions" for the action. Otherwise, the trigger will run as the user. Is the Cron blocking on the future status change to up for review? If so, this will help too.

[quote]For any status change, you probably need to turn on “Ignore Permissions” for the action. Otherwise, the trigger will run as the user.  Is the Cron blocking on the future status change to up for review? If so, this will help too.
[right][post=“13492”]<{POST_SNAPBACK}>[/post][/right][/quote]



Its strange it has actually locked running the default system cron actions. I have had ignored permissions ticked and still strange…



I currently have on status change as the event, and it currently set two future status, one to set status to live in 15 minutes, the second to set future status in 6 months.



I seperated the actions into two triggers and it still caused some issues… it is really strange

On a related note, uou cannot change the status of an asset using a trigger while its status is currently being changed. So you cant create a trigger to set the status to Live when the status changes to Safe edit approved to go live or Approved to go live.


You need to set a future status job instead, and this should only be done on the page itself, not bodycopies and divs. So make sure the trigger has a Type Code condition.

[quote]On a related note, uou cannot change the status of an asset using a trigger while its status is currently being changed. So you cant create a trigger to set the status to Live when the status changes to Safe edit approved to go live or Approved to go live.
You need to set a future status job instead, and this should only be done on the page itself, not bodycopies and divs. So make sure the trigger has a Type Code condition.

[right][post=“13494”]<{POST_SNAPBACK}>[/post][/right][/quote]



Ok Given your comments greg, how does this trigger setting look? Set types to only do it on Page (Inherit), ms Word, PDF, File…



Ok image to big to upload, and no graphics software on this machine to resize nicely…



So here is the trigger actions:



** Conditions



** Asset Status



Asset has the current status of: Safe Edit Approved To Go Live



** Asset is of type



Match any one of these types:

page (or descendant types)

word_doc

pdf_file

file





Sets future status of live in 15 minutes



Is it possible to set two future status from the single trigger?

[quote]Is it possible to set two future status from the single trigger?
[right][post=“13495”]<{POST_SNAPBACK}>[/post][/right][/quote]



No. Rather, create a second trigger that sets a future status of up for review when the asset goes live.

[quote]No. Rather, create a second trigger that sets a future status of up for review when the asset goes live.
[right][post=“13496”]<{POST_SNAPBACK}>[/post][/right][/quote]

yeah thought that would be the case…



do you see any troubles with the above trigger actions, given what Greg said about asset type restrictions?

[quote]do you see any troubles with the above trigger actions, given what Greg said about asset type restrictions?
[right][post=“13497”]<{POST_SNAPBACK}>[/post][/right][/quote]



No, that should be fine. :slight_smile: Though, having this trigger means that you’d have to manually remove the automatically added job if you actually wanted to delay the Live status change for any reason.

[quote]No, that should be fine. :slight_smile: Though, having this trigger means that you’d have to manually remove the automatically added job if you actually wanted to delay the Live status change for any reason.
[right][post=“13498”]<{POST_SNAPBACK}>[/post][/right][/quote]



Ok sent the trigger live this morning put an asset into “safe edit approved to go live”



Cron manager now on 2 run checks, and failed… nothing in logs that I can see that would be causing it, any other system logs I could look at to see real message it failed?

Triggers and Cron are entirely different beasts. Is the Trigger successfully adding the future status cron jobs? If so, we can eliminate it and just look at what's causing cron to fail.


Can you check the error.log (/path/to/matrix/data/private/logs/error.log) to see if Cron is perhaps running out of memory?

[quote]Triggers and Cron are entirely different beasts. Is the Trigger successfully adding the future status cron jobs? If so, we can eliminate it and just look at what’s causing cron to fail.


Can you check the error.log (/path/to/matrix/data/private/logs/error.log) to see if Cron is perhaps running out of memory?

[right][post=“13507”]<{POST_SNAPBACK}>[/post][/right][/quote]



Sounds like you have run into this before :stuck_out_tongue:



[12-Dec-2006 10:30:25] PHP Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 368640 bytes) in /web/data/matrix_prod/core/inclu

de/metadata_manager.inc on line 1201



core/web/index.php has been set with

ini_set(‘memory_limit’, ‘256M’);



and php.ini files are also set with 256mb

You'll need to change the memory_limit setting in core/cron/run.php as well. It defaults to 16M.

[quote]You’ll need to change the memory_limit setting in core/cron/run.php as well. It defaults to 16M.
[right][post=“13509”]<{POST_SNAPBACK}>[/post][/right][/quote]

hehehehe ok was that in any manual anywhere? or maybe looked at when he had out system optimised by squiz :smiley:



Will increase the settings in that file, any others that I should know about Greg?



Thanks for the help

I think there is one in Squiz Server as well (if you use it) but it would almost certainly be failing if it was not already set correctly.


Just a note that these memory limit options are system config options in 3.12, so you don't have to go around editing files any more.

[quote]hehehehe ok was that in any manual anywhere? or maybe looked at when he had out system optimised by squiz  :smiley:


Will increase the settings in that file, any others that I should know about Greg?



Thanks for the help

[right][post=“13510”]<{POST_SNAPBACK}>[/post][/right][/quote]



Great… until then will make the change to the file tomorrow when I get back to work, and give it another test…





Thanks

256M is pretty high – are you running 64-bit Linux? What's the total memory in the system? Usually, I'd recommend 64MB (or 128MB for 64-bit systems).

[quote]256M is pretty high – are you running 64-bit Linux? What’s the total memory in the system? Usually, I’d recommend 64MB (or 128MB for 64-bit systems).
[right][post=“13513”]<{POST_SNAPBACK}>[/post][/right][/quote]



yeah had it at 128 and there were some issues… gotta remember we are running that weird SUSE 64bit server hehehehe…



Will try it at 128 first then bump it back up there are issues…



Oh atm we have 4GB onboard ram, but can upgrade to a further 16/32 or so I beleive…



Edit:::



Ok changed limit, re-enabled triggers… send live worked great… up for review after two hours worked a treat…



Getting Porject Manager to test himself now to see if it works…



Thanks for the assistance guys