Business Processes and Business Logic
This chapter describes the kinds of logic supported in business processes.
Business processes are the middle part of any production. They accept requests from host classes inside the production — business services or business processes — and then either process the requests or relay them to other host classes inside the production for processing.
InterSystems recommends the following division of labor within a production: Use business services to receive input from outside of the production and simply forward it (as messages) into the production. Use business processes to handle any needed business logic. Use business operations to receive messages from within the production and simply generate output for destinations outside of the production. That is, centralize the business logic within the business processes.
Accordingly, InterSystems IRIS® provides extensive support for complex logic within business processes, and this logic can be defined by nontechnical users.
First, a business process can contain its own complex logic. It can also use the following reusable items:
Data transformations calculate and apply changes to message contents.
Business rules change the behavior of business processes at decision points or send messages to specific destinations based on message type, message contents, or where the message came from.
InterSystems IRIS provides tools that enable nontechnical users to define business processes, data transformations, and business rules. These users can view and edit the logic visually without programming or diagramming skills.
Note that there is overlap among the lower-level options available in business processes, data transformations, and business rules. For a comparison, see “Comparison of Business Logic Tools” in Developing Productions. It is worthwhile to review these options before deciding how to organize your logic.
Types of Business Processes
InterSystems IRIS provides the following general types of business process:
BPL processes, which are based on the class Ens.BusinessProcessBPLOpens in a new tab. To create these processes, you use a graphical editor that is intended for use by nontechnical users. This editor is available in the Management Portal and Studio. See Developing BPL Processes.
The name of these processes comes from BPL (Business Process Language), which is the XML-based language that InterSystems IRIS uses to represent their definitions.
Routing processes, which are based on the class EnsLib.MsgRouter.RoutingEngineOpens in a new tab or EnsLib.MsgRouter.VDocRoutingEngineOpens in a new tab.
InterSystems IRIS provides a set of classes to route specific kinds of messages. The following books indicate the routing process to use for different kinds of messages:
Message Type See EDIFACT Routing EDIFACT Documents in Productions' X12 Routing X12 Documents in Productions' XML Routing XML Virtual Documents in Productions'
To use these classes, no coding is generally necessary. It is, however, necessary, to provide a set of business rules, introduced later in this chapter.
Custom business processes, which are based on the class Ens.BusinessProcessOpens in a new tab. Note that all the previously listed business process classes inherit from this class. In this case, it is necessary to use a supported IDE such as Studio to develop custom code.
The EnsLib and Demo packages provide many examples.
For information on defining custom business processes, see “Developing Business Processes” in Developing Productions.
A production can include any mix of these business processes.
The following shows a partial example of a BPL business process, as displayed in the BPL editor:
A data transformation creates a new message that is a transformation of another message. You can invoke a data transformation from a business process, another data transformation, or a business rule.
When you transform a message, your data transformation swaps out the old message body object (the source) and exchanges it for a new one (the target). Some of the transformations that occur during this process can include:
Copying values from properties on the source to properties on the target.
Performing calculations using the values of properties on the source.
Copying the results of calculations to properties on the target.
Assigning literal values to properties on the target.
Ignoring any properties on the source that are not relevant to the target.
A data transformation is a class based on Ens.DataTransformOpens in a new tab or its subclass, Ens.DataTransformDTLOpens in a new tab.
If you use Ens.DataTransformDTLOpens in a new tab, the transformation is called a DTL transformation. To create these transformations, you use a graphical editor that is intended for use by nontechnical users. This editor is available in the Management Portal and Studio. For details, see Developing DTL Transformations.
The name of these transformations comes from DTL (Data Transformation Language), which is the XML-based language that InterSystems IRIS uses to represent their definitions.
If you use Ens.DataTransformOpens in a new tab, the transformation is a custom transformation. In this case, you must use a supported IDE such as Studio. For information on defining these, see Developing Productions.
The following shows an example DTL transformation, as seen in the DTL editor:
A business rule (also known as a business rule set) can return a value, transform data, or both. You can invoke a business rule from a business process or from another business rule.
A business rule is a class based on Ens.Rule.DefinitionOpens in a new tab. You define these in the Management Portal, which provides a visual editor for the benefit of nontechnical users. The following shows a partial example, as seen in this editor:
For details, see Developing Business Rules.