evergreen-user:action_trigger
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
evergreen-user:action_trigger [2009/12/07 17:11] – erickson | evergreen-user:action_trigger [2012/08/10 10:34] – [Event Definitions] rough explanation of granularity lebbeous | ||
---|---|---|---|
Line 57: | Line 57: | ||
== Processing Delay == | == Processing Delay == | ||
- | This value defines the amount of time the system should wait after a target object becomes " | + | This value defines the amount of time the system should wait after a target object becomes " |
* Overdue notices use the " | * Overdue notices use the " | ||
Line 66: | Line 66: | ||
== Processing Delay Context Field == | == Processing Delay Context Field == | ||
- | This is the field on the target object that defines the time stamp to use as the base time for determining if the target | + | This is the field on the target object that defines the time stamp to use as the base time for calculating the time since the target |
+ | |||
+ | For checkout.due, | ||
+ | |||
+ | The field name maps to a < | ||
== Processing Group Context Field == | == Processing Group Context Field == | ||
+ | |||
+ | This field is used to group events so they can be reacted upon en masse. | ||
+ | |||
+ | The field name maps to a < | ||
+ | |||
== Validator == | == Validator == | ||
+ | |||
+ | The validator module to use. To create a custom validator add code/ | ||
+ | |||
== Reactor == | == Reactor == | ||
+ | |||
+ | The reactor module to use. | ||
+ | |||
== Failure Cleanup == | == Failure Cleanup == | ||
+ | |||
+ | The failure cleanup module to use (optional) | ||
+ | |||
== Success Cleanup == | == Success Cleanup == | ||
+ | |||
+ | The success cleanup module to use (optional) | ||
+ | |||
== 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 79: | 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.txt · Last modified: 2022/02/10 13:34 by 127.0.0.1