Documentation
  • Introduction
  • Installation
    • Docker Container
      • Database
      • Deployment Modes
      • Docker Environment Variables
      • Deploy on AWS
      • Deploy on Digital Ocean
    • First Steps After Installation
      • Add New Application
      • Publish Application
      • Use Application
  • Usage
    • Send Request To Endpoint
    • Request From Web Form
    • Web Form Controls Having Multiple Values
    • Web Form With File Upload
    • HTML Snippet embedded with Java Script
    • Authentication
    • Environments
    • Debug Mode
  • Configuration
    • Application Directory Structure
      • endpoints.xml
      • security.xml
      • email-sending-configuration.xml
      • service-portal-endpoint-menu-items.xml
      • Directory: data-source-post-processing
      • Directory: data-sources
      • Directory: data-source-xslt
      • Directory: fonts
      • Directory: http-xslt
      • Directory: parameter-xslt
      • Directory: static
      • Directory: transformers
      • Directory: xml-from-application
    • Endpoint Parameter
    • Types of Endpoints
      • Endpoint to Return XSLT Transformation
      • Endpoint to Return Content From Url
      • Endpoint to Return Static File
      • Endpoint to Return OOXML
      • Endpoint to Redirect Request
      • Forwarding Between Endpoints
      • Conditional Success Action
      • Error Case
    • Data Source Transformation
      • Load Parameter Values as a Data Source
      • Load Data From a Local XML File
      • Load Data from any REST-API
      • Load Data From Databases
      • List AWS S3 keys
      • Load AWS S3 object
      • Additional Useful Data Source Types
      • Transformation Options
      • Data Source Post-Processing
      • Using Parameter Placeholders in Data Sources
      • On-Demand Incrementing Number
      • Writing Transformation Input/Output to AWS S3
    • Parameter Transformation
      • Parameter Transformation Input
      • Parameter Transformation Output
    • Tasks
      • HttpRequest Task
      • Email Task
      • Create Shortlink Task
      • Request Log Task
      • Conditional Tasks
      • Parallel or Subsequent Execution of Tasks
      • Intermediate Values
    • PDF Created With XSLT
      • Embedding Fonts
      • Embedding Images
    • OpenEndpoints XSLT Specifics
Powered by GitBook
On this page
Export as PDF
  1. Configuration
  2. Tasks

Intermediate Values

In addition to parameters there are Intermediate Values . These are like parameters, but they do not come from the user’s request, instead they come from other tasks.

For example, imagine a CRM which requires 2 separate calls to

  1. fetch the next available id to insert a new customerinsert a new customer, with that id (from irst request) as a mandatory parameter

  2. insert a new customer, with that id (from irst request) as a mandatory parameter

In this case the first <task> will fetch the id, and make it available as an input to the second task. This is an “intermediate value”.

  • Intermediate values can be referenced as ${value} just like normal parameters.

  • Intermediate values may not have the same name as a parameter declared in “endpoints.xml”. (If intermediate values could have the same names, then ${value} could be ambiguous.)

  • Tasks must explicitly specify which intermediate values they output and which they input. Any task may accept any input intermediate value, however, the output of an intermediate value is task-specific. (For example, HTTP Tasks parse the response, but there is no useful way for an email task to output a variable.)

  • A task which outputs intermediate values may not be optional (with if and equals attributes). That is because the output variables will be used by other tasks, therefore the task must always run.

For example:

<task class="endpoints.task.HttpRequestTask">
    ...
    <output-intermediate-value name="invoice-number"/>
</task>

<task class="endpoints.task.HttpRequestTask">
    <input-intermediate-value name="invoice-number"/>
    ...
</task>

To produce an <output-intermediate-value> from a response-body, one of the following syntaxes must be used:

<task class="endpoints.task.HttpRequestTask">
    ...
    <output-intermediate-value
        name="invoice-number"
        xpath="/foo/bar"
        regex=" d+"/>
</task>

<task class="endpoints.task.HttpRequestTask">
    ...
    <output-intermediate-value
        name="invoice-number"
        jsonpath="$.invoiceNumbers[:1].value"
        regex=" d+"/>
</task>

The former requires that the result of the response be XML, the latter that it be JSON. No attempt is made to convert the response between XML and JSON. The regex attribute is optional.

Using Intermediate Values in data-source-xslt

ssIn case you want to use the intermediate value within a regular data-source-xslt, then you need to declare it within the <success> tags:

<success>
    <input-intermediate-value name="name-of-intermediate-variable"/>
        <response-transformation name="name-of-transformer"/>
</success>
PreviousParallel or Subsequent Execution of TasksNextPDF Created With XSLT

Last updated 2 years ago