<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;font-size:12pt"><div id="yiv8953827247" class="" style=""><div class="" style=""><div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;font-size:12pt;" class=""><div class="" id="yiv8953827247yui_3_16_0_12_1409239173995_4" style=""><span class="" id="yiv8953827247yui_3_16_0_12_1409239173995_27" style="">Hi Jelle,</span></div><div class="" id="yiv8953827247yui_3_16_0_12_1409239173995_4" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;"><span class="" id="yiv8953827247yui_3_16_0_12_1409239173995_90" style=""><br clear="none" style=""></span></div><div class="" id="yiv8953827247yui_3_16_0_12_1409239173995_4"
 style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;"><span class="" id="yiv8953827247yui_3_16_0_12_1409239173995_93" style="">You can write any Java code within the rules so for example you can call one of your REST apis to fetch the values to display for the multiple choice answers. &nbsp;You'll need to convert whatever this returns into various PossibleAnswer objects. &nbsp;It'll be cleaner if you put most of the code in a Java class and then declare this as a global within the rules.</span></div><div class="" id="yiv8953827247yui_3_16_0_12_1409239173995_4" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;"><span class="" id="yiv8953827247yui_3_16_0_12_1409239173995_104" style=""><br clear="none"
 id="yiv8953827247yui_3_16_0_12_1409239173995_110" class="" style=""></span></div><div class="" id="yiv8953827247yui_3_16_0_12_1409239173995_4" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;"><span class="" id="yiv8953827247yui_3_16_0_12_1409239173995_33" style="background-color: transparent;">Also if you wish to persist the data that the user enters then use&nbsp;</span><span class="" id="yiv8953827247yui_3_16_0_12_1409239173995_38" style="background-color: transparent;">KnowledgeSessionHelper.getAnswers() to get the values for saving. &nbsp;Then to r</span><span id="yiv8953827247yui_3_16_0_12_1409239173995_58" style="background-color: transparent;" class="">ecreate a questionnaire from saved data you need to instantiate Answer objects and insert them into the session. &nbsp;</span><span style="font-family: HelveticaNeue,
 'Helvetica Neue', Helvetica, Arial, 'Lucida  Grande', sans-serif; background-color: transparent;" class="">xml-example illustrates both of these using a dummy textarea containing XML as the "persisted storage". &nbsp;See OutputServlet for saving and submit.jsp for reading back. &nbsp;</span><span style="background-color: transparent;" class="">In your case you'll probably want to convert the Map returned by getAnswers() into JSON which you can pass to your REST backend.</span></div><div class="" id="yiv8953827247yui_3_16_0_12_1409239173995_4" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;"><br clear="none" id="yiv8953827247yui_3_16_0_12_1409239173995_84" class="" style=""></div><div class="" id="yiv8953827247yui_3_16_0_12_1409239173995_4" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue',
 Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;">Re documentation, I'm sorry but there is only what's on the WIki (https://developer.jboss.org/wiki/Tohu) plus the examples and Javadoc. &nbsp;But I'm happy to answer any questions.</div><div class="" id="yiv8953827247yui_3_16_0_12_1409239173995_4" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;"><br class="" style=""></div><div class="" id="yiv8953827247yui_3_16_0_12_1409239173995_4" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;">Regards, Damon</div><div class="" id="yiv8953827247yui_3_16_0_12_1409239173995_4" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue',
 Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;"><br></div>  <div class="" id="yiv8953827247yui_3_16_0_12_1409239173995_9" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;font-size:12pt;"> <div class="" id="yiv8953827247yui_3_16_0_1_1409239173995_26687" style="font-family:times new roman, new york, times, serif;font-size:12pt;"> <div class="" id="yiv8953827247yqt15369" style=""><div class="" dir="ltr" id="yiv8953827247yui_3_16_0_1_1409239173995_26686" style=""> <hr class="" id="yiv8953827247yui_3_16_0_1_1409239173995_26685" size="1" style="">  <font class="" id="yiv8953827247yui_3_16_0_1_1409239173995_26688" size="2" face="Arial" style=""> <b class="" style=""><span class="" style="font-weight:bold;">From:</span></b> Jelle Victoor &lt;jelle.victoor@conundra.eu&gt;<br clear="none" class="" style=""> <b class="" style=""><span class=""
 style="font-weight:bold;">To:</span></b> "tohu-users@lists.jboss.org" &lt;tohu-users@lists.jboss.org&gt; <br clear="none" class="" style=""> <b class="" style=""><span class="" style="font-weight:bold;">Sent:</span></b> Monday, 1 September 2014 8:24 PM<br clear="none" class="" style=""> <b class="" style=""><span class="" style="font-weight:bold;">Subject:</span></b> [tohu-users] questionair to include into larger application<br clear="none" class="" style=""> </font> </div> <div class="" id="yiv8953827247yui_3_16_0_1_1409239173995_26788" style=""><br clear="none" class="" style=""><div class="" id="yiv8953827247" style="">

 
 
<style class="" style="">#yiv8953827247 #yiv8953827247 --
  
 filtered  {panose-1:2 4 5 3 5 4 6 3 2 4;}
#yiv8953827247 filtered  {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}
#yiv8953827247   
 p.yiv8953827247MsoNormal, #yiv8953827247  li.yiv8953827247MsoNormal, #yiv8953827247  div.yiv8953827247MsoNormal
        {margin:0cm;margin-bottom:.0001pt;font-size:11.0pt;}
#yiv8953827247  a:link, #yiv8953827247  span.yiv8953827247MsoHyperlink
        {color:#0563C1;text-decoration:underline;}
#yiv8953827247  a:visited, #yiv8953827247  span.yiv8953827247MsoHyperlinkFollowed
        {color:#954F72;text-decoration:underline;}
#yiv8953827247  span.yiv8953827247EmailStyle17
        {color:windowtext;}
#yiv8953827247  .yiv8953827247MsoChpDefault
        {}
#yiv8953827247 filtered  {margin:70.85pt 70.85pt 70.85pt 70.85pt;}
#yiv8953827247  div.yiv8953827247WordSection1
        {}
#yiv8953827247 </style>

<div class="" id="yiv8953827247yui_3_16_0_1_1409239173995_26787" style="">
<div class="" id="yiv8953827247yui_3_16_0_1_1409239173995_26786" style="">
<div class="" id="yiv8953827247yui_3_16_0_1_1409239173995_26785" style="">Hi</div> 
<div class="" id="yiv8953827247yui_3_16_0_1_1409239173995_26789" style=""> &nbsp;</div> 
<div class="" id="yiv8953827247yui_3_16_0_1_1409239173995_26791" style=""><span class="" id="yiv8953827247yui_3_16_0_1_1409239173995_26790" lang="EN-US" style="">I’m building large application with angularjs. Now I have a need to use a questionair and I’ve been looking at tohu and decided that this seems a solid framework for the job. The only question is how this will integrate
 with the rest of my application which is a pure rest based back-end with a angularjs front-end.</span></div> 
<div class="" id="yiv8953827247yui_3_16_0_1_1409239173995_26793" style=""><span class="" id="yiv8953827247yui_3_16_0_1_1409239173995_26792" lang="EN-US" style="">Any suggestions? Is there also more documentation to be found? Now I’m just engineering on top of the examples to build something I want. Everything works as long as I stay inside the tohu framework, but what if I want
 to get my multiple choice answers from my database etc?</span></div> 
<div class="" id="yiv8953827247yui_3_16_0_1_1409239173995_26794" style=""><span class="" lang="EN-US" style=""> &nbsp;</span></div> 
<div class="" id="yiv8953827247yui_3_16_0_1_1409239173995_27031" style=""><span class="" lang="EN-US" style=""> &nbsp;</span></div> 
</div>
</div>
</div><br clear="none" class="" style="">_______________________________________________<br clear="none" class="" style="">tohu-users mailing list<br clear="none" class="" style=""><a rel="nofollow" shape="rect" class="" id="yiv8953827247yui_3_16_0_1_1409239173995_26795" ymailto="mailto:tohu-users@lists.jboss.org" target="_blank" href="mailto:tohu-users@lists.jboss.org" style="">tohu-users@lists.jboss.org</a><br clear="none" class="" style=""><a rel="nofollow" shape="rect" class="" id="yiv8953827247yui_3_16_0_1_1409239173995_26796" target="_blank" href="https://lists.jboss.org/mailman/listinfo/tohu-users" style="">https://lists.jboss.org/mailman/listinfo/tohu-users</a><br clear="none" class="" style=""><br clear="none" class="" style=""></div></div> </div> </div>  </div></div></div></div></body></html>