Creating Variables

There are two ways of creating variables for your business process. Variables can be created in the Data Palette by selecting Add —> Variable or they can be created in the node builder when you are configuring the Send Data or Receive Data section of a Client Request, Client Request with Return (Start Node only), Client Response, Subscription (Start Node only), Control Send, Control Send with Return, or Control Receive node for your business process nodes. Whichever method you choose, you can always access your variables from the Data Palette after they are created. When you select a variable in the list on the Data Palette, its properties are displayed in the Property Editor.

Before you can create an XML variable of a particular XML Schema type, you must first import the XSD file that contains the XML Schema into the WebLogic Integration schemas project. For instructions on importing an XSD files, see Importing Files into the Schemas Project.

Before you can create a non-XML variable of a particular non-XML type, you must first import the MFL file that contains the schema for the non-XML type into the WebLogic Integration schemas project. For instructions on importing an MFL files, see Importing Files into the Schemas Project.

Before you can create a variable of a Java class type, the Java class file must first be available in the WebLogic Workshop project. To learn more about including a Java class in your project, see Using Existing Applications.

To Create a New Variable in the Data Palette

You can create variables using the Add menu on the Variables tab. To learn how to create variables in the node builder, see To Create a New Variable in the Node Builder.

  1. If the Variables tab is not visible in WebLogic Workshop, choose View —> Windows —> Data Palette from the menu bar.
  2. The Data Palette, which contains a Variables and a Controls tab, is displayed in the Design View.

  3. In the Variables tab, click Add to display the Select Variable Type menu.
  4. image

    A description of the possible variable types options are as follows:

    For more detailed descriptions of the data types, see Working with Data Types.

  5. From the drop-down menu, select the appropriate variable types from the selected option: XML, NonXML, or Java.
  6. The Create Variable dialog box is displayed with the selected variable type.

  7. In the Variable Name field, enter a name for your variable.
  8. In the Select Variable Type field, select or in the Variable type field, enter a variable type:
  9. The Variable type field is populated with the variable type you selected.

  10. If you want to assign a default value to your variable, enter it in the Default value field.
  11. If your variable is a Java simple type and you want it to be a constant that cannot be updated, select Declare as constant, then enter the constant value in the Default value field. This will create the variable as static and final.
  12. Note: If you select the Declare as constant and leave the Default value field blank, the run time default value used is:
    -non-primitive: null
    -numbers: 0
    -boolean: false
    -char: '\0'

  13. Click OK to create the new variable.
  14. The Variables tab in the Data Palette is populated with the variable you created; the name and type of the variable is displayed. When you select a variable in the list, the variable properties are displayed in the Property Editor.

To Create a New Variable in the Node Builder

You can create variables directly in the node builder while you are configuring a node's Receive or Send Data tab. To learn how to create variables outside of the node builder, see To Create a New Variable in the Data Palette.

  1. In the Receive or Send Data tab, select the Variables Assignment option if necessary.
  2. From the Select variables to assign: drop-down menu, select Create new variable.... The Create Variable dialog box is displayed.
  3. Note: The other fields in the dialog box are already populated with the variable types expected by the method you specified on the General Settings tab.

  4. In the Variable Name field, enter a name for your variable.
  5. If you would like to use a variable of a type other than what is expected by the method you specified on the General Setting tab:
    1. Select a variable type option for your variable:
    2. XML Types
    3. Lists the XML Schemas that are available in your business process project and the untyped XMLObject and XMLObjectList data types.

    4. Non-XML Types
    5. Lists the Message Format Language (MFL) files available in your business process project and the untyped RawData data type. 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.

    6. Java Types
    7. Lists Java primitive data types.

      For more detailed descriptions of the data types, see Working with Data Types.

    The Select Variable Type field is populated with the variable type you selected.

  6. Select or enter a variable type:
  7. The Variable type field is populated with the variable type you selected.

  8. If your variable is a Java simple type and you want it to be a constant that cannot be updated, select Declare as constant, then enter the constant value in the Default value field. This will create the variable as static and final.
  9. Note: If you select the Declare as constant and leave the Default value field blank, the run time default value used is:
    -non-primitive: null
    -numbers: 0
    -boolean: false
    -char: '\0'

  10. If you want to assign a default value to your variable, enter it in the Default value field.
  11. Click OK to create the new variable.
  12. The new variable you created is displayed in the Select variables to assign: drop-down menu in the node builder and is added to the Variables tab in the Data Palette; the name and type of the variable is displayed. When you select a variable in the list, the variable properties are displayed in the Property Editor.

To Convert Application Variable Data Types

The node builders support assigning typed data to untyped process variables, and untyped data to typed process variables in the following ways:

Related Topics

Deleting Variables

Working with Data Types

Assigning MFL Data to XML Variables and XML Data to MFL Variables

Previous Document Next Document