My First Dataflow (Job)

This example shows how to create a simple dataflow that reads data from a file, sorts it, then writes it to a file. Since this dataflow reads data from a file and writes its output to a file, it is a job: a dataflow that performs batch processing. (The other primary type of dataflow, a service, performs interactive processing via an API or web service call to the server.)

  1. The first step will be to create some sample data to use as input to your dataflow. Using a text editor, create a file that looks like this:
    FirstName,LastName,Region,Amount
    Alan,Smith,East,18.23
    Jeannie,Wagner,North,45.43
    Joe,Simmons,East,10.87
    Pam,Hiznay,Central,98.78
  2. Save the file in a convenient location.
  3. Select Start > Programs > Precisely > Spectrum Technology Platform > Client Tools > Enterprise Designer.
  4. Select File > New > Dataflow > Job.
  5. You are now ready to begin creating your dataflow. The first step is to define the input to the dataflow. To do this:
    1. Drag a Read from File stage to the canvas:
    2. Double-click the Read from File stage on the canvas.
    3. In the File name field, specify the file you created for this task.
    4. In the Record type field, choose Delimited.
    5. In the Field separator field, select Comma (,).
    6. Check the First row is header record box.
    7. Click the Fields tab.
    8. Click Regenerate then click Yes.

      The stage is automatically configured for the fields in your input file.

    9. Click Detect Type. This scans the input file and determines the appropriate data type for each field. Notice that the type for the Amount filed changes from string to double.
    10. You have finished configuring Read from File. Click OK.
  6. Next, you will add a stage that will sort the records by region. To do this:
    1. Drag the Sorter stage to the canvas
    2. Click the solid black triangle on the right side of the Read from File stage (the output port) and drag it to the left side of the Sorter stage on the canvas to create a channel connecting Read from File and Sorter.

      Your dataflow should look like this:

    3. Double-click the Sorter stage on the canvas.
    4. Click Add.
    5. In the Field Name field, select Region.
    6. You have finished configuring Sorter. Click OK.
  7. Finally, you will define the output file where the dataflow will write its output. To do this:
    1. Drag a Write to File stage to the canvas.
    2. Click the solid black triangle on the right side of the Sorter stage and drag it to the left side of the Write to File stage on the canvas.

      Your dataflow should look like this:

    3. Double-click the Write to File stage.
    4. In the File name field, specify an output file. This can be any file you want.
    5. In the Field separator field, select Comma (,).
    6. Check the First row is header record box.
    7. Click the Fields tab.
    8. Click Quick Add.
    9. Click Select All then click OK.
    10. Using the Move Up and Move Down buttons, reorder the fields so that they are in the following order:
      • FirstName
      • LastName
      • Region
      • Amount

      This will make the records in your output file have the fields in the same order as your input file.

    11. You have finished configuring Write to File. Click OK.
  8. In Enterprise Designer, select File > Save.
  9. Give your dataflow a name and click OK.
  10. Your dataflow is now ready to run. Select Run > Run Current Flow.
  11. The Execution Details window appears and shows the status of the job. Click Refresh. Once the status shows Succeeded click Close.

Open the output file you specified in the Write to File stage. You will see that the records have been sorted by region as you specified in the Sorter stage.

FirstName,LastName,Region,Amount
Pam,Hiznay,Central,98.78
Alan,Smith,East,18.23
Joe,Simmons,East,10.87
Jeannie,Wagner,North,45.43

Congratulations! You have designed and run your first job dataflow.