1#ifndef BPMNOS_Execution_Engine_H
2#define BPMNOS_Execution_Engine_H
76 : function(
std::move(f)) {};
79 : function(
std::move(f))
80 , stateMachine_ptr(stateMachine->weak_from_this()) {};
83 : function(
std::move(f))
84 , stateMachine_ptr(const_cast<
StateMachine*>(token->owner)->weak_from_this())
85 , token_ptr(token->weak_from_this()) {};
89 std::function<void()> function;
90 std::optional< std::weak_ptr<StateMachine> > stateMachine_ptr;
91 std::optional< std::weak_ptr<Token> > token_ptr;
Class storing a command to be executed by the engine.
Command(std::function< void()> &&f, StateMachine *stateMachine)
Command(std::function< void()> &&f, Token *token)
Command(std::function< void()> &&f)
ReadyHandler readyHandler
void process(const ReadyEvent *event)
void deleteInstance(StateMachine *instance)
Method removing completed instance.
BPMNOS::number clockTick
Timestep used to advance the current time by systemState.time += clockTick.
ConditionalEventObserver conditionalEventObserver
BPMNOS::number run(const BPMNOS::Model::Scenario *scenario, BPMNOS::number timeout=std::numeric_limits< BPMNOS::number >::max())
Runs a scenario as long as there is a token or new instantiations. Terminates when the time if the sy...
std::unique_ptr< SystemState > systemState
TaskCompletionHandler taskCompletionHandler
std::list< Command > commands
List of commands to be executed.
const SystemState * getSystemState()
Returns a pointer to the system state.
BPMNOS::number getCurrentTime()
Returns the timestamp the engine is in.
void addInstances()
Method adding all new instances and advancing tokens as much as possible.
ScenarioUpdater scenarioUpdater
Class dispatching a ready event when the required data is available for a token at an activity.
Observer that updates scenario state during execution.
Represents a state machine for BPMN execution of a scope in the model.
A class representing the state that the execution or simulation of a given scenario is in.
EventDispatcher for task completion events.
Represents a token running through a (sub)process.
Abstract base class for scenarios holding data for all BPMN instances.
BPMNOS_NUMBER_TYPE number
Represents the event that choices are made for a DecisionTask.
Represents an event that increments the current time.
Class representing the event of a token having completed an activity.
Represents the event of a token entering a node.
Represents the event of an error being raised.
Represents the event of a token exiting a node.
Represents the event of a message from the message pool being delivered.
Represents the event of a token ready to enter a node inclduing necressary new attribute data.
Represents an event causing the engine to terminate.