24 , attributeRegistry(attributeRegistry_)
26 , hasSequentialPerformer(false)
27 , isInstantaneous(true)
35 if ( status->get().attributes.has_value() ) {
42 for (
size_t index = 0; index <
attributes.size(); index ++) {
51 for (
size_t index = 0; index <
attributes.size(); index ++) {
60 for (
size_t index = 0; index <
attributes.size(); index ++) {
67 if ( attribute->expression ) {
68 for (
auto input : attribute->expression->inputs ) {
83 if (
data.back()->expression ) {
84 for (
auto input :
data.back()->expression->inputs ) {
94 if ( status->get().restrictions.has_value() ) {
95 for ( XML::bpmnos::tRestriction& restriction : status->get().restrictions.value().get().restriction ) {
97 restrictions.push_back(std::make_unique<Restriction>(&restriction,attributeRegistry));
99 catch ( const std::exception& error ) {
100 throw std::runtime_error(
"ExtensionElements: illegal restriction '" + (std::string)restriction.id.value +
"'.\n" + error.what());
103 for ( auto input : restrictions.back()->expression.inputs ) {
104 if ( restrictions.back()->scope == Restriction::Scope::ENTRY ) {
105 entryDependencies.insert(input);
107 else if ( restrictions.back()->scope == Restriction::Scope::COMPLETION ) {
108 completionDependencies.insert(input);
110 else if ( restrictions.back()->scope == Restriction::Scope::EXIT ) {
111 exitDependencies.insert(input);
115 entryDependencies.insert(input);
116 completionDependencies.insert(input);
117 exitDependencies.insert(input);
127 for (
auto& restriction : extensionElements->restrictions ) {
128 for (
auto input : restriction->expression.inputs ) {
138 ancestor = child->parent;
146 if ( status->get().operators.has_value() ) {
147 assert( !baseElement->is<XML::bpmn::tProcess>() );
149 !baseElement->is<XML::bpmn::tSubProcess>() ||
150 !baseElement->is<XML::bpmn::tSubProcess>()->triggeredByEvent.has_value() ||
151 (bool)baseElement->is<XML::bpmn::tSubProcess>()->triggeredByEvent.value().get().value
154 for ( XML::bpmnos::tOperator& operator_ : status->get().operators.value().get().operator_ ) {
156 operators.push_back( std::make_unique<Operator>(&operator_,attributeRegistry) );
158 catch ( const std::exception& error ) {
159 throw std::runtime_error(
"ExtensionElements: illegal operator '" + (std::string)operator_.id.value +
"'.\n" + error.what() );
161 auto attribute = operators.back()->attribute;
162 if ( attribute->category == Attribute::Category::STATUS && attribute->index == BPMNOS::Model::ExtensionElements::Index::Timestamp ) {
163 isInstantaneous = false;
165 if ( attribute->category == Attribute::Category::DATA && attribute->index == BPMNOS::Model::ExtensionElements::Index::Instance ) {
166 throw std::runtime_error(
"ExtensionElements: operator '" + (std::string)operator_.id.value +
"' modifies instance attribute.\n" );
169 for ( auto input : operators.back()->expression.inputs ) {
170 operatorDependencies.insert(input);
176 if ( status->get().decisions.has_value() ) {
177 for ( XML::bpmnos::tDecision& decision : status->get().decisions.value().get().decision ) {
179 choices.push_back(std::make_unique<Choice>(&decision,attributeRegistry));
181 catch ( const std::exception& error ) {
182 throw std::runtime_error(
"ExtensionElements: illegal attributes for choice '" + (std::string)decision.id.value +
"'.\n" + error.what());
184 for ( auto input : choices.back()->dependencies ) {
185 choiceDependencies.insert(input);
192 dataUpdate.global =
false;
195 for (
auto& operator_ : operators ) {
197 dataUpdate.attributes.push_back(operator_->attribute);
200 dataUpdate.global =
true;
205 for (
auto& choice : choices ) {
207 dataUpdate.attributes.push_back(choice->attribute);
210 dataUpdate.global =
true;
216 for ( XML::bpmnos::tMessage& message : element->getOptionalChild<XML::bpmnos::tMessages>()->get().message ) {
217 messageDefinitions.push_back(std::make_unique<MessageDefinition>(&message,attributeRegistry));
221 messageDefinitions.push_back(std::make_unique<MessageDefinition>(&message->get(),attributeRegistry));
226 for ( auto& messageDefinition : messageDefinitions ) {
227 for ( auto& [key,content] : messageDefinition->contentMap ) {
228 Attribute* attribute = content->attribute;
229 if ( attribute->category == Attribute::Category::DATA ) {
230 dataUpdate.attributes.push_back(attribute);
238 for ( XML::bpmnos::tParameter& parameter : element->getOptionalChild<XML::bpmnos::tLoopCharacteristics>()->get().parameter ) {
239 if ( parameter.name.value.value ==
"cardinality" ) {
240 loopCardinality = std::make_unique<Parameter>(¶meter,attributeRegistry);
242 else if ( parameter.name.value.value ==
"index" ) {
243 loopIndex = std::make_unique<Parameter>(¶meter,attributeRegistry);
245 else if ( parameter.name.value.value ==
"condition" ) {
246 loopCondition = std::make_unique<Parameter>(¶meter,attributeRegistry);
248 else if ( parameter.name.value.value ==
"maximum" ) {
249 loopMaximum = std::make_unique<Parameter>(¶meter,attributeRegistry);
255 hasSequentialPerformer = BPMNOS::Model::Model::hasSequentialPerformer( process->resourceRole );
258 hasSequentialPerformer = BPMNOS::Model::Model::hasSequentialPerformer( activity->resourceRole );
263 auto guidance = std::make_unique<Guidance>(&item,attributeRegistry);
264 if ( guidance->type == Guidance::Type::Entry ) {
265 entryGuidance = std::move(guidance);
268 exitGuidance = std::move(guidance);
271 choiceGuidance = std::move(guidance);
274 messageDeliveryGuidance = std::move(guidance);