I’d like to model a state machine with the following
behaviour:
State1 --e1–> State2 --e1[c]–> State3
e1 leads to change from State1 to State2 and now if condition c
is fulfilled it should change directly to State3 with the same
event e1 as received before. If condition c is not fulfiled the
machine shell remain in State2 and wait for a new event e1.
So the second part works, but I don’t know how to model the part
which changes directly to State3 with the same received event.
I tried to use defer for event e1 in State2, but this is not according to
UML specification.
So if anybody has an idea how to solve the problem - please help me.
as i understand your problem, you dont want to change to other state, if the guard condition ist not true. It will wait in B until an event e1 arrives and the guard condition C=true.
Guard is a boolean condition, that must be true for the transition to be taken. (from UML distilled book)
as i understand your problem, you dont want to change to other state, if the guard condition ist not true[/quote]
This is a misunderstanding. I don’t want to change if the guard condition is false.
What I want is the following:
If event E occurs I want to change from state S1 to state S2 and
it the guard condition C from S2 to S3 is fulfilled I want go directly to state S3.
If the condition is not fulfilled I want to wait for the next event E (same event
as the first one) and change to S3 if C is fulfilled (otherwise waiting for the next
event E, etc.
S1 — E --> S2 ----- [C] -------> S3
I.e.
first case:
E occurs, change from S1 to S2, C is true change to S3
second case:
E occurs, chang from S1 to S2, C is false --> wait in S2 for
next E to check C again and change to S3 if possible