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

How to do it...

  1. Create a new empty job. To do this, you can perform either of the following steps:
    • Click on the New button from the toolbar menu and select the Job item entry
    • Select the Job item entry by navigating to File | New or by pressing Ctrl + ALT + N.
  2. Go to the Job settings dialog and define a new parameter called p_country. Do this as follows:
    1. Open the Job settings dialog by either pressing Ctrl + J or right-clicking on any place of the right working area and selecting Job settings from the newly displayed contextual menu.
  3. Once the dialog opens, select the Parameters tab and add a new parameter called p_country.
  4. Select the Design tab from the left-hand side view to display the list of tasks from their corresponding category folders. Look for the following tasks and drag-and-drop them into the working area on the right:
    1. From the General category folder, get a Start task and a Transformation task and drag-and-drop them into the working area.
    2. From the File management category folder, get a Delete File task and drag-and-drop it into the working area.
    3. From the Utility category folder, get an Abort task and drag-and-drop it into the working area on the right.
  5. Connect the tasks together in the following specified order:
    1. Connect the Start task to the Delete File task.
    2. Connect the Delete File task to the Transformation task and then connect the Delete File task to the Dummy task as well.
    3. Connect the Transformation task to the Success task and then connect the Transformation task to the Dummy task as well.
    4. Connect the Dummy task to the Abort task.
  6. Configure the Delete File task as follows:
    1. Open the Delete File task properties dialog by either double-clicking on the step icon in the working area or right-clicking on the step icon and selecting Edit job entry.
    2. Configure the name of the task.
    3. Configure the name of the file to be deleted by typing the complete name of the file in the Filename input field. The file to be deleted is located in the same samples directory where the transformation and the job reside. In any case, a good approach is to type the filename in a way that is location independent, using a system variable to parameterize the directory name where the file is located. In our case, the complete filename is ${Internal.Transformation.Filename.Directory}/selected_country_customers.xls.
    4. As you can see in the Properties dialog, you can tick a checkbox so that the task will fail in case the file to be deleted does not exist.
    5. Click on OK and close the Delete File task properties dialog.
  7. Configure the Transformation task as follows:
    1. Open the Transformation task properties dialog by either double-clicking on the step icon in the working area or right-clicking on the step icon and selecting Edit job entry.
    2. Configure the name of the task.
  8. Under the Transformation specification tab, configure the name of the file for the transformation we're going to call. The transformation's file is located in the same samples directory where the job resides. In any case, a good approach is to type the filename in a way that is location independent, using a system variable to parameterize the directory name where the file is located. In our case, the complete filename is ${Internal.Job.Filename.Directory}/read-customers.ktr.
  9. Save the job with the suggested name, export-job.kjb, in the same directory where you previously saved the transformation.
  10. Try to execute the processes from the Spoon GUI. This is normally done by the developer to test or debug his/her jobs and transformations. To do this, click on the Run button, which can be identified by the green triangle icon located in the toolbar.
  11. After the execution, if anything gets terminated successfully, the task icons will be decorated by a green mark that indicates that the specific tasks were executed successfully. Moreover, down in the working area, the Job Entry log details view indicates the results for every single task called by the job.
主站蜘蛛池模板: 连江县| 宜宾县| 建水县| 南通市| 庆安县| 巴林左旗| 河池市| 灌阳县| 栾城县| 新沂市| 周宁县| 高州市| 平远县| 义马市| 曲沃县| 祁东县| 鹰潭市| 万山特区| 五华县| 新河县| 许昌县| 游戏| 河津市| 彭山县| 翁牛特旗| 广东省| 绥宁县| 图片| 屯门区| 永年县| 礼泉县| 罗城| 永登县| 策勒县| 临桂县| 梓潼县| 连山| 奉贤区| 青州市| 万载县| 武穴市|