Building and Deploying the Sample Java Processors

This topic describes the overall procedure used to build, deploy, and run an unmodified, working sample Step Processor or Launch Step Processor. These procedures step you through the process of compiling, installing, and deploying a sample Step or Launch Step Processor applet or application that is provided with the Panagon eProcess Toolkit. Understanding these procedures will assist you in customizing the sample applications or applets.

The overall procedure for building, compiling, deploying, and running a Step Processor or Launch Step Processor consists of a number of basic steps, each of which is itself a procedure or set of procedures. To help you avoid getting lost in the details of the overall process, the basic overall procedure is provided here, with links to the detailed procedure for each step.

  1. Install the eProcess Toolkit to a new directory on your local system.
  2. Install and configure the Java SDK.
  3. Compile the Step Processor or Launch Step Processor samples.
  4. Create a Java ARchive (JAR) file that contains the compiled versions of the samples.
  5. Sign the JAR file.
  6. Deploy the JAR file on the Web WorkFlo server.
  7. Configure the server for the web application.
  8. Run the Sample Step Processor application.

The remaining sections in this topic provide detailed instructions on accomplishing these steps.

Compile the Sample Processors

The Java samples provided with the Panagon eProcess Toolkit include both an application and an applet version of the Step and Launch Step Processors. If you have not already done so, you must perform the following actions before you can compile these samples:

Compile the unmodified sample Step and Launch Step Processors by performing the following steps:

  1. Navigate to the local directory which contains the development files. If you kept the directory structure the same as the structure on the Web WorkFlo and Toolkit CD, the <drive>...\Developer Files\vwpanel directory on your development system contains the correct directories and files.
  2. Select the \samplestep directory or the \samplelaunch directory, depending on which type of Java Processor you want to compile and test immediately. (Refer to the Java Step Processor Sample Files or the Java Launch Step Processor Sample Files topics for more information on the specific files available in each directory.)
  3. Select all files and subdirectories in the selected directory and change the file attributes from Read-only to Read/Write.
  4. Open a command prompt, and change to the directory containing the Step Processor sample files (for example, \samplestep).
  5. Compile the unmodified Step Processor sample applet by entering a command similar to the following (modify for the appropriate JDK):

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

Note You should specify the location of the package as part of the compiler command, as shown here. Alternatively, if you have already created a batch file that includes the pw.jar location in the CLASSPATH variable, you can specify setenv and need not specify the pw.jar location; for details, see the Configure the Java SDK topic).

Similarly, you compile the unmodified Launch Step Processor sample applet by entering a command similar to the following (from the directory containing the Launch Step Processor sample):

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

Alternatively, if you want to use the sample Java applications, you can compile the unmodified Step Processor sample or Launch Step Processor sample applications by entering commands similar to the following (from the directory containing the appropriate sample):

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

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

  1. Create a Java ARchive (.JAR) file containing the compiled classes.
  2. Deploy the JAR file on the Web WorkFlo server
  3. If you compiled the applications only, or you only want to test the applications, you can run the sample Processor applications without first having to install them on the Web WorkFlo server.

Create a Java ARchive (JAR) file

Whenever you compile the unmodified applets samples, modify and rename the applets, or customize the samples, you must create a Java Archive file to contain the compiled classes. (Refer to Sun Microsystems JDK documentation for more information on using the Java Archive tool.) The following procedure assumes you have already compiled the samples without compiler errors.

Create a JAR file, for example for the Step Processor sample, by performing the following steps:

  1. Open a command prompt, and cd to the parent directory of the directory containing the Step Processor sample (that is, ...\Developer Files\).
  2. Create a .JAR file containing only the compiled classes by entering a command similar to the following (modify for the appropriate JDK):

C:\jdk1.3.1\bin\jar.exe -cvf sample.jar samples\vwpanel\samplestep\*.class samples\vwpanel\samplestep\resources\*.class samples\vwpanel\samplestep\images\*.class samples\vwpanel\samplestep\images\*.gif

You should receive output similar to the following:

added manifest
adding: samplestep\VWSampleStepApplet.class(in = 2617) (out= 1297)(deflated 50%)
adding: samplestep\VWSampleStepApplication.class(in = 3090) (out= 1542)(deflated 50%)
adding: samplestep\VWSampleStepPanel.class(in = 4222) (out= 2053)(deflated 51%)
adding: samplestep\resources/VWResource.class(in = 437) (out= 299)(deflated 31%)
adding: samplestep\images/VWImageLoader.class(in = 1239) (out= 602)(deflated 51%)
adding: samplestep\images/icon.gif(in = 1432) (out= 1015)(deflated 29%)
adding: samplestep\images/step.gif(in = 1592) (out= 1260)(deflated 20%)

  1. Once the classes are added to the JAR file, deploy the JAR file on the Web WorkFlo server.

Note You must sign the JAR file (the Netscape Object Signing Certificate is recommended).

If you intend to use several .JAR files, you should add all of the compiled files into a single .JAR file and deploy just that one file. Alternatively, you can specify multiple .JAR files using a comma (",") delimiter (however, be aware that not all browsers support multiple .JAR files). If you plan to use several JAR files, you should place each .JAR file in the same directory as the modified .ASP file that contains the applet.

Configure the Server for the Web Application

Before you can run a Step or Launch Step Processor application/applet (e.g., the sample Java Step Processor, VWSampleStepApplication, included with the Panagon eProcess Toolkit), if you have not already done so, you will need to use the Configuration Console to specify the web application defined for VWService. For details on how to configure the server for a web application, see "Managing VWServices" in the eProcess Configuration Console Help.

Once you have configured the server for the web application, you specify the web application when you run your application/applet. For example, to run the sample Java Step Processor, VWSampleStepApplication, you specify the Panagon web application as a parameter as follows: webApp=WEB_WORKFLO (previously, you would have specified: product=PANAGON). For information and examples on running an application/applet, see the next step, Run the Sample Step Processor Application.

Run the Sample Step Processor Application

If you compiled the Step Processor application samples, you will need to create a valid workflow on your WorkFlo Services server to run and test them. You can use Designer and Administrator to create a workflow and locate a valid work object number.

To run the unmodified sample Processor applications, use the following procedure:

  1. In Designer, create a workflow.
  2. Validate and run the workflow.
  3. Retrieve a workflow object number (WobNumber) for an object in a queue from your workflow.
  4. Run the Step Processor application sample by entering a command similar to the following:

    javaw -classpath .;<sample.jar>;C:\<your directory>\pw.jar;%CLASSPATH% <package name>.VWSampleStepApplication /hostName=<host name> /routerNames=<local router> /routerPorts=1099 /idmPort=1099 /webApp=WEB_WORKFLO /queueName=<queue name> /wobNumber=<object number>;

    where <sample.jar> is the .JAR file, the <package name> is the period-separated (".") directory structure in which the sample files reside, <host name> is the name of the Web WorkFlo server, <router> is the name of the router on the Web WorkFlo server, <queue name> is the name of the queue being accessed, and <object number> is the work object number (GUID) assigned to the work object, by WorkFlo Services.

    For example, you might enter a command similar to the following:

    javaw -classpath .;C:\Developer Files\samples\vwpanel\sample.jar;C:\<your directory>\pw.jar;%CLASSPATH% samples\vwpanel\samplestep\VWSampleStepApplication /hostName=asgard /routerNames=vwrouter /routerPorts=1099
    /idmPort=1099 /webApp=WEB_WORKFLO /queueName=InBox /wobNumber=B8D270F79636E1489BA9EC2DD9F7E950

  5. Run the Launch Step Processor application sample by entering a command similar to the following:

    javaw -classpath .;<sample.jar>;C:\<your directory>\pw.jar;%CLASSPATH%; <package name>\VWSampleLaunchApplication /hostName=<host name> /routerNames=<local router> /routerPorts=1099 /idmPort=1099 /webApp=WEB_WORKFLO /workflowDefinitionDocID=<>/mainAttachmentDocID=<> /subject=<subject>

    where <sample.jar> is the .JAR file, the <package name> is the period-separated (".") directory structure in which the sample files reside, <host name> is the name of the Web WorkFlo server, <router> is the name of the router on the Web WorkFlo or WorkFlo Services server, <queue name> is the name of the queue being accessed, <> is the workflow definition ID assigned to the workflow definition, <> is the library ID assigned to the attachment, and <subject> is the subject specified for the step that launches the workflow.