<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Web service output conditional on schema definition in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Web-service-output-conditional-on-schema-definition/m-p/2325900#M95445</link>
    <description>Hi&amp;nbsp;&lt;BR /&gt;You can read the return string and check if it contains some special words that is able to distinguish different format, and use use runIf to fire different business process based on the result. For example:&lt;BR /&gt;tWebserviceInput--main--tJavaRow--runIf--tFixdeFlowInput1--main--tExtractXMLField2&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; runIf--tFixdeFlowInput2--main--tExtractXMLField2&lt;BR /&gt;&lt;BR /&gt;tJavaRow:&lt;BR /&gt;&lt;BR /&gt;globalMap.put("currentResult",input_row.result);&lt;BR /&gt;&lt;BR /&gt;if(input_row.result.contains("format1"){&lt;BR /&gt;globalMap.put("isFormat1",true);&lt;BR /&gt;}else{&lt;BR /&gt;globalMap.put("isFormat1",false);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;if(input_row.result.contains("format2"){&lt;BR /&gt;globalMap.put("isFormat2",true);&lt;BR /&gt;}else{&lt;BR /&gt;globalMap.put("isFormat2",false);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Define the condition of runIf like:&lt;BR /&gt;(Boolean)globalMap.get("isFormat1")&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;tFixedFlowInput: get the current result, define one column and set its value as: (String)globalMap.get("currentResult")&lt;BR /&gt;&lt;BR /&gt;tExtractXMLField: extract fields from a XML string.</description>
    <pubDate>Mon, 04 Jan 2016 03:58:30 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-01-04T03:58:30Z</dc:date>
    <item>
      <title>Web service output conditional on schema definition</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Web-service-output-conditional-on-schema-definition/m-p/2325899#M95444</link>
      <description>&lt;P&gt;I'm working with a web service which has the potential to provide a response in two different formats. I have the two XSDs that describe each of the formats and I've created them as metadata, but I'm trying to find a way to fire a conditional depending on the format that comes back.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Right now, I have a tWebServiceInput component that returns a row containing a single schema column&amp;nbsp;"data". That data is raw XML. It is my understanding that tFileInputXML needs a file. Would it make sense to write the raw XML to a temp file, attempt to read it with a tFileInputXML using one of the schema definitions and if that fails, try the other? Or is there a better way to pipe the initial raw XML into another type of component? Thoughts?&lt;/P&gt;</description>
      <pubDate>Thu, 31 Dec 2015 17:43:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Web-service-output-conditional-on-schema-definition/m-p/2325899#M95444</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-31T17:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: Web service output conditional on schema definition</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Web-service-output-conditional-on-schema-definition/m-p/2325900#M95445</link>
      <description>Hi&amp;nbsp;&lt;BR /&gt;You can read the return string and check if it contains some special words that is able to distinguish different format, and use use runIf to fire different business process based on the result. For example:&lt;BR /&gt;tWebserviceInput--main--tJavaRow--runIf--tFixdeFlowInput1--main--tExtractXMLField2&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; runIf--tFixdeFlowInput2--main--tExtractXMLField2&lt;BR /&gt;&lt;BR /&gt;tJavaRow:&lt;BR /&gt;&lt;BR /&gt;globalMap.put("currentResult",input_row.result);&lt;BR /&gt;&lt;BR /&gt;if(input_row.result.contains("format1"){&lt;BR /&gt;globalMap.put("isFormat1",true);&lt;BR /&gt;}else{&lt;BR /&gt;globalMap.put("isFormat1",false);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;if(input_row.result.contains("format2"){&lt;BR /&gt;globalMap.put("isFormat2",true);&lt;BR /&gt;}else{&lt;BR /&gt;globalMap.put("isFormat2",false);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Define the condition of runIf like:&lt;BR /&gt;(Boolean)globalMap.get("isFormat1")&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;tFixedFlowInput: get the current result, define one column and set its value as: (String)globalMap.get("currentResult")&lt;BR /&gt;&lt;BR /&gt;tExtractXMLField: extract fields from a XML string.</description>
      <pubDate>Mon, 04 Jan 2016 03:58:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Web-service-output-conditional-on-schema-definition/m-p/2325900#M95445</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-01-04T03:58:30Z</dc:date>
    </item>
  </channel>
</rss>

