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 | ||||||
---|---|---|---|---|---|---|---|---|
/ | entityPOST | Creates a new entity | and links it to a new UNDEFINED activity./entity?activityId?generatedBy={activity id} | POST | new version then a new UNDEFINED activity is created and linked with the new versionCreate Creates a new entity and links itcreates a generatedBy connection to the provided activity *. | /entity/{id} | PUT | Updates the entity. If the entity is version-able and the update results in a
|
/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}/versionPOST?generatedBy={activityId} | PUT | Creates a new version of a given version-able entity and links it to a new UNDEFINED activitycreates a generatedBy connection to the provided activity. Set activity id to -1 to delete generatedBy connection.
| ||||||
/entity/{id}/version?activityIdbundle?generatedBy={activityId} | POST | Creates a new version of a given version-able entity and links itEntityBundle 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.
|
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 | GET | Returns the activity that generated | (aka links to) the current version of | the specified entitythe entity.
|
/entity/{id}/version/{versionNumber}/ | activitygeneratedBy | GET | Returns the activity that generated | (aka links to) the specific version of the entity.
| |
/entity/{id}/ | activitygeneratedBy?generatedBy={activityId} | PUT | Links the specified entity to the provided activityUpdates the 'generatedBy' information of the current version of the entity, connecting it to 'activityId'. Outside the transaction of entity CRUD.
| ||
/entity/{id}/ | version/{versionNumber}/activityPUT | Links the specifiedgeneratedBy | DELETE | Removes the generatedBy connection from the current version of the entity | to the provided activity. |
...
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 |
|