了解州的转变 [英] Understand the state transtion

查看:63
本文介绍了了解州的转变的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用无状态框架。



但我不完全理解州的概念。

例如:

 phoneCall.Configure(State.Ringing)
.Permit(Trigger.HungUp,State.OffHook)
.Permit(Trigger.CallConnected,State.Connected);





这是否意味着工作流程来自Ringing => OffHook =>无条件连接?



我尝试过:



我读过文章。它说当转换的源状态的Entry操作完成时,将安排转换的触发器。



但在我的代码中例如,配置中没有 OnEntry

解决方案

引用:

这是否意味着工作流程来自Ringing => OffHook =>无条件连接?





不,不是因为我读它 - 它向我看来好像状态正在振铃,你可以根据触发/事件去OffHook OR Connected


无状态项目是一个有趣的一个,但是,我认为名称的选择令人困惑:当然它保持内部状态;并且,状态机概念都是关于状态的!



您引用的代码为给定的状态:响铃设置规则 。



它定义了两个可能的转换来自振铃。



条目 action将引用该类在运行时创建的动态创建的事件处理程序。



请记住,无状态项目不使用Microsoft的Windows WorkFlow Foundation ;它还使用了非常复杂,先进的编程技术。



通过研究WWF对一般状态机原则的深入了解,你可能会获得一些好处:[< a href =https://msdn.microsoft.com/en-us/library/dd489454(v=vs.110).aspx\"target =_ blanktitle =New Window> ^ ]。

I am using the stateless framework.

But I do not fully understand the state concept.
For example:

phoneCall.Configure(State.Ringing)
    .Permit(Trigger.HungUp, State.OffHook)
    .Permit(Trigger.CallConnected, State.Connected);



Does it mean the workflow is from Ringing=>OffHook=>Connected unconditionally?

What I have tried:

I read the article. It says A transition’s Trigger is scheduled when the transition’s source state’s Entry action is complete.

But in my code example, there is no OnEntry in the configuration.

解决方案

Quote:

Does it mean the workflow is from Ringing=>OffHook=>Connected unconditionally?



No, not as I read it - it reads to me as if the state is ringing, you can go to OffHook OR Connected depending on the trigger/event


The "Stateless" project is an interesting one, but, I think the choice of the name is confusing: of course it maintains internal state; and, the "state machine" concept is all about "state" !

The code you cite sets up a "rule" for a given "state:" "ringing."

It defines two possible "transitions" from "ringing."

The "Entry" action will refer to a dynamically created event handler that the class creates at run-time.

Keep in mind that the "Stateless" project does not use Microsoft's Windows WorkFlow Foundation; it also uses very complex, and advanced, progamming techniques.

You might get some benefit by studying WWF in terms of insight into general "state machine" principles: [^].


这篇关于了解州的转变的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆