# Sending Messages to Clients

Client Response nodes provide a way for a business process to send messages to clients. The tasks you must complete to design a Client Response node include:

- Create a Client Response Node in Your Business Process
- Design Your Client Response Node

### Create a Client Response Node in Your Business Process

1. On the Application tab, click the JPD file you want to design.

Your business process is displayed in the Design View.

2. If the Palette is not visible in WebLogic Workshop, choose View —> Windows —> Palette from the WebLogic Workshop menu.
3. Click Client Response in the Palette.
4. Drag and drop the Client Response node onto the business process in the Design View, placing it on the business process at the point in your business process at which you want to send a message to a client.

Note: As you drag your selection onto the Design View, targets appear on your business process. Each target represents a location in the flow where you can place the node. As you drag the node near a location, the target is activated and the cursor changes to an arrow . When this happens, you can release the mouse button and the node snaps to the business process at the location indicated by the active target. If the location you chose is not a valid one, an will appear next to your node. If you place your cursor over this icon,WebLogic Workshop will display a message about the violation.

The Client Response node is displayed in your business process in the Design View.

Note the following properties for the Client Response node:

- indicates that the design of this node is incomplete. To complete the design, see Design Your Client Response Node.
- By default the name for the node is Client Response. You can change the name in the following ways:

- Double-click the node name in the Design View and enter a new name to replace Client Response.
- Right-click the node name in the Design View and select Rename from the drop-down menu. Then enter a new name to replace Client Response.
- Double-click the Client Response node in your business process to display the node builder. Click the name beneath the node builder icon and enter a new name to replace Client Response.

### Design Your Client Response Node

The following sections describe how to complete the design of interactions with clients in your Client Response nodes:

- To Specify General Settings
- To Specify Send Data

To Specify General Settings

1. Double-click the Client Response node in your business process.

The node builder is displayed. It contains two tabs: General Settings and Send Data.

2. In the General Settings tab, enter a name in the Method Name field to specify the name of the method on this Client Response node.
3. In the General Settings tab, click Add to specify the type and format of the data your business process sends to clients via the Client Response node (that is, the data type for the method parameter). The node builder displays the following types of data:

- XML Types

Lists the XML Schemas that are available in your business process project. To learn how to import a Schema into your project, see Importing Files into the Schemas Project.

- Non-XML Types

Lists the Message Format Language (MFL) files available in your business process project. WebLogic Integration uses a metadata language called Message Format Language (MFL), based on XML, to describe the structure of non-XML data. Every MFL file available in your project is listed in Non-XML Types. Note that an XML Schema representation of each MFL file is built by WebLogic Workshop and is also available in the XML Types listing.

- Java Types

Lists Java primitive data types, and XMLObject, XMLObjectList, and RawData types.

To learn more about data types, see Working with Data Types.

4. Click OK.

After you select a data type from the list of supported types, the field is populated.

To Specify Send Data

1. Click the Send Data tab.

This tab allows you to define one or more variables to hold the data your business process sends to clients.

2. If the data types of your method parameters and the data type of the variables you are going to use match, you can map your variables to the corresponding methods directly.

1. If not already selected, select the Variable Assignment option.

The Client Expects field is populated with the parameter(s) you specified on the General Settings tab.

2. If you want to assign a variable that you already created in your project to the method parameters, select it from the drop-down menu.
3. If you want to create a new variable and assign it to the method parameter, select Create new variable..., then follow the instructions in To Create a New Variable in the Node Builder.
4. If the data types of your method parameters and your variables match, close the node builder by clicking the X in the top right-hand corner

3. If the data types of your method parameters and your variables are different, you can use the data mapping tool included in WebLogic Workshop to map between heterogeneous data types. The data transformations you create using the tool are stored in Data Transformation Format (DTF) files. 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.

1. To create a transformation map, select the Transformation option.

The node builder transformation screen is displayed with the data types expected by your method displayed in the Client Expects pane.

2. In Step 1 in the Transformation tab, click Select Variable to select one or more variables to be used.

Note: To remove a variable from the node builder pane, select the variable in the list and then click Remove. This action removes the variable from the node builder, not from your business process. The variable is still included in your business process; it is visible in the Variables pane in the Data Palette.

When designing a business process, you use a Transformation to create maps between disparate data types. Your project must contain an instance of a Transformation control (defined by a DTF file) for you to create the map.

3. If an appropriate instance of a Transformation control is not available in your project, you can create a new one by clicking Create Transformation to invoke the Transformation Mapping tool window.

The mapping tool displays a representation of the source schema and target schema in Source and Target panes. You can create a map between the data type of the method parameter and the data type of the variable, or variables, to which you assign the data. To learn how to create and test a map using the mapping tool, see Guide to Data Transformation.

Note: To return to node builder, in the Application pane, double-click the JPD file.

4. If the appropriate instance of a Transformation control is available in your project, click Advanced Option. The Advanced Option window opens. In this window select the Control and Method. If the method arguments and return type matches those as selected in the Transformation pane, click OK.
5. To close the node builder, click the X in the top right-hand corner.

In the Design View, the icon indicates that you completed the configuration and design of this node.

Note: To learn about changing the configuration you design in the Transformation pane of a node builder, see About Editing Node Configurations.

1. To save your work, select File —> Save.

### Adding Dynamic Callback Properties

You can set dynamic callback properties for your Client Response node by using the XQuery Dynamic Selector. The Dynamic Selector allows you to configure a lookup property based on a LookupControl or TPM function. You can then configure your business process in the WebLogic Integration Administration Console such that, at run time, the security of the callback to the client is handled differently, based on the value of the lookup property that you specified in the Dynamic Selector.

To Set the Dynamic Callback Property

1. Select the Client Response node for which you want to set a Dynamic Callback property.
2. In the Property Editor, in the xquery field under the selector section, click .

The Dynamic Selector window opens with the method schema that is configured for the Client Response node displayed.

3. Select the LookupControl or the TPM option.
4. Select the element which you want to use as the base for your lookup in the method schema.

An xquery function is created for you and displayed in the XQuery pane of the window.

5. If you want to test your xquery, click the Test tab. The Test tab displays the Source XML in the left pane.
6. Click Test to display the Result XML. Your xquery execution status is displayed in the XQuery Execution Messages pane of the window.
7. Click OK to close the Dynamic Selector window.

The xquery you created is displayed in the Property Editor of the Client Response node.

For information about how to configure the security information associated with your dynamic callback property, see "Adding or Changing Dynamic Client Callback Selectors" in Process Configuration in Managing WebLogic Integration Solutions at the following URL:

    http://edocs.bea.com/wli/docs81/manage/processconfig.html

1. To save your work, select File —> Save.

Related Topics

Receiving Messages From Clients

Buffering Client Messages

Handling Exceptions

Client Operations and Control Communication Methods