Passthru Transformation

The Passthru Transformation object creates a new dataset based on the elements that were passed to the transformation. This is useful for organizing datasets for better readability and grouping of values that are otherwise calculated over and over again (e.g. a Sequence Generator Transformation).

In this document, we will learn how to use the Passthru Transformation object in Astera Centerprise.

Sample Use-Case

In this case, we are using an XML/JSON File Source

1_data

The source file contains customers’ information in the parent node and their order and shipping details in the collection/child node.

Preview data by right-clicking on source object’s header and select Preview Output.

2_preview

A Data Preview window will open, showing you the preview of the hierarchical data.

3_data_preview

Now, we want to create a field in the parent node that contains the count of orders that arrived late for each customer, and write these records to a destination file. This new field in the parent node will depend on two fields, RequiredDate and ShippedDate, that are already present in the collection/child node.

For this purpose, we will use the Passthru Transformation object.

Using Passthru Transformation

1. To get a Passthru Transformation object from the Toolbox,* go to Toolbox > Transformations > Passthru and drag-and-drop the Passthru object onto the designer.

passthru_object

You can see that the dragged transformation object is empty right now. This is because we have not mapped any fields to it yet.

3. Auto-map source fields to the transformation object by dragging-and-dropping the top node of the source object, SampleData to the top node of transformation object, Passthru.

passthru_mapping

Now the mapping is done. Let’s configure the Passthru Transformation object.

Configuring the Passthru Transformation Object

1. Right-click on the transformation object’s header and select Properties from the context menu. A configuration window for the Passthru Transformation object will open. The first window is the Layout Builder window. This is where we can create or delete fields, change their name or data types, mark any field as a variable or attach expressions to any field.

passthru_properties

2. Create a new field under the parent node. Let’s call it LateOrders and mark it as an Output field.

7_new_field

3. Click Next, and you will be directed to a Layout Modifications window.

8_modiication

4. Select the LateOrders field. Here you can modify any field by applying expressions to it.

9_options

5. Write the expression that counts the number of late arriving orders. Click “…” , located next to the expression box to open the Expression Builder window where you can make use of Centerprise’s extensive library of built-in functions and expressions.

10_formula

6. Click on the Orders node and a panel (Options for Collection) will appear. These options are only available for collection nodes. This is where we will specify the rule for routing late arriving orders. Select Route Based on Rules and a new section for adding rules will appear on the screen.

11_route

7. Add a new rule by clicking on the Add switch condition icon

Now, write an expression to route late arriving orders and name this rule as “LateArrivals”.

12_rule

8. Click OK. Now observe that a new collection node, Orders_LateArrivals, has been added to the Passthru Transformation object.

13_node

To preview data, right-click on the header of the transformation object and select Preview Output from the context menu.

16_preview_output

A Data Preview window will open. On expanding records, you will get corresponding order details and appended details of late arriving orders.

17_data

To store the output for late arriving orders, write it to a destination file.

9. Right-click on the collection node, Orders_LateArrivals, and go to Write to > Excel Workbook Destination. An Excel Workbook Destination object will be added to the dataflow designer with auto-mapped fields from the collection field.

passthru_destination

10. Configure settings for Excel Workbook Destination object.

Learn how to configure the settings for Excel Workbook Destination from here.

11. Click on the Start Dataflow icon located in the toolbar at the top of the designer window to create the destination file.

18_start_dataflow

Upon clicking this icon, an excel file will successfully be created. You can find the link to this file in the Job progress window.