This got the better of me so I have changed it myself.
 
- removed all code pertaining to masterListOfAllItems and addItemWhenPositionalItemNotFound
- added Questionnaire.getLastActiveItem (the underlying field is transient so it doesn't get sent to the client)
- added 1 new rule in Active.drl
- wrote some tests for it
 
Now it skips any pages which aren't there so you can just add everything to the list up front.  So effectively Questionnaire.items now acts as the master list.
 
There was no useful purpose in having a completely empty page so there is no loss of functionality from before.  If someone really does want a totally blank page they just need to put an empty group or note in it as an invisible placeholder.
 
I will update the Jira.
 
Damon
 
 
-----Forwarded by Damon Horrell/Employees/SolNet Solutions on 11/07/2009 03:37PM -----

To: Derek Rendall/Employees/SolNet Solutions@SSL
From: Damon Horrell/Employees/SolNet Solutions
Date: 11/07/2009 10:39AM
cc: tohu-users@lists.jboss.org, Ronan Burns/Employees/SolNet Solutions@SSL, David Plumpton/Employees/SolNet Solutions@SSL
Subject: TOHU-13 etc

Derek,

 

Re Tohu 13 ( https://jira.jboss.org/jira/browse/TOHU-13 )

 

Another option for this one might have been to keep the structure as it is just using group.items but instead change the mechanism that handles moving from page to page so that if you try to move to a page that isn't there then it skips it and goes on to the next one in sequence.

 

This means you could just set questionnaire.items to the full list of steps and don't define the groups for the steps that you want to skip over.

 

I think this can be achieved by doing:

 

- make Questionnaire remember what the lastActiveItem was, which can just be set inside setActiveItem.

- write a rule (with a high salience) that checks whether questionnaire.activeItem exists and if not then it changes the activeItem, and it knows which direction to go (forward or back) by looking at lastActiveItem.  (Can just get the index of both activeItem and lastActiveItem and then +/- 1).

 

I'm pretty sure this would work, and it would be simpler than what you've got now.  It certainly simplifies the model anyway by not adding another list attribute to it.  I think simplicity of the model is paramount.

 

Sorry, I need to get myself added to the notifcation list in Jira so I hear about these things sooner.

 

Damon

 

P.S.  I notice Ronan made a small change too (to always open the completion action in a new tab/window), but there is no associated Jira.  Please can we do this for all changes.  It means that users of Tohu have visibility of what features have changed from one release to the next without having to look through the SVN history of individual code changes .  Also I wonder if the change made should actually be optional, as I'm not sure you'd want that behaviour in most situations.

 

P.P.S.  I think we should start using the mailing list more for discussion on changes etc as others (outside Solnet/Suncorp) have started using Tohu, and may have useful contributions they can make too.  Ronan/David you should join the list too: https://lists.jboss.org/mailman/listinfo/tohu-users

 


Attention: This email may contain information intended for the sole use of the original recipient. Please respect this when sharing or disclosing this email's contents with any third party. If you believe you have received this email in error, please delete it and notify the sender or postmaster@solnetsolutions.co.nz as soon as possible. The content of this email does not necessarily reflect the views of Solnet Solutions Ltd.