Invoke Activity for Rest Reference

Invoke activity is an asynchronous activity that calls an operation of a REST service through REST Reference Binding.

General

The General tab has the following fields

Field Description
Name The name to be displayed as the label for the activity in the process.
Service Select the service for which to specify an operation.

Description

Provide a short description for the invoke activity

Advanced

The Advanced tab has the following field

Input item Literal Value/Module Property Description
Activity Timeout (seconds) Yes The Invoke activity timeout in seconds. You can either select a preset timeout (Default Timeout, 30, 60,or 120 seconds) or specify a custom timeout in seconds.
Important: If the Invoke activity is configured to be Default Timeout, then the timeout value equates to "3" minutes by default. However this default value (3 minutes) can be modified to be a different value by setting the property bw.engine.activity.async.waitTime in BW_JAVA_OPTS environment variable. The value for the property should be specified in milliseconds.

For example: -Dbw.engine.activity.async.waitTime=<timeout in milliseconds>

Note: When the Invoke activity timeouts, the in-line subprocess instance called by the Invoke activity can be cancelled before the subprocess instance completes. Hence, the business logic in the cancelled process instance may not be executed to its entirety.

Input

The following is the input for the activity

Input Item Datatype Description
operationRequest simple or complex This input item has the primitive data type or XSD element defined for the operation. If the operation is configured with Form Parameters, it is reflected here.
httpHeaders complex The HTTP Headers that are a part of the REST request. The header structure is defined by the HTTP protocol.

For more information about the fields and content of the header, see the W3C HTTP specification at w3.org.

  • Accept: specifies the media types that are acceptable for response messages for the incoming request. For example, text/*,text/html.

    For more information about media types, see the W3C HTTP specification at w3.org

    Note: To get status messages for exceptions, set the Accept field to */* or text/html.

  • Accept-Charset: specifies the character sets that are acceptable for response messages for the incoming request. For example, iso-8859-5, unicode-1-1.

    For more information about character sets, see the W3C HTTP specification at w3.org.

  • Accept-Encoding: specifies the content-coding values that are acceptable for response messages. For example, compress, gzip.
  • Content-Type: the media type of the entity body sent to the receiver.

    For more information about media types, see the W3C HTTP specification at w3.org.

  • Content-Length: indicates the size of the entity body sent to the receiver.
  • Connection: the requester can specify options desired for this connection. For example, the option close specifies that the requester would like the connection to be closed when the request is complete.
  • Cookie: A name and value pair (also known as a cookie) containing information that the HTTP server may be expecting.
    For more information about this field, see the W3C HTTP specification at w3.org.
    Note: For correct parsing and processing of cookies, input must be in the format "key=value".
  • Pragma: is used to include implementation-specific directives that might apply to the receiver.

    For more information about this field, see the W3C HTTP specification at w3.org.

  • Authorization: This header can be used to provide credentials that authenticate a user agent with a server, allowing access to a protected resource. This header indicates what authentication schemes can be used to access the resource.
  • Dynamic Headers: The dynamic header is an additional header parameter to add runtime headers to the REST Request.
    Note: You can use only US-ASCII characters in DynamicHeaders

    The dynamic headers consist of the following information:
    Name: the name of the header
    Value: the value of the header

    You can consider the following overriding conditions. Overrides the value of HeaderName with the value found in DynamicHeaders if it is a non-repeating header. If more than one occurrence of this header is found under DynamicHeaders, it generates the following exception.

    The header [ headerName ] is defined as non-Repeating Header in Input Headers. This header cannot have multiple occurences in DynamicHeaders.

    If it is a repeating element, add the respective name or value pairs under DynamicHeaders, which is added to the existing list maintained for this element.

    For a repeating element, if the new header name is not found under the Headers section declared through TIBCO Business Studio for BusinessWorks, the following is added into HTTP headers

    Shows only one value, if found once in DynamicHeaders.
    Shows an array of values, if found repeating in DynamicHeaders.
    Note: If the operation is configured with Request Header Parameters, they are reflected in this list at the end.

dynamicConfigurations complex

Specifies the values to override the binding configuration values

URL: The whole endpoint URL, which the user wants to override from reference binding. The Host, Port on the HTTP Client shared resource and the Resource Service Path on REST Reference Binding is overridden. For more information, see "Dynamic Invocation of a REST Service".
activityTimeout: The Invoke activity timeout in seconds. At runtime, it takes precedence over the Activity Timeout value in the Advanced tab.
parameters complex This element contains the Path and Query parameters configured on the operation.

Output

The following is the output of the activity

Output Item Datatype Description
OperationResponse simple or complex This field shows the response schema element for the operation.
httpResponseHeaders complex

This field contains the standard HTTP Response Headers along with the Response Header parameters if configured for the operation. It is only visible when the operation is configured with HTTP Response Header Parameter.

Fault

The Fault tab lists the possible exceptions generated by this activity.

Fault Generated When..
ActivityTimedOutException A timeout has been reached.
clientFault The Rest Service responds with a message containing the 4XX status code.
serverFault The Rest Service responds with a message containing the 5XX status code.
Note: If the operation is configured with client or server error status codes, then they are appended to the list.