<?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: Adding custom (user defined) java code - &amp;quot;cannot be resolved&amp;quot; error in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Adding-custom-user-defined-java-code-quot-cannot-be-resolved/m-p/2282310#M56572</link>
    <description>&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;Hi, I'm having the same problem here...&lt;BR /&gt;There is no typo error or case sensitive.&lt;BR /&gt;I didn't even write into the code manually.&lt;BR /&gt;I added it into the expression filter.&lt;BR /&gt;and in expression filter, my method is visible and available.&lt;BR /&gt;but when i tried to run the job, it gave me that MyMethod cannot be resolved&lt;BR /&gt;I tried to import the class manually too....&lt;BR /&gt;Please.... tell me how can I fix this.....&lt;BR /&gt;Thanks&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Right click on the job name and select 'set routines dependencies' option to check your custom routine is there, add it if not. 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
    <pubDate>Mon, 19 Sep 2011 06:01:19 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-09-19T06:01:19Z</dc:date>
    <item>
      <title>Adding custom (user defined) java code - "cannot be resolved" error</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Adding-custom-user-defined-java-code-quot-cannot-be-resolved/m-p/2282305#M56567</link>
      <description>Hi everyone, 
&lt;BR /&gt;I am trying to use user defined method in tJavaRow component in a job. It seems to me like I'm doing everything by the book ("TalendOpenStudio_UG_41b_EN.pdf", pages 267 to 272 in pdf), but I'm still getting "cannot be resolved" error when running a job. 
&lt;BR /&gt;This is my setup: 
&lt;BR /&gt;1. I've added the java code in Repository / Code / Routines / MyCode. I've created 2 methods: SqlINstr, SqlINnum and I kept the example helloExample code as well. Enclosed that in MyCode public class and tried to create all comments as required: 
&lt;BR /&gt; 
&lt;PRE&gt;public class MyCode {&lt;BR /&gt;	&lt;BR /&gt;	/**&lt;BR /&gt;     * SqlINstr: Emulate SQL IN operator.&lt;BR /&gt;     * &lt;BR /&gt;     * &lt;BR /&gt;     * {talendTypes} boolean | Boolean&lt;BR /&gt;     * &lt;BR /&gt;     * {Category} User Defined&lt;BR /&gt;     * &lt;BR /&gt;     * {param} String("value") input: The string need to be printed.&lt;BR /&gt;     * &lt;BR /&gt;     * {param} String[] ("value2","value3") pattern: The string array to match at least one.&lt;BR /&gt;     * &lt;BR /&gt;     * {example} SqlINstr (String EntryValue, String[] MatchingConditions)&lt;BR /&gt;     * &lt;BR /&gt;     */	&lt;BR /&gt;  public static boolean SqlINstr(String EntryValue, String[] CondSet) {&lt;BR /&gt;	    int cnt = 0;&lt;BR /&gt;	    boolean MatchFound = false;&lt;BR /&gt;	    while (cnt &amp;lt; CondSet.length) {&lt;BR /&gt;	      if (EntryValue.equals(CondSet)) {MatchFound = true;}&lt;BR /&gt;	      cnt++;&lt;BR /&gt;	    }&lt;BR /&gt;	    return MatchFound;&lt;BR /&gt;	  }&lt;BR /&gt;  &lt;BR /&gt;  /**&lt;BR /&gt;   * SqlINstr: Emulate SQL IN operator&lt;BR /&gt;   * &lt;BR /&gt;   * &lt;BR /&gt;   * {talendTypes} boolean | Boolean&lt;BR /&gt;   * &lt;BR /&gt;   * {Category} User Defined&lt;BR /&gt;   * &lt;BR /&gt;   * {param} Integer(1) input: The integer need to be printed.&lt;BR /&gt;   * &lt;BR /&gt;   * {param} Integer[] (100, 101) pattern: The integer array to match at least one.&lt;BR /&gt;   * &lt;BR /&gt;   * {example} SqlINnum (int EntryValue, int[] MatchingConditions)&lt;BR /&gt;   * &lt;BR /&gt;   */ &lt;BR /&gt;  public static boolean SqlINnum(int EntryValue, int[] CondSet) {&lt;BR /&gt;      int cnt = 0;&lt;BR /&gt;      boolean MatchFound = false;&lt;BR /&gt;      while (cnt &amp;lt; CondSet.length) {&lt;BR /&gt;	if (EntryValue == CondSet) {MatchFound = true;}&lt;BR /&gt;	cnt++;&lt;BR /&gt;      }&lt;BR /&gt;      return MatchFound;&lt;BR /&gt;    }&lt;BR /&gt;    /**&lt;BR /&gt;     * helloExample: not return value, only print "hello" + message.&lt;BR /&gt;     * &lt;BR /&gt;     * &lt;BR /&gt;     * {talendTypes} String&lt;BR /&gt;     * &lt;BR /&gt;     * {Category} User Defined&lt;BR /&gt;     * &lt;BR /&gt;     * {param} string("world") input: The string need to be printed.&lt;BR /&gt;     * &lt;BR /&gt;     * {example} helloExemple("world") # hello world !.&lt;BR /&gt;     */&lt;BR /&gt;    public static void helloExample(String message) {&lt;BR /&gt;        if (message == null) {&lt;BR /&gt;            message = "World"; //$NON-NLS-1$&lt;BR /&gt;        }&lt;BR /&gt;        System.out.println("Hello " + message + " !"); //$NON-NLS-1$ //$NON-NLS-2$&lt;BR /&gt;    }&lt;BR /&gt;}&lt;/PRE&gt; 
&lt;BR /&gt;2. I've added the code in tJavaRow component to use those methods: 
&lt;BR /&gt; 
&lt;PRE&gt;String[] AcrGL = {"DND","DOD","SPD","VAG"};&lt;BR /&gt;if (SqlINstr(input_row.acr, AcrGL)) &lt;BR /&gt;	{output_row.saldorsd_gl = input_row.saldorsd;}&lt;/PRE&gt; 
&lt;BR /&gt;But, when I run the job I'm getting: "MyCode cannot be resolved" error? Is this because of some error in the code, or I didn't specify enough where the application should look fot the code? 
&lt;BR /&gt;Thanx.</description>
      <pubDate>Sat, 16 Nov 2024 13:10:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Adding-custom-user-defined-java-code-quot-cannot-be-resolved/m-p/2282305#M56567</guid>
      <dc:creator>vladika</dc:creator>
      <dc:date>2024-11-16T13:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom (user defined) java code - "cannot be resolved" error</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Adding-custom-user-defined-java-code-quot-cannot-be-resolved/m-p/2282306#M56568</link>
      <description>You must precise the package when you call your routine. Just type "Routine" and CTRL+Space for autocompletion you should get full path to your method.</description>
      <pubDate>Mon, 27 Dec 2010 11:33:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Adding-custom-user-defined-java-code-quot-cannot-be-resolved/m-p/2282306#M56568</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-12-27T11:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom (user defined) java code - "cannot be resolved" error</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Adding-custom-user-defined-java-code-quot-cannot-be-resolved/m-p/2282307#M56569</link>
      <description>Ok, I've modified now tJavaRow with the following: 
&lt;BR /&gt; 
&lt;PRE&gt;String[] AcrGL = {"DND","DOD","SPD","VAG"};&lt;BR /&gt;if (Routines.MyCode.SqlINstr(input_row.acr, AcrGL)) &lt;BR /&gt;	{output_row.saldorsd_gl = input_row.saldorsd;}&lt;/PRE&gt; 
&lt;BR /&gt;But I am still getting the same error. When I type CTRL+SPACE after typing "Routines." for autocompletion all I get is an empty window with the header: No basic/template/swt proposals?</description>
      <pubDate>Mon, 27 Dec 2010 14:55:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Adding-custom-user-defined-java-code-quot-cannot-be-resolved/m-p/2282307#M56569</guid>
      <dc:creator>vladika</dc:creator>
      <dc:date>2010-12-27T14:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom (user defined) java code - "cannot be resolved" error</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Adding-custom-user-defined-java-code-quot-cannot-be-resolved/m-p/2282308#M56570</link>
      <description>Aaah.. It's case sensitive.. Sorry 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACJ.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133049iD780B7DE0116E4D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACJ.png" alt="0683p000009MACJ.png" /&gt;&lt;/span&gt; it works allright! (It's "routines" instead of a "Routines") 
&lt;BR /&gt;Muchos gracias camsellem.</description>
      <pubDate>Mon, 27 Dec 2010 15:16:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Adding-custom-user-defined-java-code-quot-cannot-be-resolved/m-p/2282308#M56570</guid>
      <dc:creator>vladika</dc:creator>
      <dc:date>2010-12-27T15:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom (user defined) java code - "cannot be resolved" error</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Adding-custom-user-defined-java-code-quot-cannot-be-resolved/m-p/2282309#M56571</link>
      <description>Hi, I'm having the same problem here...
&lt;BR /&gt;There is no typo error or case sensitive.
&lt;BR /&gt;I didn't even write into the code manually.
&lt;BR /&gt;I added it into the expression filter.
&lt;BR /&gt;and in expression filter, my method is visible and available.
&lt;BR /&gt;but when i tried to run the job, it gave me that MyMethod cannot be resolved
&lt;BR /&gt;I tried to import the class manually too....
&lt;BR /&gt;Please.... tell me how can I fix this.....
&lt;BR /&gt;Thanks</description>
      <pubDate>Mon, 19 Sep 2011 05:23:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Adding-custom-user-defined-java-code-quot-cannot-be-resolved/m-p/2282309#M56571</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-09-19T05:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Adding custom (user defined) java code - "cannot be resolved" error</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Adding-custom-user-defined-java-code-quot-cannot-be-resolved/m-p/2282310#M56572</link>
      <description>&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;Hi, I'm having the same problem here...&lt;BR /&gt;There is no typo error or case sensitive.&lt;BR /&gt;I didn't even write into the code manually.&lt;BR /&gt;I added it into the expression filter.&lt;BR /&gt;and in expression filter, my method is visible and available.&lt;BR /&gt;but when i tried to run the job, it gave me that MyMethod cannot be resolved&lt;BR /&gt;I tried to import the class manually too....&lt;BR /&gt;Please.... tell me how can I fix this.....&lt;BR /&gt;Thanks&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Right click on the job name and select 'set routines dependencies' option to check your custom routine is there, add it if not. 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Mon, 19 Sep 2011 06:01:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Adding-custom-user-defined-java-code-quot-cannot-be-resolved/m-p/2282310#M56572</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-09-19T06:01:19Z</dc:date>
    </item>
  </channel>
</rss>

