Customizing the Sample Java Step Processor

These procedures assume you have configured your Process development environment (see Configuring the Process Development Environment), and are using the Java™ Development Kit (JDK) in native, command line mode. If you are using an IDE, add the vwpanel.jar file to your Java project to use the Process Java UI Toolkit's Swing-based controls. See Java UI Toolkit Overview.

Note: Although only customization of the Step Processor samples is discussed, simple directory and file name changes are all that is necessary to apply these instructions to the Launch Step Processor samples.

To customize the sample Java Step Processor:

  1. In your Process development environment directory, go to the Developer Files\samples\vwpanel subdirectory and copy the \samplestep directory to a new directory on the same branch of the directory tree (for example, Developer Files\samples\vwpanel\newstep).
  2. Change to the renamed directory.
  3. Rename the following sample files (for example, by adding a prefix to match your customization):
  4. Open each renamed file, and do the following:
  5. Compile the samples (from the root "samples" directory to contain the full package name).
  6. Create a new JAR file containing your customized Step Processor.
  7. Sign the JAR file.
  8. Deploy the new Java application on the Application Engine server.
  9. Run the application.

If the new custom Step Processor runs properly, you are ready to customize the Step Processor application/applet source.

Customize the Processor Source

This section describes how to add user interface controls to the custom Step Processor by adding simple fields to indicate when the Step Processor was sent (launch information) and who sent it (originator information).

  1. Open the renamed VWSampleStepPanel.java file.
  2. Define the new controls by adding the following statements at the end of the DECLARE_CONTROLS section (near the bottom of the file):
       //Create labels for the launch date and originator information.
    
        javax.swing.JLabel sentLabel = new javax.swing.JLabel();
        javax.swing.JLabel fromLabel = new javax.swing.JLabel();
    
       //Create label objects for the launch date and originator information.
    
        filenet.vw.toolkit.runtime.step.beans.VWLabel vwSentLabel = 
           new filenet.vw.toolkit.runtime.step.beans.VWLabel();
        filenet.vw.toolkit.runtime.step.beans.VWLabel vwFromLabel = 
           new filenet.vw.toolkit.runtime.step.beans.VWLabel();
    
  3. Locate the following statement:
       iconLabel.setBounds(516,48,216,108);
      
  4. Modify the values to move the icon out of the current position and make room for the new fields. For example, you might change the initial value as follows:
       iconLabel.setBounds(20,48,216,108);
      
  5. Define the launch date information by adding the following statements to the code, in the INIT_CONTROLS section:
       //Display the label text on the JPanel to specify what the launch date information means.
    
       sentLabel.setText("Launched on:");
       add(sentLabel);
       sentLabel.setBounds(320,84,100,24);
    
       //Retrieve and display the launch date for Step Processor.
    
       vwSentLabel.setParameterName("F_LaunchDate");
    add(vwSentLabel);
    vwSentLabel.setBounds(430,84,100,24);
  6. Define the originator information by adding the following statements:
       //Display the label text on the JPanel to indicate what the originator information means.
    
       sentLabel.setText("Step Originator:");
       add(fromLabel);
       fromLabel.setBounds(320,120,100,24);
    
       //Retrieve and display the originator information.
    
       vwFromLabel.setParameterName("F_Originator");
       add(vwFromLabel);
       vwFromLabel.setBounds(430,120,180,24);
      
  7. Save the changes and close the file.
  8. Recompile the samples.
  9. Create a new JAR file containing your newly customized Step Processor.
  10. Deploy the new Java application on the Application Engine server.
  11. Run the application.