On this page
You can model either non-streaming or streaming behaviors. Non-streaming behaviors consume their input object tokens at the moment they begin executing and deliver their output object tokens when they finish executing. If a system receives inputs and produces outputs even while behaviors continue to execute, this is referred to as a streaming behavior.
An Activity with streaming parameters is terminated in the following cases:
- An Activity whose only streaming parameters are output parameters is terminated once all of its actions finish executing.
- An Activity with streaming input parameters is terminated by an Activity final node or if the execution is explicitly terminated by the Activity that invoked it.
Non-streaming vs streaming behavior.
You can model a streaming behavior by setting the parameter of a Pin or Activity Parameter Node as streaming.
To set a parameter as streaming
- In the Specification window of a Parameter of a Pin or Activity Parameter Node, set the Is Stream property to true.
Setting a parameter as streaming.
Streaming parameter multiplicity
We recommend specifying the multiplicity of [1..*], [*], or [0..*] if you want to get an unlimited number of tokens. Otherwise, the streaming input parameter stops receiving tokens when it reaches the upper bound of multiplicity.
Specifying parameter streaming rate
Streaming rate is the number of objects or values that flow in or out of the parameter per time interval while the behavior or operation is executing. You define input or output parameter streaming rate by specifying the Rate property which determines the expected rate at which tokens can arrive at or leave a Pin or Activity Parameter Node.
To specify streaming rate
- Create an Instance Specification and name, e.g., 3 per min.
- Open the Specification window of the Instance Specification and set the Specification property to the number of objects or values that flow in or out of the parameter per time interval, e.g., 3.
- Set the Instance Specification (created in step 1) as the value of the Rate property both for a Pin (or Activity Parameter Node) and for the parameter of that Pin (or Activity Parameter Node).
- Open the Specification window of the Simulation Configuration and specify the Time Unit property by selecting the time interval per which the selected number of objects or values flow in or out of the parameter. If the Time Unit is not specified, a second is used as the default time interval.
Once you define parameter streaming rate, object tokens flow at fixed time intervals. This means that the specified time interval (step 4) is divided by a specified number of tokens (step 2). For example, if streaming rate is 3/min, object tokens are passed at fixed time intervals of 20 s. If a token does not arrive at the specified time, then that time interval is skipped and object token is passed only after the next fixed time interval. If there are more object tokens than an Action can accept, they wait in a corresponding Pin and are passed after the next fixed time interval.
To display streaming rate in a diagram
- Right-click a Pin or Activity Parameter Node and select Symbol Properties.
- In the Symbol Properties dialog, set the Show Tagged Values property to true.
Streaming Activity animation
The Activity Diagram below shows an example of a streaming Activity where the Manufacture, Paint, and Dry Actions can be executed simultaneously. In this example, the Manufacture action has already finished executing and is annotated in green (visited element). The Dry and Paint Actions are executing simultaneously and are annotated in red (active elements). Note that you can control the held token display (annotated as red bubbles with the number of waiting tokens) in the Project Options dialog or Simulation Configuration properties.
The execution of this Activity will not terminate even when all the Actions finish executing.
An example of a streaming Activity
The following chart displays the timeline of the fully executed streaming Activity displayed above.