BPMN-OS
BPMN for optimization and simulation
Loading...
Searching...
No Matches
BPMNOS::Execution::Token Class Reference

Represents a token running through a (sub)process. More...

Detailed Description

The Token class is used to represent tokens running through the execution flow of a (sub)process. The execution logic is documented in section Execution logic.

Note
All tokens can be WITHDRAWN at any time, e.g., when the respective state machine terminates.
It is assumed that XML::bpmn::tCompensateEventDefinition::waitForCompletion is true.
It is assumed that XML::bpmn::tAdHocSubProcess::ordering is Sequential.

Definition at line 35 of file Token.h.

#include <Token.h>

Inheritance diagram for BPMNOS::Execution::Token:

Public Types

enum class  State {
  CREATED , READY , ENTERED , BUSY ,
  COMPLETED , EXITING , DEPARTED , ARRIVED ,
  WAITING , DONE , FAILED , FAILING ,
  WITHDRAWN
}
 
- Public Types inherited from BPMNOS::Execution::Observable
enum class  Type {
  Token , Message , SequentialPerformerUpdate , Event ,
  DataUpdate , EntryRequest , ChoiceRequest , ExitRequest ,
  MessageDeliveryRequest , Count
}
 

Public Member Functions

constexpr Type getObservableType () const override
 
const BPMNOS::Model::AttributeRegistrygetAttributeRegistry () const
 
 Token (const StateMachine *owner, const BPMN::FlowNode *node, const Values &status)
 
 Token (const Token *other)
 
 Token (const std::vector< Token * > &others)
 
 ~Token ()
 
void setStatus (const BPMNOS::Values &other)
 Copies all elements except the instance id from other to status
 
bool ready () const
 
bool entered () const
 
bool busy () const
 
bool completed () const
 
bool arrived () const
 
bool waiting () const
 
bool done () const
 
bool failed () const
 
nlohmann::ordered_json jsonify () const
 
- Public Member Functions inherited from BPMNOS::Execution::Observable
 ~Observable ()
 

Public Attributes

const StateMachineowner
 State machine owning the token.
 
std::shared_ptr< StateMachineowned
 State machine owned by the token.
 
const BPMN::FlowNodenode
 
const BPMN::SequenceFlowsequenceFlow
 
State state
 
Values status
 
SharedValuesdata
 Pointer to the data of the owner or owned state machine subprocesses)
 
Valuesglobals
 
std::shared_ptr< DecisionRequestdecisionRequest
 
Tokenperforming
 Pointer to the activity token currently performed (only applies if node is a performer referenced by sequential ad-hoc subprocesses)
 
auto_list< std::weak_ptr< Token > > pendingSequentialEntries
 List of tokens awaiting an activity entry (only applies if node is a performer referenced by sequential ad-hoc subprocesses)
 

Static Public Attributes

static std::string stateName [] = { "CREATED", "READY", "ENTERED", "BUSY", "COMPLETED", "EXITING", "DEPARTED", "ARRIVED", "WAITING", "DONE", "FAILED", "FAILING", "WITHDRAWN" }
 

Friends

class SystemState
 
class StateMachine
 
class Engine
 
class ConditionalEventObserver
 

Member Enumeration Documentation

◆ State

Enumerator
CREATED 
READY 
ENTERED 
BUSY 
COMPLETED 
EXITING 
DEPARTED 
ARRIVED 
WAITING 
DONE 
FAILED 
FAILING 
WITHDRAWN 

Definition at line 48 of file Token.h.

Constructor & Destructor Documentation

◆ Token() [1/3]

Token::Token ( const StateMachine * owner,
const BPMN::FlowNode * node,
const Values & status )

Definition at line 22 of file Token.cpp.

◆ Token() [2/3]

Token::Token ( const Token * other)

Definition at line 35 of file Token.cpp.

◆ Token() [3/3]

Token::Token ( const std::vector< Token * > & others)

Definition at line 48 of file Token.cpp.

◆ ~Token()

Token::~Token ( )

Definition at line 61 of file Token.cpp.

Member Function Documentation

◆ arrived()

bool BPMNOS::Execution::Token::arrived ( ) const
inline

Definition at line 70 of file Token.h.

◆ busy()

bool BPMNOS::Execution::Token::busy ( ) const
inline

Definition at line 68 of file Token.h.

◆ completed()

bool BPMNOS::Execution::Token::completed ( ) const
inline

Definition at line 69 of file Token.h.

◆ done()

bool BPMNOS::Execution::Token::done ( ) const
inline

Definition at line 72 of file Token.h.

◆ entered()

bool BPMNOS::Execution::Token::entered ( ) const
inline

Definition at line 67 of file Token.h.

◆ failed()

bool BPMNOS::Execution::Token::failed ( ) const
inline

Definition at line 73 of file Token.h.

◆ getAttributeRegistry()

const BPMNOS::Model::AttributeRegistry & Token::getAttributeRegistry ( ) const

Definition at line 139 of file Token.cpp.

◆ getObservableType()

Type BPMNOS::Execution::Token::getObservableType ( ) const
inlineconstexproverridevirtual

Implements BPMNOS::Execution::Observable.

Definition at line 43 of file Token.h.

◆ jsonify()

nlohmann::ordered_json Token::jsonify ( ) const

Definition at line 162 of file Token.cpp.

◆ ready()

bool BPMNOS::Execution::Token::ready ( ) const
inline

Definition at line 66 of file Token.h.

◆ setStatus()

void Token::setStatus ( const BPMNOS::Values & other)

Definition at line 156 of file Token.cpp.

◆ waiting()

bool BPMNOS::Execution::Token::waiting ( ) const
inline

Definition at line 71 of file Token.h.

Friends And Related Symbol Documentation

◆ ConditionalEventObserver

friend class ConditionalEventObserver
friend

Definition at line 40 of file Token.h.

◆ Engine

friend class Engine
friend

Definition at line 39 of file Token.h.

◆ StateMachine

friend class StateMachine
friend

Definition at line 38 of file Token.h.

◆ SystemState

friend class SystemState
friend

Definition at line 37 of file Token.h.

Member Data Documentation

◆ data

SharedValues* BPMNOS::Execution::Token::data

Definition at line 58 of file Token.h.

◆ decisionRequest

std::shared_ptr<DecisionRequest> BPMNOS::Execution::Token::decisionRequest

Definition at line 60 of file Token.h.

◆ globals

Values& BPMNOS::Execution::Token::globals

Definition at line 59 of file Token.h.

◆ node

const BPMN::FlowNode* BPMNOS::Execution::Token::node

Definition at line 46 of file Token.h.

◆ owned

std::shared_ptr<StateMachine> BPMNOS::Execution::Token::owned

Definition at line 45 of file Token.h.

◆ owner

const StateMachine* BPMNOS::Execution::Token::owner

Definition at line 44 of file Token.h.

◆ pendingSequentialEntries

auto_list< std::weak_ptr<Token> > BPMNOS::Execution::Token::pendingSequentialEntries

Definition at line 62 of file Token.h.

◆ performing

Token* BPMNOS::Execution::Token::performing

Definition at line 61 of file Token.h.

◆ sequenceFlow

const BPMN::SequenceFlow* BPMNOS::Execution::Token::sequenceFlow

Definition at line 47 of file Token.h.

◆ state

State BPMNOS::Execution::Token::state

Definition at line 56 of file Token.h.

◆ stateName

std::string BPMNOS::Execution::Token::stateName[] = { "CREATED", "READY", "ENTERED", "BUSY", "COMPLETED", "EXITING", "DEPARTED", "ARRIVED", "WAITING", "DONE", "FAILED", "FAILING", "WITHDRAWN" }
inlinestatic

Definition at line 50 of file Token.h.

◆ status

Values BPMNOS::Execution::Token::status

Definition at line 57 of file Token.h.


The documentation for this class was generated from the following files: