BPMN-OS
BPMN for optimization and simulation
Loading...
Searching...
No Matches
SequentialAdHocSubProcess.cpp
Go to the documentation of this file.
2#include "Model.h"
3
4using namespace BPMNOS::Model;
5
7 : BPMN::Node(adHocSubProcess)
8 , BPMN::FlowNode(adHocSubProcess,parent)
9 , BPMN::AdHocSubProcess(adHocSubProcess,parent)
10 , performer(this)
11{
12 if ( !isSequential ) {
13 throw std::runtime_error("SequentialAdHocSubProcess: ordering not set to 'Sequential'");
14 }
15
16 // determine sequential performer
17 BPMN::Node* node = this;
18 while ( node->represents<BPMN::ChildNode>() ) {
19 if ( auto activity = node->represents<BPMN::Activity>() ) {
20 if ( BPMNOS::Model::Model::hasSequentialPerformer( activity->element->resourceRole ) ) {
21 performer = activity;
22 break;
23 }
24 }
25 node = node->as<BPMN::ChildNode>()->parent;
27 // sequential performer of adhoc subprocess must be found before other adhoc subprocess
28 break;
29 }
30 }
31
32 if ( auto process = node->represents<BPMN::Process>() ) {
33 if ( BPMNOS::Model::Model::hasSequentialPerformer( process->element->resourceRole ) ) {
34 performer = process;
35 }
36 }
37}
38
Class representing adhoc subprocesses with sequential ordering.
SequentialAdHocSubProcess(XML::bpmn::tAdHocSubProcess *adHocsubProcess, BPMN::Scope *parent)
Base class for BPMN elements within a Scope.
Definition bpmn++.h:16562
Scope * parent
Reference to the parent node.
Definition bpmn++.h:16568
T * as()
Casts the element to the specified type T.
Definition bpmn++.h:16253
T * represents()
Attempts to cast the element to the specified type T.
Definition bpmn++.h:16236
Base class for all nodes in a BPMN model.
Definition bpmn++.h:16444
Base class for BPMN elements that may contain a ChildNode elements.
Definition bpmn++.h:16510
The BPMN namespace contains linked classes representing a BPMN model.
Definition bpmn++.h:16221