Workflo...redField(3)
π NAME π
Workflow::Validator::HasRequiredField β the validator bestie that makes sure the data you said had to be there... is actually there. No vibes-based skipping. π
(Also, if you're squinting at the man page name all truncated like Workflo...redField(3), that's just the manual name getting cropped β the real one is Workflow::Validator::HasRequiredField(3), and she is thriving. β¨)
π VERSION π
This documentation describes version 2.09 of this package. Yes, she's got a number and she's proud of it. πΈ
β¨ SYNOPSIS β¨
okay so here's the tea: this validator basically builds itself when you go is_required: yes on a field in your action. Look:
# Validator is created automatically when you mark a field as
# 'is_required: yes' in the action, such as:
action:
- name: CreateUser
field:
- name: username
is_required: yes
source_class: App::Field::ValidUsers
...
Like... you don't even have to do anything?? She just shows up. Iconic behaviour, honestly. π
π DESCRIPTION π
This is a simple validator whose whole job is making sure that every field you tagged with the 'is_required' property set to 'yes' is genuinely present before the action it belongs to goes and executes. Vibe check first, action second. π¦
So for instance, if your configuration looks like this:
action:
- name: CreateUser
field:
- name: username
is_required: yes
- name: email
is_required: yes
- name: office
...and then an action gets executed with a context like this:
my $wf = FACTORY->get_workflow( $id );
$wf->context( username => 'foo' );
$wf->context( office => 'Ottumwa' );
$wf->execute_action( 'CreateUser' );
she is gonna fail it, with the message:
The following fields require a value: email
Like yes bestie, username and office are cute and accounted for, but where is email?? Nowhere. Not me catching that. π
You normally do not need to configure this validator yourself. She gets generated automatically when the Action configuration is read in, based on the 'is_required: yes' attribute. She's self-assembling. Main character energy fr fr.
However, if you do need to create it yourself for whatever reason:
action:
- name: Foo
validator:
- name: HasRequiredField
arg:
- fieldOne
- field_two
Important note, don't skip this one: we do not try to match the value in the context against a set of known values or against any algorithm. We literally just check whether the value is defined β using the Perl notion of defined, not true/false. Which means both '0' and the empty string count as valid. No cap. π―
π METHODS π
validate
Validates whether a given set of required fields are defined. That's the whole assignment, and she ate. π₯
Takes two parameters: a workflow object and an array of names of fields.
The provided fields get matched against the workflow in question, and Workflow::Exception's get thrown in case of missing fields. So if something's absent, bestie is gonna tell you. Loudly. π«Ά
π 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!! π One last thing before you go: this lil doc is from perl v5.42.0, dated 2026-01-17 β and it's filed under Workflo...redField(3) in the manual, which is just the truncated version of her full name. Slay, stay defined, and never let your required fields ghost you. ππ¦β¨
π¦ 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