title: Getting a return value from a channel
body: <p>I would like to start a mirth channel from another mirth channel, wait for it to complete, stop it and then start another. I have this code in the main channel started. My question is how to I get a response back from the other channel? I do have the following line in channel 'CH1' as the last line.</p>
  
  <pre><code>return "&lt;data&gt;&lt;value&gt;1&lt;/value&gt;&lt;/data&gt;";
  </code></pre>
  
  <p>Snipped from MAIN CHANNEL:</p>
  
  <pre><code>var channelName = 'CH1'
  ChannelUtil.StartChannel(channelName)
  
  while (getChannelState(channelName).toUpperCase() == "STARTED") {
  
  }
  
  function getChannelState(channelName){
  
      var channelStatus = ChannelUtil.getChannelState(channelName);
  
      if(channelStatus != null){
              return channelStatus.toString();
      }
  
      return "UNKNOWN";
  }
  </code></pre>