Carol Li wrote:

Hi, Wouter, I'm trying to duplicate the animal quiz project by creating those diagrams by hand. If you open the sample animal quiz in MagicDraw, and look at the left side navigation bar for the "guessing the animal" activity diagram, click on the state symbol, then you will see two states that can't be found on the right side diagram, and the transitions related to them.

hi Carol,

yes you are absolutely right, these where zombie states, deleted from the diagram and not from the model, thanks for this feedback.. just must be really going in deep with this sample :-) I'm fixing the model as we speak.

Also if I created the "false" transition of "lastAnswerWasYes" after the "true" transition, then the generated code is the same as the sample and it compiled fine. So my feeling is that the order for putting the transitions of a Decision Point matters, specially when one transitions points to a FrontEndView, since a FrontEndView will not have a corresponding method created in the Action class.


and again, you're right here too. the order of the decision outgoing transition matters, if you take a look at the generated code you'll see a comment that the dummy implementation takes the transition modeled modeled last by default.
and this brings us to a small bug I noticed last weekend, decision points may have issues in some cases (forexample if the outgoing transitions go into a final state or a jsp page directly), I'm working on this right now, it will be fixed soon



Thank you.
Carol.


thanks very much for bringing this to my attention

-- Wouter

*/Wouter Zoons <[EMAIL PROTECTED]>/* wrote:

    Carol Li wrote:

    > Hi, I tried to rebuild the animal quiz project using Magic Draw
    7.5. I
    > have two questions:
    > 1. I didn't find states "ask if user is ready to restart" and
    "ready
    > to continue" in the "guessing the animal" activity diagram and
    their
    > related transitions.
    >


me neither, who told you they would be there ? I only have "I win, continue ?"

    > 2. I tried to use ant to build my animal quiz project. There is one
    > file called AnswerQuestionYes.java generated.
    >
    > In the sample animal quiz, it has the following code in that file:
    >
    > private ActionForward lastAnswerWasYes(ActionMapping mapping,
    > ActionForm form, HttpServletRequest request, HttpServletResponse
    > response) throws Exception
    > {
    > final String value =
    >
    String.valueOf(GuessController.getInstance().lastAnswerWasYes(mapping,

    > (GuessForm)form, request, response));
    >
    > if (value.equals("true")) return
    > mapping.findForward("i.win.continue");
    > if (value.equals("false")) return askForAnimal(mapping, form,
    > request, response);
    > // we take the last action in case we have an invalid return
    > value from the controller
    > return askForAnimal(mapping, form, request, response);
    > }
    >


yes that's fine

    > But in the file generated by my project, it is:
    >
    > private ActionForward lastAnswerWasYes(ActionMapping mapping,
    > ActionForm form, HttpServletRequest request, HttpServletResponse
    > response) throws Exception
    > {
    > final String value =
    >
    String.valueOf(GuessController.getInstance().lastAnswerWasYes(mapping,

    > (GuessForm)form, request, response));
    >
    > if (value.equals("false")) ret! urn askForAnimal(mapping, form,
    > request, response);
    > if (value.equals("true")) return
    > mapping.findForward("i.win.continue");
    > // we take the last action in case we have an invalid return
    > value from the controller
    > return iWinContinue(mapping, form, request, response);
    > }


what did you change ? I can't see your UML project so it's impossible to tell what is going on. Did you touch the transitions ?

    >
    > Since iWinContinue is not a valid method, the compiler threw
    > exception here:
    >
    > compile:
    > [javac] Compiling 17 source files to
    > C:\andromda\andromda-bin-3.0M1\ant\myanimalquiz\web\target\classes
    > [javac]
    >
    
C:\andromda\andromda-bin-3.0M1\ant\myanimalquiz\web\target\src\org\andromda\samples\myanimalquiz\guess\Answe
    > rQuestionNo.java:117: cannot resolve symbol
    > [javac] symbol : method iWinContinue
    >
    (org.apache.struts.action.ActionMapping,org.apache.struts.action.ActionForm,ja
    >
    vax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
    > [javac] location: class
    > org.andromda.samples.myanimalquiz.guess.AnswerQuestionNo
    > [javac] return iWinContinue(mapping, form, request, response);
    > [javac] ^



    just a remark, but this compilation error is on file AnswerQuestionNo
    (doesn't matter at this point)




-- Wouter



    -------------------------------------------------------
    This SF.Net email is sponsored by: Oracle 10g
    Get certified on the hottest thing ever to hit the market...
    Oracle 10g.
    Take an Oracle 10g class now, and we'll give you the exam FREE.
    http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
    _______________________________________________
    Andromda-user mailing list
    [EMAIL PROTECTED]
    https://lists.sourceforge.net/lists/listinfo/andromda-user

------------------------------------------------------------------------
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger <http://messenger.yahoo.com/>





-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Andromda-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to