Creating a pipe source fileAdded by IBM on May 2, 2012 | Version 1 (Original)
|No abstract provided. Tags: pipes, classes, PipeImpl
class, performWork method, methods, source files, packages, creating, pipe source file, FSP, 8.0, developing
A pipe can be described by multiple Java
™ source files.
To create a pipe source file:
- Create a Java source file called < pipeName
- Create your pipe class. Your pipe class must:
- Be a public class.
- Extend the PipeImpl class.
Optional: If you want to access the form in the data bucket from your pipe, declare an object called _form to represent the form.
The following example describes the GetURLDataPipe
public class GetURLDataPipe extends PipeImpl implements Pipe
Create references for every public object you want to retrieve from the configuration file. You must create both a get and a set method of type "Object" for each object retrieved using JavaBeans™ naming conventions. For example, if you are retrieving a form object, you must include the following code:
Create the performWork method.
public Object getForm()
public void setForm(Object form)
this._form = form;
The pipe's performWork method can do whatever task you require. For example, you can use it to make calls to Forms Services Platform methods and objects or retrieve parameters from the data bucket.
public void performWork(Map dataBucket)
Parent topic: Creating pipes
Next topic: Creating a Pipe Activator class
The following sample displays the LoadFormPipe performWork
/* Get the FormService */
FormService theService = (FormService) this.getService(FormService.
/* Get the Request object */
Request theRequest = (Request) dataBucket.
/* Build the form from the request stream */
Form form = theService.buildForm(theRequest.getInputStream());
/* Store the form into the map */
this.evaluateSet(dataBucket, this._form, form, null);
Anything you put in the data bucket must implement the java.io.Serializable
interface. For detailed information on how to implement Java
Object serialization, see http://java.sun.com/j2se/1.4.2/docs/api/
Note that the reference to http://java.sun.com/j2se/1.4.2/docs/api/
is provided for your convenience only, and IBM
® makes no representations or warranties, expressed or implied, regarding any information or materials posted on such Web site.