Table of Contents

Search

  1. Preface
  2. Understanding Data Types and Field Properties
  3. Designing Processes
  4. Using and Displaying Data
  5. Designing Guides
  6. Designing Process Objects
  7. Designing Service Connectors
  8. Using App Connections
  9. System Services, Listeners and Connectors
  10. Designing Human Tasks

Design

Design

Output Tab

Output Tab

Use the
Output
tab to define how the service connector must parse data returned from a service and place it in variables. Typically, a service returns data in the XML format. If the service returns data in the JSON format, the service connector converts it to the XML format. You can map the XML to output fields in two ways:
  1. Directly map the data to a property based on XML tag names or JSON properties.
  2. Use
    Expression
    to extract elements.
    Informatica recommends parsing the XML response by using XML parsing tools such as JDOM and Woodstox, and then extracting values rather than performing a plain string search to match namespaces and tags. If you match plain strings, you might encounter an error because the namespace prefixes are not constant.
The following image shows the
Output
tab:
The image shows the Output tab.
For each output data item, specify:
  • Name
    : The name of a variable into which a returned value is placed. The name must start with a letter or number, and can contain only alphanumeric characters, spaces, and underscores (_). This is a required field.
  • Type
    : The data type of the value being written to the variable. If the type is Object List or Reference, Process Designer displays a list of Process Objects so you can choose one of the objects defined within the
    Process Objects
    tab.
    You can also set a list of simple type such as text, integer, number, check box, date, date time, or time for an output field. To set the type as a list of simple type, select the
    Text
    ,
    Integer
    ,
    Number
    ,
    Checkbox
    ,
    Date
    ,
    Date Time
    , or
    Time
    type as required, and then select the
    This is a list
    check box.
  • Description
    : Text describing the variable
  • Get From
    : Select one of the following options:
    • Property
      : To enter a named value (which is the name used within the XML returned by the service) to be placed within the variable. Do not set the
      Property
      option to
      Reference
      because the
      Property
      option can retrieve only a single property in the XML response.
      You must select
      Property
      only for unique fields. If you have duplicate fields, select
      Expression
      and specify an XQuery expression. For more information, see Rules and guidelines for using list of simple types.
    • Expression
      :
      To write an expression to parse the XML returned by the service. In the above image, we use the
      $RESTResponse
      output field to return one value for the
      AllModelsCount
      variable. The expression used for the
      CarMakesList
      returns a list. Click
      f(x)
      to open the Expression Editor where you can type the expression.
    • HTTP Response Status Code
      : To check the HTTP response status code.
    • HTTP Response Header
      : To enter the part of the response header to assign to the field. See the details below.
    • Entire Response
      : To assign the complete contents of the response payload to the field.
    • Simplified XML
      : To rearrange data so it can be used by process objects. For more information, see Simplified XML.
    • Entire Response As Attachment
      : To handle the entire response as an attachment.
      The
      Entire Response As Attachment
      option preserves backward compatibility. If you had created a service connector with a single attachment earlier, it will continue to work as is, and no manual changes are needed. However, Informatica recommends that you redesign your service connector to handle multipart responses as multiple attachments so that you do not have to manually split attachments. You can also use the processing logic for attachments within the service connector itself instead of doing it within a process. Therefore, you can use a service connector within multiple processes without having to design the processing logic in multiple processes. You can also use the functions available to work with output attachments.
    • Attachments
      : To work with multiple attachments and pass the entire list of attachments to the selected variable except the part used as the payload.
After you enter a value in the output field, you must click anywhere outside the row to save the value.
For details on handling HTTP errors, see Checking for HTTP Errors.

Rules and guidelines for using list of simple types

Consider the following rules and guidelines when you use a list of simple types in a service connector:
  • You must use the
    Property
    option for an output field only if the payload response contains unique fields. If you have duplicate fields or a field with a list of simple type, there might be instances of one or more values with the same field name in the XML document. In that case, you must select
    Expression
    and use
    XQuery
    to get the correct field.
    For example, assume that you select the
    Property
    option for the payload response as shown in the following sample:
    <users> <user1> <ID>1</ID> <ID>2</ID> <ID>3</ID> </user1> <user2> <ID>4</ID> <ID>5</ID> <ID>6</ID> </user2> <users>
    When you use a field with a simple type and set the output as ID. Application Integration identifies an instance of the ID and returns a single output value such as the ID with the value as 4. However, if you use a field with a list of simple type, Application Integration finds the output instance. Then, Application Integration returns all the instances from the same level within the element. In this example, if the ID with value 1 in user 1 is identified, Application Integration also returns the IDs 2 and 3 within user 1.
    To avoid this issue, when you have duplicate fields such as ID and you want to use the second ID from user 2, use
    XQuery
    to return the correct field as shown in the following sample:
    .//user2/ID[2]/text()
    Consider the following scenarios to use the sequence of values for the list of simple type variables:
    If you have text output variables that contain a list of strings, to build a comma-separated string, use XQuery as shown in the following sample:
    {string-join($TextsOut , ",")}
    If you have a list of date-time values, and you want to access the second value from a list of dates, use XQuery as shown in the following sample:
    {$DateTimesOut[2]}
    If you want to iterate all the integers from the list of integer values, use XQuery as shown in the following sample:
    {for $j in $Integers return $j}
  • When you generate a JSON payload with an input field that contains a list of simple types, the output is in the form of a JSON array. When you parse the JSON response, the fields are also converted into a list of simple types.
    For example, the generated JSON payload appears as shown in the following sample:
    { "userNames": ["Bob","John","Valery"] }
    When you generate an XML payload, the request appears as shown in the following sample:
    <root> <userNames>Bob</userNames> <userNames>John</userNames> <userNames>Valery</userNames> </root>

0 COMMENTS

We’d like to hear from you!