IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
  • 1.  Reading Property File i WTX

    Posted 04/06/18 05:09 AM

    Originally posted by: uvaiseodam


    Hi,

    I have a property file which has key value pairs as below:

    key1=value1

    key2=value2

    etc..

    Now in WTX map i'm getting key1 as input. My task is to pick the corresponding value for the given key in this case value1 from the property file. How this can be achieved in WTX mapping?


    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 2.  Re: Reading Property File i WTX

    Posted 04/09/18 04:20 AM
      |   view attached

    Originally posted by: PaulBrett


    Here is an example using the LOOKUP() function.

    Thank you.

    Paul

    Follow me on Twitter


    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange

    Attachment(s)

    zip
    INI.zip   1 KB 1 version


  • 3.  Re: Reading Property File i WTX

    Posted 04/09/18 05:04 AM

    Originally posted by: uvaiseodam


    Thanks Paul for your input. Do we have to always pass the entire content of this property file at runtime? Since this map will be used by data power , is there any option to locate the property file at runtime and read?

     

    Thanks,

    Uvaise Ahmed


    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 4.  Re: Reading Property File i WTX

    Posted 04/09/18 05:20 AM

    Originally posted by: PaulBrett


    This alternative could be used:

    =WORD(WORD(MID(GET("FILE","properties.ini"),(FIND("key2",GET("FILE","properties.ini"))),9999),"<NL>",1),"=",2)

    Thank you.

    Paul

    Follow me on Twitter


    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 5.  Re: Reading Property File i WTX

    Posted 04/09/18 05:30 AM

    Originally posted by: uvaiseodam


    Hi Paul,

    I tried the above method but when I build the map using data power as runtime, I am getting the below error:

    M128 ERROR:
    Map: ResponseMap   Output: Status Comp:ElemDecl Header Comp:ElemDecl root Element:Global:GetQuoteResponse
    Rule references unknown function: GET
     
    M113 ERROR:
    Map: ResponseMap   Output: Status Comp:ElemDecl Header Comp:ElemDecl root Element:Global:GetQuoteResponse
    Argument #1 for function MID is invalid.
     
    M113 ERROR:
    Map: ResponseMap   Output: Status Comp:ElemDecl Header Comp:ElemDecl root Element:Global:GetQuoteResponse
    Argument #2 for function MID is invalid.
     
    M113 ERROR:
    Map: ResponseMap   Output: Status Comp:ElemDecl Header Comp:ElemDecl root Element:Global:GetQuoteResponse
    Argument #3 for function MID is invalid.
     
    M113 ERROR:
    Map: ResponseMap   Output: Status Comp:ElemDecl Header Comp:ElemDecl root Element:Global:GetQuoteResponse
    Argument #2 for function WORD is invalid.
     
    M113 ERROR:
    Map: ResponseMap   Output: Status Comp:ElemDecl Header Comp:ElemDecl root Element:Global:GetQuoteResponse
    Argument #2 for function FIND is invalid.
     
    M113 ERROR:
    Map: ResponseMap   Output: Status Comp:ElemDecl Header Comp:ElemDecl root Element:Global:GetQuoteResponse
    Argument #3 for function FIND is invalid.
     
     
    Total errors: 7.   Total warnings: 0.

    Please help me in resolving this issue.

     

    Thanks

    Uvaise Ahmed


    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 6.  Re: Reading Property File i WTX

    Posted 04/09/18 05:52 AM

    Originally posted by: PaulBrett


    I forgot GET() is not allowed on DataPower.

    "Do we have to always pass the entire content of this property file at runtime? Since this map will be used by data power , is there any option to locate the property file at runtime and read?"

    Yes, you will have the parse the entire file in each map where you want to use it.

    Thank you.

    Paul

    Follow me on Twitter


    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 7.  Re: Reading Property File i WTX

    Posted 04/09/18 06:26 AM

    Originally posted by: uvaiseodam


    Thanks Paul for your valuable input.


    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange