Arbitrary Length Tasks and Request-Response Operations

When a process exposes a request-response operation, a client application pauses its activity when it sends the request and waits for the response from the process before continuing. If the result is not returned within a predefined time period, the request-response operation may timeout and fail.

An arbitrary length task is one that takes an indefinite period of time to complete, and so cannot be guaranteed to complete within this predefined time period:

  • User tasks and manual tasks should always be regarded as arbitrary length tasks.
  • Other tasks may or may not be regarded as arbitrary length tasks depending on the context in which they are used - for example, is a particular database call expected to complete in milliseconds, seconds or minutes (under normal circumstances)?
Note: You should only use a request-response operation when there are no arbitrary length tasks between the tasks or events being used to expose the request and response messages.

If arbitrary length tasks mean that you cannot use a request-response operation, you should use separate one-way operations instead - see Handling a Process that Includes Arbitrary Length Tasks for more information.

For example, the following screenshot shows a (partial) process which is intended to provide a balance enquiry web service. On receiving a balance request from an external application (or another process), the process obtains some further customer details, makes a database call to obtain the balance, and then returns the customer’s balance to the caller.

In this case the web service should not be implemented using a request-response operation, because the inclusion of a user task may cause the operation to time out.

The next screenshot shows an alternative version of the process, where the additional customer details are obtained using a database task rather than a user task. In this case, whether the web service should be implemented using a request-response operation will be a design decision, based on the characteristics of the script and database calls involved, and whether or not they are regarded as arbitrary length tasks.