title: How to convert mapped variable into base64 string using Mirth
body: <p>I have:</p>
  
  <ol>
  <li>Raw xml filled by a select query.This xml transformed into a HL7
  message</li>
  <li>One of the tags of this xml represents a clob column from a table in
  the database</li>
  <li>I mapped this data (from edit transformer section) as a variable.</li>
  <li>Now I am trying to convert this variable into a base64 string then
  replace it in my transformed hl7 message.
  5.I tried this conversion on a destination channel which is a javascript writer.</li>
  </ol>
  
  <p>I read and tried several conversion methods like </p>
  
  <pre><code>Packages.org.apache.commons.codec.binary.Base64.encodeBase64String();
  </code></pre>
  
  <p>I have got only error messages like :</p>
  
  <pre><code>EvaluatorException: Can't find method org.apache.commons.codec.binary.Base64.encodeBase64String(java.lang.String);
  </code></pre>
  
  <p>Code piece:</p>
  
  <pre><code>var ads=$('V_REPORT_CLOB');
  var encoded = Packages.org.apache.commons.codec.binary.Base64.encodeBase64String(ads.toString());
  </code></pre>
  
  <p>It is pretty clear that I am a newbie on that.How can I manage to do this conversion ?</p>