[open-ils-commits] r14807 - trunk/Open-ILS/src/perlmods/OpenILS/Application (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Nov 6 12:08:57 EST 2009
Author: erickson
Date: 2009-11-06 12:08:54 -0500 (Fri, 06 Nov 2009)
New Revision: 14807
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm
Log:
don't pre-validate events when grouping, just fetch and group
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm 2009-11-06 14:58:53 UTC (rev 14806)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm 2009-11-06 17:08:54 UTC (rev 14807)
@@ -553,7 +553,11 @@
my %groups = ( '*' => [] );
for my $e_id ( @$events ) {
+ $logger->info("trigger: processing event $e_id");
+ # let the client know we're still chugging along TODO add osrf support for method_lookup $client's
+ $client->status( new OpenSRF::DomainObject::oilsContinueStatus );
+
my $e;
try {
$e = OpenILS::Application::Trigger::Event->new($e_id);
@@ -562,37 +566,34 @@
};
next unless $e;
- my $valid;
try {
- $valid = $e->validate->valid;
+ $e->build_environment;
} catch Error with {
- $logger->error("Event validation failed with ".shift());
+ $logger->error("Event environment building failed with ".shift());
};
- if ($valid) {
+ if (my $group = $e->event->event_def->group_field) {
- if (my $group = $e->event->event_def->group_field) {
+ # split the grouping link steps
+ my @steps = split /\./, $group;
- # split the grouping link steps
- my @steps = split /\./, $group;
+ # find the grouping object
+ my $node = $e->target;
+ $node = $node->$_() for ( @steps );
- # find the grouping object
- my $node = $e->target;
- $node = $node->$_() for ( @steps );
+ # get the pkey value for the grouping object on this event
+ my $node_ident = $node->Identity;
+ my $ident_value = $node->$node_ident();
- # get the pkey value for the grouping object on this event
- my $node_ident = $node->Identity;
- my $ident_value = $node->$node_ident();
+ # push this event onto the event+grouping_pkey_value stack
+ $groups{$e->event->event_def->id}{$ident_value} ||= [];
+ push @{ $groups{$e->event->event_def->id}{$ident_value} }, $e;
+ } else {
+ # it's a non-grouped event
+ push @{ $groups{'*'} }, $e;
+ }
- # push this event onto the event+grouping_pkey_value stack
- $groups{$e->event->event_def->id}{$ident_value} ||= [];
- push @{ $groups{$e->event->event_def->id}{$ident_value} }, $e;
- } else {
- # it's a non-grouped event
- push @{ $groups{'*'} }, $e;
- }
- }
$e->editor->disconnect;
}
@@ -611,7 +612,7 @@
my ($groups) = $self->method_lookup('open-ils.trigger.event.find_pending_by_group')->run($granularity);
- for my $def ( %$groups ) {
+ for my $def ( keys %$groups ) {
if ($def eq '*') {
for my $event ( @{ $$groups{'*'} } ) {
try {
More information about the open-ils-commits
mailing list