osate / osate2

Open Source AADL2 Tool Environment
http://osate.org
Eclipse Public License 2.0
36 stars 8 forks source link

Typeset with target state of error transition not marked as error #2579

Closed lwrage closed 3 years ago

lwrage commented 3 years ago

Summary OSATE accepts error transitions where the target state has an arbitrary type set.

Expected behavior Only individual error types should be allowed E.8 rule target_error_type_instance.

Steps To Reproduce

  1. Copy and paste the following model in the AADL text editor in OSATE
package emv::transition
public
    annex emv2 {**
        error behavior EB
            events
                ev: error event;
            states
                s: state {ErrorLibrary::CommonErrors};
        end behavior;
    **};

    system S
        annex emv2 {**
            use types ErrorLibrary;
            use behavior emv::transition::EB;
            component error behavior
            transitions
                -- this is valid
                s -[ev]-> s{ItemOmission};

                -- these two should be marked as errors
                s -[ev]-> s{CommonErrors};
                s -[ev]-> s{ItemOmission, ServiceOmission};
            end component;
        **};
    end S;
end emv::transition;

Desktop (please complete the following information):

lwrage commented 3 years ago

Add validation to check that there is one error type (or a product type) named with the target state. A type set containing a single error type isn't allowed, either.

@keh181 Check other places in the standard where target_error_type_instance is used for similar bugs.

jjhugues commented 3 years ago

Can you check this issue please: https://github.com/saeaadl/emv2/issues/28 It seems related. Thanks