Difference between revisions of "Extensions.ExternalServiceProvider.GetServiceProviderEventValues"

From emotive
Jump to navigation Jump to search
(Created by Ngoc Tran.)
 
(Edited by Ngoc Tran.)
 
Line 5: Line 5:
 
== OTL Syntax ==
 
== OTL Syntax ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
ActionRealisation ExternalServiceProvider.GetServiceProviderEventValues(otx:ServiceProviderSignature providerType, otx:EventSignature eventName, event:EventTerm event, esp:ExternalEventResult value);
+
ActionRealisation ExternalServiceProvider.GetServiceProviderEventValues(otx:OtxLink providerType, otx:OtxName eventName, event:EventTerm event, esp:ExternalEventResult value);
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 13: Line 13:
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie2| providerType | [[Extensions.ExternalServiceProvider.ServiceProviderSignature|otx:ServiceProviderSignature]] |  | - | [1..1] | This attribute identifies the external provider to execute the service on.
+
{{TableRowPropertie2| providerType | [[OtxLink|otx:OtxLink]] |  | - | [1..1] | This attribute identifies the external provider to execute the service on.
 
The link will point to the corresponding [[Extensions.ExternalServiceProvider.ServiceProviderSignature|ServiceProviderSignature]]. }}
 
The link will point to the corresponding [[Extensions.ExternalServiceProvider.ServiceProviderSignature|ServiceProviderSignature]]. }}
{{TableRowPropertie1| eventName | [[Extensions.ExternalServiceProvider.EventSignature|otx:EventSignature]] |  |  | [1..1] | This attribute identifies the [[Extensions.ExternalServiceProvider.EventSignature|EventSignature]] in the given [[Extensions.ExternalServiceProvider.ServiceProviderSignature|ServiceProviderSignature]] for which event the values will be returned. }}
+
{{TableRowPropertie1| eventName | [[OtxName|otx:OtxName]] |  |  | [1..1] | This attribute identifies the [[Extensions.ExternalServiceProvider.EventSignature|EventSignature]] in the given [[Extensions.ExternalServiceProvider.ServiceProviderSignature|ServiceProviderSignature]] for which event the values will be returned. }}
 
{{TableRowPropertie2| event | [[Event|event:Event]] | [[Term]] | - | [1..1] | This term represents the value of a '''ServiceProviderEvent'''. }}
 
{{TableRowPropertie2| event | [[Event|event:Event]] | [[Term]] | - | [1..1] | This term represents the value of a '''ServiceProviderEvent'''. }}
 
{{TableRowPropertie2| value | [[ExternalEventResult|esp:ExternalEventResult]] |  | - | [1..*] | Here the event values of the event can be returned to variables. [1..*] results are possible. }}
 
{{TableRowPropertie2| value | [[ExternalEventResult|esp:ExternalEventResult]] |  | - | [1..*] | Here the event values of the event can be returned to variables. [1..*] results are possible. }}

Latest revision as of 10:48, 14 November 2019

Classification

Name GetServiceProviderEventValues
Short Description Retrieves the values of a provider event
Class Action
Extension OTX ExternalServiceProvider extension
Group ExternalServiceProvider related actions
Exceptions esp:ProviderDisposedException
otx:TypeMismatchException
Checker Rules ExternalServiceProvider_Chk001
ExternalServiceProvider_Chk009
ExternalServiceProvider_Chk011
Standard Compliant Yes

OTL Syntax

ActionRealisation ExternalServiceProvider.GetServiceProviderEventValues(otx:OtxLink providerType, otx:OtxName eventName, event:EventTerm event, esp:ExternalEventResult value);

Description

GetServiceProviderEventValues is an ActionRealisation which retrieves the values of a provider event. To address the right ServiceProviderEvent the EventName and the ProviderType will be adjusted. If the event inside the event attribute does not match to the specified ServiceProviderEvent an TypeMismatchException will be thrown.

Properties

Name Data Type Class Default Cardinality Description
providerType otx:OtxLink - [1..1] This attribute identifies the external provider to execute the service on.

The link will point to the corresponding ServiceProviderSignature.

eventName otx:OtxName [1..1] This attribute identifies the EventSignature in the given ServiceProviderSignature for which event the values will be returned.
event event:Event Term - [1..1] This term represents the value of a ServiceProviderEvent.
value esp:ExternalEventResult - [1..*] Here the event values of the event can be returned to variables. [1..*] results are possible.
- value otx:OtxName - [1..1] This attribute identifies the event value. The link will point to the corresponding EventSignature event value.
- target otx:Variable Variable - [1..1] This variable represents the OTX variable to hold the value of the event. The variable's data type will match to the value data type as declared in the corresponding event signature.

OTL Examples

/// Signatures

package ExternalServiceProvider.ServiceProviderSignature ServiceProviderSignature1
{
	ExternalServiceProvider.ConstructorSignature ConstructorSignature1(String ConstructorExternalInParameter1, String ConstructorExternalInParameter2, String ConstructorExternalInParameter3);
	ExternalServiceProvider.EventSignature EventSignature1(String EventValueParameterDeclaration1);
	ExternalServiceProvider.PropertySignature PropertySignature1(String PropertyValueDeclaration1) accessType READ-ONLY;
	ExternalServiceProvider.PropertySignature PropertySignature2(String PropertyValueDeclaration1) accessType WRITE-ONLY;
	ExternalServiceProvider.ServiceSignature ServiceSignature1(in ByteField ExternalInParameterDeclaration1, ref Float ExternalInOutParameterDeclaration1, out Integer ExternalOutParameterDeclaration1) throws ExternalServiceProvider.ConfigurationException, ExternalServiceProvider.ExecuteException, ExternalServiceProvider.ProviderServiceException;
}
package HMI.ScreenSignature ScreenSignature1();

/// Global Declarations

public procedure main()
{
	/// Local Declarations

	ExternalServiceProvider.PropertyFlag PropertyFlag = @PropertyFlag:READ-ONLY;
	ExternalServiceProvider.ServiceProvider ServiceProvider1;
	String String1 = "Abc";
	String String2 = "Def";
	String String3 = "Ghi";
	ExternalServiceProvider.Service Service1;
	ByteField ByteField1 = &1234;
	Integer Integer1 = 5678;
	Float Float1 = 9.9;
	EventHandling.Event Event1;
	Boolean Boolean1 = false;
	EventHandling.EventSource EventSource1;

	/// Flow

	ExternalServiceProvider.CreateProvider(ServiceProvider1, ServiceProviderSignature1, ConstructorSignature1, {ConstructorExternalInParameter1 = String1, ConstructorExternalInParameter2 = String1, ConstructorExternalInParameter3 = String3});
	EventSource1 = EventHandling.MonitorChangeEventSource(String3);
	EventHandling.WaitForEvent({EventSource1, EventHandling.TimerExpiredEventSource(1000)}, Event1);

	try
	{
		ExternalServiceProvider.GetServiceProviderEventValues(Event1, ServiceProviderSignature1, EventSignature1, {EventValueParameterDeclaration1 = String2});
	}
	catch (TypeMismatchException)
	{
	}

	ExternalServiceProvider.DisposeProvider(ServiceProvider1);
}

See also

CreateProvider
DisposeProvider
ExecuteService
SetProperty
TerminateService
GetProperty
IsDisposed
IsServiceRunning
GetServiceProviderFromEvent
IsServiceExecutionFinishedEvent
IsServiceProviderEvent
ServiceExecutionFinishedEventSource
ServiceProviderEventSource