From: miker Date: Tue, 24 Feb 2009 21:29:45 +0000 (+0000) Subject: adding required update_process field; fleshing "quietly" updated objects (should... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=9b79c08f87480ca42f357b032e7fe346a0d9f6bd;p=evergreen%2Ftadl.git adding required update_process field; fleshing "quietly" updated objects (should probably not use quite=>1) git-svn-id: svn://svn.open-ils.org/ILS/trunk@12286 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 37285eb0de..a5b8c8c6f2 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -742,6 +742,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm b/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm index 2dc28f97eb..aee5cb3cd7 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm @@ -34,6 +34,11 @@ sub init { $self->id( $id ); $self->environment( {} ); + if (!$self->id) { + $log->error("No Event ID provided"); + die "No Event ID provided"; + } + return $self if (!$self->id); $self->event( @@ -293,6 +298,12 @@ sub update_state { } my $e = $self->editor->retrieve_action_trigger_event( $self->id ); + if (!$e) { + $log->error( "Could not retrieve object ".$self->id." for update" ) if (!$e); + return undef; + } + + $log->info( "Retrieved object ".$self->id." for update" ); $e->start_time( 'now' ) unless $e->start_time; $e->update_time( 'now' ); $e->update_process( $$ ); @@ -303,13 +314,20 @@ sub update_state { my $ok = $self->editor->update_action_trigger_event( $e ); if (!$ok) { $self->editor->xact_rollback if ($self->standalone); + $log->error( "Update of event ".$self->id." failed" ); return undef; } else { + $e = $self->editor->data; + $e = $self->editor->retrieve_action_trigger_event( $e ) if (!ref($e)); + if (!$e) { + $log->error( "Update of event ".$self->id." did not return an object" ); + return undef; + } + $log->info( "Update of event ".$e->id." suceeded" ); $ok = $self->editor->xact_commit if ($self->standalone); } if ($ok) { - $e = $self->editor->data; $self->event->start_time( $e->start_time ); $self->event->update_time( $e->update_time ); $self->event->update_process( $e->update_process );