VS::RuleEngine::Engine - Engine declaration
use VS::RuleEngine::Engine; my $engine = VS::RuleEngine::Engine->new(); $engine->add_hook(hook1 => "MyApp::GetMoreData"); $engine->add_rule(rule1 => "MyApp::Rule"); $engine->add_action(action1 => "MyApp::Action"); $engine->add_rule_action(rule1 => "action1"); $engine->run();
This class defines a VS::RuleEngine "engine". Altho it is possible using this class directly it is more readable using the declarative interface in VS::RuleEngine::Declare or loading engines using an engine loader class (which is currently not available).
Creates a new engine.
Runs the engine.
Returns the names of all default sets.
Checks if the engine has a default set named NAME.
Returns a hash reference with the key/value pairs for the default named NAME.
Registers the hash reference DEFAULTS as NAME.
Returns the names of all registered actions.
Checks if the engine has a registered action with the given NAME.
Registers the ACTION as NAME in the engine with arguments provided by default argument sets referenced by name in the array reference DEFAULTS and additional arguments.
Returns the names of all registered hooks.
Checks if the engine has a registered hook with the given NAME.
Registers the HOOK as NAME in the engine with arguments provided by default argument sets referenced by name in the array reference DEFAULTS and additional arguments.
Adds the hook with the given NAME to the list of hooks to run before each iteration.
Adds the hook with the given NAME to the list of hooks to run after each iteration.
Returns the names of all registered inputs
Checks if the engine has a registered input with the given NAME.
Registers the INPUT as NAME in the engine with arguments provided by default argument sets referenced by name in the array reference DEFAULTS and additional arguments.
Returns the names of all registered outputs
Checks if the engine has a registered output with the given NAME.
Registers the OUTPUT as NAME in the engine with arguments provided by default argument sets referenced by name in the array reference DEFAULTS and additional arguments.
Returns the names of all registered rules
Checks if the engine has a registered rule with the given NAME.
Connects the rule NAME to the action ACTION.
Returns a list of names matching the rules in the order they'll be evaluated.
Sets which order the rules should be evaluated. The list should be the names of the rules.
To install VS::RuleEngine, copy and paste the appropriate command in to your terminal.
cpanm
cpanm VS::RuleEngine
CPAN shell
perl -MCPAN -e shell install VS::RuleEngine
For more information on module installation, please visit the detailed CPAN module installation guide.