Versions Compared

Key

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

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 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 the Implementation folder (see Modeling Data Structures for more).

Multiexcerpt include
SpaceWithExcerptINTERNAL
MultiExcerptNameRESTAdapter_SupportManager_Example
PageWithExcerptINTERNAL:_designer_examples
shouldDisplayInlineCommentsInIncludesfalse

Available Connectors

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

  • OpenAPI 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

Expand the data model in the service tree.

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

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

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.

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

AttributeDescriptionAllowed Values / Example
NameThe 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.true
Symbol Type

Operations added to a diagram are UML call operations.

Call Operation

All this is generated and cannot be changed.

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

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

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.

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

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


You can

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

Image Added

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