Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: XML as Input to Kettle Transformation

  1. #1
    Join Date
    Dec 2013
    Posts
    2

    Default XML as Input to Kettle Transformation

    Dear All,
    I am a beginner in Pentaho DI (Kettle & Spoon). My requirement is to segregate the CDR's produced by MSC(in ASN BER Format) for a telecom operator ( as HOME users/ROAM users). The segregated files (should be encoded back to ASN BER) would be used by Billing Systems (Hence I want the same input record to be available at the last step).

    There is a decoder process which decodes the ASN files and generates an XML(can't use CSV's because of the tree structure of the fileds).
    The XML's parent tag is <CallDataRecord>, and can have either <pCSPLMNCallDataRecord>(single CDR) or <compositeCallDataRecord> (multiple CDRs)as its child elements.
    <compositeCallDataRecord> will inturn have <pCSPLMNCallDataRecord> as its child node.

    So I have to read the XML, and if its single CDR then I have to check for say MSOriginating/MSTerminating..etc..and if its a composite CDR, i need to loop through that many number of times (processing as single CDR).

    I have a tight deadline for the delivery. Any help would be appreciated guys.

    Thanks a LOT,
    Ujjawal Rathor

  2. #2

    Default

    Quote Originally Posted by ujjawal50 View Post
    So I have to read the XML, and if its single CDR then I have to check for say MSOriginating/MSTerminating..etc..and if its a composite CDR, i need to loop through that many number of times (processing as single CDR).

    I have a tight deadline for the delivery. Any help would be appreciated guys.
    Hi Ujjawal,

    Take the xml feed in via the XML step, add a filter to determine whether the entry is flagged as single entry (MSOriginating) and run that fork to a table output step, if the data is a composite, feed the rows to a sub-job which is executed once for every row (see advanced settings in the job step) and then run that to an table output step. You need to make sure that you split the fields according to the end of record delimiter, so that multiple rows are fed to the sub-job.

    I hope that helps.

    ps. it is better to at least have a go at something before you ask for advice, most of us expect to see that you've tried something and failed before we come to your aid.

  3. #3
    Join Date
    Dec 2013
    Posts
    2

    Default

    Dear Woodbine,

    first of all thanks for your input.

    As you said: "Take the xml feed in via the XML step, " (If this step is 'Get Data From XML') then I am not sure how to use it because after all the googling I am still not able to provide multiple xPath for one 'Get Data From XML' node.
    However, using the StAX (XML Input Stream) I am able to segregate single and multiple call data records, in seperate files. (Please have a look at Name:  MSC_Transformation_Sample.JPG
Views: 101
Size:  17.3 KBtransformation process jpeg).

    The XML output generated is however not what I am looking for, as it is generating data as single rows.
    Say for example, "<callPosition>3</callPosition>"
    becomes ,
    <Row><xml_parent_path>&#x2f;CallDataRecord&#x2f;pCSPLMNCallDataRecord&#x2f;mSTerminating</xml_parent_path> <xml_data_name>callPosition</xml_data_name> <xml_data_value/> </Row>
    <Row><xml_parent_path>&#x2f;CallDataRecord&#x2f;pCSPLMNCallDataRecord&#x2f;mSTerminating</xml_parent_path> <xml_data_name>callPosition</xml_data_name> <xml_data_value>3</xml_data_value> </Row>
    <Row><xml_parent_path>&#x2f;CallDataRecord&#x2f;pCSPLMNCallDataRecord&#x2f;mSTerminating</xml_parent_path> <xml_data_name>callPosition</xml_data_name> <xml_data_value/> </Row>

    after transformation.

    Apologies if posting this way I have erred.

    Is there a way how I can achieve generating complex XML(user defined) structure, which will be used by an Encoder App to generate java objects from the XML and further
    encode it.

    Thanks for your patience,
    Ujjawal

  4. #4
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    You'll have a much better forum experience by providing files instead of pictures and prose.
    So long, and thanks for all the fish.

  5. #5
    Join Date
    Jun 2014
    Posts
    1

    Default

    Hi Ujjawal, could you send me the decoder which you use to transform from BER binary asn.1 files to XML? I'd really appreciate this.

    Thanks

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.