> For the complete documentation index, see [llms.txt](https://bpmflow.gitbook.io/project/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bpmflow.gitbook.io/project/engineering-models/4+1-architecture-models/logical-view/bpm-environments-or-tenants.md).

# BPM Environments or Tenants

An **Environment** is a collection of **Applications** and **Users**. An **Application** has a collection of **Bpm Processes Definitions, Roles** and **Forms**. And a **User** has a collection of **Roles**.

**BpmFlow** can work in two different modes with **Environments**:\
**1- Users Multi Environment**\
Users are enabled to be part of more than one **environment** and at login time the user has to select the environment to work with. \
This mode is used in **Governments** when each environment represent a **Ministry** and a user can work on more than one **Ministry**. \
It is also used when the same people run two different companies and each **environment** is a company. A user has to have access to all companies.\
The user must select an **Environment** at login time. Once the user is logged the **Environment** is stored in the user web session. In order to work with other **Environment** the user has to **logout** and **login** in a different **Environment**. As it is shown in the below figure a user can have access to more than one **Environment**.\
\
**2- Users Single Environment** \
Users are only enabled to be a part of only one **environment** and at login time there is **no** need to select the **environment**.\
This mode is used in **SaaS** (software as a service) installations where each **environment** is a different company and companies do not have relations with each other (users only access to one company). In this case an administrator set the **environment** for each user and at login time is **not** necessary to select the **environment**.\
In this mode there is an **exception** where **admin users** can be part of more than one environment. These admin users do the configuration of the **SasS** installation.\
Once the user is logged the system detect its **Environment** and store it in the user web session.&#x20;

This configuration has to be set immediately after the installation by a system administrator:\
`BpmEnvironment  areUsersMultiEnvironment: true. "for option one"`\
`BpmEnvironment  areUsersMultiEnvironment: false. "for option two"`

![User multi environment diagram](https://3974112602-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LH4gGgyMb1_fhOg782r%2F-LMEXOa184wyPnUs5rUt%2F-LMEXRufVwVI-4vYtWAz%2Fenvironments-arq-01.png?alt=media\&token=31b0a6bd-5618-44be-9f4b-6808cdf9d50e)

**Application names** are global to the whole **System** (including **Environments**). Two **Applications** even in different **Environments** can **not** have the same name.

To checkout all objects affected by **Environments** search *implementors* and *senders* of `bpmEnvironment` **method**.
