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 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 Platform 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 Platform Database or in a different database.

To manage the entity records you have the following entity actions:

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, 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

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