This section describes how to create the activities that are performed when the condition defined in your Decision node evaluates to true. The condition evaluates to true if the value of shipAddress/state in the XML document received from a client, equals any one of the following: CA, California, NJ, or New Jersey.
In this section, you learn how to invoke a Web service from your business process, and create a callback handler to receive the data returned by the Web service. It includes the following tasks:
To Create an Instance of the Web Service Control in Your Project
An instance of a Web Service control, named taxCalculation, is created in your project and displayed on the Data Palette Controls tab.
To Call the Tax Calculation Web Service From Your Business Process
In this step, you create the logic to call the tax calculation control from your business process.
void requestTaxRate(java.lang.String stateID)
A Control Send node is created representing the asynchronous call to your taxCalculation Web Service control. The node is named according to the name of the method you dragged onto the business process—in this case: requestTaxRate.
Note: This interaction is designed to be asynchronous, meaning that the business process can send a request to the taxCalculation control from this node, and does not block waiting for a response from the control. In other words, the business process can continue processing and receive a response from the taxCalculation service when that service completes the request.
By default, the Send Data tab opens on the Variable Assignment pane. The Control Expects field is populated with the data type expected by the requestTaxRate() method exposed by the taxCalculation Web services: String stateID.
Note: As you learned in a previous step, Send Data tabs have two modes:
In this case, you must switch to the Transformation mode because the data type required as input to the taxCalculation control is a Java String type, and the variable in which the Request for Quote message (which includes the value of shipAddress/state) is stored, is of type XML (that is, QuoteRequestDocument, which is valid against an XML Schema).
WebLogic Integration provides a data mapping tool to map between heterogeneous data types. The data transformations you create using the tool are stored in Data Transformation Format (DTF) files. You can think of DTF files as another resource with which your business process interacts via controls. That is, when DTF files containing your data transformations are built, they are built as controls. The controls expose transformation methods, which business processes invoke to map disparate data types.
Note: Creating the transformation in the preceding steps creates a Transformation control in your project: A DTF file, named RequestQuoteTransformation.dtf is created. An XQ file, which contains the query (written in the XQuery language) for the transformation method is also created. Both the DTF and XQ files are displayed in the Application tab. Also, an instance of the Transformation control was created and is represented as
transformations in the Data Palette (Controls tab).
This step completes the design of the Request Tax Rate node.
To Receive the Tax Rate Calculation From the Web Service
The interaction between the business process and the tax calculation control is asynchronous, which means that the business process can continue performing other work while the tax calculation service prepares its response. The tax calculation service notifies the business process when the response is ready.
In the preceding section you designed a call to the tax calculation Web service (via a control). To add the logic in your business process that receives the tax rate returned by the tax calculation control, complete the following steps:
void returnTaxRate(float taxRate)
A Control Receive node is created representing the asynchronous response from your Web Service control.
The node is named according to the name of the method you dragged onto the business process—in this case: returnTaxRate.
The Control Expects field is populated with the data type and name of the parameter returned by the returnTaxRate() method on the taxCalculation control: float taxRate.
This step completes the design of your returnTaxRate node and the design of the activities performed by your business process when the condition on the Decision node evaluates to true. In the Design View, your business process resembles that shown in the following figure:
Note that the Start node icon changed from
to
after you added the asynchronous call to the Web Service control. The former icon indicates that your business process is stateless, and the latter indicates that it is stateful.
The icons reflect the specification for the stateless property for your business process. To see whether the stateless property is defined as true or false, click the Start node icon
and view the Property Editor. To learn about stateful and stateless business processes, see Building Stateless and Stateful Business Processes.
Note: If the Property Editor is not displayed in WebLogic Workshop, choose View —> Property Editor from menu bar.
Note: No further design is required for this Decision node. If the condition evaluates to true, the path of execution proceeds via the Yes path and the tax rate for the order is calculated. If the condition evaluates to false—no sales tax is required—the path of execution proceeds via the No path and a value of zero is assigned to the variable taxRate. Remember, you specified that taxRate is initialized to zero when you designed the taxRate variable in the preceding section.
Interacting With Resources Using Controls
Building Stateless and Stateful Business Processes
![]() |
![]() |