Skip to content

Error message on connection when starting a flow source implementation with a data subcomponent #1987

@AaronGreenhouse

Description

@AaronGreenhouse

Summary

AADL allows a flow source implementation to begin with a data subcomponent. However, the current OSATE implementation gives an error on the subsequent connection in the flow implementation when you try to do this.

Expected and Current Behavior

The expected behavior is that there should not be an error reported on the declarative model. In actuality there is an error of the form

The source of connection connection_id does not match the preceding subcomponent subcomponent_id

Interestingly, there is no analogous error when ending a flow sink implementation at a data subcomponent.

Steps to Reproduce

Consider the example

package DataTest
public
	data D
		
	end D;
	
	thread T
		features
			output: out data port D;
		flows
			fsrc: flow source output;
	end T;
	
	thread implementation T.i
		subcomponents
			myData: data D;
		connections
			c: port myData -> output;
		flows
			fsrc: flow source myData -> c -> output;
	end T.i;
	
	thread TT
		features
			input: in data port D;
		flows 
			fsnk: flow sink input;
	end TT;
	
	thread implementation TT.i
		subcomponents
			myData: data D;
		connections
			c: port input -> myData;
		flows
			fsnk: flow sink input -> c -> myData;
	end TT.i;
end DataTest;

OSATE will show an error marker on the connection identifier c in the flow source implementation fsrc of T.i. The error is

The source of connection 'c' does not match the preceding subcomponent 'myData'

Interestingly there is no similar error in the flow sink implementation fsnk of TT.i.

The error comes from Aadl2JavaValidator.checkFlowConnectionEnds(). In this case, the source of the connection is the data subcomponent but the connection source context is null. It seems like the method is not considering this case, but instead expects the connection source to be a feature of a subprogram?

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions