Data-Conveyor

 view release on metacpan or  search on metacpan

lib/Data/Conveyor/Ticket.pm  view on Meta::CPAN

}

# rc and status are only updated from the payload; call this before storing
# the ticket whenever you change the payload's exception containers. This way,
# when you remove an exception (e.g., via a service interface), it has a
# direct effect on the ticket's rc and status.
#
# The ticket is passed to the payload method so it can pass it to the methods
# it calls; eventually the exception container will ask the ticket whether to
# ignore each exception it processes (cf. ignores_exception).
sub update_calculated_values {
    my $self = shift;
    $self->payload->update_transaction_stati($self);
    $self->calculate_status;    # calculates rc as well
}

sub calculate_rc {
    my $self = shift;
    $self->rc($self->payload->rc($self));
}

lib/Data/Conveyor/Ticket/Payload.pm  view on Meta::CPAN

    my $status =
      $self->delegate->make_obj('value_ticket_status',
        $self->delegate->TS_RUNNING) + $self->common->status($ticket);
    for my $object_type ($self->delegate->OT) {
        $status += $_->status($ticket)
          for $self->get_list_for_object_type($object_type);
    }
    $status;
}

sub update_transaction_stati {
    my ($self, $ticket) = @_;
    $_->transaction->update_status($ticket) for $self->transactions;
}

sub filter_exceptions_by_rc {
    my ($self, $ticket, @filter) = @_;
    my $result = $self->delegate->make_obj('exception_container');
    for my $object_type ($self->delegate->OT) {
        for my $payload_item ($self->get_list_for_object_type($object_type)) {
            $result->items_push(

lib/Data/Conveyor/Ticket/Transaction.pm  view on Meta::CPAN

use parent 'Class::Scaffold::Storable';
__PACKAGE__->mk_scalar_accessors(qw(
    payload_item object_type command type status necessity
));

sub is_optional {
    my $self = shift;
    $self->necessity eq $self->delegate->TXN_OPTIONAL;
}

sub update_status {
    my ($self, $ticket) = @_;

    # Apply a default value, but don't change transactions that are set to
    # TXS_IGNORE. This is relevant if you manually delete exceptions (via a
    # service interface) - then you also want to reset transaction stati.
    $self->status($self->delegate->TXS_RUNNING)
      if $self->status eq $self->delegate->TXS_ERROR;
    return unless $self->payload_item->has_problematic_exceptions($ticket);
    $self->status($self->delegate->TXS_ERROR);
}

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.807 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )