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

Allow triggers to support child definitions #1074

Merged
merged 2 commits into from
Oct 10, 2022
Merged

Conversation

Pablete1234
Copy link
Member

@Pablete1234 Pablete1234 commented Oct 10, 2022

Upgrades trigger's attributes to properties, meaning they can be used either as attributes or children:

<actions>
  <trigger scope="match">
    <filter>
      <variable var="something">0</variable>
    </filter>
    <action>
      <set var="something" value="1"/>
      <set var="something_else" value="something+5"/>
    </action>
  </trigger>
</actions>

Equivalent to:

<filters>
  <variable id="something-is-0" var="something">0</variable>
</filters>
<actions>
  <action id="set-something-to-1" scope="match">
    <set var="something" value="1"/>
    <set var="something_else" value="something+5"/>
  </action>
  <trigger filter="something-is-0" action="set-something-to-1" scope="match"/>
</action>

In some situations it's better to just inline them than to have different ids for each filter and action

The PR has been tested and works as intended.

@Pablete1234 Pablete1234 added the feature New feature or request label Oct 10, 2022
Signed-off-by: Pablete1234 <[email protected]>
@Electroid Electroid merged commit c563f4b into dev Oct 10, 2022
@Electroid Electroid deleted the trigger-properties branch October 10, 2022 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Development

Successfully merging this pull request may close these issues.

2 participants