Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Class::Workflow::StateUsertContributed PerClass::Workflow::State::AutoApply(3)

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

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.

perl v5.24.1			  2009-01-Class::Workflow::State::AutoApply(3)

NAME | SYNOPSIS | DESCRIPTION | PARTIAL TRANSITIONS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Class::Workflow::State::AutoApply&sektion=3&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help