[open-ils-commits] r12286 - in trunk/Open-ILS: examples src/perlmods/OpenILS/Application/Trigger (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Feb 24 16:29:49 EST 2009
Author: miker
Date: 2009-02-24 16:29:45 -0500 (Tue, 24 Feb 2009)
New Revision: 12286
Modified:
trunk/Open-ILS/examples/fm_IDL.xml
trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm
Log:
adding required update_process field; fleshing "quietly" updated objects (should probably not use quite=>1)
Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml 2009-02-24 19:38:34 UTC (rev 12285)
+++ trunk/Open-ILS/examples/fm_IDL.xml 2009-02-24 21:29:45 UTC (rev 12286)
@@ -742,6 +742,7 @@
<field reporter:label="State" name="state" oils_obj:array_position="11" oils_persist:virtual="false" reporter:datatype="text"/>
<field reporter:label="Template Output" name="template_output" oils_obj:array_position="12" oils_persist:virtual="false" reporter:datatype="text"/>
<field reporter:label="Error Output" name="error_output" oils_obj:array_position="13" oils_persist:virtual="false" reporter:datatype="text"/>
+ <field reporter:label="Update Process" name="update_process" oils_obj:array_position="14" oils_persist:virtual="false" reporter:datatype="int"/>
</fields>
<links>
<link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm 2009-02-24 19:38:34 UTC (rev 12285)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Event.pm 2009-02-24 21:29:45 UTC (rev 12286)
@@ -34,6 +34,11 @@
$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 @@
}
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 @@
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 );
More information about the open-ils-commits
mailing list