To create logic for your Decision node, you must complete the following steps:
The node builder displays different options depending on whether you select Variable or Method.
The following steps describe how to select a business process variable that is associated with an XML or MFL schema.
Note: To learn about creating business process variables and importing schemas to your project, see Business Process Variables and Data Types and Importing Files into the Schemas Project.
A drop-down list of business process variables in your project is displayed.
For example, if you imported an XML Schema (QuoteRequest.xsd) into your project, and created a business process variable (requestXML) of type quoteRequest (based on the QuoteRequest.xsd schema), the requestXML variable is available in the drop-down list of business process variables.
A representation of the XML Schema associated with that variable is displayed in the Select Expression Node field.
The elements and attributes of an XML document, assigned to this variable, are represented as nodes in a hierarchical representation, as shown in the preceding figure. Note that the schema in the example (QuoteRequest.xsd) specifies a root element (quoteRequest), and child elements: customerName, shipAddress, and widgetQuoteRequests. The widgetQuoteRequests element, in turn, specifies a repeating element: widgetQuoteRequest. (A repeating XML element is represented by
in the GUI representation of the Schema.)
To continue with the example, supposed you selected customerName from the XML variable represented in the preceding figure. The Selected Expression field is populated with the following expression:
data($requestXML/ns0:customerName)
For example, data($requestXML/ns0:customerName = "BEA"
The new condition is added to the bottom of the condition list.
Alternatively, you can edit conditions directly in the code. To do so, in the Condition builder, click View Code in the lower left-hand corner. The XQuery function that was written to the file from the design work in the condition builder is displayed at the line of code in your JPD file; it is indicated by the @jpd:xquery prologue annotation.
In the Design View, note that the Condition in your Decision node displays the following icons:
Defining an XML or MFL condition produces an XQuery function that is written to your JPD file, which you can see in the Source View. The condition defined by following the preceding example (in steps 1 through 7) creates the following XQuery function in the JPD file:
//* Process Language */
* @jpd:xquery prologue::
* define function cond_requestXML_1(element $requestXML) * returns xs:boolean { * data($requestXML/customerName) = "BEA"
* } * ::
The following steps describe how to select a business process variable that is associated with an XML or MFL schema.
The Source View is displayed at the line of code in your JPD file at which the Java method is written.
In the Design View, note that the Condition in your Decision node displays the following icon:
. It is a representation of the condition you defined in source code that specifies the Java method on which to base the decision. To make any further changes to the condition represented on this node, you must edit the source code in the Source View.
To Add Activities to the Paths in Your Decision Node
After you define the condition that is evaluated when the flow transitions to the Decision node at run time, you are ready to define the actions on the paths that represent the paths of execution in the flow.
This can be any node that performs an activity appropriate for your business process business logic. For example you can use a control to interact with an external resource, such as a database, a JMS queue, or an EJB.
When you complete the addition of activities on the paths of your Decision node, your decision logic is represented as a series of conditions and actions in your business process.
The following figure shows an example Decision node in the Design View.
Building on the QuoteRequest example used in building the Variable (Schema) condition, two Perform nodes are added to the paths on the Decision node. At run time, the following sequence represents the flow of control in this decision node:
data($requestXML/ns0:customerName = "BEA"
Note: The XML evaluated by the condition node is assigned to the requestXML business process variable.
Creating a Decision Node in Your Business Process
Grouping Nodes in Your Business Process
Interacting With Resources Using Controls
![]() |
![]() |