Skip to content

Check resolvable_storyboard_element_reference does not recognize name prefixes #75

@markuspi

Description

@markuspi

Describe the bug
The checker for rule asam.net:xosc:1.2.0:reference_control.resolvable_storyboard_element_reference reports false-positive errors when using name prefixes to further qualify storyboard element names.

To Reproduce

  1. Create OpenSCENARIO file with any nested storyboard element structure, e.g.
...
<Story name="Story1">
    <Act name="Act1">
        <ManeuverGroup maximumExecutionCount="1" name="Group1">
...
  1. Add a StoryboardElementStateCondition that references an element using a paritially or fully qualified name:
<StoryboardElementStateCondition storyboardElementRef="Story1::Act1::Group1"
        state="completeState"
        storyboardElementType="maneuverGroup" />
  1. run checker, observe reported error
asam.net:xosc:1.2.0:reference_control.resolvable_storyboard_element_reference
Reference in a storyboardElementRef does not point to an existing element
Storyboard element reference Story1::Act1::Group1 not found among Storyboard elements

Expected behavior
No error should be reported when storyboard element reference adhere to the standard as specified in Introduction > Naming Conventions

Show quoted text
  • Elements in scenario descriptions may be referenced from other parts of the description through their names. To ensure that all references can be unambiguously resolved, the following set of rules apply for references to scenario elements:
  • Name lookup shall start at the referencing element, but shall comprise all elements at all hierarchy levels of the scenario hierarchy.
  • Element names at each level shall be unique at that level, meaning within the same directly enclosing element. For example, within one Story, every Act shall use a unique name ("MyStory1": "MyAct1", "MyAct2"…​), but the names of the acts may be reused in another story ("MyStory2": "MyAct1", "MyAct2"…​).
  • If the referenced name is globally unique, then it may be used directly as the only part of the reference. If the referenced name is not globally unique, name prefixes shall be used to make the name unique.
  • A name prefix consists of the name of a directly enclosing element, which is prefixed to the name using the separator '::', thus forming a new name reference. This implies that the '::' must not be used in names itself. The name is disambiguated by the "::" specifying a directly enclosing element name.
  • Multiple prefixes of subordinate enclosing elements may be specified, up to the root element name, until a globally unique reference name is established.
  • If a reference cannot be resolved uniquely, for example, if too few name prefixes have been specified the result of the lookup is undefined.

i.e. the following reference should be allowed in this case:

  • Story1::Act1::Group1
  • Act1::Group1
  • Group1

poc.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    isType:BugAn issue that contains contradictions or errors in the standard.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions