[OPEN-ILS-DEV] Trouble with New Action Trigger Event

Steven Callender stevecallender at esilibrary.com
Fri Jan 14 16:33:13 EST 2011


Mike,

I bet the environments aren't set correctly. I haven't seen this hook 
before, "expire". But looking at it in your output below, it's using a 
core type of "au". That's the actor.usr table.

In your notice, you will need to change some things.  Change the 
target.0.usr to be target.0. I bet that came from an overdue notice that 
is using a core type of "circ", which needs to specifically be told how 
to get to the actor user table, hence the usr at the end of it. But in 
this case, we are already focusing on the actor usr table so it would 
just confuse the software.

The target.0.circ_lib is not correct either. Since we are not checking 
circulations here, there is no circulation library. Instead use 
target.0.home_ou for the patrons home library.

Change all the helper parameters from target.0.circ_lib.id to 
target.0.home_ou.id

And lastly, remove all environments you may have already entered for 
this event. Instead put in,

home_ou.mailing_address
home_ou.billing_address

It looks like that's the only 2 environments you will need for your notice.

Try that and see if you fair better.

Steve



On 1/14/2011 4:02 PM, Peters, Michael wrote:
>
> Perhaps this is an additional clue?
>
> osrfsys.15.log:2011-01-14 15:56:04 192.168.80.9 open-ils.trigger: [ERR 
> :15481:Event.pm:391:] Can't call method "Controller" on an undefined 
> value at /op
>
> enils/lib/perl5/OpenILS/Application/Trigger/Event.pm line 443.
>
> Sincerely,
> Michael Peters
> Indiana State Library MIS | Inspire.IN.gov Helpdesk | Evergreen 
> Indiana Helpdesk
> office - 317.234.2128
> email - mrpeters at library.in.gov <mailto:mrpeters at library.in.gov>
>
> *From:*open-ils-dev-bounces at list.georgialibraries.org 
> [mailto:open-ils-dev-bounces at list.georgialibraries.org] *On Behalf Of 
> *Peters, Michael
> *Sent:* Friday, January 14, 2011 3:57 PM
> *To:* Evergreen Development Discussion List
> *Subject:* Re: [OPEN-ILS-DEV] Trouble with New Action Trigger Event
>
> Steve,
>
> Progress!!!
>
> --debug-stdout now gives:
>
> ****
>
> ** content() isn't there.  Please create me somewhere (like in 
> OpenSRF::DomainObject::oilsMethodException)!
>
> ** Error at main (./action_trigger_runner.pl), line 156
>
> ** Call Stack (5 deep):
>
> **      main (./action_trigger_runner.pl), line 176
>
> **      Error::subs (/usr/share/perl5/Error.pm), line 416
>
> **      Error::subs (/usr/share/perl5/Error.pm), line 408
>
> **      main (./action_trigger_runner.pl), line 180
>
> **       (), line
>
> ** Object type was OpenSRF::DomainObject::oilsMethodException
>
> ****
>
> "1"
>
> Sincerely,
> Michael Peters
> Indiana State Library MIS | Inspire.IN.gov Helpdesk | Evergreen 
> Indiana Helpdesk
> office - 317.234.2128
> email - mrpeters at library.in.gov <mailto:mrpeters at library.in.gov>
>
> *From:*open-ils-dev-bounces at list.georgialibraries.org 
> [mailto:open-ils-dev-bounces at list.georgialibraries.org] *On Behalf Of 
> *Steven Callender
> *Sent:* Friday, January 14, 2011 3:52 PM
> *To:* Evergreen Development Discussion List
> *Subject:* Re: [OPEN-ILS-DEV] Trouble with New Action Trigger Event
>
> Mike,
>
> I noticed that your delay (-30 days) is the same as your max_delay 
> (-30 days). This may be the cause of your issue. Try changing the 
> max_delay to -29 days.
>
> Or if you want the true 30 day mark, change your delay to -31 days and 
> leave your max_delay at -30.
>
> Right now even if everything else was correct, your delays are just 
> canceling each other out.
>
> Try that and run them again and see what happens.
>
> Steve
>
>
> On 1/14/2011 3:13 PM, Peters, Michael wrote:
>
> Apparently my txt attachment was filtered.  Pasted here:
>
> evergreen=# SELECT * FROM action_trigger.event_definition WHERE id=274;
>
> -[ RECORD 1 
> ]---+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> id              | 274
>
> active          | t
>
> owner           | 1
>
> name            | 30 Day Card Expiration Courtesy Notice
>
> hook            | expire
>
> validator       | NOOP_True
>
> reactor         | ProcessTemplate
>
> cleanup_success |
>
> cleanup_failure |
>
> delay           | -30 days
>
> delay_field     | expire_date
>
> group_field     | usr
>
> template        |
>
>                 : [%- USE date -%]
>
>                 : [%- user = target.0.usr -%]
>
>                 : [%- lib = target.0.circ_lib -%]
>
>                 : To: [%- params.recipient_email || user.email %]
>
>                 : From: [%- 
> helpers.get_org_setting(target.0.circ_lib.id, 'org.bounced_emails') || 
> lib.email || params.sender_email || default_sender %]
>
>                 : Reply-To: [%- 
> helpers.get_org_setting(target.0.circ_lib.id, 'org.bounced_emails') || 
> lib.email || params.sender_email || default_sender %]
>
>                 : Errors-To: [%- 
> helpers.get_org_setting(target.0.circ_lib.id, 'org.bounced_emails') || 
> lib.email || params.sender_email || default_sender %]
>
>                 : Subject: Courtesy Notice - Library Card Expiration 
> in 30 days
>
>                 :
>
>                 : Dear [% user.first_given_name %] [% user.family_name %],
>
>                 :
>
>                 : Our records indicate your library card is due to 
> expire in 30 days.  Please visit your local library at your 
> convenience to renew your card in order to avoid a disruption in 
> access to library service.
>
>                 :
>
>                 : Sincerely,
>
>                 : [% lib.name %]
>
>                 :
>
>                 : Contact your library for more information:
>
>                 :
>
>                 : [% lib.name %]
>
>                 : [%- SET addr = lib.mailing_address -%]
>
>                 : [%- IF !addr -%] [%- SET addr = lib.billing_address 
> -%] [%- END %]
>
>                 : [% lib.mailing_address.street1 %] [% 
> lib.mailing_address.street2 %]
>
>                 : [% lib.mailing_address.city %], [% 
> lib.mailing_address.state %]
>
>                 : [% lib.mailing_address.post_code %]
>
>                 : [% lib.phone %]
>
>                 :
>
>                 :
>
> max_delay       | -30 days
>
> evergreen=# SELECT * FROM action_trigger.hook WHERE key='expire';
>
> -[ RECORD 1 ]----------------
>
> key         | expire
>
> core_type   | au
>
> description | Card is expired
>
> passive     | t
>
> evergreen=# SELECT * FROM action_trigger.environment WHERE event_def=274;
>
> id  | event_def |    path     | collector | label
>
> -----+-----------+-------------+-----------+-------
>
> 103 |       274 | active      |           |
>
> 104 |       274 | expire_date |           |
>
> 105 |       274 | deleted     |           |
>
> 106 |       274 | usr         |           |
>
> (4 rows)
>
> evergreen=# SELECT * FROM action_trigger.event_params WHERE event_def=274;
>
> id | event_def |    param     |             value
>
> ----+-----------+--------------+-------------------------------
>
> 23 |       274 | sender_email | evergreen at evergreen.lib.in.us 
> <mailto:evergreen at evergreen.lib.in.us>
>
> (1 row)
>
> Sincerely,
> Michael Peters
> Indiana State Library MIS | Inspire.IN.gov Helpdesk | Evergreen 
> Indiana Helpdesk
> office - 317.234.2128
> email - mrpeters at library.in.gov <mailto:mrpeters at library.in.gov>
>
> *From:*open-ils-dev-bounces at list.georgialibraries.org 
> <mailto:open-ils-dev-bounces at list.georgialibraries.org> 
> [mailto:open-ils-dev-bounces at list.georgialibraries.org] *On Behalf Of 
> *Peters, Michael
> *Sent:* Friday, January 14, 2011 3:06 PM
> *To:* open-ils-dev at list.georgialibraries.org 
> <mailto:open-ils-dev at list.georgialibraries.org>
> *Subject:* [OPEN-ILS-DEV] Trouble with New Action Trigger Event
>
> PureMessage has discarded the attachment due to the file extension. If you need to receive this file, please have the sender resend using a password protected zip file.
>
> Hi all,
>
> Really thought I was rocking along on this but I've hit a speed bump.  
> I can't get this new event to run.
>
> Attached are all of the parameters for the new event from the database 
> (eventdef.txt), along with my action_trigger_filter.json file 
> including my new hook.
>
> I've set the validator to "ProcessTemplate" since this is still in 
> testing, and my understanding is that this would just create the 
> action_trigger.event_output rows for my new triggered event until 
> switched to "SendEmail".  Sadly, after running 
> action_trigger_runner.pl --process-hooks --run-pending I didn't find 
> any output for this new event.
>
> Just on the off chance that noone's card expired 30 days from today, I 
> set a test user to expire_date=now() + interval '30 days' an ran 
> action_trigger_runner.pl again.
>
> I also tried running action_trigger_runner.pl with "--hook=expire" and 
> "--debug-stdout" to see if any clues came up, but sadly I just got a 
> response of " ".
>
> Any thoughts?
>
> Sincerely,
> Michael Peters
> Indiana State Library MIS | Inspire.IN.gov Helpdesk | Evergreen 
> Indiana Helpdesk
> office - 317.234.2128
> email - mrpeters at library.in.gov <mailto:mrpeters at library.in.gov>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://libmail.georgialibraries.org/pipermail/open-ils-dev/attachments/20110114/0888b205/attachment-0001.htm 


More information about the Open-ils-dev mailing list