Open smithdtyler opened 4 years ago
Hi Tyler,
when it comes to memory components, I think the issue is that the error message does not help to understand what is wrong: if you want to use a BA in a memory component, the purpose is to define a state machine for the component's modes. So your states should represent modes and you transitions should represent mode transitions.
when it comes to the devices components, the error is due to the fact the BA plugin did not manage to find that the Dispatch_Protocol property can apply to devices. We should investigate why. This reminded me of #2151 which I experienced some time ago but I was not able to reproduce it.
I have tried to reproduce the issue but that was not fruitful: after performing the two modifications suggested by Tyler in the provided model, I get no error message (none for the memory component, and none for the device component).
@smithdtyler for the memory component, I could add a rule to check there is at least one complete state. I would then improve the error messages to guide towards mode transitions out of this complete state. Is this ok for you?
@lwrage I only tested with OSATE 2.7.0-vfinal (product version) on Linux. The only difference I see with Tyler's environment is the OS (Windows 10). Can you see if you get an error message with the following model? @smithdtyler are there specific steps (e.g. edition/opening/closing the aadl file) to reproduce the issue?
package BehaviorsOnThings
public
abstract tiger
end tiger;
abstract implementation tiger.white_tiger
end tiger.white_tiger;
memory brain
features
hunger_status_in: in data port;
end brain;
-- I am seeing some odd errors/warnings from the behavior annex
-- Sometimes it asks for complete states, other times it says they are not allowed.
memory implementation brain.tiger
annex behavior_specification {**
states
hunting : initial state;
playing : state;
resting : state;
transitions
t1 : hunting -[hunger_status_in=1]-> resting;
t2 : playing -[hunger_status_in=1]-> resting;
t3 : resting -[hunger_status_in=1]-> hunting;
t4 : playing -[hunger_status_in=1]-> hunting;
**};
end brain.tiger;
device mouth
end mouth;
device stomach
features
hunger_status: out data port;
food_in: in event data port;
annex behavior_specification {**
states
hungry : initial state;
not_hungry : complete state;
transitions
t1: hungry -[food_in=1]-> not_hungry;
t2: not_hungry -[on dispatch]-> hungry;
**};
end stomach;
system hobbes
end hobbes;
system implementation hobbes.comic
subcomponents
stomach : device stomach;
brain : memory brain.tiger;
end hobbes.comic;
end BehaviorsOnThings;
@smithdtyler for the memory component, I could add a rule to check there is at least one complete state. I would then improve the error messages to guide towards mode transitions out of this complete state. Is this ok for you?
Yes, apologies for the slow response.
@smithdtyler are there specific steps (e.g. edition/opening/closing the aadl file) to reproduce the issue?
I observed variations in behavior depending on the order of clean/build/open/close, but I do not recall a specific set of steps to get this problem.
Summary
OSATE warns me that I need complete states on behavior specifications for
device
andmemory
types (those are all I've tested). When I add complete states, it tells me that I am not allowed to have complete states on those types of components.MWE
If I add a complete state:
Then I get
And then adding
on dispatch
Environment