Run the Unmodified Samples

To ensure that your development system is set up correctly and to gain a basic understanding of how to connect to a session, query a workflow queue, and access work objects, it is recommended that you first compile and run the API samples as delivered (without modifying the samples' Java source code).

To run the API samples, perform the following steps:

  1. Compile the API samples
  2. Run the sample application
  3. Review the sample output

Note To run the API samples you must have workflow server running an active eProcess Pooled Process Manager (PPM). To view additional information about the eProcess Pooled Process Manager, see Panagon eProcess Services architecture. The samples will not run without being able to attach to the Web WorkFlo Server.

Compile the API samples

  1. If you have not already done so, configure the JDK on your development system.
  2. cd to the directory containing the API samples (including the main sample file, MainSample.java), and enter a command similar to (assumes the Sun JDK 1.3.1 on a Windows platform; modify as needed):

    C:\jdk1.3.1\bin\javac.exe -classpath .;C:\<your directory>\pw.jar;%CLASSPATH% MainSample.java

Alternatively, you need not specify the location of pw.jar if you have already created a batch file (to set variables) that includes the pw.jar location in the CLASSPATH variable (for details, see the Configure the Java SDK topic). If this is the case, you could specify:

setenv
C:\jdk1.3.1\bin\javac.exe MainSample.java

Or you can compile all of the classes in the directory at once. For example:

setenv
C:\jdk1.3.1\bin\javac.exe *.java

Note The complete pathname for javac.exe is not necessary if your system PATH variable already includes the corresponding javac.exe.

Run the sample application

Once you have compiled the samples, you can run them. The command line syntax for the running the MainSample application is as follows:

MainSample <username> <password> <server name>:<port number>/<router instance name> [<wfDefinition_filename> | <wfDefinition_filename> <output_filename>]

where: <username> is an existing user name in the eProcess Service (for example, SysAdmin ); <password> is the valid password for the specified user; <server name> (defaults to the local machine) and <port number> (defaults to the default port number) are entities on the web server, and <router instance name> is the name you want to specify for your local instance of the router object.

The first three parameters are required; the remaining parameters are optional. The <wfDefinition_filename> is an existing workflow definition (.pep) file, and the <output_filename> is the file name where you want the results of the application directed.

Suppose, for example, you want to run the unmodified samples as SysAdmin, with a router instance on server Asgard, port 1099, named myrouter, without specifying workflow definition (*.pep) or output files. In this case you would enter a command similar to the following:

java -classpath .;%CLASSPATH% MainSample SysAdmin Asgard:1099/myrouter

When the MainSample application runs without encountering errors, you will receive output similar to the following, in the same command window from which you ran the MainSample application:

Writing messages to file: MainSample.out
~~ Starting the main sample.

~ Starting SysConfigSample execution.
~ SysConfigSample execution complete.

~ Starting WFDefinitionSample execution.
~ WFDefinitionSample execution complete.

~ Starting LaunchSample execution.
~ LaunchSample execution complete.

~ Starting RosterSample execution.
~ RosterSample execution complete.

~ Starting StepProcessorSample execution.
~ StepProcessorSample execution complete.

~ Starting QueueSample execution.
~ QueueSample execution complete.

~ Starting MilestoneSample execution.
~ MilestoneSample execution complete.

~ Starting OperationsSample execution.
~ OperationsSample execution complete.

~ Starting SystemStepSample execution.
~ Launching Generated Workflow
~ SystemStepSample execution complete.

~ Starting StepProcessorSample execution.
~ StepProcessorSample execution complete.

~ Starting ProcessSample execution.
~ ProcessSample execution complete.

~ Starting StepProcessorSample execution.
~ StepProcessorSample execution complete.

~ Starting LogSample execution.
~ LogSample execution complete.

~~ MainSample execution complete.

Note This output represents the typical console output results for the first time the MainSample application is run. If the MainSample application is run a second time, without modification, you will receive notification stating the required queues already exist.

Review the sample output

You will notice that several files appeared as result of running the samples. This section lists and describes, in general terms, each of the files created by the unmodified samples.

Note If you followed the procedures for compiling and running the samples, the output files should reside in the same directory as the MainSample.class file.