Difference between revisions of "Extensions.Measure.GetDeviceServiceNameFromEvent"
Jump to navigation
Jump to search
(6 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | [[Category:Measure]] | + | {{DISPLAYTITLE:'''GetDeviceServiceNameFromEvent '''}}[[Category:Measure]] |
== Classification == | == Classification == | ||
− | {{ClassificationActivity | GetDeviceServiceNameFromEvent | | + | {{ClassificationActivity | GetDeviceServiceNameFromEvent | Gets the device and service name of the device and service that caused the event. | [[Term]] | [[Extensions.Measure|OTX Measure extension]] | [[Extensions.Measure#Terms|Event related terms]] | [[Core.DataTypes.ComplexDataType.TypeMismatchException|TypeMismatchException]] | - }} |
== OTL Syntax == | == OTL Syntax == | ||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | StringTerm | + | StringTerm Measure.GetDeviceServiceNameFromEvent(EventValue event); |
</syntaxhighlight> | </syntaxhighlight> | ||
== Description == | == Description == | ||
− | + | The '''GetDeviceServiceNameFromEvent''' term accepts an '''EventValue''' term and returns a string which contains the device and service name of the device and service that caused the event. By using this term, an OTX sequence can wait for an '''Event''' raised by a device receiving a new result and then evaluate which service of that device caused the event. | |
− | The string value | + | The returned string value will be composed out of two parts: '''"devicename.servicename"''', where '''"devicename"''' and '''"servicename"''' are the names as given by the corresponding '''DeviceSignature'''. |
− | {{TermReturnValue| [[String]] | The string that contains the name of the device and services. }} | + | {{TermReturnValue| [[Core.DataTypes.SimpleDataType.String|String]] | The string that contains the name of the device and services. }} |
== Properties == | == Properties == | ||
{| {{TableHeader}} | {| {{TableHeader}} | ||
{{TableRowPropertiesHeader}} | {{TableRowPropertiesHeader}} | ||
− | {{ | + | {{TableRowPropertie2| Event | [[Extensions.EventHandling.Event|Event]] | [[Value]] | - | [1] | Represents the '''event''' that was raised after executing a device service.}} |
|} | |} | ||
== OTL Examples == | == OTL Examples == | ||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | package Measure.DeviceSignature | + | /// Signatures |
+ | |||
+ | package Measure.DeviceSignature DeviceSignature1 | ||
{ | { | ||
− | + | Measure.DeviceServiceSignature Add(in Integer a, out Measure.Measurement Measurement); | |
} | } | ||
− | public procedure | + | /// Global Declarations |
+ | |||
+ | public procedure main() | ||
{ | { | ||
− | + | /// Local Declarations | |
− | + | ||
− | + | Measure.Measurement Measurement1; | |
− | + | Integer a1 = 10; | |
+ | EventHandling.EventSource EventSource1; | ||
+ | EventHandling.Event Event1; | ||
+ | String String1 = ""; | ||
+ | |||
+ | /// Flow | ||
− | + | EventSource1 = Measure.DeviceEventSource(DeviceSignature1); | |
− | + | parallel | |
− | + | { | |
− | + | lane | |
− | + | { | |
− | + | Measure.ExecuteDeviceService(DeviceSignature1, Add, {a = a1, Measurement = Measurement1}, false, false); | |
− | + | } | |
− | + | lane | |
− | + | { | |
− | + | EventHandling.WaitForEvent({EventSource1}, Event1); | |
− | + | } | |
− | + | } | |
− | + | String1 = Measure.GetDeviceServiceNameFromEvent(Event1); | |
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== See also == | == See also == | ||
− | [[DeviceEventSource]] <br/> | + | [[Extensions.Measure.DeviceEventSource|DeviceEventSource]] <br/> |
− | [[IsDeviceEvent]] | + | [[Extensions.Measure.IsDeviceEvent|IsDeviceEvent]] |
Latest revision as of 02:56, 13 September 2019
Contents
Classification
Name | GetDeviceServiceNameFromEvent |
Short Description | Gets the device and service name of the device and service that caused the event. |
Class | Term |
Extension | OTX Measure extension |
Group | Event related terms |
Exceptions | TypeMismatchException |
Checker Rules | - |
Standard Compliant | Yes |
OTL Syntax
StringTerm Measure.GetDeviceServiceNameFromEvent(EventValue event);
Description
The GetDeviceServiceNameFromEvent term accepts an EventValue term and returns a string which contains the device and service name of the device and service that caused the event. By using this term, an OTX sequence can wait for an Event raised by a device receiving a new result and then evaluate which service of that device caused the event.
The returned string value will be composed out of two parts: "devicename.servicename", where "devicename" and "servicename" are the names as given by the corresponding DeviceSignature.
Return Value
The Term returns the value, see table below.
![]()
In OTX, Terms are categorized according to its return data type!
Data Type | Description |
String | The string that contains the name of the device and services. |
Properties
Name | Data Type | Class | Default | Cardinality | Description |
Event | Event | Value | - | [1] | Represents the event that was raised after executing a device service. |
OTL Examples
/// Signatures
package Measure.DeviceSignature DeviceSignature1
{
Measure.DeviceServiceSignature Add(in Integer a, out Measure.Measurement Measurement);
}
/// Global Declarations
public procedure main()
{
/// Local Declarations
Measure.Measurement Measurement1;
Integer a1 = 10;
EventHandling.EventSource EventSource1;
EventHandling.Event Event1;
String String1 = "";
/// Flow
EventSource1 = Measure.DeviceEventSource(DeviceSignature1);
parallel
{
lane
{
Measure.ExecuteDeviceService(DeviceSignature1, Add, {a = a1, Measurement = Measurement1}, false, false);
}
lane
{
EventHandling.WaitForEvent({EventSource1}, Event1);
}
}
String1 = Measure.GetDeviceServiceNameFromEvent(Event1);
}