REST connector

The REST connector is used to provide a connection with a REST service. The REST connector is graphically represented by a pair of curly brackets under the OOTB Connectors menu whilst modeling a process.

The REST connector has the following actions that correspond to HTTP methods with the same name:

  • restConnector.GET
  • restConnector.HEAD
  • restConnector.POST
  • restConnector.PUT
  • restConnector.PATCH
  • restConnector.DELETE
  • restConnector.OPTIONS
  • restConnector.TRACE

An an example, the implementation value of the GET action in a service task would be similar to the following:

<bpmn2:serviceTask id="ServiceTask_5xed7dm" implementation="restConnector.GET" />

Input parameters

The following are the parameters that can be passed to the REST connector as input parameters using any of the actions:

restUrlURL of the REST endpoint including the protocol and pathStringYes
restUrlParamsURL parameters to append to the URLMap <String, String>No
restUrlEncodedWhether the URL should be encoded or notBooleanNo
requestPayloadThe HTTP body to be sentJSON objectNo
requestHeadersA map of the request header names and values. Values can be fixed, variables or form fieldsMap <String,String>No
circuitBreakerAny value entered will enable the circuit breakerBooleanNo
timeoutThe request timeout value in millisecondsIntegerNo

Note: The parameters can accept variables as part of their values in the format ${variable}. The variable names can be viewed and their values set using connector variables. For example: if the connector variable REST_HOST is set to localhost and the input parameter restURL is set to http://{$host}/service the REST service will resolve this to http://localhost/service.

Output parameters

The following are the parameters that are returned to the process by the REST connector as output parameters using any of the actions:

restResultThe response sent back to the process from the REST serviceJSON object
restStatusThe HTTP response status code if the request was performedInteger
restErrorIf an error was encountered it will be described in this parameterString

Note: The execution of the REST connector is always successful. Any errors will be returned in the restError parameter.

Configuration parameters

Values for configuration parameters that are specific to a connector instance can be set in the modeling application or during application deployment.

The following are the configuration parameters that need to be set for the REST connector:

REST_HOSTThe host address of the REST service that can be used as the variable ${host}
REST_HTTP_PORTThe port used for HTTP calls that can be used as the variable ${rest-http-port}80
REST_HTTPS_PORTThe port used for HTTPS calls that can be used as the variable ${rest-https-port}443
REST_AUTH_TOKENThe token used by the REST service that can be used as the variable ${rest-auth-token}
REST_AUTH_USERThe user that the REST service uses that can be used as the variable ${rest-auth-user}
REST_CIRCUIT_BREAKER_BUFFERThe size of the ring buffer when the circuit breaker is closed5
REST_CIRCUIT_BREAKER_WAIT_INTERVALThe duration the circuit breaker should stay open before switching to half open1000
REST_CIRCUIT_BREAKER_FAILURE_RATEThe percentage above which the circuit breaker should trip and start short circuiting calls20

© 2023 Alfresco Software, Inc. All Rights Reserved.