1Workflow::Context(3)  User Contributed Perl Documentation Workflow::Context(3)
2
3
4

NAME

6       Workflow::Context - Data blackboard for Workflows, Actions, Conditions
7       and Validators
8

SYNOPSIS

10        # Create your own context and merge it with one that may already be
11        # in a workflow
12
13        my $context = Workflow::Context->new();
14        $context->param( foo => 'bar' );
15        $context->param( current_user => User->fetch( 'foo@bar.com' ) );
16        $wf->context( $context );
17
18        # In a Condition get the 'current_user' back out of the workflow's context
19
20        sub evaluate {
21            my ( $self, $wf ) = @_;
22            my $current_user = $wf->context->param( 'current_user' );
23            ...
24        }
25
26        # Set values directly into a workflow's context
27
28        $wf->context->param( foo => 'bar' );
29        $wf->context->param( news => My::News->fetch_where( 'date = ?', DateTime->now ) );
30

DESCRIPTION

32       Holds information to pass between your application and a Workflow,
33       including its Actions, Conditions and Validators.
34

OBJECT METHODS

36       merge( $other_context )
37
38       Merges the values from $other_context into this object. If there are
39       duplicate keys in this object and $other_context, $other_context wins.
40

SEE ALSO

42       Workflow
43
45       Copyright (c) 2003-2006 Chris Winters. All rights reserved.
46
47       This library is free software; you can redistribute it and/or modify it
48       under the same terms as Perl itself.
49

AUTHORS

51       Jonas B. Nielsen (jonasbn) <jonasbn@cpan.org>, current maintainer.
52
53       Chris Winters <chris@cwinters.com>, original author.
54
55
56
57perl v5.8.8                       2007-04-25              Workflow::Context(3)
Impressum