# Using the XML MetaData Cache Control In a Business Process

Once created, you can use the new XML MetaData Cache Control in a business process.

The business process usually starts with a Client Request node. This node represents a request made by a client to the process. In this case, the client invokes the get(String key) method on the process to get an XML metadata key from the cache.

To set up your business process to get XML metadata from the cache, do the following:

- Create an instance of the XML MetaData Cache Control. Name it MyXML MetaData Cache Control. Use the steps provided in Creating an XML MetaData Cache Control in WebLogic Integration.
- Your new XML MetaData Cache Control will be visible under the Controls tab in the Data Palette. Expand MyXML MetaData Cache Control to view the XMLMetadata get method that you can use in your business process.
- Design a Control Send Node in your business process, to prepare the control to get cache data from the cache. For more information on how to do this, see To Prepare the Client Node.

To Prepare the Client Node

1. Open the Client Request node. In the General Settings tab, enter NewXMLMetadata in the Method Name field.
2. Click Add, then select String from the Java datatype list. Enter Key1 as the variable in the Name field, then click OK to add your selection to the Client Request node. This indicates to the client that the control expects the client to send and receive a value of type string. The String represents the datatype used to define the key with which the XML metadata is associated.
3. In the Receive Data tab, select a string as the variable that you want to assign to the tab of the Client Request node. The variable type is pre-defined, based on the parameters to which you are assigning the variable. The string represents the datatype used to define the value of the key, which is the core aspect of the object.
4. Close the Client Request node. You can now add a get (String key) node to your business process.

To Get an XML metadata Document

You can use the following property to get an XML metadata document using the XML MetaData Cache Control:

xmlObject get(String key)

The control uses this property to get a specific key from the XML MetaData Cache.

To get a key using the XML MetaData Cache Control in a business process, perform the following steps:

1. Drag the XmlObject get(String) method from the Data Palette and drop it below the Client Request node in your business process.
2. Double-click the get node to display the General Settings tab of the Node Builder.
3. Confirm that MyXML MetaData Cache Control is displayed in the Control field and that the following method is selected in the Method field:

    get(String key)

4. Open the Send Data tab. In the Select variables to assign drop-down list, select Key1(String).
5. Open the Receive Data tab. In the Select variables to assign list, create a new variable called XML_1. The XMLObject datatype is selected by default. This step completes the get request for the XML metadata.
6. Close the window.

The following code sample reflects the configuration of the add (String key) node.

    public void get_metadataGet() throws Exception
    {
    //#START: CODE GENERATED - PROTECTED SECTION - you can safely add code above this comment in this method. #//
    // input transform
    // return method call
    this.XML_1 = get_metadata.get(this.Key_1);
    // output transform
    // output assignments
    //#END: CODE GENERATED - PROTECTED SECTION - you can safely add code below this comment in this method. #//
    }