Parameter Processor

The Parameter processor retrieves parameters from one input and applies them to another flow. This allows flows to be developed and reused with different sets of parameters and for parameters to be maintained independent of the flows.

To understand the interaction of parameters, we need to understand the sequence of a flow. When we want to view data from a Result, the request is sent from the Result back up the flow to the source or sources. The source(s) then push the records back down the flow to the Result. The Parameter processor intercepts the original request as it travels up the flow and inserts the necessary parameter values. These are then available to processors further up the flow (towards the source). With this understanding we can see that Parameter processors are often used close to the Result-end of the flow, so that they can propagate parameters to all upstream processors.

Properties

The Parameter properties are shown in Figure 4.33, “Parameter Wizard”.

Figure 4.33. Parameter Wizard

Parameter Wizard

Working with Parameter processor

Let us filter records based on a parameter which is read from a different datasource:

  1. Create a Properties DataSource named SampleProperty.

  2. Click Add Column and in the dialog enter field Name as FruitChoice, Data Type as String and the Value as Orange. Click the OK button. The column is added to the DataSource. Similarly any number of fields can be added. After adding the fields the DataSource Wizard appears as shown in Figure 4.34, “Completed Properties DataSource”. Click the Finish button. (For more information on working with Properties DataSource refer to Chapter 8, Properties DataSource.)

    Figure 4.34. Completed Properties DataSource

    Completed Properties DataSource
  3. Add a Tabular DataSource SampleFruit which includes a column listing each fruit name.

  4. Drag and drop SampleFruit onto the Composite diagram.

  5. Place a Filter on the diagram and use a Flow to connect SampleFruit DataSource processor to the Filter processor.

  6. Invoke the Filter Properties and in the Filter#1 tab select Matches from the When combo box in the Fruit row. Enter condition as ${FruitChoice} where ${FruitChoice} is the dynamic parameter we will get from the Properties datasource. For more information on dynamic parameters refer to Appendix A, Dynamic Parameters.

  7. Click the Finish button.

  8. Place a Parameter processor on the diagram.

  9. Connect the Filter output to the data input of the parameter processor.

  10. Drag and drop the SampleProperty onto the diagram.

  11. Connect the SampleProperty data source with the params input of the Parameter processor.

  12. Finally, connect the output of the Parameter processor to the Result. The diagram appears as shown in Figure 4.35, “Sample Parameter Flow”.

    Figure 4.35. Sample Parameter Flow

    Sample Parameter Flow
  13. Select Result and choose View from the popup menu. The output is shown in Figure 4.36, “Parameter Result”. As the Value of FruitChoice in the property DataSource is Orange the records corresponding to Orange are fetched.

    Figure 4.36. Parameter Result

    Parameter Result