GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  CLASS::WORKFLOW::STATE::AUTOAPPLY (3)

.ds Aq ’

NAME

Class::Workflow::State::AutoApply - Automatically apply a transition upon arriving into a state.

CONTENTS

SYNOPSIS



        package MyState;
        use Moose;

        with qw/Class::Workflow::State::AutoApply/;
       
        my $state = Mystate->new( auto_transition => $t );

        my $i2 = $state->accept_instance( $i, @args ); # automatically calls $t->apply( $i, @args )



DESCRIPTION

This state role is used to automatically apply a transition

PARTIAL TRANSITIONS

If an auto-application may fail validation or something of the sort you can do something like:



        around apply_auto_transition => sub {
                my $next = shift;
                my ( $self, $instance, @args ) = @_;

                eval { $self->$next( $instance, @args ) }

                die $@ unless $@->isa("SoftError");
        }



If apply_auto_transition returns a false value then the original instance will be returned automatically, at which point the intermediate state is the current state.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 CLASS::WORKFLOW::STATE::AUTOAPPLY (3) 2009-01-10

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.