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

Truncate the length of field value in flat file schema problem

  • 1.  Truncate the length of field value in flat file schema problem

    Posted Fri March 02, 2012 09:19 PM

    Hi,I have created the ff schema and i am converting the ff document to string using pub.ff.covertToString service. we are using delimiter flat file schema .But here twist is the values written in file should be some limited length only.so for example:ffDoc is having 2 fields 1)Name (value=abcd)& 2) Department (value=xyzpqrst)Now i am converting this into string and writing into file which we need to send to third party system. but they are having restriction on fields.Like they say that maximum length of value of Name field should be 3 char && max value for Department filed should be 5 char…In all they wants like:NameabcDepartmentxyzpqSo can i impose any rule on schema to achieve this??Please suggest me best way…Thanks


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


  • 2.  RE: Truncate the length of field value in flat file schema problem

    Posted Sat March 03, 2012 03:31 AM

    You have to do that in the mapping logic written in the flow services before invoking convertToString service. You can perform validation while parsing/creating ff, or you can set some default value to fields using schema but not transformation.

    -Senthil


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


  • 3.  RE: Truncate the length of field value in flat file schema problem

    Posted Tue March 13, 2012 03:09 AM

    As Senthil recommends - I’d add a recommendation to put the mapping logic into a separate service - do not simply embed the truncating logic in a map step… That way you can properly unit test your mapping logic and consider the various input scenarios…

    You also have to be careful about simply truncating values - it will create problems down the track in terms of data matching across systems.

    regards,
    Nathan Lee


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


  • 4.  RE: Truncate the length of field value in flat file schema problem

    Posted Thu March 15, 2012 09:03 AM

    dude just take length of fields and use leftPad or rightPad services to truncate string. this logic is to be implement in map step.


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


  • 5.  RE: Truncate the length of field value in flat file schema problem

    Posted Thu March 15, 2012 08:51 PM