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

FreeBSD Manual Pages

  
 
  

home | help
Class::Workflow::TransUsernContributedCPass::Workflow::Transition::Validate(3)

NAME
       Class::Workflow::Transition::Validate - Provide a hook for validating a
       transition (conditionals, input validators, etc).

SYNOPSIS
	       package MyTransition;
	       use Moose;

	       with qw/
		       Class::Workflow::Transition
		       Class::Workflow::Transition::Validate
	       /;

	       sub validate {
		       my ( $self, $instance, %args ) =	@_;

		       die "only the owner can apply this transition"
			       unless $args{user} eq $instance->owner;
	       }

DESCRIPTION
       This role will call the "validate" method at the	appropriate time.

       "validate" receives the same arguments as "apply", and is expected to
       die if any of the parameters for	the transition are invalid.

       Technically, this role doesn't do much more than	adding syntactic sugar
       for "before 'apply'". However, it's value is in the convention that you
       can call	"validate" without applying the	body. This eases writing side
       effect free introspection of transitions.

perl v5.24.1			  2009Class::Workflow::Transition::Validate(3)

NAME | SYNOPSIS | DESCRIPTION

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

home | help