Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space WDESIGNER and version 23.1

REST (Representational State Transfer) is a way to provide access to web resources using a uniform and predefined set of stateless operations. Refer to the Wikipedia pages of Representational State Transfer for more information on REST.

Today, there are already many services, which speak REST. The Designer has a REST adapter ready. It enables you to use any REST service as a backend for your service implementations.

A REST adapter needs information on the REST API to be called, means the REST resources and their interface. You can provide this information in two ways:

  • Via a connector (see image above)
    This is the easiest way to provide the necessary information. The Designer allows for importing different connector configurations (see Creating Importing an OpenAPI Connector for more information about that).
  • Via a manual data model
    If you do not have a configuration file to import at hand, you can create the necessary resources and interface definitions manually in to the Implementation folder (see Modeling Data Structures Manually Providing the REST Interface for more).

Available Connectors

Find below a list of all connectors that are available for usage with the REST adapter.

OpenAPI Connector for REST Services

Each Web service has its own distinct interface - in case of a REST service, defined by the names of the resources, their operations and their parameters. Before you are able access an external web service from your service model, its interface definition must be imported to the service model.
With the Designer, you can create a connector based on OpenAPI 2.0 Specification service descriptors encoded in YAML (Swagger). The connector contains

  • the REST interface that describes how resources of this endpoint can be accessed,
  • a REST alias that specifies where the REST service is located and more connection options.

For more details on connectors, refer to

  • Importing an OpenAPI Connector for more information on how to create a connector by importing a descriptor
  • Using Connectors for more information on how to use the elements provided by the connector in your service model
  • Aliases for more information on how to configure an aliasOpenAPI Connector
    A connector that can be generated from an OpenAPI description file (YAML).

Accessing a REST Resource

Once you have created a connector to your service (or created the necessary data model by hand), you can add REST operations from the connector to any diagram to create a REST adapter to your service.

Adding a REST Operation to a Diagram

Image Removed

Expand the data model in the service tree.

Image Removed
  1. Add an operation from the REST connector to a diagram to add a REST adapter.

  1. You can drag out operations from the data model to any diagram:
diagram
diagram

The example on the left shows how to add a REST operation to an activity diagram.

Image Removed

The response of an adapter call can be either of complex type ( SupportCaseInfo in the example on the left) or of type Blob.

Configuring the REST Adapter Operation

Once a REST operation has been added to a diagram, it needs to be configured as a REST adapter.

Image Removed

Select the newly added REST operation and switch to the Attributes panel. You can see the following information:

AttributeDescriptionAllowed Values / ExampleNameThe generated name of the operation within the diagram. Call_Operation_4 TypeThe path to the operation within the data model. SupportAPI.SupportAPI.supportcases Is staticREST operations are static.trueSymbol Type

Operations added to a diagram are UML call operations.

Call Operation
  1. Configure the REST adapter to your needs.
    REST adapter operations need to get stereotype REST Adapter applied. Refer to REST Adapter Reference for more information on the configuration options of this adapter.

Refer to Using Connectors for more

All this is generated and cannot be changed.

Image Removed

Click Add Stereotype to define the selected operation as to bea REST adapter.

Image Removed

Select REST Adapter from the list of available adapter stereotypes.
Click Save.

Image Removed

The Attributes panel now shows the added adapter stereotype. Now you still need to configure the adapter.

Expand the stereotype by clicking the arrow on the right.

Image Removed

A REST adapter is configured via its alias. Additionally, you can add a digest algorithm to add a HTTP digest header.

Click the Image Removed icon to add an alias to the REST adapter.

Image Removed

You can

  • select an existing alias from a list
  • add a new alias by clicking the Image Removed icon
  • remove the alias (if one has been assigned) by clicking the Image Removed icon.

Image Removed

After having applied the stereotype, two additional parameter pins are added to the REST adapter operation which whom you can set request options (requestOptions, see Setting REST Request Options) and get the complete response of the adapter call (adapterResponse, see REST Adapter Reference > AdapterResponse).

You can delete these additional pins if they are not used

.

Otp
Floatingfalse

Multiexcerpt include
SpaceWithExcerptINTERNAL
MultiExcerptNameRESTAdapter_SupportManager_Example
PageWithExcerptINTERNAL:_designer_examples
shouldDisplayInlineCommentsInIncludesfalse

Rp

Children Display

Rde