1Workflow::Context(3) User Contributed Perl Documentation Workflow::Context(3)
2
3
4
6 Workflow::Context - Data blackboard for Workflows, Actions, Conditions
7 and Validators
8
10 This documentation describes version 1.05 of this package
11
13 # Create your own context and merge it with one that may already be
14 # in a workflow
15
16 my $context = Workflow::Context->new();
17 $context->param( foo => 'bar' );
18 $context->param( current_user => User->fetch( 'foo@bar.com' ) );
19 $wf->context( $context );
20
21 # In a Condition get the 'current_user' back out of the workflow's context
22
23 sub evaluate {
24 my ( $self, $wf ) = @_;
25 my $current_user = $wf->context->param( 'current_user' );
26 ...
27 }
28
29 # Set values directly into a workflow's context
30
31 $wf->context->param( foo => 'bar' );
32 $wf->context->param( news => My::News->fetch_where( 'date = ?', DateTime->now ) );
33
35 Holds information to pass between your application and a Workflow,
36 including its Actions, Conditions and Validators.
37
39 merge( $other_context )
40
41 Merges the values from $other_context into this object. If there are
42 duplicate keys in this object and $other_context, $other_context wins.
43
45 Workflow
46
48 Copyright (c) 2003-2006 Chris Winters. All rights reserved.
49
50 This library is free software; you can redistribute it and/or modify it
51 under the same terms as Perl itself.
52
54 Jonas B. Nielsen (jonasbn) <jonasbn@cpan.org>, current maintainer.
55
56 Chris Winters <chris@cwinters.com>, original author.
57
58
59
60perl v5.32.0 2020-07-28 Workflow::Context(3)