官术网_书友最值得收藏!

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

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

Create a new transformation.

Read the JIRA file and filter the unassigned tasks, just as you did in the previous section.

  1. Add a Filter rows step. Create a hop from the previous Filter rows step toward this new filter. When asked for the kind of hop, select Main output of step.
  2. Add two Microsoft Excel Output steps.
  3. Create a hop from the last Filter row to one of the Microsoft Excel Output steps. As the type for the hop, select Result is TRUE.
  4. Create a hop from the last Filter row to the other Excel step. This time as the type for the hop, select Result is FALSE. The transformation looks as follows:
  5. Double-click on the Filter rows step to edit it.
    Note

    Note that the content of the textboxes Send "true" data to step and Send "false"data to step should be the names of the destination steps - the two Microsoft Excel Output steps.

  6. Enter the condition Priority = [Critical] OR Priority = [Severe] OR Priority = [Blocker].
    Tip

    Alternatively you can use a single condition: Priority IN LIST Critical;Severe;Blocker.

  7. Configure the Microsoft Excel Output step located at the end of the green hop. As fields, select Priority and Summary, and as the name for the file type b_bouchard.xls (the name of the senior programmer).
  8. Configure the other Microsoft Excel Output step to send the fields Priority and Summary to an Excel file named new_features_to_develop.xls.
  9. Click on OK and save the transformation.
  10. Run the transformation, and verify that the two Excel files were created. The files should look like this:

What just happened?

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

In the Filter rows step, you put a condition to evaluate if the priority of a task was blocker, severe, or critical. For every row coming to the filter, the condition was evaluated.

The rows that met the condition, that is, those that had one of those three priorities, followed the green hop. This hop linked the Filter rows step with the Microsoft Excel Output step that creates the b_bouchard.xls file. If you take a look at the Filter rows configuration window, you can also see the name of that step in the Send 'true' data to step textbox.

The rows that did not meet the condition, that is, those with another priority, were sent toward the other Microsoft Excel Output step, following the red hop. This hop linked the Filter rows step with the Microsoft Excel Output step that creates the new_features_to_develop.xls file. In this case, you can also see the name of the Microsoft Excel Output step in the Send 'false' data to step textbox.

PDI steps for splitting the stream based on conditions

When you have to make a decision, and upon that decision split the stream into two, you can use the Filter rows 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 towards 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 towards the step selected in the second drop-down list of the configuration window: Send 'false' data to step.

Alternatively, you can use the Java Filter step. As said in the last chapter, the purpose of both steps—Filter rows and Java Filter—is the same; the main difference is the way in which you type or enter the conditions.

Sometimes you have to make nested decisions, for example:

When the conditions are as simple as testing whether a field is equal to a value, you have a simpler way for creating a transformation like the one shown previously.

主站蜘蛛池模板: 甘洛县| 台中县| 洮南市| 武冈市| 登封市| 竹溪县| 水富县| 石首市| 琼中| 遵义县| 吉首市| 海兴县| 沙坪坝区| 郑州市| 巧家县| 兴城市| 龙井市| 雅江县| 耿马| 汝南县| 台江县| 湘西| 崇明县| 潼南县| 黎平县| 定结县| 介休市| 梁山县| 佛冈县| 贞丰县| 宜昌市| 祁连县| 迭部县| 广南县| 丹棱县| 安平县| 介休市| 凤庆县| 小金县| 临沂市| 沁源县|