Transforming pattern parameters

Calculate a pattern parameter value from the values entered for other pattern parameters.

Before you begin

Complete the following tasks:

About this task

You can transform pattern parameters by using XPath expressions; for example, to calculate a pattern parameter value from the values entered for other pattern parameters. 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 Transform tab. The parameter IDs for pattern parameters are shown in the Parameter ID column of the Pattern Parameters table.
  • When a pattern instance is generated by a pattern user, transformation expressions are processed before any Java™ and PHP code that has been added to modify pattern instances. Transformation of pattern parameters is processed in the following sequence:
    1. Every parameter that has an XPath transformation expression is evaluated.
    2. The value of each parameter that has an XPath transformation expression is updated with the result of its evaluation, overwriting the value entered by the pattern user.
    3. The parameters are evaluated in top to bottom order, as they are listed in the Pattern Configuration tab of the Pattern Authoring editor.

Procedure

To transform a pattern parameter by using an XPath expression:

  1. In the Pattern Configuration tab of the Pattern Authoring editor, double-click the parameter that you want to transform, or select the parameter and click Edit. The Edit Parameter window opens.

    You cannot transform a parameter that uses a table type.

  2. Click the Transform tab. Create an XPath expression for your chosen parameter:
    • To select a function:
      1. Expand Boolean, Number, Pattern, or String in the Functions section, then click a function. 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 parameter ID shown in the Parameter ID column of the Pattern Parameters table for the chosen 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.
  3. Repeat the actions in step 2, as required, to create your XPath expression.
  4. You can now choose whether to test your expression: