Workflow::Context(3)
π Workflow::Context π
okay bestie, welcome to Workflow::Context β the Data blackboard for Workflows, Actions, Conditions and Validators π yes it's really called a blackboard, and yes that's iconic of it.
This page lives in the Workflow::Context(3) section of the user-contributed Perl docs, and the package it describes is at version 2.09 β¨ (that's the version this documentation covers, fr fr).
β¨ SYNOPSIS β¨
like, here's the whole vibe in code. watch her go:
# Create your own context and merge it with one that may already be
# in a workflow
my $context = Workflow::Context->new();
$context->param( foo => 'bar' );
$context->param( current_user => User->fetch( 'foo@bar.com' ) );
my $wf = FACTORY()->create_workflow( 'w/f', $context );
# The above is the same as:
$context = Workflow::Context->new(
foo => 'bar',
current_user => User->fetch( 'foo@bar.com' ),
);
$wf = FACTORY()->create_workflow( 'w/f', $context );
# In a Condition get the 'current_user' back out of the workflow's context
sub evaluate {
my ( $self, $wf ) = @_;
my $current_user = $wf->context->param( 'current_user' );
...
}
# Set values directly into a workflow's context
$wf->context->param( foo => 'bar' );
$wf->context->param( news => My::News->fetch_where( 'date = ?', DateTime->now ) );
tl;dr: you build a context, you hand it to a workflow, and everyone downstream can pull stuff back out of it. π
πΈ DESCRIPTION πΈ
Workflow::Context holds information to pass between your application and a Workflow β and that includes the workflow's Actions, Conditions and Validators too π«Ά.
It's giving shared bag of stuff everyone can reach into. main character energy, honestly. π
π¦ OBJECT METHODS π¦
init( %params )
Adds %params to the context right at instantiation. so like, when it's born, it already knows things πΌβ¨
merge( $other_context )
Merges the values from $other_context into this object.
β οΈ heads up bestie: if there are duplicate keys in this object and in$other_context, then$other_contextwins. no cap. the other context is the one eating. π€
π SEE ALSO π
Workflow
π COPYRIGHT π
Copyright (c) 2003-2021 Chris Winters. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Please see the LICENSE
π AUTHORS π
Please see Workflow
and that's the whole page, bestie β slay π β¨
sign-off szn: this doc came to you via perl v5.42.0, dated 2026-01-17, and it's the Workflow::Context(3) page. obsessed with her. periodt. ππ¦πΈ
π¦ where this page comes from
- fedora 44: perl-Workflow 2.09-2.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms