List of BPL Elements
This topic divides BPL elements into functional groups and explains the purpose of each element.
A BPL document consists of a <process> element and its various child elements. The <process> element is the container for the business process.
The life cycle of a business process requires it to have certain state information saved to disk and restored from disk, whenever the business process suspends or resumes execution. This feature is especially important for long-running business processes, which may take days or weeks to complete.
A BPL business process supports the business process life cycle with a group of variables known as the execution context. The variables in the execution context are automatically saved and restored each time the BPL business process suspends and resumes execution. The variables are:
Most of the execution context variables are automatically defined for the business process. The exception to this rule is the general-purpose container object called context, which a BPL developer defines by providing <context>, <property>, and <parameters> elements at the beginning of the BPL document.
For complete details on these variables, see Business Process and Data Transformation Language Reference.
Also see documentation of the <assign> element and see Business Process Execution Context.
Within a business process, activities are either executed sequentially or in parallel:
BPL includes a number of control flow elements that you can use to control the order of execution inside a BPL business process.
|Conditionally cause an immediate change in the flow of execution.
|Break out of a loop and exit the loop activity.
|Jump to the next iteration within a loop, without exiting the loop.
|Perform activities in a non-determinate order.
|Define a sequence of activities to be executed iteratively.
|Evaluate a condition and perform one action if true, another if false.
|Provide a destination for a conditional branch operation.
|Organize one or more calls to other business operations and business processes. Structures parts of the BPL diagram.
|Evaluate a set of conditions to determine which of several actions to perform.
|Define a sequence of activities to be repeatedly executed until a condition is true.
|Define a sequence of activities to be repeatedly executed as long as a condition is true.
BPL business process code can initiate a sudden, but graceful exit by setting the business process execution context variable status to a failure value using an <assign> or <code> statement.
BPL includes elements that allow you to make synchronous and asynchronous requests to business operations, and to other business processes.
|Send a request and (optionally) receive a response from a business operation or business process. The call may be synchronous or asynchronous.
|Prepare the request for a call to another business operation or business process.
|Receive the response returned from a call to another business operation or business process.
|Wait for a response from one or more asynchronous calls to other business operations and business processes.
|Return a primary response from the business process before execution of the process is fully complete.
The <delay> element can be used to delay execution of a business process for a specified duration or until a future time.
Rules and Decisions
The <rule> element executes a business rule. This element specifies the business rule name, plus parameters to hold the result of the decision and (optionally) the reason for that result.
The parameters for the <rule> element can include any property in the general-purpose execution context variable called context. Therefore, a typical design approach, for a business process that invokes a rule, is to ensure that the business process accomplishes the following:
Provides <property> and <context> elements so that the context object contains properties with appropriate names and types.
For example, if the rule determines eligibility for a state education loan, you might add properties such as Age, State, and Income.
Gathers values for the properties in whatever way you wish, for example by sending requests to business operations or business processes, and as responses return, assigning values to the properties in context.
Provides a <rule> element that invokes a business rule that returns an answer based on these input values.
For details on the execution context variables, see Business Process Execution Context.
For information on creating business rules, see Developing Business Rules.
BPL includes several elements that allow you to move data from one location to another. For example, a typical business process makes a series of calls to business operations or other business processes. To set up these calls, as well as to process the data they return, the business process shuffles data between the various execution context variables — context, request, response, and others. This shuffling and other data manipulation tasks are accomplished using the elements described below.
|Assign a value to a property.
|Execute an embedded SQL SELECT statement.
|Transform one object into another using a data transformation.
|Evaluate XPath expressions on a target XML document.
|Execute an XSLT transformation to modify a data stream.
For cases where BPL is not expressive enough to solve a specific problem, InterSystems IRIS® provides mechanisms to embed user-written code within the automatically generated business process code.
|Allows you to specify the required code within a CDATA block.
|Performs no action; acts as a placeholder until code can be written.
BPL includes elements you can use to log informational and error messages.
|Write a text message to an external alert mechanism.
|Store a message to acknowledge a step achieved by a business process.
|Write a text message to a console window and to the Event Log.
BPL includes elements that you can use to throw and catch faults, and perform compensation for errors or faults. These elements are closely interrelated. For details, see Handling Errors in BPL. The list of elements is as follows:
|Catch a fault produced by a <throw> element.
|Catch a fault or system error that does not match any <catch>.
|Invoke a <compensationhandler> from <catch> or <catchall>.
|Perform a sequence of activities to undo a previous action.
|Contain one or more <compensationhandler> elements.
|Provide zero or more <catch> and one <catchall> element.
|Wrap a set of activities with its fault and compensation handlers.
|Throw a specific, named fault.