Extensions.EventHandling.CloseEventSource
Jump to navigation
Jump to search
Classification
Name | CloseEventSource |
Short Description | Stops the event processing all specified sources |
Class | Action |
Extension | OTX EventHandling extension |
Group | EventHandling related actions |
Exceptions | - |
Checker Rules | - |
Standard Compliant | Yes |
OTL Syntax
EventHandling.CloseEventSource({EventSourceVariable[ ] source});
Description
The OTX CloseEventSource action will close and dispose given event sources. Closed event sources will no more queue any events.
Once closed, an event source can not be reopened. Using a closed event source e.g. in a WaitForEvent action is an error and will cause an otx:InvalidReferenceException (through the EventSourceValue term).
In case that CloseEventSource is applied to an event source which is already closed, the action will perform nothing (NOP)
CAUTION — In Parallel execution, situations may occur where an event source gets closed by a CloseEventSource action while being used in a WaitForEvent action (in another parallel lane). If the WaitForEvent action has no other event sources registered, this will cause a deadlock situation. OTX authors need to avoid such situations by careful test sequence design and the usage of the MutexGroup node.
Properties
Name | Data Type | Class | Default | Cardinality | Description |
Source | EventSource | Variable | - | [1] | This represents one or more variables which contain the event sources that will be closed. |
OTL Examples
/// Local Declarations
Integer Variable1 = 0;
EventHandling.Event Event1;
EventHandling.EventSource EventSource1;
/// Flow
EventSource1 = EventHandling.MonitorChangeEventSource(Variable1);
Variable1 = Variable1 + 1;
EventHandling.WaitForEvent({EventSource1}, Event1);
EventHandling.CloseEventSource({EventSource1});