[Opensource] workflow using addStatePairing - not quite getting it
Helga Wyns
helgawyns at hotmail.com
Tue Dec 10 04:22:54 PST 2002
Mike,
you're right, now I see what I was missing.
I'd rather not write my own ControllerForms though, as this seems to be a
lot of extra work to me.
Now, I have modified the DefaultForm to extend the ControllerForm. It seems
to work: the StateForm is instantiated in State.perform(). But I must admit
that I don't know if it's ok to do that. Do you have any idea's?
>
>Aime,
>Your sample matches my code, but I am using
>com.jcorporate.expresso.core.controller.DefaultForm as my form bean, as
>Helga Wyns suggested was possible. In State.perform(), StateForm is null. I
>assume that's because DefaultForm doesn't work here and I need to have a
>custom ControllerForm?
>
>Thanks,
>Mike
>
>-----Original Message-----
>From: BSC [mailto:bsci at lycos.com]
>Sent: Sunday, December 08, 2002 1:20 AM
>To: opensource at jcorporate.com
>Subject: Re: [Opensource] workflow using addStatePairing - not quite
>getting it
>
>
>Hi Mike,
>
>Here's some code snippets that are working for me. Hopefully this will
>help..
>
>
>My Controller:
>--------------
>
>public SignIn() throws NonHandleableException {
>
> super();
>
> State promptState = null;
> State handleState = null;
>
> promptState = new PromptSignIn("prompt1", "Sign In");
> handleState = new ValidateSignIn("handle1", "Sign In");
> addStatePairing(promptState, handleState, null); //Will use
>controller form by default
>
> handleState = new CompleteSignIn("handleFinal", "Sign IN");
> addFinalState(handleState);
>}
>
>
>My External State:
>-----------------
>
>public class ValidateSignIn extends State {
>
>public void perform(StateForm stateForm, ControllerRequest request,
>ControllerResponse response)
> throws ControllerException, NonHandleableException {
>
> super.perform(stateForm, request, response);
> SignInForm signInForm = (SignInForm) stateForm;
>
> String signInID = StringUtil.notNull(signInForm.getSignInID());
> if (signInID.equals("")) {
> response.addError("Please type your ID.");
> return;
> }
>
><snip>
>
>
>
>My Controller Form:
>------------------
>
>public class SignInForm extends ControllerForm {
> private String signInID;
>
><snip>
>
>
>
>My Struts Config:
>----------------
> <!-- Sign In form bean -->
> <form-bean name="signInForm"
> type="com.xxx.view.SignInForm" />
>
>
> <action path="/SignIn"
> type="com.xxx.controller.SignIn"
> name="signInForm"
> scope="request"
> validate="false">
> <forward name="default" path="/MainOptions.do" redirect="true"/>
> <forward name="prompt1" path="showSignIn" />
> </action>
>
>
>
>
>---
>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
>_______________________________________________
>Opensource mailing list
>Opensource at jcorporate.com
>http://mail.jcorporate.com/mailman/listinfo/opensource
>Archives: http://mail.jcorporate.com/pipermail/opensource/
>_______________________________________________
>Opensource mailing list
>Opensource at jcorporate.com
>http://mail.jcorporate.com/mailman/listinfo/opensource
>Archives: http://mail.jcorporate.com/pipermail/opensource/
_________________________________________________________________
Ontvang je Hotmail & Messenger berichten op je mobiele telefoon met Hotmail
SMS http://www.msn.nl/jumppage/
More information about the Opensource
mailing list