# Creating a New Process Control

This topic describes how to create a new Process control.

You can create a Process control in two different ways, which are described in the following sections:

- Creating a New Process Control Using the Control Wizard
- Generating a Process Control from a JPD File

### Creating a New Process Control Using the Control Wizard

You can use the Insert Process dialog to create a new Process control and add it to your business process. If you are not in the Design View, click the Design View tab.

Note: If the Data Palette is not visible in WebLogic Workshop, click View —> Windows —> Data Palette from the menu bar.

To create a new Process control:

1. Click Add on the Data Palette Controls tab to display a drop-down list of controls that represent the resources with which your business process can interact.
2. Highlight Integration Controls to display the list of controls used for integrating applications.
3. Select Process.

The Insert Control - Process dialog appears.

4. In Step 1, in the Variable name for this control field, type the name for your Process control.
5. In Step 2, check the Create a new Process control to use radio button.
6. In the New JCX name field, type the name of the new file.
7. In Step 3a, select the business process you want to access by selecting the name of a business process (.jpd) file.
8. In Step 3b, select a start method from the Start Method menu. Only those start methods contained in the specified business process are displayed.
9. Step 3c is optional. Process controls allow you to decide at run time which one of multiple subprocesses to call using a dynamic selector. For simple cases, where you know at design time which subprocess you want to call, no selector is necessary.

To specify a dynamic selector, enter a query in the Query field or click the Query Builder button to display the Dynamic Selector query builder.

If you invoked the Dynamic Selector query builder, perform the following steps to build and test a query:

1. Select the type of lookup function for the query by choosing the LookupControl or TPM radio button. Choose TPM to bind lookup values to properties in the TPM repository. Choose LookupControl to bind lookup values to dynamic properties specified in a domain-wide DynamicProperties.xml file. You should only edit the DynamicProperties.xml file to bind lookup values to dynamic properties if the domain is inactive. If the domain is active, it is recommended that you use the WebLogic Integration Administration Console to bind lookup values.

For more information on binding lookup values to dynamic properties using the WebLogic Integration Administration Console, see "Adding or Changing Dynamic Control Selectors" in Process Configuration in Managing WebLogic Integration Solutions, which is available at the following URL:

http://e-docs.bea.com/wli/docs81/manage/processconfig.html#1039959

2. In the Start Method Schema area, select an element from the schema to associate it with the start method of the control. Only XML elements are displayed; non-XML elements are not supported. The resulting query appears in the XQuery area.
3. Click OK.

10. Click Create.

The Process control is created and displayed in the Applications tab. An instance of the control is also created and is added to the Data Palette.

For more information, see "Step 6: Invoke a Business Process Using a Process Control" in Tutorial: Building Your First Business Process.

### Generating a Process Control from a JPD File

You can create a new Process control from an existing JPD file.

Note: If the Application pane is not visible in WebLogic Workshop, click View —> Application from the menu bar.

To generate a Process control from a JPD file:

1. Open the application that contains the business process for which you want to create the Process control.
2. Expand the Application pane to display the JPD file for the process.

l

3. Right-click on the JPD file.

A menu appears displaying a list of options.

4. Click Generate Process Control.
5. The Process control is created and displayed below the JPD file in the Applications tab. The name is generated by appending PControl to the JPD name. For example, if you generate a Process control JCX file from RequestQuote.jpd, the resulting JCX file is named RequestQuotePControl.jcx.

Double-click the Process control JCX file in the Application Pane to display the control in Design View.

6. Use the Property Editor to edit the dynamic selector as described in Editing and Testing a Dynamic Selector.

Alternatively, you may create a Process control JCX file manually. For example, you may copy an existing Process control JCX file and modify the copy.

#### Notes on XQueries

When you are using XQuery expressions and the XQuery Builder, it is important to remember:

- If you create a new Process control and want to use the XQuery Builder to associate an element in the schema with the start method for the new control, remember that XQuery Builder will only declare namespaces for schemas used in argument 2. So, if argument 1 uses "schema1", but argument 2 does not use "schema1", it will not declare namespace "schema1".
- If you use the XQuery Builder to generate XQuery expressions that involve an optional element, it is possible that you will have to manually edit the expression to generate a correct XPath location
- Some XQuery expressions are not supported when using complex Predicates.