MapFunctionName

This action can be used to define a function name mapping, so that the recorder scripts a wrapper function (which needs to be present, for example in a BDH file, for the script to be compileable) instead of the original function. Such a wrapper function must have the same parameter list as the original function, because this rule does not modify the function parameters in any way.

The recorder scripts the wrapper function instead of the original function, if the condition returns true and in the course of the evaluation of the condition something was saved to the variable FunctionName.

If the conditions also save a non-empty string to the variable BdhFileName, the recorder will also generate a use statement to include the given BDH file into the script.

This rule replaces each WebPageLink function call with a MyWebPageLink function call.

<HttpScriptingRule>
  <Name>Replace WebPageLink with my wrapper function</Name>
  <Active>true</Active>
  <Action>MapFunctionName</Action>
  <Conditions>
    <CompareData>
      <ApplyTo>DefaultFunctionName</ApplyTo>
      <Data>WebPageLink</Data>
    </CompareData>
    <Exists>
      <ApplyTo>Literal:MyWebPageLink</ApplyTo>
      <SaveAs>FunctionName</SaveAs>
    </Exists>
    <Exists>
      <ApplyTo>Literal:MyFunctions.bdh</ApplyTo>
      <SaveAs>BdhFileName</SaveAs>
    </Exists>
  </Conditions>
</HttpScriptingRule>