|
In 'State and transitions' the concepts of input (signal consumption) and output (signal sending) were introduced in connection with the transition. Signals in 'State and transitions' were only used for the initiation of a transition, but they can also be used to carry data values from one process to another. In this case, the output construct includes one or more data values. In the corresponding input construct variables are specified, which store the received data values. The types of the values sent in the output construct must be compatible with the types of parameters of the signal and the variables in the corresponding input construct. The ordering of the values sent together with a signal depends on the ordering of the parameter sorts in the signal definition.
Figure 15: Signal with data With the signal A in figure 15 the values 5 and true are sent from process p1 to process p2. The process p2 owns variables v1 and v2 of type Integer and Boolean, respectively. When signal A is consumed by process p2, the value 5 is assigned to v1 and true is assigned to v2. In the input and output constructs, the order of the data values and variables is important. If in the example of figure 15, v1 was of type Boolean and v2 of type Integer, the description would not be valid. One or more variables may be omitted in the input construct. The corresponding received values are lost in this case. Similarly, one or more values may be omitted in an output construct, but the order of the remaining values and variables is important figure 16 shows some examples. Figure 16: Examples of the omission of values and variables |
Contact the webmaster with
questions or comments about this web site. |