See Tohu - FAQ for instructions on how to build and run the examples.
Shows the basics of using Tohu to generate a dynamic UI from rules.
Covers: Questionnaire.items, Questionnaire.completionAction, Question, MultipleChoiceQuestion, Note (dynamic), truth-maintenance, getting answers out
Shows how to do multiple pages.
doesn't exist yet - see loyalty-medium-example instead
Shows the various presentation styles built-in.
Covers: Item.presentationStyles, readonly
doesn't exist yet - search other .drl files for setPresentationStyles
See also: Tohu - Presentation styles
Shows how to do branches in a page-flow.
Covers: Questionnaire.navigationBranch, custom javscript to present a boolean question as Yes/No buttons.
Shows how to integrate with a Java domain model.
Covers: DomainModelAssociation, creating a session, getting Java object data in/out, reuse of business rules between Tohu and backend systems
Shows a simple way to get data in and out via XML.
Covers: creating a session, getting XML data in/out
Shows how to persist the answers captured using the Tohu questionnaire model rather than a Java domain model.
Covers: QueryHelper.getPersistentObjects, when you should use insert instead of insertLogical
doesn't exist yet - for now see the Javadoc for QueryHelper.getPersistentObjects
An example of an airport departure card.
Covers: data validation, using Group for layout, displaying dynamic images
Note: this example was actually written as a test of how productive this technology is. The author wrote the rules in 1 hour and then a UI developer (who doesn't know the underlying technology) spent another 1 hour making it look nice using CSS. The example (and the original paper version from which it was modelled) includes 5 separate branching points.
A simple family tree example.
3 examples of increasing complexity which build up a ficticious Solnet Loyalty Card.
- simple - single page with some dynamic behaviour
- complex - joint account (reuse of question rules), other loyalty programs (page branching), custom answerType to aid validation, readonly questions
- complete - it would be nice to extend this into a compete end-to-end working application by adding persistence so you can enter your name and it opens your record allowing you to edit the fields (but perhaps with some readonly).
SpreadsheetBiology and SpreadsheetLoyaltyGold
These two examples demonstrate how to use tohu-loader to generate drl files from an Excel spreadsheet.
The readme.txt file explains how to enable auto-reloading of the rules if the spreadsheet is edited.