Processing Action Triggers
To run the action triggers, an Evergreen administrator will need to run the trigger processing script. This should be set up as a cron job to run periodically. To run the script, use this command:
/openils/bin/action_trigger_runner.pl --process-hooks --run-pending
You have several options when running the script:
-
--run-pending: Run pending events to send emails or take other actions as
specified by the reactor in the event definition.
-
--process-hooks: Create hook events
-
--osrf-config=[config_file]: OpenSRF core config file. Defaults to:
/openils/conf/opensrf_core.xml
-
--custom-filters=[filter_file]: File containing a JSON Object which describes any hooks
that should use a user-defined filter to find their target objects. Defaults to:
/openils/conf/action_trigger_filters.json
-
--max-sleep=[seconds]: When in process-hooks mode, wait up to [seconds] for the lock file to go
away. Defaults to 3600 (1 hour).
-
--hooks=hook1[,hook2,hook3,…]: Define which hooks to create events for. If none are defined, it
defaults to the list of hooks defined in the --custom-filters option.
Requires --process-hooks.
-
--granularity=[label]: Limit creating events and running pending events to
those only with [label] granularity setting.
-
--debug-stdout: Print server responses to STDOUT (as JSON) for debugging.
-
--lock-file=[file_name]: Sets the lock file for the process.
-
--verbose: Show details of script processing.
-
--help: Show help information.
Examples:
Run all pending events that have no granularity set. This is what you tell
CRON to run at regular intervals.
perl action_trigger_runner.pl --run-pending
Batch create all "checkout.due" events
perl action_trigger_runner.pl --hooks=checkout.due --process-hooks
Batch create all events for a specific granularity and to send notices for all
pending events with that same granularity.
perl action_trigger_runner.pl --run-pending --granularity=Hourly --process-hooks