External |
public static ExternalServiceResult ExecuteService( Guid executionKey, Document document, IExternalData data )
Exception | Condition |
---|---|
ArgumentException | The execution key is either invalid or of a service that is not registered. To execute a service, the key returned by RegisterService method must be used. -or- The execution key is of a service that is already being executed. |
ArgumentNullException | A non-optional argument was null |
InvalidOperationException | Executing a recordable service in a document that is not modifiable. |
Execution of a service should be invoked only by the application that registered the service. The execution will use the active server (or servers in the case of a multi-server service) currently set for the given document. If there is no server specifically set for the document the current application-wide server (or servers) will be applied.
Please note that recordable services may only be executed in a document that is currently modifiable. An exception will be thrown if it isn't so. This requirement does not apply to non-recordable services.
This method is primarily intended for executing of recordable services, for it is assumed that any changes made to the model during the service's execution are likely tied with the service's currently active servers. If the service was registered as non-recordable, changes to the model may still be made, but the framework does not assume any explicit or implicit correlations between the document changes and servers that caused them, therefore it is not recorded which server did what. This fact is very important, particularly in work-sharing environment. If it may happen that different local users can have different servers installed and available, it is imperative for a non-serialized service that its servers are completely compatible with (or indifferent to) document modifications made by other servers of the same service. The responsibility for complying with this assumption is entirely on the service's provider.