第二十六章 开发Productions - ObjectScript Productions - 定义业务流程
业务流程负责生产中的更高级别处理。本页介绍它们并讨论如何设计和开发业务流程类。
介绍
按照惯例,业务流程包含大部分的生产逻辑。它们可以包含自己的逻辑,可以调用业务规则和数据转换,其中每一个都包含专门的逻辑。下图说明了这一点:
image.png请注意,此图仅显示请求消息。
业务流程有许多可能的用途。在某些情况下,业务流程协调一个或多个外部应用程序中的一系列操作。它包含确定处理的逻辑,并根据需要调用业务操作或其他业务流程。业务流程还可以包括人机交互;有关详细信息,请参阅开发工作流。
InterSystems IRIS
提供以下一般类型的业务流程:
- BPL 流程,基于类
Ens.BusinessProcessBPL
。
只有 BPL 流程支持业务流程执行上下文和逻辑的图形显示。
- 路由进程,基于类
EnsLib.MsgRouter.RoutingEngine
或EnsLib.MsgRouter.VDocRoutingEngine
。
IRIS
提供一组类来路由特定类型的消息。要使用这些子类,通常不需要编码。有关讨论这些类的书籍列表,请参阅 Introducing Interoperability Productions
中的业务流程类型。
- 自定义业务流程,基于类
Ens.BusinessProcess
。
产品可以包括这些业务流程的任意组合。
注意Ens.BusinessProcessBPL
,EnsLib.MsgRouter.RoutingEngine
,EnsLib.MsgRouter.VDocRoutingEngine
都是基于Ens.BusinessProcess
。
业务逻辑工具的比较
可能会结合使用的数据转换和业务规则来开发业务流程。数据转换和业务规则旨在包含特定类型的逻辑:
- 数据转换改变消息
- 业务规则返回值或指定发送消息的位置(或可能两者)
然而,在业务流程、数据转换和业务规则中可用的选项之间存在重叠。为了帮助确定如何创建这些项目,下表对它们进行了比较。它讨论了 BPL(最常见的业务流程)、DTL
(最常见的数据转换)和业务规则。
Option | Supported in BPL? | Supported in DTL? | Supported in business rules? |
---|---|---|---|
Retrieving information about the business process | Yes (business execution context variables) | No | No |
Assigning a value | Yes (<assign>) | Yes (assign action) | Yes (assign action) |
Calling a data transformation | Yes (<transform>) | Yes (subtransform action) | Yes (send action) |
Calling a business rule | Yes (<call>) | No | Yes (delegate action) |
Calling custom code | Yes (<code>) | Yes (code action) | No |
Invoking SQL | Yes (<sql>) | Yes (sql action) | No |
Conditional logic | Yes (<if>, <switch>, <branch>) | Yes (if action) | No |
Looping | Yes (<foreach>, <while>, <until>) | Yes (for each action ) | No |
Sending an alert | Yes (<alert>) | No | No |
Including trace elements | Yes (<trace>) | Yes (trace action) | Yes (trace action) |
Sending a request message to a business operation or process | Yes (<call>) | No | Yes (send action) |
Waiting for a response from asynchronous requests | Yes (<sync>) | No | No |
Deleting the message | No | No | Yes (delete action) |
Performing error handling | Yes (<throw>, <catch>, and others) | No | No |
Delaying execution for a specified duration or until a future time | Yes (<delay>) | No | No |
Sending a primary response before execution is complete | Yes (<reply>) | No | No |
Using XPATH and XSLT | Yes (<xpath>, <xslt>) | No | No |
Storing a message temporarily to acknowledge a milestone | Yes (<milestone>) | No | No |
网友评论