Documentation Center

  • Trial Software
  • Product Updates

Identify Data Using Dot Notation

What Is Dot Notation?

Dot notation is a way to identify data at a specific level of the chart hierarchy. A qualified data name uses dot notation to specify the path to the parent state for that data.

For example, you can specify qualified data names in state actions and transitions by using dot notation.

In this chart, data resides in the state aa. The qualified data names in state actions and transitions use dot notation to refer to this data.

  • In state a, the entry action contains the qualified data name aa.data.

  • In state b, the entry action contains the qualified data name a.aa.data.

  • In the default transition, the action contains the qualified data name a.aa.data.

Resolution of Qualified Data Names with Dot Notation

During simulation, the chart searches for data that matches the qualified data name with dot notation. These rules apply:

  • The chart does not do an exhaustive search of all data.

  • The chart does not stop searching after finding one match. The search continues until it reaches the chart level.

Process for Resolving Qualified Data Names

The flow chart describes the following search process.

StageAction
1

The search begins at the level of the hierarchy where the qualified data name appears.

  • For a state action, that state is the starting point.

  • For a transition label, the parent of the source object is the starting point.

2

The chart searches at that level of the hierarchy for a path to the data. If the chart finds a match, it adds that path to the list of possible matches.

3

The chart moves up to the next highest level of the hierarchy. At that level, the chart searches for a path to the data. If the chart finds a match, it adds that path to the list of possible matches.

4

The previous step repeats until the search reaches the chart level.

5

At the chart level, one more search occurs for a path to the data. If a match exists, that path becomes part of the list of possible matches. Then, the search ends.

6

After the search ends, one of the following occurs:

  • If a unique match exists, the statement containing the qualified data name executes.

  • If no matches or multiple matches exist, an error message appears.

Best Practices for Using Dot Notation in Qualified Data Names

These examples show how to avoid problems when using dot notation in qualified data names.

Use a Specific Path in the Qualified Data Name

Be specific when defining the path to the data.

Suppose that state aa contains data. In state b, the entry action contains aa.data, a qualified data name that the chart cannot resolve. The following search process occurs:

StageActionFinds a Match?
1Chooses state b as the starting point and searches at that level for an object aa that contains data.No
2Moves up to the next level of the hierarchy and searches at the chart level for an object aa that contains data.No

The search ends, and an error message appears because no match exists for aa.data.

To avoid this error, use a specific path for the qualified data name in the entry action of state b:

en: a.aa.data+=1;

Use Unique State Names

Use unique names when you name the states in a chart.

Suppose that both states named aa contain a data object named data. In state a, the entry action contains two instances of aa.data that the chart cannot resolve. The following search process occurs:

StageActionFinds a Match?
1Chooses state a as the starting point and searches at that level for an object aa that contains data.Yes
2Moves up to the next level of the hierarchy and searches at the chart level for an object aa that contains data.Yes

The search ends, and an error message appears because multiple matches exist for aa.data.

To avoid this error, perform one of these corrective actions:

  • Rename one of the two states named aa.

  • Use a more specific path for the qualified data names in the entry action of state a:

    en: y+=a.aa.data, a.aa.data+=1;
  • Enclose the outer state aa in a box or another state. Adding an enclosure prevents the search process from detecting that outer state.

Was this topic helpful?