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::TRANSITION::VALIDATE (3)

.ds Aq ’

NAME

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

CONTENTS

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.

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


perl v5.20.3 CLASS::WORKFLOW::TRANSITION::VALIDATE (3) 2009-01-10

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