[Opensource] Is anyone actually using workflow with Controller Form/StateFor

BSC bsci at lycos.com
Tue Feb 18 22:07:57 PST 2003


>>I have one question though that concerns having a handle state as the first
state.  I would like to have a work flow controller, and have the first
state be a prompt state. I wasn't sure by your example...Is this type of
thing legal:

..snip..


Dave,

I don't think your sample code would work.  If you are simply trying to validate the input parameters to the 1st prompt state then you can do so in the prompt state itself (instead of some initial handle state).  Try adding something like this to the perform method:


	//Check for session timeout or user meddling
	if ("input params not valid") {
		Transition oneTransition = new Transition();
		oneTransition.setControllerObject("com.xxx.controller.HubController");
		setSuccessTransition(oneTransition);
		return;
	}	

I have this type of code in 'all' my prompt states that have some required parameters.  If any input params are missing or not valid then I redirect to my main Hub screen.  In this sample I don't display an error message because any missing request params would be as a result of some end user hacking.  So essentially, this logic will short-circuit a controller before it completes successfully thus overriding any return-to-sender plans for the controller.

HTMS - Hope this makes sense!


---
Aime








_____________________________________________________________
Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year.
http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus



More information about the Opensource mailing list