In Service Studio you can use entities that are exposed by another eSpace or Extension, called, in this context, a Producer. Simply add these entities as eSpace references (Is an element exposed by a Producer eSpace or extension that, when referenced by a Consumer eSpace, is called an eSpace reference in its context. Once an eSpace reference, e.g. an action or entity, is added, you can use it anywhere in the Consumer eSpace but you cannot change its definition.) for your eSpace, called, in this context, a Consumer eSpace.

How to add an entity reference:

  • In the consumer eSpace, launch the Add/Remove References window, select the producer eSpace or Extension in this window and then check the entity that you want.

In this window, you can add two special types of entities, by selecting:

    • (System) eSpace: Contains the system entities. Learn more about system entities.

    • ForeignEntities extension: Contains the entities declared as Foreign Entities in versions lower than OutSystems Hub Edition 3.1. Learn more about foreign entities.

How entity references are handled

Once an entity is added as a reference in the Consumer eSpace, you can use it like any other entity originally created in your eSpace with the difference that you cannot change its definition.

The entities added as references in the Consumer eSpace remain in their Producer repository. If the producer is an eSpace, the entities remain stored in this eSpace repository. If the producer is an extension, the entities remain stored in the repository specified in this extension, which could be a different table in the OutSystems Hub Database or in a different database.

To manage the entity data you have automatically access to all entity actions: Create, CreateOrUpdate, Update, Get, GetForUpdate and Delete. These entity actions are executed in the context of the Consumer eSpace. See how action references are executed.

If the entity has no primary key, only the Create action is available.

Single and Multi-tenant entities

If the entity is single-tenant, then all the data managed by the Producer and the Consumers is stored in the Producer repository and shared and visible to any eSpace.

If the entity is multi-tenant, OutSystems Service Studio guarantees data isolation between the Producer eSpace and its Consumers. The entity is stored in the Producer repository but each Consumer has its own tenant identifier. Therefore you can have the data segmented by tenant. See how to manage multi-tenant entities.

See Also

eSpace References | Add / Remove eSpace References | Expose an Entity | Use a System Entity | Use a Foreign Entity