<process request="MyApp.Request" response="MyApp.Response"> <context> ... </context> <sequence> ... </sequence> </process>
|Attribute or Element||Description||Value|
|request attribute||Required. The name of the request class, specifying the type of the initial request to this business process.||A string of one or more characters.|
|response attribute||Optional. The name of the response class, specifying the type of the response returned by this business process, if any.||A string of one or more characters.|
Optional. Setting this value to 1 (true) designates this <process> as a reusable component.
|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 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.||A class name.|
|height attribute||Optional. Refers to the graphical representation of the business process in the Business Process Designer.||A positive integer.|
|includes attribute||Optional. A comma-delimited list of include file names, so that you can use macros in your <code> segments.|
|language attribute||Optional. Should be "objectscript"||. "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.||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.||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.||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 the <assign> element in this book, and see Developing BPL Processes.|
|<sequence> element||Optional. Zero or more <sequence> elements may appear. Each defines actions that the business process can perform.|
The <process> element is the outermost element for a BPL document. All the other BPL elements are contained within a <process> 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.
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 window value status. Each variable has a specific purpose, as described in documentation for the <assign>, <call>, <code>, and <sync> elements.
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>
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.
The <process> element defines the scripting language used by a business process by providing a value for the language attribute: The value shouold be "objectscript". Any expressions found in the business process, as well as lines of code within <code> elements, must use the specified language.
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.
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.