Customer Portal

Partitioning JSONWriter output not working & hiding elements from the xml

Comments 2

  • Avatar
    anyeone
    0
    Comment actions Permalink
    I still don't have the partitioning working, but I found another solution to the two issues (not quite as elegant, I fear) but I thought I would share.

    Instead of partitioning, in my main jobflow I use an aggregate to get the list of distinct catalog names that appears in both the category and the product feeds, then combine the two so that I have a single list of catalog names that I will want to produce files for. Then I feed those into another jobflow, which reads the category and product input data into separate feeds, filters out all records that are not for the current catalog name, and looks to see whether there are only categories, only products, or both. Depending on which of those 3 scenarios is relevent, a different XMLWriter is called with the two feeds that either outputs only categories, only products, or both. In this way I don't get any empty records in the files and they all contain only the correct products and/or categories.

    I still think partitioning would have been more elegant, but this works.
  • Avatar
    Pedro Vazquez Rosario
    0
    Comment actions Permalink
    Hi,

    I would suggest the following:

    • Instead of using a Jobflow, your use case is better suited in a graph

    • If you need to use the ListFiles in the you graph, Right Click on the Palette - Customize - File Operations - disable Hide

    • I would start by removing the ExHashJoin (this will remove the null values in the Catalog)

    • You will have three inputs streams coming into the XMLWriter
      [list:1ey756fc][*:1ey756fc]In the upper stream where you have Catalog you will want to use a Reformat to create two output streams

    • The first will output the catalog_id

    • The second you will output everything (including the catalog_id
    [/*:m:1ey756fc]
  • The stream that includes the catalog_id you will add a Dedup (thus removing duplicates from the root element)

  • In the XMLWriter you will map the first stream (catalog_id) with the root catalog_id

  • The second stream will be mapped to the category elements (make sure Key and Parent Key are mapped to catalog_id)

  • The third stream will be mapped to the product elements (make sure Key and Parent Key are mapped to catalog_id)
  • [/list:u:1ey756fc]

Please sign in to leave a comment.