Extensions.ExternalServiceProvider.CreateProvider

From emotive
Jump to navigation Jump to search

Classification

Name CreateProvider
Short Description An instance of the related provider via calling the specified constructor
Class Action
Extension OTX ExternalServiceProvider extension
Group ExternalServiceProvider related actions
Exceptions esp:ExternalServiceProviderException
otx:TypeMismatchException
Checker Rules ExternalServiceProvider_Chk001
ExternalServiceProvider_Chk002
ExternalServiceProvider_Chk004
ExternalServiceProvider_Chk010
Standard Compliant Yes

OTL Syntax

ActionRealisation ExternalServiceProvider.CreateProvider(otx:OtxName constructor, otx:OtxLink providerType, esp:ServiceProviderVariable serviceProvider, esp:ConstructorArguments arguments);

Description

CreateProvider is an otx:ActionRealisation which returns an instance of the related provider via calling the specified constructor. If a new instance is created, this depends on the underlying system.
In the case of a singleton or a static implementation of the provider CreateProvider returns an existing instance. For a static implementation of the provider a CreateProvider without a constructor attribute and without any parameters will be called.

Properties

Name Data Type Class Default Cardinality Description
constructor otx:OtxName - [0..1] This attribute identifies the constructor that will be called. If this attribute is not given no constructor is called within the runtime environment. This feature is needed for already instantiated classes that need no construction. The link will point to the corresponding ConstructorSignature.
providerType otx:OtxLink - [1..1] This attribute identifies the external provider. From this provider the constructor will be called. The link will point to the corresponding ServiceProviderSignature.
serviceProvider esp:ServiceProvider Variable [1..1] Specifies a ServiceProvider declaration to hold the new instance of ServiceProvider.
arguments esp:ConstructorArguments - [0..1] This simple container element represents the list of arguments for a constructor. The content-type is a <xsd:choice> [0..1] which allows an arbitrary-length list of input arguments for a provider constructor.
- inArgument esp:ExternalInArgument - [1..1] Describes an input parameter for a provider constructor.
-- 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.

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 String ExternalInParameterDeclaration1, ref String ExternalInOutParameterDeclaration1, out String 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;

	/// Flow

	ExternalServiceProvider.CreateProvider(ServiceProvider1, ServiceProviderSignature1, ConstructorSignature1, {ConstructorExternalInParameter1 = String1, ConstructorExternalInParameter2 = String1, ConstructorExternalInParameter3 = String3});
}

See also

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