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:
Note To run the API samples you must have workflow server running an active Process Pooled Process Manager (PPM). To view additional information about the Process Engine's Pooled Process Manager, see the Process Engine Overview. The samples will not run without being able to attach to the Process Engine. Refer to Help for Process Engine Administrators for additional information on the PPM and routers.
C:\jdk1.3.1\bin\javac.exe -classpath .;C:\<your directory>\eProcess.jar;C:\<your directory>\wcm.jar;%CLASSPATH% MainSample.java
Alternatively, you need not specify the location of wcm.jar and eProcess.jar files if you have already created a batch file (to set variables) that includes the eProcess.jar and wcm.jar locations 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.javaOr you can compile all of the classes in the directory at once. For example:
setenv
C:\jdk1.3.1\bin\javac.exe *.javaNote The complete pathname for javac.exe is not necessary if your system PATH variable already includes the corresponding javac.exe.
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 Process Engine (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.
Note The FileNet default RMI port for the router (also for the PPM and IDM port) is 32771.
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 myserver, port 32771, 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 Sys Admin myserver:32771/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.
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.