IBM FileNet P8, Version 5.2.1            

Customizing the Sample Java Step Processor

These procedures assume that you configured your 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.

For information about the Process development environment, see Configuring the Process Development Environment. For information about swing-based controls, see Java UI Toolkit Overview.

Note: Only customization of the Step Processor samples is discussed here. Simple directory and file name changes, however, 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.
  2. Copy the \samplestep directory to a new directory on the same branch of the directory tree (for example, Developer Files\samples\vwpanel\newstep).
  3. Change to the renamed directory.
  4. Rename the following sample files (for example, by adding a prefix to match your customization):
    • VWSampleStepApplet.java
    • VWSampleStepApplication.java
    • VWSampleStepPanel.java
  5. Open each renamed file, and do the following actions:
    • Change the class name to match the new file name.
    • Replace every occurrence of VWSample* (such as VWSampleStepApplication) with the (appropriate) new class name.
    • Change every occurrence of the package name "samples.vwpanel.samplestep" with the new package name. For example, if your new directory is "newstep", replace samples.vwpanel.samplestep with samples.vwpanel.newstep.
  6. Compile the samples (from the root "samples" directory to contain the full package name).
  7. Create a JAR file that contains your customized Step Processor.
  8. Sign the JAR file.
  9. Deploy the new Java application on the Application Engine server.
  10. 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

You can add user interface controls to the custom Step Processor by adding simple fields. These controls can indicate the following information:
  • When the Step Processor was sent (launch information)
  • 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 JAR file that contains your newly customized Step Processor.
  10. Deploy the new Java application on the Application Engine server.
  11. Run the application.


Last updated: October 2015
modifying_the_sample_step_processor.htm

© Copyright IBM Corporation 2015.