Skip to main content

Available BPL Elements

This page introduces the elements you can use in a BPL business process. The elements are grouped here by category.

Control Flow

BPL includes a number of control flow elements that you can use to control the order of execution. First, here are the elements involved in branching:

  • <branch> conditionally causes an immediate change in the flow of execution.

  • <if> evaluates a condition and perform ones action if true, another if false.

  • <label> provides a destination for a conditional branch operation.

  • <switch> evaluates a set of conditions to determine which of several actions to perform.

Additional elements are used for looping:

  • <break> breaks out of a loop and exits the loop activity.

  • <continue> jumps to the next iteration within a loop, without exiting the loop.

  • <foreach> defines a sequence of activities to be executed iteratively.

  • <until> defines a sequence of activities to be repeatedly executed until a condition is true.

  • <while> defines a sequence of activities to be repeatedly executed as long as a condition is true.

Two elements can be used for grouping activities:

  • <flow> performs activities in a non-determinate order.

  • <sequence> organizes one or more calls to other business operations and business processes. Structures parts of the BPL diagram.

Note:

In addition to these options you can initiate a immediate, but graceful exit as follows: set the status variable to a failure value using an <assign> or <code> statement.

Messaging

BPL includes elements that make synchronous and asynchronous requests to business operations, and to other business processes.

  • <call> sends a request and (optionally) receives a response from a business operation or business process. The call may be synchronous or asynchronous.

  • <request> prepares the request for a call to another business operation or business process.

  • <response> receives the response returned from a call to another business operation or business process.

  • <sync> waits for a response from one or more asynchronous calls to other business operations and business processes.

  • <reply> returns a primary response from the business process before execution of the process is fully complete.

Scheduling

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 context variable. Therefore, for a business process that invokes a rule, the typical design is to ensure that the business process accomplishes the following:

  1. 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.

  2. 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.

  3. Provides a <rule> element that invokes a business rule that returns an answer based on these input values.

For details on context, see Available Variables in BPL.

For information on creating business rules, see Developing Business Rules.

Data Manipulation

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 BPL variablescontext, request, response, and others. This shuffling and other data manipulation tasks are accomplished using the elements described below.

  • <assign> assigns a value to a property.

  • <sql> executes an embedded SQL SELECT statement.

  • <transform> transforms one object into another using a data transformation.

  • <xpath> evaluates an XPath expression on a target XML document.

  • <xslt> executes an XSLT transformation to modify a data stream.

User-written Code

For cases where BPL is not expressive enough, InterSystems IRIS® provides mechanisms to embed user-written code within the automatically generated business process code.

  • <code> allows you to specify the required code within a CDATA block.

  • <empty> performs no action; acts as a placeholder until code can be written.

Logging

BPL includes elements you can use to log informational and error messages.

  • <alert> writes a text message to an external alert mechanism.

  • <milestone> stores a message to acknowledge a step achieved by a business process.

  • <trace> write a text message to a console window and to the Event Log.

Error Handling

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> catches a fault produced by a <throw> element.

  • <catchall> catches a fault or system error that does not match any <catch>.

  • <compensate> invoke a <compensationhandler> from <catch> or <catchall>.

  • <compensationhandler> performs a sequence of activities to undo a previous action.

  • <compensationhandlers> contains one or more <compensationhandler> elements.

  • <faulthandlers> provides zero or more <catch> and one <catchall> element.

  • <scope> wraps a set of activities with its fault and compensation handlers.

  • <throw> throws a specific, named fault.

FeedbackOpens in a new tab