BPMN-OS
BPMN for optimization and simulation
Loading...
Searching...
No Matches
ReadyEvent.cpp
Go to the documentation of this file.
1#include "ReadyEvent.h"
3
4using namespace BPMNOS::Execution;
5
6ReadyEvent::ReadyEvent(const Token* token, BPMNOS::Values statusAttributes, BPMNOS::Values dataAttributes)
7 : Event(token)
8 , statusAttributes(statusAttributes)
9 , dataAttributes(dataAttributes)
10{
11}
12
13void ReadyEvent::processBy(Engine* engine) const {
14 engine->process(this);
15}
16
17nlohmann::ordered_json ReadyEvent::jsonify() const {
18 nlohmann::ordered_json jsonObject;
19
20 jsonObject["event"] = "ready";
21 jsonObject["processId"] = token->owner->process->id;
22 jsonObject["instanceId"] = BPMNOS::to_string((*token->data)[BPMNOS::Model::ExtensionElements::Index::Instance].get().value(),STRING);
23 jsonObject["nodeId"] = token->node->id;
24
25 return jsonObject;
26}
void process(const ReadyEvent *event)
Definition Engine.cpp:129
const BPMN::Process * process
Pointer to the top-level process.
Represents a token running through a (sub)process.
Definition Token.h:35
const BPMN::FlowNode * node
Definition Token.h:46
const StateMachine * owner
State machine owning the token.
Definition Token.h:44
SharedValues * data
Pointer to the data of the owner or owned state machine subprocesses)
Definition Token.h:58
std::string id
Id of element.
Definition bpmn++.h:16298
std::string to_string(number numericValue, const ValueType &type)
Converts a number to a string.
Definition Number.cpp:150
@ STRING
Definition Value.h:9
const Token * token
Definition Event.h:18
nlohmann::ordered_json jsonify() const override
void processBy(Engine *engine) const override
ReadyEvent(const Token *token, BPMNOS::Values statusAttributes, BPMNOS::Values dataAttributes)
Definition ReadyEvent.cpp:6