Skip to main content

<process>

Define a business process.

Syntax

<process request="MyApp.Request" response="MyApp.Response">
    <context>
     ...
    </context>
    <sequence>
     ... 
    </sequence> 
</process>

Attributes and Elements

request attribute

Required. The name of the request class, specifying the type of the initial request to this business process.

response attribute

Optional. The name of the response class, specifying the type of the response returned by this business process, if any.

component attribute

Optional. Setting this value to 1 (true) designates this <process> as a reusable component.

Specify a Boolean value: 1 (true) or 0 (false). The default is false.

contextsuperclass attribute

Optional. Lets you specify the superclass for your business process context. This is useful if you have many different business processes that share the same execution context variables. The idea is that you subclass Ens.BP.Context yourself, adding your own properties, then use that class for the contextsuperclass. If not specified, Ens.BP.Context is the default. Specify a class name.

height attribute

Optional. Refers to the graphical representation of the business process in the Business Process Designer. Specify a positive integer.

includes attribute

Optional. A comma-delimited list of ObjectScript include file names, so that you can use macros in your <code> segments.

language attribute

Optional. Specifies the default language in which any expressions or <code> elements are written.

Can be "python", "objectscript", or "basic" (not documented). Default is "objectscript".

layout attribute

Optional. The name of the layout style used in BPL diagrams for this business process. The value automatic indicates that the Business Process Designer and BPL Viewer will choose layouts for the diagram elements. The value manual overrides the tools to use the exact layout that you specify. Specify a string, either manual or automatic. If not specified, the default layout is automatic.

version attribute

Optional. An integer that expresses a version number. Higher values indicate later versions. If an expression, the version attribute value must use ObjectScript. Specify a positive integer. May be a literal integer, or an expression that evaluates to an integer.

width attribute

Optional. Refers to the graphical representation of the business process in the Business Process Designer. Specify a positive integer.

<context> element

Optional. Defines general-purpose properties in the business process execution context. For information about the business process execution context, see <assign>, and see Developing BPL Processes.

Optional. An optional list of Python from / import statements, one per line. Use this so that Python code within this business process can refer to these modules.

<sequence> element

Optional. Zero or more <sequence> elements may appear. Each defines actions that the business process can perform.

Description

The <process> element is the outermost element for a BPL document. All the other BPL elements are contained within a <process> element.

A business process consists of an execution context (defined by the <context> element) and a sequence of activities (defined by the <sequence> element).

The request attribute defines the type (class name) for the business process’s initial request. The response attribute defines the type (class name) for the eventual response from the business process. The request attribute is required, but the response attribute is optional, since the business process might not return a response.

Execution Context

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. A BPL business process supports the business process life cycle with a group of variables known as the execution context.

The execution context variables include the objects called context, request, response, callrequest, callresponse and process; the integer value synctimedout; the collection syncresponses; and the %StatusOpens in a new tab value status. Each variable has a specific purpose, as described in documentation for the <assign>, <call>, <code>, and <sync> elements.

Example

The following sample business process provides a <sync> element to synchronize several <call> elements. Further activities within the <process> element are replaced by ellipses (...) near the end of the example:

<process request="Demo.Loan.Msg.Application">
<context>
  <property name="BankName" type="%String"/>
  <property name="IsApproved" type="%Boolean"/>
  <property name="InterestRate" type="%Numeric"/>
  <property name="TheResults" type="Demo.Loan.Msg.Approval" collection="list"/>
  <property name="Iterator" type="%String"/>
  <property name="ThisResult" type="Demo.Loan.Msg.Approval"/>
</context>
<sequence>
  <trace value='"received application for "_request.Name'/>
  <call name="BankUS" target="Demo.Loan.BankUS" async="1">
    <annotation>
      <![CDATA[Send an asynchronous request to Bank US.]]>
    </annotation>
    <request type="Demo.Loan.Msg.Application">
      <assign property="callrequest" value="request"/>
    </request>
    <response type="Demo.Loan.Msg.Approval">
      <assign property="context.TheResults"
              value="callresponse"
              action="append"/>
    </response>
  </call>

  <call name="BankSoprano" target="Demo.Loan.BankSoprano" async="1">
    <annotation>
      <![CDATA[Send an asynchronous request to Bank Soprano.]]>
    </annotation>
    <request type="Demo.Loan.Msg.Application">
      <assign property="callrequest" value="request"/>
    </request>
    <response type="Demo.Loan.Msg.Approval">
      <assign property="context.TheResults"
              value="callresponse"
              action="append"/>
    </response>
  </call>

  <call name="BankManana" target="Demo.Loan.BankManana" async="1">
    <annotation>
      <![CDATA[Send an asynchronous request to Bank Manana.]]>
    </annotation>
    <request type="Demo.Loan.Msg.Application">
      <assign property="callrequest" value="request"/>
    </request>
    <response type="Demo.Loan.Msg.Approval">
      <assign property="context.TheResults"
              value="callresponse"
              action="append"/>
    </response>
  </call>

  <sync name='Wait for Banks'
        calls="BankUS,BankSoprano,BankManana"
        type="all"
        timeout="5">
    <annotation>
      <![CDATA[Wait for responses. Wait up to 5 seconds.]]>
    </annotation>
  </sync>
  <trace value='"sync complete"'/>
  ...
</sequence>
</process>

Replies

The primary response from a business process is the response it returns to the request that originally invoked the specific business process instance. Normally, the business process returns its primary response automatically, as soon as it is done executing. However, the <reply> element can be used to return the primary response sooner. This can be useful if the response needed by the original caller is ready to be returned, but there is additional work for the business process to perform as a result of the original call.

Language

The <process> element defines the scripting language used by a business process by providing a value for the language attribute: The value should be "objectscript". Any expressions found in the business process, as well as lines of code within <code> elements, must use the specified language.

Versioning

Developers can update the version number for a BPL business process to indicate that its new functionality is incompatible with previous versions. A higher number indicates later versions. There is no automatic versioning of BPL business processes. A developer manually updates the value of the version attribute within the BPL <process> element to highlight the fact that the new code contains changes that are incompatible with previous versions of the same business process. Examples include adding or deleting properties within the business process <context>, or changing the flow of activities within the business process <sequence>.

Prior versions of the same BPL business process that have instances already executing continue to execute their original activities, with their original context. New versions use their own context and their own activities. InterSystems IRIS achieves this by generating new context and thread classes for each version. The version appears as a subpackage in the generated class hierarchy. For example, if you have a class MyBPL, version 3 generates MyBPL.V3.Context and MyBPL.V3.Thread1.

Layout

By default, when a user opens a BPL diagram in the Business Process Designer, the tool display the diagram using automatic layout arrangements. These automatic choices may or may not be appropriate for a particular drawing. If you suspect that this may be an issue for your diagram, you can disable automatic layout to ensure that your diagram always displays with exactly the layout you want.

The most direct way to control the layout of your diagram is to clear the Auto arrange check box on the Preferences tab.

You can also click the General tab and choose either Automatic or Manual for the Layout. The manual selection preserves the exact position of each element each time you save the diagram, so that when the diagram is displayed in the Business Process Designer, it does not take on any layout characteristics except any that you specify.

Problems in scrolling through a business process diagram in the Business Process Designer can be fixed by adjusting the height or width attributes of the <process> element. You can do this using the General tab as for the layout attribute.

FeedbackOpens in a new tab