The MainSample application is a top-level application that demonstrates how to call the runtime operations in the other sample files. The MainSample application represents one way of developing a simple application to work with the APIs.
This sample application does not use the Swing components found in the Step Processors and Launch Step Processor samples or the LogViewer sample. Instead, the sample relies on the command line input and the standard console for output.
Run the sample by entering a command similar to the following:
java LaunchSample username password <server name>:<port
number>/<router instance name> [wfDefinition_filename | wfDefinition_filename
output_filename]
Note For a detailed explanation of the command line, see the Run the sample application section of the Run the Unmodified Samples topic.
MainSample initializes a logger object and a session object, which will be used throughout the workflow process. MainSample instantiates the session object as an instance of the SessionHelper class and uses it to log onto a session. These two objects are then passed to sampleClass, which is an instance of the MainSample class.
The sampleClass object creates and launches a workflow definition, completes the steps, and writes history information to log files. To achieve this, the sampleClass object configures the workflow session with an instance of the SysConfigSample class. SysConfigSample creates a queue, an exposed field, and an index. To view details of workflow design and launch, see the WFDefinitionSample and LaunchSample classes, which are used by this sample.
The outer class sampleClass then invokes the runtime operations, which are performed by the following sample classes:
Note After you have reviewed, compiled, and run the samples, you will notice that some of the classes, like StepProcessorSample, are called more than once to perform similar operations.