<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;font-size:12pt"><div class="" style=""><span class="" style="">I think I understand now. &nbsp;You want to leverage the rules part of Tohu to model a questionnaire but not the UI part of it?</span></div><div 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;" class=""><span class="" style=""><br class="" style=""></span></div><div 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;" class=""><span class="" style="">In this case you would use tohu-core only, and instead of tohu-xml you would write your own code to interact with the Drools
 knowledge session. &nbsp;Have a look at the code in tohu-xml to see how it works.</span></div><div 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;" class=""><span class="" style=""><br class="" style=""></span></div><div 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;" class=""><span class="" style="">tohu-core just provides the object model and the rules. &nbsp;KnowledgeSessionHelper.getActiveObjects() &nbsp;will return you all the active (i.e. visible) questions. &nbsp;When the user responds by answering questions you will have to insert them into the session by creating Answer objects. &nbsp;This will then trigger the rules and change what is returned by&nbsp;</span><span
 style="font-size: 12pt;" class="">getActiveObjects.</span></div><div style="color: rgb(0, 0, 0); font-size: 12pt; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal; background-color: transparent;" class=""><span style="font-size: 12pt;" class=""><br class="" style=""></span></div><div 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;" class=""><span style="font-size: 12pt;" class="">Tohu is stateful so you'd need to maintain a knowledge session per user session. &nbsp;tohu-xml contains a&nbsp;ChangeCollector class which allows it determine which objects have changed and only the changes (inserts/updates/deletes) are sent back to the JQuery UI. &nbsp;You'll need to work out how you want to handle this, whether you just ignore it and always re-render the
 whole screen, or whether you use a similar mechanism to only update what has changed.</span></div><div class="" style=""><br class="" style=""></div>  <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 12pt;" class=""> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;" class=""> <div dir="ltr" class="" style=""> <hr size="1" class="" style="">  <font size="2" face="Arial" class="" style=""> <b class="" style=""><span style="font-weight:bold;" class="">From:</span></b> Jelle Victoor &lt;jelle.victoor@conundra.eu&gt;<br class="" style=""> <b class="" style=""><span style="font-weight: bold;" class="">To:</span></b> Damon Horrell &lt;damonnomad71@yahoo.co.nz&gt; <br class="" style=""><b class="" style=""><span style="font-weight: bold;" class="">Cc:</span></b> "tohu-users@lists.jboss.org" &lt;tohu-users@lists.jboss.org&gt; <br class="" style=""> <b class=""
 style=""><span style="font-weight: bold;" class="">Sent:</span></b> <br class="" style=""> <b class="" style=""><span style="font-weight: bold;" class="">Subject:</span></b> Re: [tohu-users] questionair to include into larger application<br class="" style=""> </font> </div> <div class="" style=""><br class="" style=""><div id="yiv0138967311" class="" style=""><div class="" style="">
<div dir="ltr" class="" style="">Hey Damon, thanks for tour awnser.<br clear="none" class="" style="">
I think I asked my question the wrong way.<br clear="none" class="" style="">
I want to replace the generated ui by my own rest interface so that tohu is encapsulated on my service layer.</div>
<div dir="ltr" class="" style="">It looks like a fine product but overall it was hard to find the right maven repo (jboss developer) and I had to build it from svn. I got it working but a more 'out-of-the-box' approach would help it getting spread. The examples included are very
 good and I found some good YouTube video's so kudos for that :)</div>
<div class="" id="yiv0138967311yqt10424" style=""><div class="" style="">On 1 Sep 2014 22:03, Damon Horrell &lt;damonnomad71@yahoo.co.nz&gt; wrote:<br clear="none" class="" style="">
</div>
<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="yiv0138967311" style="">
<div class="" style="">
<div class="" style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;font-size:12pt;">
<div class="" id="yiv0138967311yui_3_16_0_12_1409239173995_4" style=""><span class="" id="yiv0138967311yui_3_16_0_12_1409239173995_27" style="">Hi Jelle,</span></div>
<div class="" id="yiv0138967311yui_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="yiv0138967311yui_3_16_0_12_1409239173995_90" style=""><br clear="none" style="" class="">
</span></div>
<div class="" id="yiv0138967311yui_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="yiv0138967311yui_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="yiv0138967311yui_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="yiv0138967311yui_3_16_0_12_1409239173995_104" style=""><br clear="none" class="" id="yiv0138967311yui_3_16_0_12_1409239173995_110" style="">
</span></div>
<div class="" id="yiv0138967311yui_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="yiv0138967311yui_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="yiv0138967311yui_3_16_0_12_1409239173995_38" style="background-color:transparent;">KnowledgeSessionHelper.getAnswers()
 to get the values for saving. &nbsp;Then to r</span><span class="" id="yiv0138967311yui_3_16_0_12_1409239173995_58" style="background-color:transparent;">ecreate a questionnaire from saved data you need to instantiate Answer objects and insert them into the session.
 &nbsp;</span><span class="" style="font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida  Grande', sans-serif;background-color:transparent;">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 class="" style="background-color:transparent;">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="yiv0138967311yui_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" class="" id="yiv0138967311yui_3_16_0_12_1409239173995_84" style="">
</div>
<div class="" id="yiv0138967311yui_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="yiv0138967311yui_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" class="" style="">
</div>
<div class="" id="yiv0138967311yui_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="yiv0138967311yui_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" class="" style="">
</div>
<div class="" id="yiv0138967311yui_3_16_0_12_1409239173995_9" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;font-size:12pt;">
<div class="" id="yiv0138967311yui_3_16_0_1_1409239173995_26687" style="font-family:times new roman, new york, times, serif;font-size:12pt;">
<div class="" id="yiv0138967311yqt15369" style="">
<div class="" dir="ltr" id="yiv0138967311yui_3_16_0_1_1409239173995_26686" style="">
<hr class="" id="yiv0138967311yui_3_16_0_1_1409239173995_26685" size="1" style="">
<font class="" id="yiv0138967311yui_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="yiv0138967311yui_3_16_0_1_1409239173995_26788" style=""><br clear="none" class="" style="">
<div class="" id="yiv0138967311" style=""><style class="" style="">
#yiv0138967311 #yiv0138967311 --
  -- filtered
        {}
#yiv0138967311  filtered
        {font-family:Calibri;}
#yiv0138967311  p.yiv0138967311MsoNormal, #yiv0138967311  li.yiv0138967311MsoNormal, #yiv0138967311  div.yiv0138967311MsoNormal
        {margin:0cm;margin-bottom:.0001pt;font-size:11.0pt;}
#yiv0138967311  a:link, #yiv0138967311  span.yiv0138967311MsoHyperlink
        {color:#0563C1;text-decoration:underline;}
#yiv0138967311  a:visited, #yiv0138967311  span.yiv0138967311MsoHyperlinkFollowed
        {color:#954F72;text-decoration:underline;}
#yiv0138967311  span.yiv0138967311EmailStyle17
        {color:windowtext;}
#yiv0138967311  filtered
        {margin:70.85pt 70.85pt 70.85pt 70.85pt;}
#yiv0138967311 
</style>
<div class="" id="yiv0138967311yui_3_16_0_1_1409239173995_26787" style="">
<div class="" id="yiv0138967311yui_3_16_0_1_1409239173995_26786" style="">
<div class="" id="yiv0138967311yui_3_16_0_1_1409239173995_26785" style="">Hi</div>
<div class="" id="yiv0138967311yui_3_16_0_1_1409239173995_26789" style="">&nbsp;</div>
<div class="" id="yiv0138967311yui_3_16_0_1_1409239173995_26791" style=""><span class="" id="yiv0138967311yui_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="yiv0138967311yui_3_16_0_1_1409239173995_26793" style=""><span class="" id="yiv0138967311yui_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="yiv0138967311yui_3_16_0_1_1409239173995_26794" style=""><span class="" lang="EN-US" style="">&nbsp;</span></div>
<div class="" id="yiv0138967311yui_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="yiv0138967311yui_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="yiv0138967311yui_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>
</div></div>
</div></div><br class="" style=""><br class="" style=""></div> </div> </div>  </div></body></html>