IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Flow, Document List to Document transformations...

  • 1.  Flow, Document List to Document transformations...

    Posted Thu February 04, 2010 10:21 AM

    Hi to all.
    I’m trying to read a flat file and do some document transformation.
    I’m reading the file supposing i’m goind to handle large files.
    The problem is, when i have my raw document (from flat file) i try to
    convert in a more convenient document where for example i “transform”
    two fields (a date part and a time part) in a date field of java type set
    as date.
    To do this, i have trouble with document list and document transformations.
    I have this steps:

    == parseFile ===================================

    pub.file:getFile
    REPEAT
    pub.flatFile:convertToValues
    pub.flow:tracePipeline (*)
    MyPackage.myFlow:transformRowToItem
    pub.flow:tracePipeline (**)

    == transformRowToItem ==========================

    input …: rawDocument
    recordWithNoID(List)
    ddate: String
    dhour: String
    output …: itemDocument
    thedate: Object[java.util.Date])

    LOOP over ‘/row/recordWithNoID’
    MAP (here handle transformation and map results to the output item)

    What I would like to obtain is to have a unique itemDocument in the
    pipeline at point (**) with a wonderful thedate field as java.util.Date

    Instead, if I go in “trace here” mode till “transformRowToItem” all run
    correctly. If I run all “parseFile” flow an error occur saying
    “Dimension mismatch, List expected”.

    I’m using webMethods 6.5
    I have tried some forum suggestions without success. I have tried to
    use documentListToDocument but I don’t know how to use it… absolutely
    stacked.

    Thanks in advance for any help.


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: Flow, Document List to Document transformations...

    Posted Thu February 04, 2010 10:50 AM

    Found the answer. The problem is the raw document type created
    automatically from the flat file schema. That doc type has a recordWithNoID
    set as DocumentList, but when you read file record by record in a REPEAT
    step
    it is more better to drop that document type and create a new one
    with recordWithNoID set up as Document.
    Mapping ffValues of convertToValues to the new document type give a
    unique raw document (as expected) and after that, you can add simply a
    MAP step with transformations (so the LOOP step can be removed).
    This is more readable and run correctly.
    Hoping this could help someone else.
    Bye


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services