Customer Portal

JSONReader vs. JSONExtract mappings

Comments 1

  • Avatar
    imriskal
    0
    Comment actions Permalink
    Hello,

    Let me answer step by step:

    JSONReader
    1) This is unfortunately expected. JSONReader uses DOM tree to parse the input and this tree can grow quite fast in case of 50.000 records and any complex structure in the data. It is therefore recommended to use JSONExtract anywhere it is possible.
    2) All array values can be returned for example this way (you need two output ports):
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>

    <Context xpath="/root/object" outPort="0">

    <Mapping cloverField="group_id" xpath="group_x005fid"/>
    <Mapping cloverField="city" xpath="city"/>

    <Context xpath="city_x005fcodes" outPort="1">
    <Mapping cloverField="city_codes" xpath="." />

    </Context>
    </Context>


    JSONExtract
    1) This is thanks to SAX technology used instead of DOM. Memory requirements are much lower in this case.
    2) I think this is not possible or even wanted. There could be any number of items in an array so you can not prepare metadata in advance. You could read all of them in one string but this is better done using for example Denormalizer afterwards where you can define delimiters, quotation marks and so on for the values. There is however a plan to support direct extraction of arrays and maps. They should be extracted into a list or map variable in one field ("Container type" property set to "List" or "Map" on the metadata field). For more details, see https://bug.javlin.eu/browse/CLO-2054

    I hope this helps.

Please sign in to leave a comment.