Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify complex exclusive scenarios for OnEvents #594

Closed

Conversation

ricardozanini
Copy link
Member

Signed-off-by: Ricardo Zanini zanini@redhat.com

Many thanks for submitting your Pull Request ❤️!

Please specify parts of this PR updates:

  • Specification
  • Schema
  • Examples
  • Extensions
  • Roadmap
  • Use Cases
  • Community
  • TCK
  • Other

What this PR does / why we need it:
The Event state exclusive attribute had some margin for interpretation. This PR adds a more complex example to clarify such a scenario.

Additional information (if needed):
I understand that the exclusive property should be moved to the OnEvent definition. This way, the user could fine-tune their event consumption.

Right now, what we have is:

# exclusive = false
(eventA and eventB) and (eventC and eventD)

# exclusive = true
(eventA or eventB) and (eventC or eventD)

I'm assuming that we want that all the actions defined in the eventRefs definition should be consumed to transition the state.

Having the exclusive property defined on OnEvents, we would have:

# OnEvents: exclusive = false and exclusive = false
(eventA and eventB) and (eventC and eventD)

# OnEvents: exclusive = true and exclusive = true
(eventA or eventB) and (eventC or eventD)

# OnEvents: exclusive = true and exclusive = false
(eventA or eventB) and (eventC and eventD)

# OnEvents: exclusive = false and exclusive = true
(eventA and eventB) and (eventC or eventD)

Thus, a more controlled definition of how the events should be consumed.

I can propose a PR adding this modification if we agree with that.

Additionally, we could also control if all the actions should be executed to transition to the next state or not. This new property could be in the Event state definition to replace the exclusive attribute. This way, we would also have this possibility:

# OnEvents: exclusive = false and exclusive = false
(eventA and eventB) or (eventC and eventD) 

# OnEvents: exclusive = true and exclusive = true
(eventA or eventB) or (eventC or eventD)

# OnEvents: exclusive = true and exclusive = false
(eventA or eventB) or (eventC and eventD)

# OnEvents: exclusive = false and exclusive = true
(eventA and eventB) or (eventC or eventD)

Cheers!

Signed-off-by: Ricardo Zanini <zanini@redhat.com>
@tsurdilo
Copy link
Contributor

thanks! will look.
there is also related discussion on this: #581

@tsurdilo tsurdilo added the change: documentation Improvements or additions to documentation. It won't impact a version change. label Feb 23, 2022
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@ricardozanini
Copy link
Member Author

I'm closing this one in favor of the discussion we had a couple of weeks ago regarding the depreciation way we define start up events.

@ricardozanini ricardozanini deleted the clarify-exclusive branch April 14, 2022 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change: documentation Improvements or additions to documentation. It won't impact a version change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants