<?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: Java Expression for tMap in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Java-Expression-for-tMap/m-p/2294519#M67388</link>
    <description>hi ncooper and welcome
&lt;BR /&gt;when you create a new routine and you want that appear in the menu(list) follow the default example :
&lt;BR /&gt;
&lt;PRE&gt;/*&lt;BR /&gt; * user specification: the function's comment should contain keys as follows: 1. write about the function's comment.but&lt;BR /&gt; * it must be before the "{talendTypes}" key.&lt;BR /&gt; * &lt;BR /&gt; * 2. {talendTypes} 's value must be talend Type, it is required . its value should be one of: String, char | Character,&lt;BR /&gt; * long | Long, int | Integer, boolean | Boolean, byte | Byte, Date, double | Double, float | Float, Object, short |&lt;BR /&gt; * Short&lt;BR /&gt; * &lt;BR /&gt; * 3. {Category} define a category for the Function. it is required. its value is user-defined .&lt;BR /&gt; * &lt;BR /&gt; * 4. {param} 's format is: {param} &amp;lt;type&amp;gt; &amp;lt;name&amp;gt;&lt;BR /&gt; * &lt;BR /&gt; * &amp;lt;type&amp;gt; 's value should be one of: string, int, list, double, object, boolean, long, char, date. &amp;lt;name&amp;gt;'s value is the&lt;BR /&gt; * Function's parameter name. the {param} is optional. so if you the Function without the parameters. the {param} don't&lt;BR /&gt; * added. you can have many parameters for the Function.&lt;BR /&gt; * &lt;BR /&gt; * 5. {example} gives a example for the Function. it is optional.&lt;BR /&gt; */&lt;/PRE&gt;
&lt;BR /&gt;anyway you can call your static function like that :
&lt;BR /&gt;
&lt;PRE&gt;yourRoutine.yourStaticFunction(param)&lt;/PRE&gt;
&lt;BR /&gt;for the second issue you can wrap your switch code in a routine and return the expected value.
&lt;BR /&gt;ps : 
&lt;I&gt;in your case do nothing except return default value !&lt;/I&gt;
&lt;BR /&gt;hope it helps you 
&lt;BR /&gt;regards
&lt;BR /&gt;laurent</description>
    <pubDate>Wed, 26 May 2010 22:48:55 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-05-26T22:48:55Z</dc:date>
    <item>
      <title>Java Expression for tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Java-Expression-for-tMap/m-p/2294518#M67387</link>
      <description>Hi, I am still new to Talend and have been looking over the documentation and forum posts for an answer to this problem. 
&lt;BR /&gt;I have created a new Routine in Code. 
&lt;BR /&gt;Code : Routines : resolveName 0.1 
&lt;BR /&gt; 
&lt;PRE&gt;package routines;&lt;BR /&gt;public class resolveName {&lt;BR /&gt;    public static String helloExample(String name) {&lt;BR /&gt;    	String str = "fish";&lt;BR /&gt;    	return str;&lt;BR /&gt;    }&lt;BR /&gt;}&lt;/PRE&gt; 
&lt;BR /&gt;The code simply returns fish for what ever the input. I am now trying to use this in a tMap expression builder, I look at the list of categories and it's not listed. What do I have to do to get it to show up? I have restarted Talend after saving. 
&lt;BR /&gt;The other question I've got is for more complex Expressions entered directly into the tMap expression builder, how do I use something like a switch? 
&lt;BR /&gt; 
&lt;PRE&gt;switch(row1.name) {&lt;BR /&gt;  case 1: output X; break;&lt;BR /&gt;  case 2: output Y: break;&lt;BR /&gt;  default: output Z;&lt;BR /&gt;}&lt;/PRE&gt; 
&lt;BR /&gt;I'm not sure what to code for the 'Output X/Y/Z' bit. 
&lt;BR /&gt;Thanks for any help you can offer.</description>
      <pubDate>Sat, 16 Nov 2024 13:25:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Java-Expression-for-tMap/m-p/2294518#M67387</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T13:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Java Expression for tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Java-Expression-for-tMap/m-p/2294519#M67388</link>
      <description>hi ncooper and welcome
&lt;BR /&gt;when you create a new routine and you want that appear in the menu(list) follow the default example :
&lt;BR /&gt;
&lt;PRE&gt;/*&lt;BR /&gt; * user specification: the function's comment should contain keys as follows: 1. write about the function's comment.but&lt;BR /&gt; * it must be before the "{talendTypes}" key.&lt;BR /&gt; * &lt;BR /&gt; * 2. {talendTypes} 's value must be talend Type, it is required . its value should be one of: String, char | Character,&lt;BR /&gt; * long | Long, int | Integer, boolean | Boolean, byte | Byte, Date, double | Double, float | Float, Object, short |&lt;BR /&gt; * Short&lt;BR /&gt; * &lt;BR /&gt; * 3. {Category} define a category for the Function. it is required. its value is user-defined .&lt;BR /&gt; * &lt;BR /&gt; * 4. {param} 's format is: {param} &amp;lt;type&amp;gt; &amp;lt;name&amp;gt;&lt;BR /&gt; * &lt;BR /&gt; * &amp;lt;type&amp;gt; 's value should be one of: string, int, list, double, object, boolean, long, char, date. &amp;lt;name&amp;gt;'s value is the&lt;BR /&gt; * Function's parameter name. the {param} is optional. so if you the Function without the parameters. the {param} don't&lt;BR /&gt; * added. you can have many parameters for the Function.&lt;BR /&gt; * &lt;BR /&gt; * 5. {example} gives a example for the Function. it is optional.&lt;BR /&gt; */&lt;/PRE&gt;
&lt;BR /&gt;anyway you can call your static function like that :
&lt;BR /&gt;
&lt;PRE&gt;yourRoutine.yourStaticFunction(param)&lt;/PRE&gt;
&lt;BR /&gt;for the second issue you can wrap your switch code in a routine and return the expected value.
&lt;BR /&gt;ps : 
&lt;I&gt;in your case do nothing except return default value !&lt;/I&gt;
&lt;BR /&gt;hope it helps you 
&lt;BR /&gt;regards
&lt;BR /&gt;laurent</description>
      <pubDate>Wed, 26 May 2010 22:48:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Java-Expression-for-tMap/m-p/2294519#M67388</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-05-26T22:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: Java Expression for tMap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Java-Expression-for-tMap/m-p/2294520#M67389</link>
      <description>Thank you for replying, I now have it working.
&lt;BR /&gt;I will include the comment below.
&lt;BR /&gt;
&lt;PRE&gt;    /**&lt;BR /&gt;     * String() Converts a string to junk&lt;BR /&gt;     * &lt;BR /&gt;     * {talendTypes} string | String&lt;BR /&gt;     * &lt;BR /&gt;     * {Category} importResolver&lt;BR /&gt;     * &lt;BR /&gt;     * {param} string() name: string value&lt;BR /&gt;     * &lt;BR /&gt;     * {example} String('Cat'):string&lt;BR /&gt;     * &lt;BR /&gt;     */&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 May 2010 09:38:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Java-Expression-for-tMap/m-p/2294520#M67389</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-05-27T09:38:06Z</dc:date>
    </item>
  </channel>
</rss>

