How to share entity data between solutions
A how-to guide for sharing entity data between solutions.
Introduction
Would you like to share data between projects? Then share a persistent EntityDataStore between projects.
This guide refers to two Packhunt solutions:
- “Source” project: The project that created the persistent EntityDataStore initially. See the example configuration below:
my-source-entity-data-store:
kind: EntityDataStore
persistToStore: my-source-store-name
properties:
property-1:
type: Number
- “Current” project: The project that is using the EntityDataStore created in the source project, which you’ll edit following the steps below.
Prerequisites
- You have a working source project containing a persistent
EntityDataStore
. - You have a working current project, but it’s not yet using the entities from the source project.
- To access an EntityDataStore in another project, you (and any other users) need at least “can use” permission to both projects.
1. Add an entity datastore to the current project
To access data in the entity datastore in the source project, configure an EntityDataStore
in your current project.
- Add an entity datastore with
kind: EntityDataStore
. - Define the
properties
of your entity datastore.
❗The properties
of the source and current EntityDataStore
s should be the same.
The configuration should look similar to the example below:
my-entity-data-store:
kind: EntityDataStore
properties:
property-1:
type: Number
2. Define the store name
- Define the store name with the source store name using the
persistToStore
property.
The configuration should look similar to the example below:
my-entity-data-store:
kind: EntityDataStore
persistToStore: my-source-store-name
properties: ...
3. Define the project
- Specify the name of the project containing the entity datastore with the
persistToProject
property.
The configuration should look similar to the example below:
my-entity-data-store:
kind: EntityDataStore
persistToStore: my-source-store-name
persistToProject: my-source-solution
properties: ...
💡 You can use the entities in the Model
, ControlPanel
and EntityTable
as usual by subscribing these blocks to the shared EntityDataStore
.
Configuration
See the entity data store configuration docs.