Skip to main content

xSuite Interface Windows Prism 5.x – Online Help

DirectProcess Web Service

The DirectProcess Web Service is a web service for direct batch processing. With certain limitations (see Functional Restrictions), this web service can process normal scenarios.

Contrary to regular xSuite Interface functionality, the input, processing, and output steps are not processed asynchronously with the help of multiple independent worker instances and a management database. Instead, the steps are processed synchronously one after another by the web service instance itself. The web service receives a batch with one or more documents as input data, performs the desired steps on the documents according to the scenario configuration, and returns the modified batch directly as a result value.

Syntactically, the input batch corresponds to that of the Input Web Service (see Input System "WebServiceInput"), and the output batch corresponds to that of the Output Web Service (see Output System "WebServiceOutput").

The DirectProcess Web Service has the following endpoint:

POST /api/v1/DirectProcess/{Tenant}/{Scenario}/Batches [DirectProcessBatch]

Notice

Unlike the Input Web Service and the Output Web Service, there is no provision here for optional transfer of file attachments in separate calls for the purpose of breaking the total amount of data into smaller units. The attachments are always carried directly as Base64-encoded binary data into the document objects of the batch.

The DirectProcess Web Service should only be used in cases where only individual files or only index data are processed. This is also recommended because all data stored during processing is stored exclusively in the main memory. File attachments are not outsourced to a separate storage destination.

Property

Description

DirectProcessService.Scenario[].ConfigSource*

DirectProcessService.Scenario[].Tenant

List of the processing scenarios that the DirectProcess Web Service is meant to execute

The .ConfigSource property contains the reference to the data source with the scenario configuration analogous to the Worker[].ConfigSource[] property of a worker instance. If no .Scenario[] is configured or if none contains a .ConfigSource, the web service will automatically remain inactive.

Since no tenant-specific database and storage resources are used in this context, the use of the .tenant specification (default value: "Default") is limited here to separate logging and to tenant-specific constants in the configuration data.

A scenario for use in the DirectProcess Web Service must always take "WebServiceDirectProcess" as the input system (see Input System "WebServiceDirectProcess"). A separate output system for the batch that is returned by the web service as the result, on the other hand, does not need to be configured. The properties required for the output are already defined in the context of the input system.

The possible use cases for the DirectProcess Web Service are manifold. On the one hand, processing paths that are typical for xSuite Interface (e.g., the transfer of a document to an archive system) can be mapped with it. The document reference generated by the archive can be returned directly as a result here, in contrast to asynchronous processing.

On the other hand, the scenario does not necessarily have to include an output step. The processing can also end as soon as the processing step. This is the case, for example, if the web service is only used for the format conversion of an input file (i.e., only a file conversion macro is executed in the scenario and the target file is returned).

The following example shows a scenario configuration to convert an arbitrary source file to PDF, where the source file filter NOT(batch.json) is needed because the input system automatically generates an artificial file attachment with the raw JSON data of the input batch, but it is not converted.

{
   "InputSystem": {
      "Type": "WebServiceDirectProcess",
      "OutputFileFilter": "*.pdf"
   },
   "ProcessMacro": [
      {
         "Macro": [
            "ConvertToPdf('NOT(batch.json)')"
         ]
      }
   ]
}

The file attachment in the input data and in the output data must necessarily be embedded in a batch object and a document object (even if only the pure binary data is required in the present case). However, if you have more complex operations, it is a good idea to use the fields of the document object for dynamic control parameters from outside.

Functional Restrictions

The following restrictions apply to the use of the web service and the configuration of the scenarios executed by this web service:

Functionality

Restriction/Comment

Status management

The management database is configured for regular operation and is not used by the web service to persist processing states of batch and document data. This data is volatile, and the processing of a submitted batch is either successful or unsuccessful in its entirety.

If processing is unsuccessful, the web service immediately reports back an error. Status management and a reprocessing attempt can only be made by the calling web service client.

Therefore, status monitoring for such batches is not possible in xSuite Interface. The monitoring options are limited to normal logging.

Duplicate checks

A duplicate check (Input.CheckDuplicate***) is not supported, because it would have to check against batches persisted in the database.

Change of processing scenario

The function for dynamically switching the processing scenario (Process.ScenarioSwitchMacro) is based on a document persisted in the database. Therefore, it cannot be used in the context of the web service.

Waiting for condition

Functionalities that wait asynchronously for a condition for further processing and thus interrupt the synchronous processing flow cannot be used.

In particular, these are functions for temporally deferring a batch (SetDeferred()) and for temporally repeating an erroneous processing (General.Retry***). The use of asynchronously waiting output systems, such as "XSuiteConveyorResult," is not permitted either.

Aborting processing

Functions that trigger an abort of processing (SetError(), SetSuspended(), and SetCanceled()) result in a direct error response from the web service.

Data backup

There is no data backup of the batches. If necessary, a data backup must be implemented on the part of the calling process.