README-work
Raku DSL::FiniteStateMachines
In brief
This repository is for a Raku package with class definitions and functions for creation of Finite State Machines (FSMs) and their execution.
Usage example (Address book)
Here we load the definition of the class AddressBookCaller
(provided by this package)
and related entities package,
"DSL::Entity::AddressBook":
use DSL::FiniteStateMachines::AddressBookCaller;
use DSL::Entity::AddressBook;
use DSL::Entity::AddressBook::ResourceAccess;
Here we obtain a resource object to access a (particular) address book:
my $resourceObj = DSL::Entity::AddressBook::resource-access-object();
Here we create the FSM:
my DSL::FiniteStateMachines::AddressBookCaller $abcFSM .= new;
$abcFSM.make-machine(($resourceObj,));
Here is how the dataset of the create FSM looks like:
.say for $abcFSM.dataset.pick(3);
For an interactive execution of the FSM we use the command:
#$abcFSM.run('WaitForCallCommand');
Here we run the FSM with a sequence of commands:
$abcFSM.run('WaitForCallCommand',
["call an actor from LOTR", "",
"take last three", "",
"take the second", "", "",
"2", "5", "",
"quit"]);
Object Oriented Design
Here is the Unified Modeling Language (UML) diagram corresponding to the classes in this package:
image izef_dsl_finitestatemachines_raku_dsl_finitestatemachines_docs_uml_class_diagram_png not found
(The UML spec was automatically generated with "UML::Translators", [AAp5].)
References
Packages
[AAp1] Anton Antonov, DSL::Shared Raku package, (2020), GitHub/antononcube.
[AAp2] Anton Antonov, DSL::Entity::Metadata Raku package, (2021), GitHub/antononcube.
[AAp3] Anton Antonov, DSL::English::DataAcquisitionWorkflows Raku package, (2021), GitHub/antononcube.
[AAp4] Anton Antonov, [DSL::Entity::AddressBook Raku package](https://github.com/antononcube/Raku-DSL-Entity-AddressBook, (2023), GitHub/antononcube.
[AAp5] Anton Antonov, [UML::Translators Raku package](https://github.com/antononcube/Raku-UML-Translators, (2021), GitHub/antononcube.
Videos
[AAv1] Anton Antonov, "Multi-language Data Wrangling and Acquisition Conversational Agents (in Raku)", (2021), YouTube.com.