# ObX Backend Engineering

## ObX Admin Tools

The ObX Admin tool serves as the primary backend engineering instrument for the ObX platform. It is the essential tool you'll rely on for all engineering tasks.

<figure><img src="/files/plxbHaK36BIQGwKaqIJ1" alt=""><figcaption><p>ObX Admin Tool</p></figcaption></figure>

## License Management

### Requesting a License

The trial version of ObX provides enhanced capabilities for users to delve deeper into the functionality of the software. When you decide to upgrade your license, you can do so seamlessly by utilizing the ObX Admin tool to generate a license request.

1. Open the ObX Admin Tool
2. From the top menu, click on `License` and select `Request lic`.
3. This will open the License window, fill out all required fields in the window that best suites your requirements.
4. Once filed, Click the `Create License Request` button
5. Select a folder where you want to save the license request, and click OK.

<figure><img src="/files/qyV0cT6jKowaCdNuk3gs" alt=""><figcaption><p>Requesting a license</p></figcaption></figure>

{% hint style="info" %}
To initiate the creation of a Production license, you must forward the Request License file to your designated ObX sales representative. Once processed, the finalized Production license will be sent to you for installation onto your server.
{% endhint %}

### Loading a License

Once you have the production license, you may simply load it to your server

1. Open the ObX Admin Tool
2. From the top menu, click on `License` and select `Load Lic`
3. Browse the folder and select the production license.
4. This will open the License viewer window and double-check if your requested license is the same as the production license. Once confirmed, click OK.
5. A message telling you that the license was successfully loaded. Note that the ObX admin tool will automatically close after loading a new license.

<figure><img src="/files/0OmjN6PTowE6eHNHYXRL" alt=""><figcaption><p>Loading a license.</p></figcaption></figure>

{% hint style="info" %}
In the ObX Admin Tool home tab (at the lower part), click on the `Check License Info` link to view the loaded license on your server.
{% endhint %}

## Web Dashboard and Datasource configuration

Upon launching the ObX Admin Tool, it initiates an automatic retrieval of essential data from both the ObX Historian and ObX WebUI component. To enable this process, configuration of the IP address interfaces for both the historian and WebUI component within the ObX Admin Tool is required.

### Web Dashboard Config

This configuration is for assigning IP address where ObX WebUI component was installed.&#x20;

1. Open ObX Admin Tool.
2. From the top menu, click on `Admin Tool` and select the `Web Dashboard config`, this will open the WebUI Configuration window.
3. On the IP address, simply input the IP address where ObX WebUI components is installed.
4. Click on `Test Connection` to check if you have a connection to the IP address you have inputted.
5. A message will tell you if it was successful or have any issue.

{% hint style="info" %}
If ObX historian and WebUI component are installed on the same computer, simply set the IP address to `localhost` (which is the default value) in the WebUI Configuration.
{% endhint %}

### Datasource Config

This configuration pertains to the allocation of an IP address for the installation location of the ObX historian component. Unlike the straightforward input of the IP address of the WebUI component computer in the Web Dashboard Config, in the datasource configuration, you must specify the precise IP address of your computer within the network. This involves selecting from a list of existing IPv4 addresses available on your computer, presented in a selection field.

1. Open the ObX Admin Tool
2. From the top menu, click on `Admin Tool` and select `Datasource Config`
3. This will open the Datasource configuration window.
4. Please ensure that you select the IP address of your computer for communication between the ObX historian and WebUI component. This IP address must be selected specifically to facilitate seamless interaction between the two components.
5. Click Save

{% hint style="info" %}
If the ObX WebUI and ObX Historian is installed on the same computer, simply set the IP address of Datasource config to `localhost`
{% endhint %}

<figure><img src="/files/riSJiYVpHwaxGqppFOKy" alt=""><figcaption><p>Setting the WebUI Dashboard and Datasource config</p></figcaption></figure>

## Adding Datasource

Datasources function akin to databases, serving as repositories for storing and archiving data as necessary. They are particularly useful for segregating various types of data, such as those associated with specific systems (e.g., ABB, Yokogawa, Honeywell) or categorized by site locations (e.g., Site 1, Site 2). Employing different datasources allows for efficient organization and separation of data according to distinct criteria.

{% hint style="info" %}
You can add as many datasources that fits your requirements. :thumbsup:
{% endhint %}

1. Open the ObX Admin Tool
2. From left side bar, click on Datasources
3. Right click on Datasources and select `Add Datasource`
4. Enter the name of the Datasource *(no special character and space, you may use underscore `_`  as space)*
5. Click OK.
6. A successful message will notify you the the datasource was added.

<figure><img src="/files/hhToFojZURSmAF62D7tM" alt=""><figcaption><p>Adding a Datasources</p></figcaption></figure>

{% hint style="warning" %}
You cannot edit the name of the Datasource, so make sure you have input the right name of the specific datasource.
{% endhint %}

### Data Retention

By default, when you create a new datasource, its data retention is limited to 7 days. Depends on your existing license, you may increase or decrease the data retention of specific datasource.

{% hint style="info" %}
If you are using a demo license, the maximum data retention will only be 7 days and you cannot edit retention duration. Simply load a production license to edit it (if needed).
{% endhint %}

1. Open the ObX Admin Tool
2. From left side bar menu, expand `Datasources` tab.
3. From the list of datasources, click the name of the datasource you want to change its retention.
4. From the `Info Tab` -> under `Data Retention` -> `Duration`, select the desired duration for the specific datasource.
5. Click Save.
6. A successful message will notify you.

<figure><img src="/files/0EkJqs5eGZ9UCOiAlmVl" alt=""><figcaption><p>Changing data retention of a datasource</p></figcaption></figure>

{% hint style="danger" %}
When reducing the duration of data retention, the system will automatically purge data that exceeds the newly specified duration. For instance, if you originally stored 3 years of data and your retention policy was set to 3 years, then you adjusted it to 1 year, the system will delete data older than 1 year, effectively removing 2 years' worth of data. It's essential to exercise caution when shortening the retention period to avoid unintended data loss.
{% endhint %}

{% hint style="success" %}
Increasing the duration of data retention will have no effect on your existing data, and will automatically applied the duration you have set on the specific datasource.
{% endhint %}

## Deleting a Datasource

Deleting a datasource is pretty straightforward.

1. Open the ObX Admin Tool.
2. From the left side bar menu, expand the `Datasource` tab.
3. From the list of datasource, select the datasource you want to delete.
4. Right-click and select `Delete Datasource`.
5. A confirmation delete dialog will open. Type in the word `delete`

<figure><img src="/files/GF521REz4OKvaHzU5OxP" alt=""><figcaption><p>Deleting a datasource</p></figcaption></figure>

## Adding Users

User management is a critical component of any platform. The ObX Admin Tool facilitates the creation of users with varying levels of access privileges to a designated data source. These users serve as the authentication credentials for all ObX clients seeking access to data from said source.

There are three types of users when accessing the datasources inside the ObX historian.

| User Type     | Description                                                               | Privilege         |
| ------------- | ------------------------------------------------------------------------- | ----------------- |
| Excel Report  | A user used to connect to a datasource via the ObX Excel addin component. | read              |
| ObX Collector | A user used by ObX collector to push process data (tags) to a datasource. | write             |
| API           | A user used to connect to a datasource via a 3rd party systems.           | read or/and write |

{% hint style="info" %}
Make sure to create specific users for different user Types, there is no limit to the number of users you want to create.
{% endhint %}

### Create Excel Report User

1. Open the ObX Admin Tool.
2. From the left side bar menu, click and expand the `Users` tab.
3. Click on the user `Type` you want to add ( Excel Report, ObX Collector or API), then right-click -> `Add User`
4. An `Add User` windows will open, fill all required fields (username, password and password confirm)
5. In the bottom, a list of existing datasources is listed, check on the column `Grant`, where you want to give `read` privilege on the user you want to add.  You can check as many as you want.
6. Click `Create` button.
7. Repeat the steps to add more Excel Report user.

<figure><img src="/files/yEWJkKbgACb5LmmVSEcL" alt=""><figcaption><p>Creating Excel User</p></figcaption></figure>

{% hint style="info" %}
In the production license, it is required to have `Excel Addin` license features to create an Excel Report user. However, a demo license is a fully featured license, so you can create as many as you want.
{% endhint %}

{% hint style="warning" %}
You cannot edit the username of the user, so make sure you have input the right username.
{% endhint %}

### Create ObX Collector User

1. Open the ObX Admin Tool
2. From the left side bar menu, click and expand the `Users` tab.
3. Click on the user `Type` you want to add ( Excel Report, ObX Collector or API), then right-click -> `Add User`
4. An `Add User` windows will open, fill all required fields (username, password and password confirm)
5. In the bottom, a list of existing datasources is listed, check on the column `Grant`, where you want to give `write` privilege on the user you want to add.  You can check as many as you want.
6. Click `Create` button.
7. Repeat the step to add more ObX collector user.

<figure><img src="/files/xsDw5zdvjMnHyGDzMk8B" alt=""><figcaption><p>Creating ObX Collector User</p></figcaption></figure>

{% hint style="warning" %}
You cannot edit the username of the user, so make sure you have input the right username.
{% endhint %}

### Create API User

1. Open the ObX Admin Tool
2. From the left side bar menu, click and expand the `Users` tab.
3. Click on the user `Type` you want to add ( Excel Report, ObX Collector or API), then right-click -> `Add User`
4. An `Add User` windows will open, fill all required fields (username, password and password confirm)
5. In the bottom, a list of existing datasources is listed, check on the column `Grant`, where you want to give privilege on the user you want to add.  You can check as many as you want.
6. In the privilege column select wether to give `read, write or all` for this specific user on a specific datasource.
7. Click `Create` button.
8. Repeat the step to add more ObX API user.

<figure><img src="/files/44Q9Ouq8dV9DHqjACNAE" alt=""><figcaption><p>Adding an API User</p></figcaption></figure>

{% hint style="info" %}
In the production license, it is required to have `API` license features to create an API user. However, a demo license is a fully featured license, so you can create as many as you want.
{% endhint %}

## Deleting Users

Deleting a user is pretty straightforward.

1. Open the ObX Admin Tool
2. From the left side bar menu, expand the `Users`tab.
3. From the list of `Users`, select the user you want to delete.
4. Right-click and select `Delete User`.

<figure><img src="/files/4hkp2NqpwcjKNu1NmBTF" alt=""><figcaption><p>Delete Users</p></figcaption></figure>

## Changing User Password

1. Open the ObX Admin Tool.
2. From the left side bar menu, expand the `Users` tab.
3. From the list of `Users`, select the user you want to edit.
4. From the `Info Tab`, click / check the `Change Password` , this will enable the input for passwords.
5. Input valid passwords in the field.
6. Click `Save` button.

<figure><img src="/files/ldDo64unXHGZBgzDizow" alt=""><figcaption><p>Changing User password</p></figcaption></figure>

## Changing User Grant / Privilege

1. Open the ObX Admin Tool.
2. From the left side bar menu, expand the `Users` tab.
3. From the list of `Users`, select the user you want to edit.
4. From the `Info Tab`, check / uncheck the on the Grant column for the database you want to give or revoke grant to the selected user.
5. Click `Save` button.
6. A confirmation dialog will open, just confirm.

<figure><img src="/files/x95mq40ZEqfQvViBRyT4" alt=""><figcaption><p>Check / Uncheck Grant column</p></figcaption></figure>

## Adding Calculation Tags

Calculation tags enable the creation of custom tags that produce outputs determined by mathematical functions or equations. These functions utilize the JavaScript Math libraries for computation. For more information about the Math libraries, you can read it [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math).

{% hint style="info" %}
In production license, you must have a `Calculation Engine` license in order to add a calculation tag. However, in a demo license you can add as many as you want.
{% endhint %}

1. Open the ObX Admin Tool.
2. From the left side bar menu, expand the CAL TAGS tab.
3. Click on a datasource where you want store the calculation tag, and right-click -> `Add Cal Tags`
4. From the new open window, input a valid value for each field. (Tagname, description, engmax, engmin, unit)
5. Define the formula by drag and drop any tags available in Variables (bottom part of the window). If you can't see any tags in the variables, click on `add button` and select necessary tags you want to add in the Variables.
   1. Select the Datasource in the window, a list of tags will be listed after you selected a datasource.
   2. Double-clicking the tag name will automatically add the tag in the Variables.
6. Once you define the formula, click the `Test Formula` button to check if you have any syntax error in your formula. A message will notify you that it is valid or not.
7. Click the `Create Cal` button to create a tag.

<figure><img src="/files/6YlQqw2WbubUHtLWVhMn" alt=""><figcaption><p>Adding CAL tags</p></figcaption></figure>

{% hint style="info" %}
In technical terms, a CAL tag can be generated using a fixed equation, such as the example formula: 1000\*10/2.5. This type of equation is functional but lacks dynamic adaptability to real-world scenarios. To incorporate specific tag values into equations, like (tag1 \* tag2 / tag3), it necessitates pre-existing tags within the ObX historian system. The process of introducing new tags is facilitated through the [ObX collector](/obx-r3-manual/backend-engineering/obx-collector.md).
{% endhint %}

## Organizations

Organizations are comprised of users, data sources, dashboards, and alarms. While each organization may possess a unique combination of these elements, they all utilize a singular instance of the ObX WebUI component. This functionality, commonly referred to as **`multi-tenancy`**, is particularly prevalent in cloud environments, enabling multiple organizations to share a single instance of the WebUI component.

Organizations are part of the WebUI component, it is where you create your Dashboards and Alarms via a web based application. We will talk about it more on the [front-end engineering](/obx-r3-manual/front-end-engineering.md).

{% hint style="info" %}
The concept of Multi-Organizations entails the creation of distinct resource allocations tailored for various applications, such as energy management, IoT, etc. This may involve segmentation based on different systems like Yokogawa, ABB, Honeywell, etc., or it could revolve around organizing by plant sites, denoted as Site1, Site2, etc. The categorization and segregation of applications within Multi-Organizations are flexible and depend on specific organizational needs and objectives.
{% endhint %}

### Adding an Organization

By default, **ObX** Organization is already added upon installation of ObX WebUI. Of course you can rename this with your preferred name.

{% hint style="info" %}
In production license, to add more than one(1) organization, you must have a `multi-organization` license. However the demo license contains multi-organization with up to three(3) organization to add.&#x20;
{% endhint %}

1. Open the ObX Admin Tool
2. From the left bar menu, click the `Organizations`.
3. Right-click on `Organizations` -> `Add Organization.`
4. Enter the name of the Organization.
5. Click OK.

<figure><img src="/files/Xoo0zqqYIUeBYKsMSZyi" alt=""><figcaption><p>Adding Organization</p></figcaption></figure>

### Renaming Organization

Renaming of Organization is pretty straightforward.

1. Open the ObX Admin Tool.
2. From the left bar menu, expand the `Organizations` tab.
3. Select the Organization name and Righ-click -> `Rename Organization`.
4. Enter a new name of the Organization.
5. Click OK.

<figure><img src="/files/KcwQhwvy5g225mfnQ95W" alt=""><figcaption><p>Renaming Organization</p></figcaption></figure>

### Deleting an Organization

1. Open the ObX Admin Tool.
2. From the left bar menu, expand the `Organizations` tab.
3. Select the Organization name and Righ-click -> `Delete Organization`.
4. A confirmation dialog will prompt you for confirmation.
5. Click Yes.

<figure><img src="/files/ykBUoLfcU5QDK36krHoY" alt=""><figcaption><p>Deleting Organization</p></figcaption></figure>

{% hint style="warning" %}
You cannot delete all Organizations, you must retain at least one(1) organization of each WebUI component instance.
{% endhint %}


---

# 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://obx-organization.gitbook.io/obx-r3-manual/backend-engineering/obx-backend-engineering.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.
