Sleep Service

The Sleep service pauses a business process for the amount of time specified in its configuration.

The following table provides an overview of the Sleep service:

Category Description
System name SleepService
Graphical Process Modeler (GPM) categories All Services, System
Description Sleeps for the amount of time specified in the business process.
Preconfigured? Yes
Requires third-party files? No
Platform availability All supported Sterling B2B Integrator platforms
Related services No
Application requirements No
Initiates business processes? No
Invocation Runs as part of a business process.
Business process context considerations No
Returned status values
Returned status values:
  • 0 –Success
  • 1 – Error
Restrictions No
Persistence level None

Configuring the Sleep Service

Use the field definitions in the following table to set up the service configuration in the GPM:

Field Description
Config Select the name of the service configuration from the list.
MSEC_SLEEP_INTERVAL Duration of sleep time in milliseconds. Required.
SLEEP_INTERVAL Duration of sleep time in seconds. Required.

Business Process Example

The following example illustrates how the Sleep service can be used in a business process. The first service in the business process is the Sleep service, which causes the business process to pause for 60 seconds, then uses the File System adapter to collect a file from a folder called “Test” on the local drive:

This is how the business process looks in the GPM:

This is the BPML for the business process:

<process name="default">
 <sequence>
    <operation name="Sleep Service">
      <participant name="SleepService"/>
     <output message="SleepServiceInputMessage">
       <assign to="SLEEP_INTERVAL">60</assign>
       <assign to="." from="*"></assign>
     </output>
      <input message="inmsg">
       <assign to="." from="*"></assign>
     </input>
    </operation>
   <operation name="File System Adapter">
     <participant name="Test"/>
      <output message="FileSystemInputMessage">
       <assign to="Action">FS_COLLECT</assign>
       <assign to="." from="*"></assign>
     </output>
      <input message="inmsg">
       <assign to="." from="*"></assign>
     </input>
    </operation>
 </sequence> 
</process>

This is the status message for the Sleep service step, which you can view from the Execution Manager after the business process completes:

Parameters Passed From Business Process to Service

The following table contains the parameters passed from the business process to the Sleep service:

Parameter Description
MSEC_SLEEP_INTERVAL Duration of sleep time in milliseconds.
SLEEP_INTERVAL Duration of sleep time in seconds.