-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Align exchanges with spec workflows #25
Comments
I think an important piece of this is issue is to align how the existing ExchangeDefinition in the implementation with the new Create Workflow request body
|
Another key piece is how to modify the existing entities.
Workflow Entity
WorkflowStep EntityNote: workflowStep could be a new entity, but it could also be a simple Type and persisted as
Exchange Entity
ExchangeStep EntityThis is a rename of the |
Here is how I envision how I envision some of the sequences with the above entities would look. Entity DesignThe Workflow and Exchange entities are separate aggregates. Workflows have methods ( graph TD
subgraph Workflow Aggregate
WorkflowEntity[WorkflowEntity]
end
subgraph Exchange Aggregate
ExchangeEntity[ExchangeEntity]
ExchangeStepEntity[ExchangeStepEntity]
ExchangeEntity --> ExchangeStepEntity
end
Create a new ExchangeThis is after the workflow has been created already and someone calls sequenceDiagram
participant ws as WorkflowService
participant wr as WorkflowRepository
participant er as ExchangeRepository
participant we as WorkflowEntity
participant ee as ExchangeEntity
ws ->> wr: retrieve workflow entity
ws ->> we: call WorkflowEntity.getFirstStep
we -->> ws: return WorkflowStep Value Object
ws ->> ee: call ExchangeEntity constructor, passing the WorkflowStep
ee ->> ee: ExchangeEntity constructor includes new ExchangeStepEntity
ee -->> ws: return new ExchangeEntity
ws ->> er: persist new ExchangeEntity (which also persists the ExchangeStep)
Participate in ExchangeThis is triggered by a call to sequenceDiagram
participant ws as WorkflowService
participant wr as WorkflowRepository
participant er as ExchangeRepository
participant we as WorkflowEntity
participant ee as ExchangeEntity
participant ese as ExchangeStepEntity
ws ->> er: retrieve exchange entity
ws ->> wr: retrieve workflow entity
ws ->> we: call getNextStep(exchangeEnity.currentStep)
we -->> ws: return next WorkflowStep
ws ->> ee: call participate(nextWorkflowStep, presentation, verifier)
ee ->> ese: call processPresentation
ee ->> ee: based on processing result, create new step in exchange
ws ->> er: persist updated ExchangeEntity (which also persists all the ExchangeSteps)
ee ->> ese: call getStepResponse()
ee -->> ws: return ExchangeResponse
Get Exchange ResponseThis is a response to a call to sequenceDiagram
participant ws as WorkflowService
participant wr as WorkflowRepository
participant er as ExchangeRepository
participant we as WorkflowEntity
participant ee as ExchangeEntity
participant ese as ExchangeStepEntity
ws ->> er: retrieve exchange entity
ws ->> wr: retrieve workflow entity
ws ->> ee: call getResponse()
ee ->> ese: call getStepResponse()
ee -->> ws: return ExchangeResponse
|
The VC API spec has introduced a new workflows section: https://w3c-ccg.github.io/vc-api/#workflows-and-exchanges
This implementation has an exchanges features.
Aligning this implementation to the spec would:
Definition of done
Endpoint translation
The text was updated successfully, but these errors were encountered: