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 Entity CRUD API:
URL | HTTP Type | Description | |||
---|---|---|---|---|---|
/entity?generatedBy={activity id} | POST | Creates a new entity | of the given entity. This will create a new "Undefined" activity/entity | GET | Get a list of all entities of the given type: entity. For version-able entity types, this will list the current version of each entity of that typeand creates a generatedBy connection to the provided activity.
|
/entity/{id}?generatedBy={activity id} | GETPUT | Get an entity using its type and id. For version-able entities this will returnUpdates the entity and creates a generatedBy connection from the current version of the entity | ./entity/{id} | PUT | Update the entity identified by type and id. For a version-able entity this will update the current version of the entityto the provided activity. Set activity id to -1 to delete generatedBy connection.
|
/entity/{id}/version?generatedBy={activityId} | DELETE | Delete the entity identified by type and id. For a PUT | Creates a new version of a given version-able entity | this will delete the entity and all versions of the entityand creates a generatedBy connection to the provided activity. Set activity id to -1 to delete generatedBy connection.
| |
/entity/bundle?generatedBy={ | idactivityId} | /annotationsGET | Get the annotations for the entity identified by type and id. For a version-able entity this will return the annotations of the current entityPOST | 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={ | idactivityId} | /annotationsPUT | Update the annotations for the entity identified by type and id. For a version-able entity this will update the annotations of the current entity. |
...
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 table describes the new methods for manipulating the versions of a version-able entityare new suffixes on the Entity services for Provenance.
URL | HTTP Type | Description | |
---|---|---|---|
/{versionable-entityType}entity/{entityIdid}/versiongeneratedBy | POST | Create a new version of a given version-able entity. The user should provide a versionLabel and Synapse will auto-generate a new versionNumber. When this called on a version-able entity, the annotations of the current entity will be copied and applied to the newly created version. | |
/{versionable-entityType}/{entityId}/version | GET | Returns a list of all versions of this entity. This will be a paginated list with a default sort on versionNumber descending | |
/{versionable-entityType}/{entityId}/version/{versionNumber} | GET | Get a particular version of a version-able entity using the given id and version number. | |
/{versionable-entityType}/{entityId}/version/{versionNumber} | PUT | Not supported! Only the current version of an entity can be updated using the existing API. | |
/{versionable-entityType}/{entityId}/version/{versionNumber} | DELETE | Delete a particular version of a version-able entity using the given id and version number. | |
/{versionable-entityType}/{entityId}/version/{versionNumber}/annotations | GET | Get the annotations of a particular version of a version-able entity using the given id and version number. | |
/{versionable-entityType}/{entityId}/version/{versionNumber}/annotations | PUT | Not Supported! You can only change the annotations of the current versionGET | 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. |
Activity API
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 |
|