Sterling Connect:Direct Server Run Task Service
This is an overview of the Sterling Connect:Direct Server Run Task service:
System Name | Sterling Connect:Direct® Server Run Task Service |
Graphical Process Modeler (GPM) categories | All Services, Applications > IBM > IBM® Sterling Connect:Direct |
Description | Executes a program or command synchronously to the remaining steps in a Process. The program or command can execute locally or on the remote Sterling Connect:Direct node. User programs can be run in different environments. |
Business usage | You want to execute a job on a mainframe. You can write a business process that uses the Run Task service to execute a script on a remote Sterling Connect:Direct node on the z/0S platform and then wait for the completion of the run task operation. |
Usage example | You execute a script that compresses and archives log files synchronously on a remote Sterling Connect:Direct Server. |
Preconfigured? | A Sterling Connect:Direct Server adapter must be configured before using this service |
Requires third party files? | No |
Platform availability | All supported Sterling B2B Integrator platforms |
Related services | The Sterling Connect:Direct Server Run Task Service works between a Sterling Connect:Direct Server Begin Session Service and a Sterling Connect:Direct Server End Session service, |
Application requirements | For information, search for Requirements. |
Initiates business processes? | No |
Invocation | The business process running this service must be started by a user with permission to issue the Run Task statement on the target Sterling Connect:Direct server. |
Business process context considerations | None |
Returned status values |
|
Restrictions | None |
Persistence level | None |
Testing considerations | None |
Implementing the Sterling Connect:Direct Server Run Task Service
To implement the service, complete the following tasks:
- Configure the Sterling Connect:Direct Server adapter to use with this service.
- Create a Sterling Connect:Direct Run Task service configuration.
- Configure the Sterling Connect:Direct Server Run Task.
- Use the service in a business process.
Sterling Connect:Direct Server Run Task Service Settings
Field | Description |
---|---|
Program | Specifies the operation to be performed in the remote environment. This field is
optional depending on the platform where the operation will run. For more information, see the IBM Sterling Connect:Direct for Microsoft Windows documentation for the
specific platform you are communicating with. The valid values depend on the destination Sterling Connect:Direct server. For example, the valid values for Sterling Connect:Direct for Windows are:
|
SessionToken | Identifies an established session between two Sterling Connect:Direct nodes. Required. Session integrity cannot be guaranteed if the session token is omitted. |
SystemOpts | Specifies either the program and its arguments or only the arguments passed to
the program when it is started. This is field is optional depending on the platform where the
operation will run. For more information, see the Sterling Connect:Direct documentation for the specific
platform you are communicating with. The valid values depend on the destination Sterling Connect:Direct server. For example, the valid values for Sterling Connect:Direct for Windows are:
|
Parameters Passed from a Business Process to a Run Task Service
This table describes the parameters passed from the business process to the Sterling Connect:Direct Server Run Task service:
Field | Description |
---|---|
Program | Specifies the operation to be performed in the remote environment. |
SessionToken | Identifies an established session between two Sterling Connect:Direct nodes. Valid value is an XML structure
that includes the following elements:
|
SystemOpts | Specifies either the program and its arguments or only the arguments passed to the program when it is started. |
MaxTimeToWait | Specifies a period of time the service should wait for the task to complete on the remote CD node before timing out. Valid value is in seconds. If not specified, the period to wait is used from the MaxSocketReadTimeout parameter value set in the Connect Direct Server adapter. |
Parameter Passed from a Run Task Service to a Business Process
This parameter is passed from the Sterling Connect:Direct Server Run Task service to the business process:
Parameter | Description |
---|---|
Status | Indicates whether the remote job was executed. Note: This does not address the
success of the executed job. It only identifies if it was executed.
|
Business Process Example of the Run Task Service for Sterling Connect:Direct for UNIX
Each parameter's value and syntax is defined by the remote Sterling Connect:Direct platform and underlying operating system. When the remote platform operating system is UNIX/Linux, the command and its arguments, if any, are specified as the Program parameter value and in the same syntax that they would be entered at a shell prompt. For example, to execute the 'ls' command with the '-1' option (single column output) and send the output to a file called 'ls.out' locally on a UNIX/Linux host, type the following at a shell prompt:
$ ls -1 > ls.out
To specify this operation in the RunTask Service, assign the text to the RunTask Service Program parameter in the business process:
<assign to="Program">ls -1 /tmp > ls.out</assign>
Following is a business process for UNIX with the Program parameter:
<process name = "SampleRunTask">
<sequence>
<operation name="CD Server Begin Session Service">
…
</operation>
<operation name="CD Server Run Task Service">
<participant name="CDServerRunTask"/>
<output message="CDServerRunTaskServiceTypeInputMessage">
<assign to="Program">ls -1 /tmp > ls.out</assign>
<assign to="." from="*"></assign>
</output>
<input message="inmsg">
<assign to="." from="*"></assign>
</input>
</operation>
<operation name="CD Server End Session Service">
…
</operation>
</sequence>
</process>
Business Process Example of the Run Task Service for Sterling Connect:Direct for Microsoft Windows
When a Sterling Connect:Direct for Microsoft Windows node receives a request to execute a task, the business process must specify whether or not the task requires a cmd shell to execute. Sterling Connect:Direct for Microsoft Windows defines a syntax for communicating this information. To execute a program, the pgm and args keywords are used:
<assign to="Program">pgm(\path\file.exe) args(arg1 arg2 arg3)</assign>
To execute a Windows command:
<assign to="Program">cmd(command arg1 arg2 arg3)</assign>
The following business process demonstrates how to configure the Sterling Connect:Direct
RunTask Service:<process name = "SampleRunTask">
<sequence>
<operation name="CD Server Begin Session Service">
…
</operation>
<operation name="CD Server Run Task Service">
<participant name="CDServerRunTask"/>
<output message="CDServerRunTaskServiceTypeInputMessage">
<assign to="Program">cmd(dir mp > mp\dir.out)</assign>
</output>
<input message="inmsg">
<assign to="." from="*"></assign>
</input>
</operation>
<operation name="CD Server End Session Service">
…
</operation>
</sequence>
</process>
Run Task Service Parameter for Sterling Connect:Direct for z/OS
The SystemOpts parameter value is appended to the Program parameter value. Use this parameter when the remote node is Sterling Connect:Direct for z/OS®. In this case, the Program parameter value specifies the remote program name only. Any remote program parameters are specified using the SystemOpts parameter. Do not enclose values in double quotes. For information about the format of the SystemOpts parameter in Sterling Connect:Direct for z/OS, refer to the Sterling Connect:Direct Process Language Web Site.
The following example uses the data type of character in the parameter list:
<assign to="SystemOpts">C' ALLOC',C' DSN=CSDQA1.O.TESTFILE.SMS2',
C' DISP=(MOD,DELETE)',F'-1',C' UNALLOC',C' DSN=CSDQA1.O.TESTFILE.SMS2'
</assign>