TDM & GetMapProperty returning object rather than string....

Highlighted
Employee

TDM & GetMapProperty returning object rather than string....

Hi,

 

I am trying to use a simple Java function to parse a string to an integer for a FixedLoop in TDM, however when doing so an error is thrown,posting only last bit of the stack trace below.

 

GetMapProperty is supposed to return a string, however based on the below, is this correct? How can i get this to work? I have attached a screenshot of my map also.

 

Thanks

 

: Error - The transformation code (XQuery/XSLT) failed to compile. (201)
Exception: net.sf.saxon.trans.XPathException: Required item type of first argument of java_lang_IntegerSmiley TonguearseInt() is xs:string; supplied value has item type java:java.lang.Object
at net.sf.saxon.expr.TypeChecker.staticTypeCheck(TypeChecker.java:303)
at net.sf.saxon.functions.ExtensionFunctionCall.typeCheck(ExtensionFunctionCall.java:113)
at net.sf.saxon.expr.ExpressionVisitor.typeCheck(ExpressionVisitor.java:181)
at net.sf.saxon.expr.LetExpression.typeCheck(LetExpression.java:96)
at net.sf.saxon.expr.ExpressionVisitor.typeCheck(ExpressionVisitor.java:181)
at net.sf.saxon.expr.RangeExpression.typeCheck(RangeExpression.java:39)
at net.sf.saxon.expr.ExpressionVisitor.typeCheck(ExpressionVisitor.java:181)
at net.sf.saxon.expr.ForExpression.typeCheck(ForExpression.java:96)
at net.sf.saxon.expr.ExpressionVisitor.typeCheck(ExpressionVisitor.java:181)
at net.sf.saxon.query.XQueryFunction.compile(XQueryFunction.java:365)
at net.sf.saxon.query.XQueryFunctionLibrary.fixupGlobalFunctions(XQueryFunctionLibrary.java:198)
at net.sf.saxon.query.QueryModule.fixupGlobalFunctions(QueryModule.java:1033)
at net.sf.saxon.instruct.Executable.fixupQueryModules(Executable.java:625)
at net.sf.saxon.query.QueryParser.makeXQueryExpression(QueryParser.java:107)
at net.sf.saxon.query.StaticQueryContext.compileQuery(StaticQueryContext.java:343)
at com.oaklandsw.transform.runtime.xquery.saxon9.Saxon9AdaptorImpl.compile(Saxon9AdaptorImpl.java:395)
at com.oaklandsw.transform.runtime.xquery.XQueryAdaptorImpl.compile(XQueryAdaptorImpl.java:66)
at com.oaklandsw.transform.runtime.xquery.XQueryAdaptorImpl.compile(XQueryAdaptorImpl.java:93)
at com.oaklandsw.transform.runtime.StandardMapRuntimeImpl.compile(StandardMapRuntimeImpl.java:162)
at com.oaklandsw.transform.runtime.StandardMapRuntimeImpl.runSubclass(StandardMapRuntimeImpl.java:232)
at com.oaklandsw.transform.runtime.MapRuntimeImpl$1.run(MapRuntimeImpl.java:402)
at com.oaklandsw.transform.runtime.RuntimeEngineImpl.runSansEditor(RuntimeEngineImpl.java:1149)
at com.oaklandsw.transform.runtime.MapRuntimeImpl.runMap(MapRuntimeImpl.java:393)
at com.oaklandsw.transform.runtime.MapOrStructRuntimeImpl.run(MapOrStructRuntimeImpl.java:805)
at mdm_transformation_update.jo_tdm_sap_idoc_test_0_1.jo_TDM_SAP_IDoc_Test.tFileInputXML_1Process(jo_TDM_SAP_IDoc_Test.java:2329)
at mdm_transformation_update.jo_tdm_sap_idoc_test_0_1.jo_TDM_SAP_IDoc_Test.runJobInTOS(jo_TDM_SAP_IDoc_Test.java:2908)
at mdm_transformation_update.jo_tdm_sap_idoc_test_0_1.jo_TDM_SAP_IDoc_Test.main(jo_TDM_SAP_IDoc_Test.java:2726)


at mdm_transformation_update.jo_tdm_sap_idoc_test_0_1.jo_TDM_SAP_IDoc_Test.tFileInputXML_1Process(jo_TDM_SAP_IDoc_Test.java:2338)
at mdm_transformation_update.jo_tdm_sap_idoc_test_0_1.jo_TDM_SAP_IDoc_Test.runJobInTOS(jo_TDM_SAP_IDoc_Test.java:2908)
at mdm_transformation_update.jo_tdm_sap_idoc_test_0_1.jo_TDM_SAP_IDoc_Test.main(jo_TDM_SAP_IDoc_Test.java:2726)


Accepted Solutions
Nine Stars

Re: TDM & GetMapProperty returning object rather than string....

Hi,

 

Could you try with this syntax ?

 

EricCapture.PNG


All Replies
Nine Stars

Re: TDM & GetMapProperty returning object rather than string....

Hi,

 

Could you try with this syntax ?

 

EricCapture.PNG

Employee

Re: TDM & GetMapProperty returning object rather than string....

That is the syntax I am using:

 

TDM.Error.JPG

Nine Stars

Re: TDM & GetMapProperty returning object rather than string....

No, remove your java call.

 

Eric

Employee

Re: TDM & GetMapProperty returning object rather than string....

Actually, sorry I am not using the same syntax Smiley Happy - I have just tested your suggestion (without the Java function) and I am not getting an error in the map anymore! Looks like the value is being cast automatically.

 

Cheers

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog