Time for action - assigning tasks by filtering priorities with the Filter rows step

Following with the JIRA subject, let's do a more realistic distribution of tasks among programmers. Let's assign the serious task to our most experienced programmer, and the remaining tasks to others.

  1. Create a new transformation.
  2. Read the JIRA file and filter the unassigned tasks, just as you did in the previous tutorial.
  3. Add a Filter rows step and two Excel Output steps to the canvas, and link them to the other steps as follows:
    Time for action - assigning tasks by filtering priorities with the Filter rows stepstreamssplitting, based on condition
  4. Configure one of the Excel Output steps to send the fields, Priority and Summary, to an Excel file named b_bouchard.xls (the name of the senior programmer).
  5. Configure the other Excel Output step to send the fields Priority and Summary to an Excel file named new_features_to_develop.xls.
  6. Double-click the Filter row step to edit it.
  7. Enter the condition Priority = Critical OR Priority = Severe.
  8. From the first drop-down list, Send 'true' data to step, select the step that creates the b_bouchard.xls Excel file.
  9. From the other drop-down list, Send 'false' data to step, select the step that creates the Excel new_features_to_develop.xls Excel file.
  10. Click OK.
  11. The hops leaving the Filter rows step change to show which way a row will take, depending on the result of the condition.
    Time for action - assigning tasks by filtering priorities with the Filter rows stepstreamssplitting, based on condition
  12. Save the transformation.
  13. Run the transformation, and verify that the two Excel files were created.
  14. The files should look like this:
    Time for action - assigning tasks by filtering priorities with the Filter rows stepstreamssplitting, based on condition

What just happened?

You sent the list of PDI new features to two Excel files—one file with the critical issues and the other file with the rest of the issues.

In the Filter row step, you put a condition to evaluate if the priority of a task was severe or critical. For every row coming to the filter, the condition was evaluated. The rows that had a severe or critical priority were sent toward the Excel Output step that creates the b_bouchard.xls file. The rows with another priority were sent towards the other Excel Output step, the one that creates the new_features_to_develop.xls file.

PDI steps for splitting the stream based on conditions

When you have to make a decision, and upon that decision split the stream in two, you can use the Filter row step as you did in this last exercise. In this case, the Filter rows step acts as a decision maker. It has a condition and two possible destinations. For every row coming to the filter, the step evaluates the condition. Then if the result of the condition is true, it decides to send the row toward the step selected in the first drop-down list of the configuration window—Send 'true' data to step.

If the result of the condition is false, it sends the row toward the step selected in the second drop-down list of the configuration window: Send 'false' data to step.

Sometimes you have to make nested decisions; consider the next figure for example:

PDI steps for splitting the stream based on conditions

In the transformation shown in the preceding diagram, the conditions are as simple as testing if a field is equal to a value. In situations like this you have a simpler way for accomplishing the same..

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.159.223