Difference between revisions of "Extensions.EventHandling.Sleep"

From emotive
Jump to navigation Jump to search
Line 1: Line 1:
 
{{DISPLAYTITLE:  '''Sleep'''}}[[Category:EventHandling]]
 
{{DISPLAYTITLE:  '''Sleep'''}}[[Category:EventHandling]]
 
== Classification ==
 
== Classification ==
{{ClassificationActivity | Sleep| UPDATING...| [[Action]]| [[Extensions.EventHandling|OTX EventHandling extension]]  | [[Extensions.EventHandling#Actions|EventHandling related actions]] | - | - }}
+
{{ClassificationActivity | Sleep| Suspends the current thread| [[Action]]| [[Extensions.EventHandling|OTX EventHandling extension]]  | [[Extensions.EventHandling#Actions|EventHandling related actions]] | [[Core.DataTypes.ComplexDataType.OutOfBoundsException|OutOfBoundsException]]  | - }}
  
 
== OTL Syntax ==
 
== OTL Syntax ==
UPDATING...
 
<!--
 
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
EventHandling.WaitForEvent(EventSourceTerm);
+
EventHandling.Sleep(NumericTerm);
 
</syntaxhighlight>
 
</syntaxhighlight>
-->
+
 
  
 
== Description ==
 
== Description ==
UPDATING...
+
The OTX '''Sleep''' activity suspends the current thread for the specifies amount of time in milliseconds. This can be useful for waiting on an external application or task. It does not cause CPU usage during the pause.
<!--
 
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.
 
  
Ending the waitforevent activity, all on-the-fly (ie on the corresponding event source term, see [[Property Source]]) event sources generated automatically.
 
-->
 
 
== Properties ==
 
== Properties ==
UPDATING...
 
<!--
 
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie1| Event | [[Extensions.EventHandling.Event|Event]] | [[Variable]] | - | [0..1] | After an event is triggered, this variable contains the corresponding event.}}
+
{{TableRowPropertie2| TimeOut | [[Numeric]] | [[Term]] | - | [1] | This element specifies an [[Core.DataTypes.SimpleDataType.Integer|Integer]] value that is interpreted as a time in milli-seconds to wait. [[Core.DataTypes.SimpleDataType.Float|Float]] values shall be truncated.}}
{{TableRowPropertie2| EventSource | [[Extensions.EventHandling.EventSource|EventSource]] | [[Term]] | - | [1] | One or more event sources. The order is insignificant. Once a source triggering an event, the waiting is ended.}}
 
 
|}
 
|}
-->
+
 
 
== OTL Examples ==
 
== OTL Examples ==
UPDATING...
 
<!--
 
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
Boolean Bool1 = false;
+
/// Local Declarations
 +
 
 +
Integer Integer1;
 
EventHandling.EventSource EventSource1;
 
EventHandling.EventSource EventSource1;
  
EventSource1 = EventHandling.MonitorChangeEventSource(Bool1);
+
/// Flow
 +
 
 +
Integer1 = 12;
 +
EventSource1 = EventHandling.MonitorChangeEventSource(Integer1);
 +
 
 
parallel
 
parallel
 
{
 
{
  lane
+
lane
  {
+
{
      Bool1 = true;
+
EventHandling.WaitForEvent({EventSource1});
  }
+
}
  lane
+
lane
  {
+
{
    EventHandling.WaitForEvent({EventSource1}, Event1);
+
EventHandling.Sleep(500);
  }
+
Integer1 = 13;
 +
}
 
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>
-->
+
 
 
== See also ==
 
== See also ==
[[Extensions.EventHandling.WaitForEvent|WaitForEvent]]
+
[[Extensions.EventHandling.WaitForEvent|WaitForEvent]]<br/>
 +
[[Extensions.EventHandling.CloseEventSource|CloseEventSource]]

Revision as of 10:31, 24 October 2018

Classification

Name Sleep
Short Description Suspends the current thread
Class Action
Extension OTX EventHandling extension
Group EventHandling related actions
Exceptions OutOfBoundsException
Checker Rules -
Standard Compliant Yes

OTL Syntax

EventHandling.Sleep(NumericTerm);


Description

The OTX Sleep activity suspends the current thread for the specifies amount of time in milliseconds. This can be useful for waiting on an external application or task. It does not cause CPU usage during the pause.

Properties

Name Data Type Class Default Cardinality Description
TimeOut Numeric Term - [1] This element specifies an Integer value that is interpreted as a time in milli-seconds to wait. Float values shall be truncated.

OTL Examples

/// Local Declarations

Integer Integer1;
EventHandling.EventSource EventSource1;

/// Flow

Integer1 = 12;
EventSource1 = EventHandling.MonitorChangeEventSource(Integer1);

parallel
{
	lane
	{
		EventHandling.WaitForEvent({EventSource1});
	}
	lane
	{
		EventHandling.Sleep(500);
		Integer1 = 13;
	}
}

See also

WaitForEvent
CloseEventSource