bpmn++
A BPMN parser library, written in C++
Loading...
Searching...
No Matches
BoundaryEvent.cpp
Go to the documentation of this file.
1#include "BoundaryEvent.h"
2
3using namespace BPMN;
4
6 : Node(boundaryEvent)
7 , FlowNode(boundaryEvent,parent)
8 , CatchEvent(boundaryEvent,parent)
9 , isInterrupting(element->get<XML::bpmn::tBoundaryEvent>()->cancelActivity.has_value() ? (bool)element->get<XML::bpmn::tBoundaryEvent>()->cancelActivity.value().get().value : true)
10 , attachedTo(resolveReference())
11{
12}
13
15 const std::string& reference = element->get<XML::bpmn::tBoundaryEvent>()->attachedToRef.value;
16 for ( auto& sibling : parent->flowNodes ) {
17 if ( sibling->id == reference ) {
18 Activity* activity = sibling->as<Activity>();
19 activity->boundaryEvents.push_back(this);
20 return activity;
21 }
22 }
23 throw std::runtime_error("BoundaryEvent: cannot resolve reference '" + reference + "' for boundary event '" + id + "'");
24}
25
std::vector< BoundaryEvent * > boundaryEvents
Definition Activity.h:20
Activity * resolveReference()
BoundaryEvent(XML::bpmn::tBoundaryEvent *boundaryEvent, Scope *parent)
XML::bpmn::tCatchEvent * element
Definition CatchEvent.h:16
Scope * parent
Reference to the parent node.
Definition ChildNode.h:46
T * as()
Casts the element to the specified type T.
Definition Element.h:38
Base class for BPMN elements that may contain incoming and outgoing sequence flows.
Definition FlowNode.h:20
Base class for all nodes in a BPMN model.
Definition Node.h:24
Base class for BPMN elements that may contain a ChildNode elements.
Definition Scope.h:24
std::vector< FlowNode * > flowNodes
Vector containing pointers to all flow nodes within the scope of the nodes.
Definition Scope.h:33
T * get()
Attempt to cast the current instance to the specified type T.
Definition XMLObject.h:171
The BPMN namespace contains linked classes representing a BPMN model.
The XML namespace contains classes representing XML-nodes defined in given XML-schema(s).
Definition XMLObject.cpp:9