简体   繁体   English

java中用于复杂CRM逻辑的非确定性有限状态机

[英]Non deterministic finite state machine in java for complex CRM logic

Was looking at implementing Non-deterministic finite state machine in Java.正在考虑在 Java 中实现非确定性有限状态机。 Have checked easyflow and many other such libraries but they offer is Deterministic finite state machine.检查过easyflow和许多其他这样的库,但它们提供的是确定性有限状态机。

Eg.例如。 Use case.用例。 A user is in suspended state and has bill due of 100$ now he can refill his account with money voucher.用户处于暂停状态并且有 100 美元的账单到期,现在他可以用现金券充值他的帐户。 if he refills with amount that makes his user balance less than 100 then he will continue in suspended state and if his account balance reached equal or more than hundred dollar then user is send to Active state.如果他补充的金额使他的用户余额小于 100,那么他将继续处于暂停状态,如果他的帐户余额达到或超过一百美元,则用户将被发送到活动状态。

So the event is same "refill" but user states very on his user-balance.所以该事件是相同的“重新填充”,但用户在他的用户余额上非常声明。 So FSM is not deterministic.所以 FSM 不是确定性的。

Is there any idea on how to cater the case??有没有关于如何处理案件的想法?

On contrary on the second thought I can implement this indeterministic FSM (or kind of FSM) using rule engines like drools .相反,第二个想法是,我可以使用drools等规则引擎来实现这种不确定的 FSM(或某种 FSM)。

Oracle BRM seems to be using some sort of state machine. Oracle BRM似乎正在使用某种状态机。 Any idea on how ND-FSM is implemented in crm-systems.关于如何在 crm 系统中实现 ND-FSM 的任何想法。 And what are the most used library(java) for same.最常用的库(java)是什么。

Your state machine is not 'non-deterministic', but merely needs either guards on some of the transitions, which reduce to extra transitions in your handler.你的状态机是不是“不确定性”,而只是需要要么卫士上的一些转变,从而减少对额外的转换在你的处理器的。 I don't know the library you're using and it has no documentation so I don't know whether it supports guards, so instead when in the 'refill received' state your handler can check the resultant balance immediately trigger either transition to either 'suspended' or 'active'我不知道你正在使用的库,它没有文档,所以我不知道它是否支持守卫,所以当处于“refill received”状态时,你的处理程序可以立即检查结果余额,触发任一转换“暂停”或“活动”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM