title: ODI: How to correctly define and pass variables between tasks inside Knowledge Module?
body: <p>I'm building a custom IKM, and I need to keep some values in memory during execution. So in the first task, I try to define all the variables that will be used in following tasks.</p>
  
  <p>For example, I need to get Session Number as integer. I do it like this:</p>
  
  <pre><code>&lt;% 
  int SESSIONID = Integer.parseInt(&lt;?=odiRef.getSession("SESS_NO")?&gt;); 
  %&gt;
  </code></pre>
  
  <p>But I get the following error:</p>
  
  <pre><code>Parse error at line 2, column 17.  Encountered: &lt;
  Pre-execution text:
  int SESSIONID = 699;
  out.print("");
  </code></pre>
  
  <p>This</p>
  
  <pre><code>&lt;%
  String sessionNo = odiRef.getSession("SESS_NO");
  int SESSIONID = Integer.parseInt(sessionNo);
  %&gt;
  </code></pre>
  
  <p>is also not working:</p>
  
  <pre><code>Sourced file: inline evaluation of: `` String sessionNo =             
  odiRef.getSession("SESS_NO"); Integer SESSIONID = Integer.pa . . . '' : Typed variable declaration : Method Invocation Integer.parseInt
  Target error:
  For input string: "707"
  Pre-execution text:
  String sessionNo = odiRef.getSession("SESS_NO");
  int SESSIONID = Integer.parseInt(sessionNo);
  out.print("");
  Error text:
  Integer .parseInt ( sessionNo ) 
  </code></pre>
  
  <p>What am I doing wrong? </p>