这是状态机的用例吗?如果是这样,您建议使用哪个开源软件?
我的应用程序需要从多个来源提取数据。以下需要用户定义
- 数据源的顺序
- 在顺序中,条件(如果有的话)确定是否使用数据源或跳过它
一旦用户定义了上述两项,应用程序将为他的“他随后将使用它来提取数据。
我想要一些指导,了解
- 我是否更好地编写自己的代码来处理顺序和条件,或者这是一个状态机用例
- 如果它是一个状态机用例那么哪个是提供此支持的更好的开源项目
- 有没有状态机规范? SCXML?
- 状态机的最佳开源实现有哪些?标准(按此顺序):基于标准、易于调试、易于嵌入、正在积极开发、支持状态机的运行时创建
用例:这是一个多租户应用程序。每个客户都将设计自己的编排并将其保存到数据库中。我们称之为登机客户。一旦客户登机,他的所有请求都将使用他之前保存的编排。
现在假设有 3 个数据源 A、B 和 C。Orchestrion
- 1 中很少有可能的编排:Pull A、Pull B 和 然后在该订单
- Orchestrion 2 中拉取 C:拉动 A,如果 A 返回错误,则拉动 B、拉动 B(所以基本上是(A 或 C)和 B)
- Crchesrion 3:拉动 A、B 和 C。顺序并不重要。全部需要拉动(可能是并行的)
My app needs to pull data from MULTIPLE sources. The following needs to be user defined
- Order of the data sources
- Within the Order, Conditions (if at all) determine whether to use a data source or skip it
Once the user has defined the above two, the app will assign a name to his "orchestration" that he subsequently will use to pull the data.
I want some guidance on
- whether I am better of writing my own code to handle the order and conditions OR is this a state machine use case
- If it is a state machine use case then which is the better open source project providing this support
- Is there any specification for state machines? SCXML?
- Which are the best open source implementations of state machine? Criteria (in this order): Based on standard, easy to debug, easy to embed, actively being developed, support for runtime creation of the state machine
Use case: This is a multi-tenant app. Each customer is going to design his own orcehstration and save it to the db. This we call as boarding the customer. Once a customer has been boarded, all his requests will use the orcestration he had saved earlier.
Now let us say there are 3 data sources A, B and C. Few of the possible orchestrations are
- Orchestrion 1: Pull A, Pull B and
then Pull C in that ORDER - Orchestrion 2: Pull A, if A returned error then pull B, pull B (so basically (A or C) and B)
- Crchestrion 3: Pull A, B and C. order DOESNT matter. all need to be pulled (may be in parallel)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用状态机的经验法则:
为了您的目的,我将查看 JBoss 业务流程管理套件。您可以使用 XML 表示形式定义和管理状态机,包括允许其他人更改状态机的 GUI 编辑器,然后将其传递给“虚拟机”执行。定义语言提供了许多不同的钩子,用于自定义代码执行和建模更复杂的行为,例如并行流程、迭代活动和计划事件。
针对评论 #1 的更新
我会研究并比较 SCXML 和 jPDL 规范。我的印象是 SXCML 是 jPDL 的超集,例如 jPDL 能够将重复任务作为其定义的一部分,而 SCXML 似乎则不然。
Rules of thumb for using a state machine:
For your purpose I would look at the JBoss Business Process Management suite. You have the ability to define and manage the state machine using an XML representation, including a GUI editor for allowing others to alter it, and then pass it to a "virtual machine" for execution. The definition language provides a lot of different hooks for custom code execution and modelling more complex behaviors such as processes in parallel, iterative activities and scheduled events.
Update in Response to Comment #1
I would study and compare SCXML and the jPDL specs. My impression is that SXCML is superset of jPDL, for instance jPDL has the ability to repeat tasks as part of its definition whereas SCXML does not appear so.