Difference between revisions of "Extensions.EventHandling.WaitForEvent"

From emotive
Jump to navigation Jump to search
Line 9: Line 9:
  
 
== Description ==
 
== Description ==
The OTX '''WaitForEvent''' activity blocks the current flow (thread) until a specified event sources has triggered an event. When an event is triggered, completed the WaitForEvent activity and the process continues with the next activity. The event that led to the termination of the activity can be evaluated using the Event property, see below.
+
The OTX '''WaitForEvent''' action shall block the thread of execution until it receives an event from one of its event sources. As soon as an event becomes available in one of the sources' event queues, '''WaitForEvent''' shall remove that event from the event source's queue and exit; the thread of execution continues to the next node.
  
Ending the waitforevent activity, all on-the-fly (ie on the corresponding event source term, see [[Property Source]]) event sources generated automatically.
+
If an event variable was specified, the event that caused '''WaitForEvent''' to exit is assigned to the variable.
  
 
== Properties ==
 
== Properties ==

Revision as of 07:51, 26 September 2018

Classification

Name WaitForEvent
Short Description Wait until an event is triggered and then continues processing
Class Action
Extension OTX EventHandling extension
Group EventHandling related actions
Exceptions -
Checker Rules -
Standard Compliant Yes

OTL Syntax

EventHandling.WaitForEvent(EventSourceTerm, EventVariable);

Description

The OTX WaitForEvent action shall block the thread of execution until it receives an event from one of its event sources. As soon as an event becomes available in one of the sources' event queues, WaitForEvent shall remove that event from the event source's queue and exit; the thread of execution continues to the next node.

If an event variable was specified, the event that caused WaitForEvent to exit is assigned to the variable.

Properties

Name Data Type Class Default Cardinality Description
Event Event Variable - [0..1] This optional element represents an Event-type variable which shall receive the event that terminates this wait.
Source EventSource Term - [1..*] This represents one or more event sources that the action shall wait for. The wait shall be terminated by the first source to fire an event.

OTL Examples

Boolean Bool1 = false;
EventHandling.EventSource EventSource1;

EventSource1 = EventHandling.MonitorChangeEventSource(Bool1);
parallel
{
   lane
   {
      Bool1 = true;
   }
   lane
   {
     EventHandling.WaitForEvent({EventSource1}, Event1);
   }
}

See also

CloseEventSource