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

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.

主站蜘蛛池模板: 高雄县| 图们市| 南丹县| 广元市| 辉南县| 绵阳市| 陇川县| 南郑县| 二手房| 乐清市| 资阳市| 吴忠市| 车致| 两当县| 博客| 两当县| 阳山县| 蓝山县| 江安县| 韶关市| 封丘县| 三江| 同心县| 濮阳县| 万全县| 宾川县| 光泽县| 二手房| 巴东县| 迁西县| 贵阳市| 平阴县| 大兴区| 璧山县| 集安市| 翁源县| 莱州市| 元朗区| 宁化县| 黄陵县| 晋中市|