状态图中初始伪状态是否可以有两条向外的转换?

  这两天为一个初始状态是否可以有两条向外的转换给难住了。朋友说看看规范,我看了2.0的规范上说:

An initial pseudostate is shown as a small solid filled circle (see Figure 15.16). In a region of a classifierBehavior state

machine, the transition from an initial pseudostate may be labeled with the trigger event that creates the object; otherwise,

it must be unlabeled. If it is unlabeled, it represents any transition from the enclosing state.

这没有明确说明是否可以有两条。

  在argouml的用户组和umlchina上发信,一个argouml的外国用户朋友回了信,可是全是长难句,只模模糊糊懂了些。

我把问题和信也贴在这里,有谁看了知道答案说一下:

  argouml用户组的回信:

users@argouml.tigris.org

CC: umlchina@yahoogroups.com, nirvanax@tom.com, users@learndiary.tigris.org, iuking@163.com

From: "Dashing Meng" <learndiary_dashing@yahoo.com>  Add to Address Book  Add Mobile Alert

Yahoo! DomainKeys has confirmed that this message was sent by yahoogroups.com. Learn more

Date: Thu, 29 Dec 2005 01:18:42 -0800 (PST)

Subject: [UMLChina] Re: [argouml-users] ArgoUML told me,the initial state should has only one outgoing transition in a statechart diagram

   

Thanks for your answer very much.I understood most part of your answer except those very long sentence:),my english isn't well.

 

This is something I will model:

User(userID,userName)

Goal(goalID,goalName)

MyGoal(userID,goalID,goalState)

the relationship between User and Goal is :M:N,and MyGoal is the association class.

MyGoal has three states:processing,quited,finished.

 

People will join an existed goal,and write diary under a goal,like the operation model of http://www.43things.com

 

From a user's view,there are two ways he can create a new object of class MyGoal:a user join a goal directly without posting diary under it, and a user post an diary under a goal, when he do these,a new MyGoal's record will be insert into database and with the state:processing.

 

From the system's view,in fact,user join a goal is the operation like:

User.joinGoal(int GoalID),then a new MyGoal is created;

user post a diary under a goal is the operations below:

User.postDiary(int GoalID),and,if this is the first posting diary under this goal,this operation will call the previous operation:User.joinGoal(int GoalID).

 

So,in fact,the object of class MyGoal's creating is caused by User.joinGoal(int GoalID) only.

 

But,I am modeling a business model now and only from the user's view to do so,what do you think to treat this kind of things?

 

Thanks.

 

/Dashing Meng

Leif Holmgren <sm4rpq@amsat.org> wrote:

Hi!

As I have been tought and what I can make out of the UML standard the

initial state symbol is there just to show which of the other states the

object end up in when it is created. So there is no real transition from

the "initial state" and another state other than the one taken from the

big void when the object is created. The UML standard also specifies

that you can have only one initial state in each (sub)state-machine!

Unfortunately the UML standard is pretty messed up when it comes to

state machines so you have to read the text carefully to understand

this, and don't stop at the 1.4 standard as the newer ones are more

clear but still messy.

Exactly what are you trying to state with your model? Can your object

start off in one of two different states or are you treating the initial

state symbol as a state of it's own?

I would not model (or program for that matter) a class that have it's

object start off in two different states at all. I would instead create

an initial state (created) from which I immediately transit to one of

those that I really want to be in after initialization. When an object

has something that needs to be initialized at object creation time it

tends to be the same initialization no matter what lifecycle you want

the object to go through later on.

If you are just thinking of the initial state as a proper state you

just have to add an extra state and then two outgoing transitions from

that one (properly named and guarded of cource) and you are back on track.

/Leif

Dashing Meng wrote:

> Hi,All,

> There are two path from the initial state can enter the state call

> "Processing".But when I draw two outgoing transition from the initial

> state,The ArgoUML said:

> This Initial state has an invalid number of transitions. Normally

> Initial states have at most one outgoing transition.

> Defining correct state transitions is needed to complete the

> behavioral specification part of your design.

> To fix this, remove transitions by clicking on transition in the

> diagram and pressing the "Ctrl-Delete" key.

>

> So I added a Junction between the initial state and state

> "Processing".Is this way all right?

>

> Thanks.

>

> ------------------------------------------------------------------------

  umlchina上的回答:

From: <alexzhang@...>

Date: Wed Dec 28, 2005  8:40 pm

Subject: RE: [UMLChina] Re: ArgoUML told me,the initial state should has only one outgoing transition in a statechart diagram  alexzhang@...

 Send Email 

Hi Dashing,

I think this quesiton is tool  independent. You should refer to the state chart specification to see how it is prescribed in UML.

I urgently recommend we should learn from UML specification as the root cause.

 

 

Regards,

 

Alex Zhang

___________

GDNT, G124

ESN: 554-8782

-----Original Message-----

From: UMLChina@yahoogroups.com [mailto:UMLChina@yahoogroups.com] On Behalf Of Dashing Meng

Sent: Wednesday, December 28, 2005 8:36 PM

To: UMLChina@yahoogroups.com

Subject: RE: [UMLChina] Re: ArgoUML told me,the initial state should has only one outgoing transition in a statechart diagram

But,is there anyone can answer my question? If a initial state can has outgoing transition more than one in a state diagram?

http://learndiary.tigris.org/source/browse/learndiary/old/documentatio

n/easy_diary/design/pictures/MyGoalInfoStateChart.gif?

rev=1.1&view=markup

I am a UML self-learner,please tell me all the errors of mine.

Thanks a lot.

Dashing Meng <learndiary_dashing@yahoo.com> wrote:

ArgoUML is 100 percent free open source UML tool,it has been developing for 10 years,the main reason I using it in our open source project-LearnDiary is the spirit of ArgoUML developing Team.

Because we use a UML tool only for open source non-commerial developing for learning purpose.So we don't need a very powerful commerial UML tool.

In fact,I found ArgoUML is a little hard to use at first,but after using it some days,I have known some little skills for avoiding its defects and do some model with ArgoUML happily.

Thanks for introducing Visual Paradigm for UML for all of us.

Alex Guo <Alex.Guo@BenQ.com> wrote:

Hi, everyone

脗 脗 脗  Have you try Visual Paradigm for UML, it芒鈧劉s a perfect tool for draw UML diagram.

 

 

 

 

 

-----------------

Alex Guo

2005

--------------------------------------------------------------------------------

From: UMLChina@yahoogroups.com [mailto:UMLChina@yahoogroups.com] On Behalf Of Dashing Meng

Sent: Wednesday, December 28, 2005 4:01 PM

To: UMLChina@yahoogroups.com

Subject: RE: [UMLChina] Re: ArgoUML told me,the initial state should has only one outgoing transition in a statechart diagram

 

All is in http://argouml.tigris.org

Here is its last version of all things:include source,binary distribution,user manual,etc..

:http://argouml-downloads.tigris.org/argouml-0.20.ALPHA_4/

alexzhang@gdnt.com.cn wrote:

Hi

Dou you have the User Guide to ArgoUML?

Regards,

 

Alex Zhang

___________

GDNT, G124

ESN: 554-8782

-----Original Message-----

From: UMLChina@yahoogroups.com [mailto:UMLChina@yahoogroups.com] On Behalf Of learndiary_dashing

Sent: Wednesday, December 28, 2005 11:15 AM

To: UMLChina@yahoogroups.com

Subject: [UMLChina] Re: ArgoUML told me,the initial state should has only one outgoing transition in a statechart diagram

 

  可能是我没有正确的表达自己的意思吧:)

ArgoUML有个模型正确性的自动判定功能,也就是他们说的:cognitive

support.

  当我在状态机图的初始状态后面画了两条进入下一状态的转换线时,它告诉

我一般初始状态只能有最多一条向外的转换线。

  于是,我在初始状态和下一状态间加了一个分支点:Junction,然后ArgoUML

就不报错了。状态机图见下:

http://learndiary.tigris.org/source/browse/learndiary/old/documentatio

n/easy_diary/design/pictures/MyGoalInfoStateChart.gif?

rev=1.1&view=markup

  我想问:从UML规范来说,一个初始状态是不是只能有一条向外的转换

线?如果不能,假设我的真实的第一个状态有两条路径都可以进入,我怎样来表

达这种需求呢?

  我没有在课堂上学过UML,用语不规范或其他的任何不当的地方还望给予

指出。

  谢谢。

http://www.learndiary.com

http://develop.learndiary.com

LearnDiay Develop Group

--- In UMLChina@yahoogroups.com, ZhangChaoYang <from_mfc@y...> wrote:

>

> 他的意思可能是认为initState只是一个虚拟状态,不是真实存在的,所以要

定义一个真正的初始状态,比如idel状态

>

> Dashing Meng <learndiary_dashing@y...> wrote: Hi,All,

> There are two path from the initial state can enter the state

call "Processing".But when I draw two outgoing transition from the

initial state,The ArgoUML said:

> This Initial state has an invalid number of transitions. Normally

Initial states have at most one outgoing transition.

> Defining correct state transitions is needed to complete the

behavioral specification part of your design.

> To fix this, remove transitions by clicking on transition in the

diagram and pressing the "Ctrl-Delete" key.

>

> So I added a Junction between the initial state and

state "Processing".Is this way all right?

>

> Thanks.

>