evergreen-user:action_trigger
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
evergreen-user:action_trigger [2011/12/19 13:38] – data-type note on processing delay edoceo | evergreen-user:action_trigger [2022/02/10 13:34] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 80: | Line 80: | ||
== Validator == | == Validator == | ||
- | The validator module to use. | + | The validator module to use. To create a custom validator add code/ |
== Reactor == | == Reactor == | ||
Line 95: | Line 95: | ||
== Granularity == | == Granularity == | ||
+ | |||
+ | A string used to distinguish among events that should be run (by the action_trigger_runner.pl script) at different times. | ||
+ | |||
+ | If a site is busy or large enough that all the events typically run overnight won't be able to finish by morning if they' | ||
+ | |||
== Max Event Validity Delay == | == Max Event Validity Delay == | ||
== Opt-In Setting Type == | == Opt-In Setting Type == | ||
Line 100: | Line 105: | ||
== Template == | == Template == | ||
+ | A [[http:// | ||
+ | |||
+ | < | ||
+ | [% USE date %] | ||
+ | [% USE Dumper %] | ||
+ | [% SET user = target.0.usr %] | ||
+ | To: [%- user.email -%] | ||
+ | From: | ||
+ | Subject: Item Due Reminder | ||
+ | |||
+ | Dear [% user.first_given_name %] | ||
+ | |||
+ | [% FOR circ IN target %] | ||
+ | | ||
+ | | ||
+ | Due: [% circ.due_date %] | ||
+ | [% END %] | ||
+ | |||
+ | [% Dumper.dump(target) %] | ||
+ | </ | ||
+ | |||
+ | == Event Environment == | ||
+ | |||
+ | Controls which data are available when processing this trigger (Validator, Reactor, Cleanup). | ||
+ | |||
+ | == Event Parameters == | ||
+ | |||
+ | This allows one to define key/value type data which becomes available during the processing of the trigger (Validator, Reactor). | ||
+ | |||
+ | ===== Processing Action Triggers ===== | ||
+ | |||
+ | When events occur records are created in the action_trigger.event table and these events are processed by the action_trigger_runner.pl script. | ||
+ | |||
+ | < | ||
+ | # General A/T | ||
+ | */2 * * * * action_trigger_runner.pl --process-hooks --run-pending | ||
+ | |||
+ | # Run Specific Granularity Only | ||
+ | 20 20 * * * action_trigger_runner.pl --run-pending --granularity Daily-Active-Report --granularity-only | ||
+ | |||
+ | # Just do these hooks | ||
+ | 21 21 * * * action_trigger_runner.pl --run-pending --hooks=checkout | ||
+ | |||
+ | # Example with Wrapper | ||
+ | 4 4 * * * / | ||
+ | </ | ||
+ | |||
+ | It's not uncommon to have dozens of entries in the crontab for Evergreen. | ||
+ | |||
+ | < | ||
+ | #!/bin/bash | ||
+ | # I'm some documentation on this script! | ||
+ | # Run holds available, only the daily-hold granularity | ||
+ | |||
+ | / | ||
+ | --debug-stdout \ | ||
+ | --verbose \ | ||
+ | --run-pending \ | ||
+ | --hooks=hold.available \ | ||
+ | --granularity=Daily-Hold \ | ||
+ | --granularity-only \ | ||
+ | >/ | ||
+ | 2>/ | ||
+ | |||
+ | logger --id --tag atr " | ||
+ | </ | ||
evergreen-user/action_trigger.1324319900.txt.gz · Last modified: 2022/02/10 13:33 (external edit)