metomi / rose

:rose: Rose is a toolkit for writing, editing and running application configurations.
https://metomi.github.io/rose/
GNU General Public License v3.0
56 stars 53 forks source link

metadata: cascading triggers #2107

Open dvalters opened 7 years ago

dvalters commented 7 years ago

A bug reported by a user via email, I believe the supplied working example from the user correctly reproduces the issue, though a second pair of eyes might confirm this.

Say I have an item B which is triggered off both A1 and A2. Item B in turn triggers item C. If I change the value of A1 or A2 so that B is 'half-triggered', i.e. one of the conditions has been met but the other hasn't, then C will become active, even though B is not. This is most obvious if B and C are in a different panel to A1 and A2; in that case the second panel becomes visible even though it should be hidden.

At this point if I reload the metadata it will register as an error, although strangely just running the standard check doesn't complain at all, even though it's clearly wrong.

# rose-app.conf
[namelist:nml]
a1=2
a2=3
!!b=10
!!c=100
# rose-meta.conf
[namelist:nml]

[namelist:nml=a1]
compulsory=true
ns=panel1
trigger=namelist:nml=b: 2;
values=1,2

[namelist:nml=a2]
compulsory=true
ns=panel1
trigger=namelist:nml=b: 4;
values=3,4

[namelist:nml=b]
compulsory=true
trigger=namelist:nml=c: 10;
ns=panel2
values=10,20

[namelist:nml=c]
compulsory=true
ns=panel2
values=100,200
dvalters commented 7 years ago

E.g with the above metadata: cascade1