bpmn++
A BPMN parser library, written in C++
Loading...
Searching...
No Matches
Activity.cpp
Go to the documentation of this file.
1#include "Activity.h"
5
6using namespace BPMN;
7
9 : Node(activity)
10 , FlowNode(activity,parent)
11 , compensatedBy(nullptr)
12 , isForCompensation(activity->isForCompensation.has_value() && activity->isForCompensation.value().get().value)
13 , element(activity)
14{
15 auto marker = activity->getChildren<XML::bpmn::tLoopCharacteristics>();
16 if ( !marker.empty() ) {
17 if ( marker[0].get().is<XML::bpmn::tStandardLoopCharacteristics>() ) {
18 loopCharacteristics = LoopCharacteristics::Standard;
19 }
20 else if ( auto multiInstanceMarker = marker[0].get().is<XML::bpmn::tMultiInstanceLoopCharacteristics>() ) {
21 if ( multiInstanceMarker->isSequential.has_value() &&
22 (bool)multiInstanceMarker->isSequential.value().get().value
23 ) {
25 }
26 else {
28 }
29 }
30 else {
31 throw std::logic_error("Activity: Failed determining loop characteristics for activity '" + activity->id.value().get().value.value + "'");
32 }
33 }
34}
35
Activity(XML::bpmn::tActivity *activity, Scope *parent)
Definition Activity.cpp:8
XML::bpmn::tActivity * element
Definition Activity.h:26
Node * compensatedBy
Pointer to compensation activity or compensation event sub-process.
Definition Activity.h:21
bool isForCompensation
Definition Activity.h:22
std::optional< LoopCharacteristics > loopCharacteristics
Definition Activity.h:24
T * is()
Attempts to return the element in the specified type T.
Definition BaseElement.h:38
T * get()
Casts the element to the specified type T.
Definition BaseElement.h:55
Scope * parent
Reference to the parent node.
Definition ChildNode.h:46
FlowNode(XML::bpmn::tFlowNode *flowNode, Scope *parent)
Definition FlowNode.cpp:7
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
auto getChildren(this Self &&self)
Get all children of type T.
Definition XMLObject.h:283
std::optional< std::reference_wrapper< Attribute > > id
Attribute value can be expected to be of type 'std::string'.
The BPMN namespace contains linked classes representing a BPMN model.