NAME
PNI::Scenario - is a set of nodes connected by edges
METHODS
add_edge
add_node
Adds a new node, given a PNI node type. PNI::Scenario checks if PNI node type is valid, then initializes it.
# if arg type is not provided, creates a dummy node:
my $dummy_node = $scenario->add_node;
# it can be useful for tests, and you can also decorate it later.
# suppose 'Foo::Bar' is a valid PNI node type,
# this creates a PNI::Node::Foo::Bar.
my $node_foo = $scenario->add_node( type => 'Foo::Bar' );
# an additional inputs => {} arg, is used to set node inputs data
# before running the first node task.
$node = $scenario->add_node(
type => 'Perlfunc::Print',
inputs => {
list => [ 'Hello World!' ],
do_print => 1,
}
);