With the BRIDGE you can define dedicated activities that should be executed on service startup and service shutdown. You can use this to implement task that should be executed only once, e.g. reading or writing a data cache.

Example File (Builder project Advanced Modeling/Service StartupShutdown):

<your example path>\Advanced Modeling\Service StartupShutdown\uml\serviceStartupShutdown.xml

The startup and shutdown activities can be added to the service composite in section StartupShutdown:

Startup and shutdown activities are executed automatically:

  • A startup activity is the one activity of a service that is executed on service startup before any other activity.
  • A shutdown activity is the last activity of a service that is executed. No other user-controlled activities can be executed after the shutdown activity.

Implementing a Startup / Shutdown Activity

The example shows a simple caching service. On service startup, the startup activity reads the data from the cache file and stores it into memory. While the service is up and running, new data may be added to the data in memory. On service shutdown, the data is written to the cache file to be available on next service start.

Startup and shutdown activities cannot have any parameters. Apart from this, you can do what you want: read files, call other services, call adapters or libraries, trigger the BRIDGE API, and more.

Testing a Startup / Shutdown Activity

If startup and shutdown activities are present in an xUML service composite, the compiler will automatically generate a shadow port to be able to access them. The generated port number is service port + 40000, but you can configure this on the composite in section StartupShutdown:

Via this port, you can trigger the startup or shutdown activity from the SOAP Test Tool or the ANALYZER.

On this Page:
  • No labels