Enabling pattern parameters

You can control whether pattern parameters can be edited by pattern users based on the values of other pattern parameters.

Before you begin

Complete the following tasks:

About this task

By using XPath expressions you can control whether pattern users can edit pattern parameters in the Pattern Instance editor . If an expression evaluates to Boolean true, the pattern user can configure the parameter in the Configure Pattern Parameters page; if an expression evaluates to Boolean false, the parameter is read-only, and the pattern user cannot configure it. When the pattern user configures pattern parameters, expressions are evaluated whenever any of the pattern parameters used in an expression change.

IBM® App Connect Enterprise supports XPath 1.0. For XPath reference information, including information about XPath functions, see W3C XPath 1.0 Specification.

The pp:getValue() function is included, in addition to the functions in the XPath 1.0 Specification. The pp:getValue() function takes the parameter ID of a pattern parameter and returns the value of that pattern parameter. To see the parameter ID for a pattern parameter:
  1. In the Pattern Configuration tab of the Pattern Authoring editor, double-click a parameter, or select a parameter and click Edit. The Edit Parameter window opens.
  2. Click the Enable tab. The parameter IDs for pattern parameters are shown in the Parameter ID column of the Pattern Parameters table.

Procedure

To define an XPath expression to control whether a pattern parameter can be edited:

  1. In the Pattern Configuration tab of the Pattern Authoring editor, select the parameter that you want to configure. Click Edit.
    The Edit Parameter window opens.
  2. Click the Enable tab. Create an XPath expression for your selected parameter by applying the following operations as required:
    • To select a function:
      1. Click a function in the Functions section. The function is displayed in the Function name field.
      2. Click Use. The function is inserted into the Expression field at the cursor.
    • To select an operator:
      1. Click an operator in the Operators section. The operator is displayed in the Operator field.
      2. Click Use. The operator is inserted into the Expression field at the cursor.
    • To select a pattern parameter:
      1. Click a pattern parameter in the Pattern Parameters table. The ID shown in the Parameter ID column of the Pattern Parameters table for the selected parameter is displayed in the Parameter ID field.

        You cannot select a pattern parameter that uses a table type.

      2. Click Use. The parameter ID is inserted into the Expression field at the cursor.
    • You can also edit the expression directly in the Expression field.

    A common requirement is for a pattern parameter to be read-only. To ensure that a pattern parameter is read-only, set the XPath expression for the pattern parameter to false().

  3. You can now choose whether to test your expression:
    • To test your expression, see Testing an enabling expression.
    • To accept the expression without testing it, click OK. The Edit Parameter window closes.