ETSI's Bug Tracker - Ext Pack: Advanced Matching (ES 203 022)
View Issue Details
0007742Ext Pack: Advanced Matching (ES 203 022)New Featurepublic25-01-2018 17:0305-01-2019 12:26
Jacob Wieland - Spirent 
Gyorgy Rethy 
normalminorhave not tried
closedfixed 
 
v1.3.1 (ongoing) 
?
Spirent - Jacob Wieland
1
0007742: Allow passing instances of templates with out parameters/value redirects as specially marked actual template in parameters
At the moment, instances of templates with out parameters or inline templates with value redirects are allowed to be used only in a match operation, select case or receive operation template.

They cannot be assigned to variables or returned from a function.
The reason for this is that if that were allowed, it cannot be controlled where the template ends up and whether the variables bound to it are still valid at the point when the template is used for matching.

This restriction should be lessened to allow passing such template instances to template-in-parameters of functions with a special modifier (e.g. @redirect or @match). Such in parameters would be subject to the same restriction as these instances have, i.e. they can be used only for matching or as @match-in-parameters of called functions.

Any template instance using a @match-parameter automatically becomes a redirect template and thus is also limited to these restrictions.
We had a use-case with a deeply nested template with several decmatch-layers where each layer potentially could contribute redirected values.

At the moment, it is not possible to pass an instance of such a template to a general-purpose function which tries to receive a message matching the template and deal with timeouts or other messages in a different way.

Since that template-instance lives only as long (or shorter) as the variables it uses as its out parameters, there is no harm in such a usage and thus it should be allowed.
No tags attached.
docx CR7742.docx (374,856) 11-10-2018 11:34
http://oldforge.etsi.org/mantis/file_download.php?file_id=3801&type=bug
docx CR7742-v2.docx (427,898) 11-10-2018 15:15
http://oldforge.etsi.org/mantis/file_download.php?file_id=3803&type=bug
Issue History
25-01-2018 17:03Jacob Wieland - SpirentNew Issue
16-07-2018 13:40Jens GrabowskiNote Added: 0015129
16-07-2018 13:41Jens GrabowskiAssigned To => Jacob Wieland - Spirent
16-07-2018 13:41Jens GrabowskiStatusnew => assigned
11-10-2018 09:15Jacob Wieland - SpirentNote Added: 0015246
11-10-2018 11:34Jacob Wieland - SpirentFile Added: CR7742.docx
11-10-2018 11:36Jacob Wieland - SpirentNote Added: 0015252
11-10-2018 11:36Jacob Wieland - SpirentAssigned ToJacob Wieland - Spirent => Tomas Urban
11-10-2018 11:36Jacob Wieland - SpirentStatusassigned => confirmed
11-10-2018 15:15Tomas UrbanFile Added: CR7742-v2.docx
11-10-2018 15:16Tomas UrbanNote Added: 0015257
11-10-2018 15:16Tomas UrbanAssigned ToTomas Urban => Jacob Wieland - Spirent
11-10-2018 16:48Jacob Wieland - SpirentNote Added: 0015261
11-10-2018 16:48Jacob Wieland - SpirentStatusconfirmed => resolved
11-10-2018 16:48Jacob Wieland - SpirentResolutionopen => fixed
11-10-2018 16:48Jacob Wieland - SpirentAssigned ToJacob Wieland - Spirent => Tomas Urban
11-10-2018 16:48Jacob Wieland - SpirentAssigned ToTomas Urban => Jens Grabowski
11-10-2018 16:48Jacob Wieland - SpirentStatusresolved => feedback
11-10-2018 16:48Jacob Wieland - SpirentResolutionfixed => reopened
11-10-2018 16:48Jacob Wieland - SpirentStatusfeedback => resolved
11-10-2018 16:48Jacob Wieland - SpirentResolutionreopened => fixed
05-01-2019 12:26Gyorgy RethyNote Added: 0015320
05-01-2019 12:26Gyorgy RethyStatusresolved => closed
05-01-2019 12:26Gyorgy RethyAssigned ToJens Grabowski => Gyorgy Rethy
05-01-2019 12:26Gyorgy RethyFixed in Version => v1.3.1 (ongoing)

Notes
(0015129)
Jens Grabowski   
16-07-2018 13:40   
STF discussion: Some examples are needed.
(0015246)
Jacob Wieland - Spirent   
11-10-2018 09:15   
Suppose you have a general purpose function

function f_receiveMessage(template(present) MsgType p_expectedMsg, out MsgType p_result) runs on Mtc return MsgType {
   timer t := 5.0;
   t.start;
   alt {
   [] msgPort.receive(p_expectedMsg) -> value p_result { }
   [] msgPort.receive { setverdict(fail); }
   [] t.timeout { setverdict(inconc); }
   }
}

You then have a template with variable assignments of type MsgType

template MsgType mySpecialTemplate(out integer p_deepNestedField) := {

... ... ... ... ? -> p_deepNestedField
... ... ... ...
}

Now, because of the out parameter, it's not possible to call

f_receiveMessage(mySpecialTemplate(v_fieldresult), v_msg)

even though the template instance mySpecialTemplate(v_fieldresult) lives only as long as the function call (and never longer than the scope of v_fieldResult, if it is a local variable because you cannot return such an inline template).

The purpose of the CR is to allow adding a @match modifier in front of parameters and variables so that they are allowed to store templates that can only be used for matching and assignment to variables/parameters that also have the @match modifier and nothing else.

The restriction that templates with out parameters/contained redirect symbols cannot be used as actual parameters can be lessened with the exception that they can be used as in parameters with modifier @match.
(0015252)
Jacob Wieland - Spirent   
11-10-2018 11:36   
I have uploaded a proposal which both restricts the general passing around of value-retrieval templates (which wasn't done properly before now) and allows special cases when the newly introduced @match modifier is used.

Please review
(0015257)
Tomas Urban   
11-10-2018 15:16   
I made some modifications to the first proposal. Please check.
(0015261)
Jacob Wieland - Spirent   
11-10-2018 16:48   
Changes are fine. I consider this resolved.
(0015320)
Gyorgy Rethy   
05-01-2019 12:26   
Added to draft v1.2.2