Extensions.ExternalServiceProvider.ExecuteService
Jump to navigation
Jump to search
Classification
Name | ExecuteService |
Short Description | Executes externally implemented functionality of the provider |
Class | Action |
Extension | OTX ExternalServiceProvider extension |
Group | ExternalServiceProvider related actions |
Exceptions | esp:ProviderDisposedException esp:ProviderServiceException otx:TypeMismatchException |
Checker Rules | ExternalServiceProvider_Chk001 ExternalServiceProvider_Chk005 ExternalServiceProvider_Chk006 |
Standard Compliant | Yes |
OTL Syntax
ActionRealisation ExternalServiceProvider.ExecuteService(otx:OtxLink providerType, otx:OtxName service, Boolean executeAsync, esp:ServiceProviderTerm serviceProvider, esp:ServiceArguments arguments, esp:ServiceVariable
serviceHandle);
Description
The ExecuteService action will execute a service provided by an external service provider. The action executes externally implemented functionality of the provider. The required parameters of the service are defined in the ServiceSignature.
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. | |||||
serviceSignature | otx:OtxName | - | [1..1] | This attribute identifies the service that will be executed. The service name will be defined within the corresponding service declaration within the ServiceProviderSignature. | |||||
executeAsync | Boolean | - | [0..1] | This option tells the communication backend to make this service execution non-blocking. This means that if executeAsync is set to true, the OTX execution flow will immediately move on to the next Action, without waiting for the result of the ExecuteService action. An OTX sequence can make use of the ServiceExecutionFinishedEventSource term to be notified when the service has finished. | |||||
serviceProvider | esp:ServiceProvider | Term | - | [1..1] | A service of this ServiceProvider will be executed. | ||||
arguments | esp:ServiceArguments | - | [0..1] | This simple container element represents the list of arguments for a service. The content-type is a <xsd:choice> [0..1] which allows an arbitrary-length list of arguments for a service. | |||||
- inArgument | esp:ExternalInArgument | - | [1..1] | Describes an input argument for a service call. An input argument may be omitted if and only if there is an explicit initial value defined for the corresponding parameter. This initial value applies in place of the missing argument. The parameter for the argument is identified by name. | |||||
-- parameter | OtxName | - | [1..1] | This attribute represents the target parameter to which the argument will be assigned. | |||||
-- term | Term | Term | - | [1..1] | This term represents the value to be used as input argument for the service parameter. The value data type will match to the parameter data type as declared in the corresponding service signature. | ||||
- inoutArgument | esp:ExternalInOutArgument | - | [1..1] | Describes an input&output argument for a service call. Arguments for input&output parameters will be passed by reference. This means that any change to the parameter value is immediately visible to the caller also. An input&output argument may be omitted if and only if there is an initial value defined for the parameter. This initial value applies in place of the missing argument. The parameter for the argument is identified by name.
| |||||
-- parameter | OtxName | - | [1..1] | This attribute represents the output parameter whose value will be assigned to the target OTX variable. | |||||
-- target | Variable | Variable | - | [1..1] | This variable represents the OTX variable to hold the value of the parameter of the service. The variable's data type will match to the parameter data type as declared in the corresponding signature. | ||||
- outArgument | esp:ExternalOutArgument | - | [1..1] | Describes an output argument for a service call. Output arguments may be omitted freely (e.g. in the case when there is no interest in the returned data). The parameter is identified by name, the argument is a variable.
| |||||
-- parameter | OtxName | - | [1..1] | This attribute represents the output parameter whose value will be assigned to the target OTX variable. | |||||
-- target | Variable | Variable | - | [1..1] | This variable represents the OTX variable to hold the value of the parameter of the service. The variable's data type will match to the parameter data type as declared in the ServiceSignature. | ||||
serviceHandle | Service | Variable | - | [0..1] | For every started service a serviceHandle is returned. With this handle the running service can be stopped (if possible). It is also possible to check if the service is already running. |
OTL Examples
/// Signatures
package ExternalServiceProvider.ServiceProviderSignature ServiceProviderSignature1
{
ExternalServiceProvider.ConstructorSignature ConstructorSignature1(String ConstructorExternalInParameter1, String ConstructorExternalInParameter2, String ConstructorExternalInParameter3);
ExternalServiceProvider.EventSignature EventSignature1(String EventValueParameterDeclaration1, String EventValueParameterDeclaration2);
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;
String String2;
String String3;
ExternalServiceProvider.Service Service1;
ByteField ByteField1;
Integer Integer1;
Float Float1;
/// Flow
ExternalServiceProvider.CreateProvider(ServiceProvider1, ServiceProviderSignature1, ConstructorSignature1, {ConstructorExternalInParameter1 = String1, ConstructorExternalInParameter2 = String1, ConstructorExternalInParameter3 = String3});
ExternalServiceProvider.ExecuteService(ServiceProvider1, ServiceProviderSignature1, ServiceSignature1, {ExternalInParameterDeclaration1 = ByteField1, ExternalInOutParameterDeclaration1 = Float1, ExternalOutParameterDeclaration1 = Integer1}, Service1, false);
ExternalServiceProvider.DisposeProvider(ServiceProvider1);
}