BPMN-OS
BPMN for optimization and simulation
Loading...
Searching...
No Matches
Choice.h
Go to the documentation of this file.
1#ifndef BPMNOS_Model_Choice_H
2#define BPMNOS_Model_Choice_H
3
4#include <memory>
5#include <vector>
6#include <variant>
7#include <string>
8#include <bpmn++.h>
10#include "Attribute.h"
11#include "Expression.h"
12#include "AttributeRegistry.h"
13
14namespace BPMNOS::Model {
15
16/**
17 * @brief Class representing a choice to be made within a @ref BPMNOS::Model::DecisionTask.
18 *
19 * The choice to be made may be restricted through @ref BPMNOS::Model::Restriction "restrictions".
20 */
21class Choice {
22public:
27 std::pair<bool,bool> strictness;
28 std::optional< Expression > lowerBound;
29 std::optional< Expression > upperBound;
30 std::vector< Expression > enumeration;
31 std::set<const Attribute*> dependencies;
32
33 template <typename DataType>
34 std::pair<BPMNOS::number,BPMNOS::number> getBounds(const BPMNOS::Values& status, const DataType& data, const BPMNOS::Values& globals) const; ///< Returns the minimal and maximal value the attribute may take.
35
36 template <typename DataType>
37 std::vector<BPMNOS::number> getEnumeration(const BPMNOS::Values& status, const DataType& data, const BPMNOS::Values& globals) const; ///< Returns the allowed values the attribute may take.
38};
39
40} // namespace BPMNOS::Model
41
42#endif // BPMNOS_Model_Choice_H
Class representing a choice to be made within a BPMNOS::Model::DecisionTask.
Definition Choice.h:21
std::optional< Expression > upperBound
Definition Choice.h:29
std::set< const Attribute * > dependencies
Definition Choice.h:31
Choice(XML::bpmnos::tDecision *decision, const AttributeRegistry &attributeRegistry)
Definition Choice.cpp:10
std::pair< BPMNOS::number, BPMNOS::number > getBounds(const BPMNOS::Values &status, const DataType &data, const BPMNOS::Values &globals) const
Returns the minimal and maximal value the attribute may take.
Definition Choice.cpp:100
std::vector< BPMNOS::number > getEnumeration(const BPMNOS::Values &status, const DataType &data, const BPMNOS::Values &globals) const
Returns the allowed values the attribute may take.
Definition Choice.cpp:125
XML::bpmnos::tDecision * element
Definition Choice.h:24
Attribute * attribute
Definition Choice.h:26
const AttributeRegistry & attributeRegistry
Definition Choice.h:25
std::optional< Expression > lowerBound
Definition Choice.h:28
std::vector< Expression > enumeration
Definition Choice.h:30
std::pair< bool, bool > strictness
Definition Choice.h:27