我正在尝试使用perl Workflow模块 - http://search.cpan.org/~jonasbn/Workflow/
我设法弄清楚它是如何工作的工作流程,操作,条件和所有但我无法让它将验证器类应用于该操作.
来自验证器的我的_init方法加载并打印出我放在那里进行测试的行,但验证方法不会被触发.此外,当从动作类转储$ self-> get_validators()时,我得到空列表.
我创建了一个简短的示例,所以如果您发现问题,请尝试并提供帮助.TNX!
链接到代码 - https://github.com/vmcooper/perl_workflow_test
运行程序
程序以.开头
Answer: London
If you answer right the action should change state to 'finished'. Try answering wrong first.
Capital city of England:
Run Code Online (Sandbox Code Playgroud)
如果你回答"伯明翰"它应该写
Your answer is being validated!
Run Code Online (Sandbox Code Playgroud)
然后再问这个问题.
当你回答"伦敦"它应该
Correct! Current state of workflow is - finished
Run Code Online (Sandbox Code Playgroud)
编辑现在它写出"正确!工作流的当前状态 - 完成"无论你的答案是什么.
workflow_test.pl
use strict;
use Log::Log4perl qw( get_logger );
use Workflow::Factory qw( FACTORY );
Log::Log4perl::init( 'log4perl.conf' );
system('clear');
# Stock the factory with the configurations; we …Run Code Online (Sandbox Code Playgroud)