Used links are stored directly in the Activity model object as an array. We have added an additional flag that marks a used entity as "executed" for display purposes.
wasGeneratedBy links are stored for each version of each Entity. Thus you update the entity with the activity id that generated it. You can ask the entity service which activity generated it, and conversely you can ask the activity service what entity versions were generatedBy a given activity.
The following table describes how provenance effects the current Entity CRUD API:
URL | HTTP Type | Description |
---|---|---|
/entity?generatedBy={activity id} | POST | Creates a new entity and creates a generatedBy connection to the provided activity.
|
/entity/{id}?generatedBy={activity id} | PUT | Updates the entity and creates a generatedBy connection from the current version of the entity to the provided activity. Set activity id to -1 to delete generatedBy connection.
|
/entity/{id}/version?generatedBy={activityId} | PUT | Creates a new version of a given version-able entity and creates a generatedBy connection to the provided activity. Set activity id to -1 to delete generatedBy connection.
|
/entity/bundle?generatedBy={activityId} | POST | Creates a new EntityBundle and creates a generatedBy connection to the provided activity. Set activity id to -1 to delete generatedBy connection.
|
/entity/bundle?generatedBy={activityId} | PUT | Updates an EntityBundle and creates a generatedBy connection to the provided activity. Set activity id to -1 to delete generatedBy connection.
|
The following are new suffixes on the Entity services for Provenance.
URL | HTTP Type | Description |
---|---|---|
/entity/{id}/generatedBy | GET | Returns the activity that generated the current version of the entity.
|
/entity/{id}/version/{versionNumber}/generatedBy | GET | Returns the activity that generated the specific version of the entity.
|
/entity/{id}/generatedBy?generatedBy={activityId} | PUT | Updates the 'generatedBy' information of the current version of the entity, connecting it to 'activityId'. Outside the transaction of entity CRUD.
|
/entity/{id}/generatedBy | DELETE | Removes the generatedBy connection from the current version of the entity. |
The following table describes the new methods for performing CRUD on Activity objects.
URL | HTTP Type | Description |
---|---|---|
/activity | POST | Creates a new activity object. |
/activity/{activityId} | GET | Returns the specified activity.
|
/activity/{activityId} | PUT | Updates the specified activity.
|
/activity/{activityId} | DELETE |
|