Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cola-component-statemachine:同一个事件支持不同condition状态流转 #158

Merged
merged 2 commits into from
May 28, 2021

Conversation

WhiteBookMan1994
Copy link
Contributor

@WhiteBookMan1994 WhiteBookMan1994 commented Jan 6, 2021

Hi,这个PR是解决我们在使用中遇到的同一个事件根据不同condition触发不同状态流转的业务场景。

场景:
针对同一个事件:EVENT1

 if condition == "1", STATE1 --> STATE1
 if condition == "2" , STATE1 --> STATE2
 if condition == "3" , STATE1 --> STATE3

原有无法支持该场景,一个event只能支持一个condition流转分支。该PR增加了对该场景的支持。

添加了一个单测:StateMachineChoiceTest,测试该场景。

@CLAassistant
Copy link

CLAassistant commented Jan 6, 2021

CLA assistant check
All committers have signed the CLA.

@WhiteBookMan1994 WhiteBookMan1994 changed the title feat:同一个事件支持不同condition状态流转 cola-component-statemachine:同一个事件支持不同condition状态流转 Jan 6, 2021
@oldratlee oldratlee force-pushed the master branch 21 times, most recently from fa5ef64 to c9e77a6 Compare January 10, 2021 11:58
� Conflicts:
�	cola-components/cola-component-statemachine/pom.xml
@significantfrank significantfrank merged commit 82ba354 into alibaba:master May 28, 2021
@significantfrank
Copy link
Collaborator

这个Enhance我加进去了,重构了一下,加了一个EventTransitons代替了google guava的依赖

@qqxx6661
Copy link

EventTransitons看代码仓库,貌似在4.2.0-SNAPSHOT才有支持,4.1.0的正式版依然是采用了

HashMap<E, Transition<S, E, C>> transitions = new HashMap();

如果正式环境想要用这个特性,该应用哪个版本?

@WhiteBookMan1994
Copy link
Contributor Author

EventTransitons看代码仓库,貌似在4.2.0-SNAPSHOT才有支持,4.1.0的正式版依然是采用了

HashMap<E, Transition<S, E, C>> transitions = new HashMap();

如果正式环境想要用这个特性,该应用哪个版本?
我看4.1.0正式版里面是EventTransitions,里面的Map是HashMap<E, List<Transition<S, E, C>>> eventTransitions,应该是支持的。你再确认一下呢

@qqxx6661
Copy link

EventTransitons看代码仓库,貌似在4.2.0-SNAPSHOT才有支持,4.1.0的正式版依然是采用了
HashMap<E, Transition<S, E, C>> transitions = new HashMap();
如果正式环境想要用这个特性,该应用哪个版本?
我看4.1.0正式版里面是EventTransitions,里面的Map是HashMap<E, List<Transition<S, E, C>>> eventTransitions,应该是支持的。你再确认一下呢

找到问题了,是我们公司内网的4.1.0貌似和公网的不一样。公网的4.1.0确实是ok的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants