Activity
...
Type | Description |
---|---|
UNDEFINED | (Default) The user has not specified details for the Activity |
MANUAL | The user manually generated the wasGeneratedBy entities of this Activity |
CODE EXECUTION | The user executed code that generated the wasGeneratedBy entities of this Activity |
...
Model
- id - unique id for the Activity(string)
- name - (string)
- description - (string)
- used - Array of UsedEntity objects. UsedEntity stores a Reference to an Entity (id & version) and a flag if this entity was "executed" as part of the Activity
- etag - optimistic concurrency flag. Changes with each update (string)
- createdOn
- modifiedOn
- createdBy
- modifiedBy
Used & GeneratedBy
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.
Modifications to the current Entity API
The following table describes how provenance effects the current Entity CRUD API:
...
URL | HTTP Type | Description | |
---|---|---|---|
/entity?activityIdgeneratedBy={activity id} | POST | Create Creates a new entity and links itcreates a generatedBy connection to the provided activity.
| |
/entity/{id}?activityIdgeneratedBy={activity id} | PUT | Updates the entity and linkscreates 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?activityIdgeneratedBy={activityId} | POSTPUT | Creates a new version of a given version-able entity and links itcreates a generatedBy connection to the provided activity. Set activity id to -1 to delete generatedBy connection.
| |
/entity/bundle?generatedBy={idactivityId}/activity | GET | Returns the activity that generated (aka links to) the current version of the specified entityPOST | Creates a new EntityBundle and creates a generatedBy connection to the provided activity. Set activity id to -1 to delete generatedBy connection.
|
/entity/{id}/version/{versionNumber}/activity | GET | Returns the activity that generated (aka links to) the specific version of the entity. |
OR
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.
|
Provenance Additions to the API
Additions to Entity API
The following are new suffixes on the Entity services for Provenance.
URL | HTTP Type | Description | |||||
---|---|---|---|---|---|---|---|
/entity/{id}/ | activitygeneratedBy | POST | Creates a new activity and links it to this entity. | /entity/{id}/activity | PUT | Links the activity to this entityGET | Returns the activity that generated the current version of the entity.
|
/entity/{id}/version/{versionNumber}/generatedBy | GET | Returns the activity | POST | Creates a new activity and links it to thisthat generated the specific version of the entity.
| |||
/entity/{id}/ | version/activitygeneratedBy?generatedBy={activityId} | PUT | Links the activity to thisUpdates the 'generatedBy' information of the current version of the entity | /entity/{id}/activity | GET | Returns the activity linked to the current version of the specified entity, connecting it to 'activityId'. Outside the transaction of entity CRUD.
| |
/entity/{id}/ | version/{versionNumber}/activityGET | Returns the activity linked to this specificgeneratedBy | DELETE | Removes the generatedBy connection from the current version of the entity. |
...
Activity API
The following table describes the new methods for manipulating the versions of a version-able entityperforming CRUD on Activity objects.
URL | HTTP Type | Description | ||||
---|---|---|---|---|---|---|
/activity | POST | Creates a new activity object. | ||||
/activity/{activityId} | PUTGET | UpdatesReturns the specified activity. | Only the creator of an activity may update it./activity/{activityId} | GET | Returns the specified
| (aka links to)
|
/activity/{activityId} | DELETEPUT | Delete Updates the specified activity.
| ||||
/activity/{activityId} | DELETE |
|