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::EXIT ) {
105 entryDependencies.insert(input);
107 if ( restrictions.back()->scope != Restriction::Scope::ENTRY ) {
108 exitDependencies.insert(input);
118 for (
auto& restriction : extensionElements->restrictions ) {
119 for (
auto input : restriction->expression.inputs ) {
128 ancestor = child->parent;
136 if ( status->get().operators.has_value() ) {
137 assert( !baseElement->is<XML::bpmn::tProcess>() );
139 !baseElement->is<XML::bpmn::tSubProcess>() ||
140 !baseElement->is<XML::bpmn::tSubProcess>()->triggeredByEvent.has_value() ||
141 (bool)baseElement->is<XML::bpmn::tSubProcess>()->triggeredByEvent.value().get().value
144 for ( XML::bpmnos::tOperator& operator_ : status->get().operators.value().get().operator_ ) {
146 operators.push_back( std::make_unique<Operator>(&operator_,attributeRegistry) );
148 catch ( const std::exception& error ) {
149 throw std::runtime_error(
"ExtensionElements: illegal operator '" + (std::string)operator_.id.value +
"'.\n" + error.what() );
151 auto attribute = operators.back()->attribute;
152 if ( attribute->category == Attribute::Category::STATUS && attribute->index == BPMNOS::Model::ExtensionElements::Index::Timestamp ) {
153 isInstantaneous = false;
155 if ( attribute->category == Attribute::Category::DATA && attribute->index == BPMNOS::Model::ExtensionElements::Index::Instance ) {
156 throw std::runtime_error(
"ExtensionElements: operator '" + (std::string)operator_.id.value +
"' modifies instance attribute.\n" );
159 for ( auto input : operators.back()->expression.inputs ) {
160 operatorDependencies.insert(input);
166 if ( status->get().decisions.has_value() ) {
167 for ( XML::bpmnos::tDecision& decision : status->get().decisions.value().get().decision ) {
169 choices.push_back(std::make_unique<Choice>(&decision,attributeRegistry));
171 catch ( const std::exception& error ) {
172 throw std::runtime_error(
"ExtensionElements: illegal attributes for choice '" + (std::string)decision.id.value +
"'.\n" + error.what());
174 for ( auto input : choices.back()->dependencies ) {
175 choiceDependencies.insert(input);
182 dataUpdate.global =
false;
185 for (
auto& operator_ : operators ) {
187 dataUpdate.attributes.push_back(operator_->attribute);
190 dataUpdate.global =
true;
195 for (
auto& choice : choices ) {
197 dataUpdate.attributes.push_back(choice->attribute);
200 dataUpdate.global =
true;
206 for ( XML::bpmnos::tMessage& message : element->getOptionalChild<XML::bpmnos::tMessages>()->get().message ) {
207 messageDefinitions.push_back(std::make_unique<MessageDefinition>(&message,attributeRegistry));
211 messageDefinitions.push_back(std::make_unique<MessageDefinition>(&message->get(),attributeRegistry));
216 for ( auto& messageDefinition : messageDefinitions ) {
217 for ( auto& [key,content] : messageDefinition->contentMap ) {
218 Attribute* attribute = content->attribute;
219 if ( attribute->category == Attribute::Category::DATA ) {
220 dataUpdate.attributes.push_back(attribute);
228 for ( XML::bpmnos::tParameter& parameter : element->getOptionalChild<XML::bpmnos::tLoopCharacteristics>()->get().parameter ) {
229 if ( parameter.name.value.value ==
"cardinality" ) {
230 loopCardinality = std::make_unique<Parameter>(¶meter,attributeRegistry);
232 else if ( parameter.name.value.value ==
"index" ) {
233 loopIndex = std::make_unique<Parameter>(¶meter,attributeRegistry);
235 else if ( parameter.name.value.value ==
"condition" ) {
236 loopCondition = std::make_unique<Parameter>(¶meter,attributeRegistry);
238 else if ( parameter.name.value.value ==
"maximum" ) {
239 loopMaximum = std::make_unique<Parameter>(¶meter,attributeRegistry);
245 hasSequentialPerformer = BPMNOS::Model::Model::hasSequentialPerformer( process->resourceRole );
248 hasSequentialPerformer = BPMNOS::Model::Model::hasSequentialPerformer( activity->resourceRole );
253 auto guidance = std::make_unique<Guidance>(&item,attributeRegistry);
254 if ( guidance->type == Guidance::Type::Entry ) {
255 entryGuidance = std::move(guidance);
258 exitGuidance = std::move(guidance);
261 choiceGuidance = std::move(guidance);
264 messageDeliveryGuidance = std::move(guidance);