Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
402 views
in Technique[技术] by (71.8m points)

uml - Execution Order of Hierarchical State Machine (HSM) Actions

Actually, I want validation about execution order about HSM. Are there true on picture, below?

enter image description here

question from:https://stackoverflow.com/questions/65847485/execution-order-of-hierarchical-state-machine-hsm-actions

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I suppose the question is about the unique transition present in the diagrams

self transition

There is no transition to s2 so it is impossible to be in s2 when the transition occurs. The transition is external so s1ExitAction then T1TransAction then s1EnterAction

Supposing there is an additional initial pseudo state and a transition from it to s2 then the execution is the one you indicate.

If we are in s2 because of a hidden transition which is not from an hidden initial pseudo state then the execution is s2ExitAction then s1ExitAction then T1TransAction then s1EnterAction

external transition A

Supposing the transition occurs for at least the second time then the execution is the one you indicate, else the transition occurs when being in s1 and the execution is s1ExitAction then t1TransAction then s1EnterAction then s2EnterAction

local transition A

Supposing the transition occurs for at least the second time or we are in s2 because of a hidden transition then the execution is the one you indicate, else the transition occurs when being in s1 and the execution is t1TransAction then s2EnterAction

external transition B

There is no transition to s2 so it is impossible to be in s2 and then it is impossible to do the transition.

Supposing there is an additional initial pseudo state and a transition from it to s2 then the execution is the one you indicate.

If we are in s2 because of a hidden transition which is not from an hidden initial pseudo state then the execution is s2ExitAction then s1ExitAction then t1TransAction then s1EnterAction

local transition B

There is no transition to s2 so it is impossible to be in s2 and then it is impossible to do the transition.

Supposing there is an additional initial pseudo state and a transition from it to s2 or an hidden transition allowing to be in s2 then the execution is the one you indicate.

internal transition

There is no transition to s2 so it is impossible to be in s2 when the transition occurs, then the execution is t1TransAction

Supposing there is an additional initial pseudo state and a transition from it to s2 then the execution is the one you indicate.

If we are in s2 because of a hidden transition which is not from an hidden initial pseudo state then the execution is s2ExitAction then t1TransAction


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...