[tohu-users] questionair to include into larger application

Jelle Victoor jelle.victoor at conundra.eu
Tue Sep 2 01:36:14 EDT 2014


Hey Damon, thanks for tour awnser.
I think I asked my question the wrong way.
I want to replace the generated ui by my own rest interface so that tohu is encapsulated on my service layer.

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 :)

On 1 Sep 2014 22:03, Damon Horrell <damonnomad71 at yahoo.co.nz> wrote:
Hi Jelle,

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.  You'll need to convert whatever this returns into various PossibleAnswer objects.  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.

Also if you wish to persist the data that the user enters then use KnowledgeSessionHelper.getAnswers() to get the values for saving.  Then to recreate a questionnaire from saved data you need to instantiate Answer objects and insert them into the session.  xml-example illustrates both of these using a dummy textarea containing XML as the "persisted storage".  See OutputServlet for saving and submit.jsp for reading back.  In your case you'll probably want to convert the Map returned by getAnswers() into JSON which you can pass to your REST backend.

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.  But I'm happy to answer any questions.

Regards, Damon

________________________________
From: Jelle Victoor <jelle.victoor at conundra.eu>
To: "tohu-users at lists.jboss.org" <tohu-users at lists.jboss.org>
Sent: Monday, 1 September 2014 8:24 PM
Subject: [tohu-users] questionair to include into larger application

Hi

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.
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?



_______________________________________________
tohu-users mailing list
tohu-users at lists.jboss.org<mailto:tohu-users at lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/tohu-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/tohu-users/attachments/20140902/0a3ecaaf/attachment-0001.html 


More information about the tohu-users mailing list