workflowLauncher: Running a Business Process from a Command Line
Sterling B2B Integrator provides a utility that is called workflowLauncher that you can use to start a business process from a command line. The utility starts a business process and provides the status when it completes, or when a timeout occurs (whichever comes first).
About this task
To launch a business process from a command line:
Procedure
- Change to the install_dir/bin directory.
- Run one of the following commands:
- (For UNIX) - ./workflowLauncher.sh -n BPname [option(s)]
- (For Windows) - workflowLauncher.cmd
-n BPname [option(s)] BPname is the name of the business process you want to launch. The available options are listed in the following table:
Option Description -n BPname Specifies the name of the business process definition to launch. Mandatory.
Example: workflowLauncher.sh -n testBP
An error will be generated if the business process name is not provided.
-s Specifies Silent mode. Optional. In Silent mode, less information about the business process is output to the standard output. Default is Verbose mode. -u username Specifies the user name from which to include the userToken. Optional.
Example: -u username
This parameter is used to specify the user token of the business process.
-d directory Specifies the output directory. Optional.
Example: -d absolutePath/directory
Used in conjunction with the -t parameter when you generate step XML trace files. This is used to set the directory output of the trace files.
-t Turns on step XML trace generation. Optional. Used in conjunction with the -d parameter when you want to generate XML trace files.
By default, the trace file name will be prefixed with the business process ID. To turn this feature off, use the -o parameter.
-o Used to prevent prefixing the trace file name with the business process ID when generating step XML trace files. Optional. -v versionNumber Specifies a specific version of the business process definition to launch. Optional.
Example: -v business_process_version_number
The version number is not the user description string. It is the internal running number (a positive integer) that is automatically incremented each time you check in a new version of the same business process (as described using the Graphical Process Modeler and/or XML). If there is only one version, the version number will be 1. An error will be generated if the version number is not found.
You can view the version number by resting your mouse on, or clicking the information icon for the business process in the Change History section of the Sterling B2B Integrator Business Process Source Manager.
-f inputFile Specifies a file to use as the primary document when launching the business process. Optional.
Example: -f path/filename
Only one file is allowed. An absolute path or a relative path to the file may be used. To specify the encoding of the file, use the -e parameter.
An error will be generated if the file is not found.
-e encoding Specifies the encoding of the primary document. Optional.
Example: -e encodingName
Used in conjunction with the -f parameter.
To see what encoding names are supported, see the encodings.properties file in the install_dir/properties directory. The full listing is shown in the encodings_large.properties file.
-w count Specifies the number of times to sleep. Default is 10.
Example: -w count
Used in conjunction with the -i parameter to define the total timeout value. For an example showing the total timeout value, see the -i parameter.
-i time Specifies the length of time, in milliseconds, to sleep. Default is 3000 (3 seconds).
Example: -i time
Used in conjunction with the -w parameter to define the total timeout value.
For example, the default value for -i time is 3000 milliseconds and the default value for -w count is 10. Therefore, the default timeout value is 30,000 milliseconds (3000 milliseconds x 10), or 30 seconds.
-x Specifies not to return an exit code. Optional. By default, the utility returns an exit code. -h | -? Displays the Help screen. Exit Codes
The workflowLauncher utility returns the following exit codes:Exit Code Description 0 The business process completed with success status. 1 The business process completed with error status. 99 The workflowLauncher utility reached timeout while waiting for status from the business process.