title: is it possible to call Java functions from aiml?
body: <p>I am creating a chatbot using Java and program ab. In few places I can’t answer the questions directly, I have to process something or call a web service and process the result and then reply back. In such cases how to include the result of my java function to the responses in the aiml.</p>
  
  <p>Say,</p>
  
  <pre><code>User: What is the price of the product A?
  Bot: The price of product A is $50 
  </code></pre>
  
  <p>In the above example, $50 is not going to be same always. I have to take that in run time. So how to solve this problem?</p>
  
  <pre><code>**AIML:**
  
  &lt;category&gt;
      &lt;pattern&gt;WHAT IS THE PRICE OF THE *&lt;/pattern&gt;
      &lt;template&gt;The price of &lt;star/&gt; is $&lt;call some function price(productA)&gt; 
      &lt;/template&gt;
  &lt;/category&gt;
  
  **JAVA:**
  
  public int price(String product){
     // gets the product price
     // do the conversion 
     // apply discount
     return price;
  }
  </code></pre>
  
  <p>Please someone help me. Thanks in advance.</p>