Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Activity

...

TypeDescription
UNDEFINED(Default) The user has not specified details for the Activity
MANUAL

The user manually generated the wasGeneratedBy entities of this Activity

CODE EXECUTIONThe 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}POSTCreate

Creates a new entity and

links it

creates a generatedBy connection to the provided activity.

  • Error Codes
    • 403 - Unauthorized assignment of activity. You must be the creator of the activity to connect it to an entity
    • 404 - If activityId is not found.
/entity/{id}?activityIdgeneratedBy={activity id}PUT

Updates the entity and

links

creates a generatedBy connection from the current version of the entity to the provided activity. Set activity id to -1 to delete generatedBy connection.

  • Error Codes
    • 403 - Unauthorized assignment of activity. You must be the creator of the activity to connect it to an entity
    • 404 - If activityId is not found.
/entity/{id}/version?activityIdgeneratedBy={activityId}POSTPUT

Creates a new version of a given version-able entity and

links it

creates a generatedBy connection to the provided activity. Set activity id to -1 to delete generatedBy connection.

  • Error Codes
    • 403 - Unauthorized assignment of activity. You must be the creator of the activity to connect it to an entity
    • 404 - If activityId is not found.
/entity/bundle?generatedBy={idactivityId}/activityGETReturns 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.

  • Error Codes
    • 403 - Unauthorized assignment of activity. You must be the creator of the activity to connect it to an entity
    • 404 - If activityId is not found.
/entity/{id}/version/{versionNumber}/activityGETReturns 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.

  • Error Codes
    • 403 - Unauthorized assignment of activity. You must be the creator of the activity to connect it to an entity
    • 404 - If activityId is not found.

 

Provenance Additions to the API

Additions to Entity API

The following are new suffixes on the Entity services for Provenance.

activityLinks the activity to this entityCreates a new activity and links it to this version/activityLinks the activity to this Returns the activity linked to the current version of the specified entityversion/{versionNumber}/activityReturns the activity linked to this specific

URL

HTTP Type

Description

/entity/{id}/generatedByPOSTCreates a new activity and links it to this entity./entity/{id}/activityPUTGET

Returns the activity that generated the current version of the entity.

  • Error Codes
    • 404 - If the entity is not connected to an activity.
/entity/{id}/version/{versionNumber}/generatedByGET

Returns the activity

POST

that generated the specific version of the entity.

  • Error Codes
    • 404 - If that version of the entity is not connected to an activity.
/entity/{id}/generatedBy?generatedBy={activityId}PUT

Updates the 'generatedBy' information of the current version of the entity

/entity/{id}/activityGET

, connecting it to 'activityId'. Outside the transaction of entity CRUD.

  • Error Codes
    • 403 - Unauthorized assignment of activity. You must be the creator of the activity to connect it to an entity
    • 404 - If activityId is not found.
/entity/{id}/GETgeneratedByDELETE

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.

PUTUpdates Only the creator of an activity may update it.Returns the specified (aka links to)

URL

HTTP Type

Description

/activityPOST

Creates a new activity object.

/activity/{activityId}GET

Returns the specified activity.

/activity/{activityId}GET

  • Error Codes
    • 403 - Unauthorized access of activity. READ access is permitted if you can see a single entity that was generated by
    • this activity.
    • 404 - If activityId is not found.
/activity/{activityId}DELETEPUTDelete

Updates the specified activity.

  • Error Codes
    • 403 - Unauthorized update of activity.
Only
    • You must be the creator of
an activity may delete it
    • the activity to modify it.
    • 404 - If activityId is not found.
/activity/{activityId}DELETE
  • Error Codes
    • 403 - Unauthorized delete of activity. You must be the creator of the activity to modify it.
    • 404 - If activityId is not found.