[OPEN-ILS-GENERAL] Action Trigger Event Parameters

David Busby david.busby at edoceo.com
Wed Jan 4 14:57:17 EST 2012


Howdy,

  I've constructed a custom Action Trigger Validator
(Actor::StatCatMatch) it's working pretty OK, but I've got some hard
coded values in there that I want to remove.
  I was thinking that I would use the Action Trigger Event Parameters
to configure the way this validator works.
  In my mind I would set to parameters there, eg: StatCatEntry which
would be the name (or ID) of the stat-cat to match; and StatCatMatch
which would be a regular expression.
  In this fashion, my Validator module could use those, when running
this little snip...

  my $circ = $env->{target};
  my $u = $circ->usr;
  foreach my $sce (@{$u->stat_cat_entries}) {
    # Logic here
  }

  The issue I'm having is that the data is not getting into this
module as I expected.  That is.
  What I set in the UI, does not get into the validator verbatim; it's mangled.
Vis:
---
(postgres@[local]:5432) [evergreen] > select * from action_trigger.event_params;
 id | event_def |     param     |         value
----+-----------+---------------+------------------------
  3 |       101 | Stat-Cat.ID   | 3,5
  1 |       101 | StatCat+Name  | email_reciept_due_date
  2 |       101 | Stat_CatMatch | Yes!
---

  My event is 101, when I am in the perl code for this, my values are
mangled to things like: "5", "email_reciept_due_date" and "Yes".  As
if it only matches \w+.  What's odd is that the param value comes
through un-mangled, with spaces and all.  I basically was logging with
Dumper() to see this.

  Thoughts?  This related to a LP I created too,
https://bugs.launchpad.net/evergreen/+bug/911904

--
David Busby
Managing Director
Edoceo, Inc.
http://edoceo.com/
206.282.6500


More information about the Open-ils-general mailing list