aas-specs icon indicating copy to clipboard operation
aas-specs copied to clipboard

Modelling of operation parameters

Open mjacoby opened this issue 1 year ago • 8 comments

Image the following scenario: We have an operation called doStuff which takes a single input parameter called data. data is a SubmodelElementList of SubmodelElementCollections with a predefined structure, i.e. Property x of type string, Property y of type integer, and Property z of type boolean.

An example invocation call with valueOnly serialization would look like this

{
	"inputArguments":
	{
		
		"data": [
			{
				"x": "value1",
				"y": 0,
				"z": true
			},
			{
				"x": "value2",
				"y": 1,
				"z": false
			},
			...
		]
	},
	"inoutputArguments": {},
	"clientTimeoutDuration": "PT60S"
}

How should the operation be modeled to reflect this? If I model the data input parameter as a list with one element to describe the structure of the SubmodelElementCollection that is expected like this...


{
	"modelType": "Operation",
	"idShort": "doStuff"
	"inputVariables": [
		{
			"value":
			{
				"modelType": "SubmodelElementList",
				"idShort": "data",
				"orderRelevant": true,
				"typeValueListElement": "SubmodelElementCollection",
				"value": [
					{
						"modelType": "SubmodelElementCollection",
						"value": [
							{
								"modelType": "Property",
								"idShort": "x",
								"valueType": "xs:string"
							},
							{
								"modelType": "Property",
								"idShort": "y",
								"valueType": "xs:integer"
							},
							{
								"modelType": "Property",
								"idShort": "z",
								"valueType": "xs:boolean"
							},
						]
					}
				]
			}
		}
	],
	"outputVariables": []
}

... then this reads like data only accepts exactly one element instead of an arbitrary number. If you argue that this should mean that data contains an arbitrary number of elements than how is it possible to define that it should contain exactly one element?

I was looking at Part 1 of the AAS specification to find an answer but unfortunately without success.

My initial thought was that setting the kind property on the SubmodelElementCollection to template might be the answer, but this property has been marked as deprecated sin v3.0.

Using Qualifiers also came to mind but it seems TemplateQualifiers are only allowed on elements that belong to a Submodel of kind=template (which is not the case here is this Submodel is an instance) according to Constraint AASd-129

If any Qualifier/kind value of a Qualifiable/qualifier is equal to TemplateQualifier and the qualified element inherits from "hasKind", the qualified element shall be of kind Template (HasKind/kind = "Template").

To me, it seems like I am therefore not able to properly model/describe the input parameters of my operation which means nobody can use my AAS/operation without an accompanying document describing how to use it. Am I missing something? Is there a way to describe this?

mjacoby avatar Aug 12 '24 14:08 mjacoby