1#ifndef BPMNOS_Execution_FlattenedGraph_H
2#define BPMNOS_Execution_FlattenedGraph_H
4#include <unordered_map>
8#include <unordered_set>
10#include <nlohmann/json.hpp>
27 nlohmann::ordered_json
jsonify()
const;
46 std::optional< std::pair<Vertex*, Vertex*> >
parent;
47 std::vector< std::pair<const BPMN::SequenceFlow*, Vertex*> >
inflows;
48 std::vector< std::pair<const BPMN::SequenceFlow*, Vertex*> >
outflows;
59 nlohmann::ordered_json
jsonify()
const;
68 std::vector< std::unique_ptr<Vertex> >
vertices;
69 std::unordered_set< const Vertex* >
dummies;
72 std::unordered_map< const BPMN::Node*, std::vector< const BPMNOS::Model::Attribute* > >
loopIndexAttributes;
81 std::pair<Vertex*, Vertex*> createVertexPair(
BPMNOS::number rootId,
BPMNOS::number instanceId, std::vector< size_t > loopIndices,
const BPMN::Node* node, std::optional< std::pair<Vertex*, Vertex*> > parent);
85 std::vector< std::tuple<const BPMN::EventSubProcess*, Vertex*, Vertex*, unsigned int, Vertex*> > nonInterruptingEventSubProcesses;
86 std::unordered_map<const BPMN::FlowNode*, std::vector< std::pair<Vertex*, Vertex*> > > sendingVertices;
87 std::unordered_map<const BPMN::FlowNode*, std::vector< std::pair<Vertex*, Vertex*> > > receivingVertices;
90 std::unordered_map<const Vertex*, std::vector< std::pair<const Vertex*, const Vertex*> > >
sequentialActivities;
91 std::unordered_map<const Vertex*, std::vector< std::pair<const Vertex*, const Vertex*> > >
dataModifiers;
std::pair< const Vertex *, const Vertex * > dataOwner(const BPMNOS::Model::Attribute *attribute) const
Returns the index of the data owner of an attribute.
std::vector< std::pair< const BPMN::SequenceFlow *, Vertex * > > outflows
Container holding vertices connecting by an incoming sequence flow, for loop activities the sequence ...
std::vector< Vertex * > senders
Container holding successors according to the execution logic (excl. sequence flows)
std::vector< Vertex * > successors
Container holding predecessors according to the execution logic (excl. sequence flows)
nlohmann::ordered_json jsonify() const
Returns a reference of the vertex excluding the type.
std::vector< std::pair< const BPMN::SequenceFlow *, Vertex * > > inflows
Parent vertices.
Vertex(const Vertex &)=delete
Vertex & operator=(Vertex &&)=delete
Vertex & operator=(const Vertex &)=delete
size_t dataOwnerIndex(const BPMNOS::Model::Attribute *attribute) const
Returns the entry vertex of the performer of a sequential activity vertex.
std::string shortReference() const
Returns a unique reference of the vertex.
std::vector< Vertex * > predecessors
Container holding vertices connecting by an outgoing sequence flow, for loop activities the sequence ...
const Vertex * performer() const
Container holding all entry vertices of nodes owning at least one data attribute.
std::optional< std::pair< Vertex *, Vertex * > > parent
std::vector< Vertex * > recipients
Container holding all possible vertices sending a message (or the message delivery notification for a...
const std::vector< size_t > loopIndices
std::vector< Vertex * > dataOwners
Container holding all possible vertices receiving a message (or the message delivery notification for...
std::string reference() const
Returns the vertices of the owner of a data attribute.
const BPMNOS::number rootId
const BPMNOS::number instanceId
Represents a graph containing all BPMN nodes that may receive a token during execution of a scenario.
void addInstance(const BPMNOS::Model::Scenario::InstanceData *instance)
Map holding entry and exit vertices of each possible instantiation of a node.
nlohmann::ordered_json jsonify() const
std::unordered_set< const Vertex * > dummies
Container holding entry and exit vertices of each possible instantiation of a node.
const Vertex * getVertex(const Token *token) const
Method returning true if the vertex modifies a global attribute.
const BPMNOS::Model::Attribute * getLoopIndexAttribute(const BPMN::Activity *activity) const
Container holding dummy vertices for loop & multi-instance activities.
const BPMNOS::Model::Scenario * scenario
const Vertex * exit(const Vertex *vertex) const
std::vector< const Vertex * > sortVertices() const
Container holding entry vertices of all process instances.
const Vertex * entry(const Vertex *vertex) const
std::vector< std::pair< const Vertex *, const Vertex * > > globalModifiers
Container allowing to look up vertices of tasks modifying data attributes given a pointer to the entr...
std::vector< const Vertex * > initialVertices
std::unordered_map< const Vertex *, std::vector< std::pair< const Vertex *, const Vertex * > > > sequentialActivities
tuple_map< std::tuple< BPMNOS::number, std::vector< size_t >, const BPMN::Node * >, std::pair< Vertex *, Vertex * > > vertexMap
bool modifiesGlobals(const Vertex *vertex) const
Method returning true if the vertex modifies a data attribute of the given owner.
std::unordered_map< const Vertex *, std::vector< std::pair< const Vertex *, const Vertex * > > > dataModifiers
Container allowing to look up vertices of sequential activities given a pointer to the entry vertex o...
std::unordered_map< const BPMN::Node *, std::vector< const BPMNOS::Model::Attribute * > > loopIndexAttributes
bool modifiesData(const Vertex *vertex, const Vertex *dataOwner) const
Container holding vertices of tasks modifying global attributes.
std::vector< std::unique_ptr< Vertex > > vertices
Returns a topologically sorted vector of all vertices reachable from the initial vertices.
FlattenedGraph(const BPMNOS::Model::Scenario *scenario)
Represents a token running through a (sub)process.
Abstract base class for scenarios holding data for all BPMN instances.
Wrapper class around std::unordered_map for maps with tuple keys.
T * represents()
Attempts to cast the element to the specified type T.
Base class for all nodes in a BPMN model.
Base class for BPMN elements that may contain a ChildNode elements.
BPMNOS_NUMBER_TYPE number