# AWB Execution Modes

Agent.Workbench provides four different execution modes: End-user ***Application***, \*\*\*\****Background System***, ***Service*** and ***Embedded System Agent***. These modes are suited for different use cases (simulation/operation) and offer individual features like direct execution of agents, a user interface (UI) etc.

## Introductory remarks

Agent.Workbench allows you to switch the execution mode anytime. Except for a special setting in the mode *Embedded System Agent* mode, the tab *Program Start* in the *Options* is the central location for this. Depending on the current mode, the *Options* can be accessed in different ways, which will be explained below. To switch modes, select the desired mode in the top section (*Agent.Workbench - Start as:*), specify the required parameters for the specific mode (see below), and click Apply to restart Agent.Workbench.

In execution modes *Application* and *Service*, Agent.Workbench can be connected to a *Background System*. This allows to distribute the JADE agent platform across multiple machines. To do so, specify the location of the so-called *server.master* by its URL or IP-address. The port settings must match the configuration of the server.master - usually it will be the default ports 1099 and 7778. More details about the *Background System* and *Server* configuration can be found [here](https://enflexit.gitbook.io/agent-workbench/development/distributed-application).

![](https://874617837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LL95HBh1KIqu90YyWBK%2Fuploads%2Fgit-blob-ab717ffa843339cdaf8e67e210f8aab3b52fb968%2Foptionsgeneral.jpg?alt=media\&token=fadb092a-55dc-4b41-9e18-0874827e15ba)

## End-User Application

The *End-User Application* mode is the default. It provides the graphical user interface to create, configure and execute your AWB agent projects. When connected to a *Background System*, agents can be distributed and remote containers can be monitored via the end-user application.

In the *End-User Application* mode, the *Options* dialog can be found under *Extras > Options.* Alternatively, as shown further below, you can also use the context menu of the AWB tray icon.

![](https://874617837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LL95HBh1KIqu90YyWBK%2Fuploads%2Fgit-blob-09fc483c7a8727122d563e0d47fbfb4af287a891%2Fapplicationgotooptions.jpg?alt=media\&token=a4a9f865-bd5b-4aec-b6e2-b441ad2eb415)

Beside optional settings for the *Background System* connection, the *Application* execution mode does not require any further specific configuration.

![](https://874617837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LL95HBh1KIqu90YyWBK%2Fuploads%2Fgit-blob-539b750d48ea3560c5b9784b1d8dda726f4c0962%2Foptionsapplication.jpg?alt=media\&token=74df2750-f0a0-4eab-8cab-b286231961b3)

## Server / Background System

Agent.Workbench can also be executed in a *Server* mode that is dedicated to the *Background System*. This mode does not provide a graphical user interface. The only visual representation is the AWB tray icon in the icon tray of the operating system (if available). It allows to control the AWB execution by a context menu. This allows the user to perform important actions like opening the *Options* dialog, showing *Console* output or starting and stopping Agent.Workbench in the current mode.

The *Server* mode is connected to the *Background System*. In fact, it is not possible to start an Agent.Workbench instance in *Server* mode without laying down parameters for the *Background System*. When configured correctly, an AWB instance is either handled as a so called *server.master*, *server.slave* or *server.client*. These instances can be distributed over several machines and thus create the background system, a network that is in control of dynamically extending the JADE platform with JADE containers. More information about configuring the *Server* mode, the background system and how to create one is provided on [this page](https://enflexit.gitbook.io/agent-workbench/development/distributed-application).

![](https://874617837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LL95HBh1KIqu90YyWBK%2Fuploads%2Fgit-blob-f7c215cbcb22f5ec04d2f3dd8ea9b1aca293b005%2Foptionsserver.jpg?alt=media\&token=a6335ed6-4570-426c-892d-ef2cded2a6b7)

## Service

In *Service* mode, Agent.Workbench spares the user to open and start an agent project manually. At startup, Agent.Workbench automatically starts JADE and executes a specified project setup (direct execution). The visual appearance of the *Service* mode is equal to the end-user oriented *Application* mode.

To utilize the *Service* mode, you need to specify the project to open, choose *Run as: Service* and select a a project setup to execute. The agents specified in the agent start-list of the project setup will be executed directly after pressing the *Apply* button or the next time you start Agent.Workbench.

![](https://874617837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LL95HBh1KIqu90YyWBK%2Fuploads%2Fgit-blob-544aef6f1fca70f0eab61e36b6327531ed12f525%2Foptionsservice.jpg?alt=media\&token=2a9bbc59-e8f7-4511-8497-6a3caaa1fe72)

## Embedded System Agent

The mode *Embedded System Agent* is configured similar to the *Service* mode and also features direct execution of agents. However, at startup only specified agents from a project will be started. In this mode, the visual representation is restricted. The user can choose between a *Server*-like appearance with a tray-icon or a hidden execution, with no visual representation. In contrast to the *Application* or *Service* mode, the *Embedded System Agent* mode is suited for operational purpose, as for example for agents that have to run in an automation environment on an industrial PC or in a Smart House scenario.

![](https://874617837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LL95HBh1KIqu90YyWBK%2Fuploads%2Fgit-blob-9fb93ff671d36c07f24a55d0df1340c0d5307291%2Foptionsembeddedsystemagent.jpg?alt=media\&token=331e31e7-eb40-4586-b44b-800e5b00bc19)

To utilize the *Embedded System Agent* mode, you have to specify a project and choose *Run as: Embedded System Agent*. To specify the agents that you want to execute, for each agent, click the ![](https://874617837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LL95HBh1KIqu90YyWBK%2Fuploads%2Fgit-blob-468d784f2f17a6a4528f582246dd2a4912719068%2Faddagentbutton.jpg?alt=media) button and select the desired agent from the list; afterwards, assign a runtime name to the agent. For the visualization you have two options:

#### Display Agent.Workbench - Tray icon

In this mode Agent.Workbench is represented by a tray-icon and can be controlled via the context menu.

#### Disable all visual representation

With this option, Agent.Workbench will be executed completely hidden. The console output is redirected to a log file in the root directory of Agent.Workbench. Also, a file called ***Shutdown\_Service\_EmbeddedSystemAgent\_\[PID]*** will be created. This file indicates that Agent.Workbench is running and is permanently observed by a system agent. As soon as this file is deleted, Agent.Workbench (and JADE) will shutdown automatically.

## Configuration File *org.agentgui.core.prefs*

As compensation for the missing Options dialog, the configuration file .*/configuration/.settings./org.agentgui.core.prefs* can be found in the Agent.Workbench installation. In fact, configuring this file is the same as configuring Agent.Workbench in the Options dialog. It allows you to switch to any execution mode by specifying the necessary parameters, or change the visualization within the *Embedded System Agent* mode. You can open and edit the file *org.agentgui.core.prefs* file with any text editor.

The value for *01\_RUNAS* specifies the execution mode you want to switch to. Connecting to a *Background System* is also as straight forward as in the Options dialog. Just type the URL or IP-address of the server.master at *11\_MASTER\_URL* and so on.

![](https://874617837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LL95HBh1KIqu90YyWBK%2Fuploads%2Fgit-blob-a00b171bb523455c27f30b492fdf158c6e6dcf69%2Fprefsembeddedsystemhiddenexecedited.jpg?alt=media\&token=3efbbfe4-a97e-4e35-abf7-0c9362466a90)

The following table shows the possible values for the ***01\_RUNAS*** key and explains how the *org.agentgui.core.prefs* file further needs to be configured to successfully switch an execution mode.

| Value                                                                                               | Explanation                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| --------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>APPLICATION</strong></p><p>\<b>\</b></p><p>\<b>\</b></p><p>\<b>\</b></p><p>\<b>\</b></p> | <p>Indicates the usage as <em>End-User Application</em>. Since it does not require any mode-specific configuration, this is basically the only parameter you need to change.<br>If you like to extend and distibute your agent platform over several computer systems, specifiy the URL or IP-address of a running server.master instance by setting a value to <em>11\_MASTER\_URL</em>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| <p><strong>SERVER</strong></p><p><br><br></p>                                                       | <p>Indicates to execute in the <em>Server</em> mode. Based on the further configuration, the instance is either handled as a so-called <em>server.master</em> or as <em>server.slave</em>.</p><p>The <em>Server</em> mode requires to define the URL or IP-address of the <em>server.master</em> system at <em>11\_MASTER\_URL</em>. If you intend to execute a <em>server.master</em> instance, you additionally need to specify the values for <em>MASTER\_DB\_HOST, -NAME, -USER</em> and -<em>PSWD</em>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| <p><strong>DEVICE\_SYSTEM</strong></p><p><br><br><br></p><p><br></p>                                | <p>Indicates the usage of the <em>Service</em> or <em>Embedded System Agent</em> mode. Analogue to the <em>Options</em> dialog , it requires further configuration. For both execution modes, the key <em>40\_DEVICE\_SERVICE\_PROJECT</em> needs to define a valid project out of the current projects directory; the specification of the subdirectory is sufficient here (e.g. my-agent-project).</p><p>For the <em>Embedded System Agent</em> mode, key <em>41\_DEVICE\_SERVICE\_EXEC\_AS</em> has to be set to <strong>AGENT</strong>. Further, the corresponding agent has to be specified under <em>44\_DEVICE\_SERVICE\_AGENT\_Name</em>. Finally, choose between <strong>NONE</strong> (for hidden execution) and <strong>TRAY\_ICON</strong> (for tray-icon visualization) for <em>45\_DEVICE\_SERVICE\_VISUALISATION</em>.</p><p>For <em>Service</em> mode, <em>41\_DEVICE\_SERVICE\_EXEC\_AS</em> must be set to <strong>SETUP</strong>. The corresponding setup out of the project needs to be specified at <em>42\_DEVICE\_SERVICE\_SETUP</em></p> |

For sure, the easiest way to configure Agent.Workbench is to use the Options dialog, since it provides suitable user support functions. For some configurations, as for example for the configuration of so-called device agents, the configuration is more complex (see example below). Therefore it can be helpful to use the Options dialog to configure your own configuration examples. Here the example:

44\_DEVICE\_SERVICE\_AGENT\_Name = Agent1(net.package.MyAgent), AgentNo2(net.package.MyAgent)

The table below gives explanations on the individual lines, that need to be configured properly to switch to *Server*, *Service* or \_Embedded System Agen\_t mode.

| Key                                                                      | Value                                   | Explanation                                                                                                   |
| ------------------------------------------------------------------------ | --------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| 11\_MASTER\_URL                                                          | <p>myComputerURL</p><p>or 127.0.0.1</p> | URL or IP address of the server.master. Necessary for connecting to a Background System.                      |
| 20\_MASTER\_DB\_HOST                                                     |                                         | URL/IP address of the DB host for the server.master.                                                          |
| 21\_MASTER\_DB\_NAME                                                     |                                         | Specifies the name of the database.                                                                           |
| 22\_MASTER\_DB\_USER                                                     |                                         | Specifies the username.                                                                                       |
| 23\_MASTER\_DB\_PSWD                                                     |                                         | Password for utilizing the database.                                                                          |
| 40\_DEVICE\_SERVICE\_PROJECT                                             |                                         | Specifies project name for the *Service* or *Embedded System Agent* mode, depending on further configuration. |
| <p>41\_DEVICE\_SERVICE\_EXEC\_AS</p><p>\<em>\</em></p><p>\<em>\</em></p> | AGENT                                   | Specifies the *Embedded System Agent* mode, if 01\_RUNAS is set to DEVICE\_SYSTEM.                            |
|                                                                          | SETUP                                   | <p>Specifies the <em>Service</em> mode, if 01\_RUNAS<br>is set to DEVICE\_SYSTEM.</p>                         |
| 42\_DEVICE\_SERVICE\_SETUP                                               |                                         | Specifies the project setup, and thus the agent-start list, that is utilized in *Service* mode.               |
| 44\_DEVICE\_SERVICE\_AGENT\_Name                                         | (see above)                             | Specifies the agent that is executed in *Embedded System Agent* mode.                                         |
| 45\_DEVICE\_SERVICE\_VISUALISATION                                       | TRAY\_ICON                              | Enables a tray-icon in *Embedded System Agent* mode, thru which Agent.Workbench can be controlled.            |
|                                                                          | NONE                                    | Disables all visualization in *Embedded System Agent* mode.                                                   |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://enflexit.gitbook.io/agent-workbench/development/execution-modes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
