diff --git a/CHANGELOG.md b/CHANGELOG.md index 2707a34485..03358af972 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ _**For better traceability add the corresponding GitHub issue number in each cha - XXXX added workflow to import testdata ### Changed +- #1108 Rework of data sov documentation - #1070 Correct semantic model in dev/README.md - #1070 Update documentation artefacts according to TRG 1 - Documentation - #1070 Convert png to svg according to TRG 1.04 - Diagrams as code / Editable static files diff --git a/docs/concept/#638-contractagreement-admin-view/get-all-contracts-sequenceflow.puml b/docs/concept/#638-contractagreement-admin-view/get-all-contracts-sequenceflow.puml deleted file mode 100644 index 263be59575..0000000000 --- a/docs/concept/#638-contractagreement-admin-view/get-all-contracts-sequenceflow.puml +++ /dev/null @@ -1,50 +0,0 @@ -@startuml -title - ==POST api/contracts/request -end title - -autonumber "[00]" - -participant "Trace-X Frontend" as FE order 0 -participant "Trace-X Backend" as BE order 1 -participant "Trace-X Database" as DB order 2 -participant "EDC" as EDC order 3 - -FE -> BE: POST api/contracts/request (limit, offset, sort, filter) - -activate BE -BE -> DB: Fetch requested distinct contractAgreementIds -activate DB -autonumber stop -DB --> BE: List(contractAgreementIds) -autonumber resume -deactivate DB - -BE -> EDC: POST tx-edc/management/v2/contractagreements/request \nfiltered by contractAgreementIds -activate EDC -autonumber stop -EDC --> BE: JSON response -autonumber resume -deactivate EDC -BE -> BE: Extract contractSigningDate, policy -activate BE -deactivate BE - -loop for all contractAgreementIds -BE -> EDC: GET tx-edc/management/v2/contractagreements/{contractAgreementId}/negotiation -activate EDC -autonumber stop -EDC --> BE: JSON response -autonumber resume -deactivate EDC -BE -> BE: Extract id, counterPartyAddress, state -activate BE -deactivate BE -end - -autonumber stop -BE --> FE: JSON response -autonumber resume -deactivate BE - -@enduml diff --git a/docs/concept/#638-contractagreement-admin-view/get-all-contracts-sequenceflow.svg b/docs/concept/#638-contractagreement-admin-view/get-all-contracts-sequenceflow.svg index 1f1438577f..bc3c66354c 100644 --- a/docs/concept/#638-contractagreement-admin-view/get-all-contracts-sequenceflow.svg +++ b/docs/concept/#638-contractagreement-admin-view/get-all-contracts-sequenceflow.svg @@ -1,48 +1 @@ - - - - - - - - - - +Endpoint POST /contractsTrace-XFrontendTrace-XFrontendTrace-XBackendTrace-XBackendTrace-XDatabaseTrace-XDatabaseEDCEDC[01]POST contractsapi endpoint is pageable,filterable, limitable, sortable[02]fetch requested distinct contractAgreementIdslist of contractAgreementIds[03]POST edc/management/v2/contractagreements/requestfiltered by contractAgreementIdslist of contractAgreement objects[04]extract contractSigningDate, policyloop[for all contractAgreementIds][05]GET edc/management/v2/contractagreements/{contractAgreementId}/negotiationcontractAgreementNegotiation object[06]extract attributes of response (id, counterPartyAddress, state)pageable result of contractResponse objects \ No newline at end of file diff --git a/docs/concept/#638-contractagreement-admin-view/get-contract-sequenceflow.puml b/docs/concept/#638-contractagreement-admin-view/get-contract-sequenceflow.puml index 58f7d17114..05ceb7957b 100644 --- a/docs/concept/#638-contractagreement-admin-view/get-contract-sequenceflow.puml +++ b/docs/concept/#638-contractagreement-admin-view/get-contract-sequenceflow.puml @@ -1,47 +1,54 @@ @startuml title - ==GET api/contracts/{tx-assetId} + == Request ContractResponse (Contract Agreements) end title autonumber "[00]" - -participant "Trace-X Frontend" as FE order 0 -participant "Trace-X Backend" as BE order 1 -participant "Trace-X Database" as DB order 2 -participant "EDC" as TXEDC order 3 - -FE -> BE: GET api/contracts/{tx-assetId} - -activate BE -BE -> DB: Take contractAgreementId for tx-assetId -activate DB -autonumber stop -DB --> BE: contractAgreementId -autonumber resume -deactivate DB - -BE -> TXEDC: GET tx-edc/management/v2/contractagreements/{contractAgreementId} -activate TXEDC -autonumber stop -TXEDC --> BE: JSON response -autonumber resume -deactivate TXEDC -BE -> BE: Extract contractSigningDate, policy -activate BE +skinparam monochrome true +skinparam shadowing false +skinparam defaultFontName "Architects daughter" +skinparam linetype ortho + +participant "Trace-X \n Frontend" as FE order 0 +participant "Trace-X \n Backend" as BE order 1 +participant "Trace-X \n Database" as DB order 2 +participant "EDC \n ManagementAPI" as TXEDC order 3 + +FE -> BE: Request for ContractResponse +note left + GET /contracts by filterExpression +end note + +loop for each contract agreement + activate BE + BE -> DB: Query contractAgreementId for assetId + activate DB + DB --> BE: result contractAgreementId + deactivate DB + + BE -> TXEDC: GET contractagreements + note left + GET edc/management/v2/contractagreements/{contractAgreementId} + end note + activate TXEDC + TXEDC --> BE: return contract agreements + deactivate TXEDC + BE -> BE: Extract contractSigningDate, policy + activate BE + deactivate BE + + BE -> TXEDC: GET edc/management/v2/contractagreements/{contractAgreementId}/negotiation + activate TXEDC + TXEDC --> BE: Gets a contract negotiation with the given contract agreement ID + deactivate TXEDC + BE -> BE: Extract id, counterPartyAddress, state + activate BE + BE -> BE : Create ContractResponse + deactivate BE + +end loop + +BE --> FE: List of ContractResponses for filterExpression deactivate BE - -BE -> TXEDC: GET tx-edc/management/v2/contractagreements/{contractAgreementId}/negotiation -activate TXEDC -autonumber stop -TXEDC --> BE: JSON response -autonumber resume -deactivate TXEDC -BE -> BE: Extract id, counterPartyAddress, state -activate BE -deactivate BE - autonumber stop -BE --> FE: JSON response -deactivate BE - @enduml diff --git a/docs/src/docs/arc42/runtime-view/data-sovereignty/policy-management.adoc b/docs/src/docs/arc42/runtime-view/data-sovereignty/policy-management.adoc index 49fd9f8f19..1690702e6c 100644 --- a/docs/src/docs/arc42/runtime-view/data-sovereignty/policy-management.adoc +++ b/docs/src/docs/arc42/runtime-view/data-sovereignty/policy-management.adoc @@ -10,6 +10,17 @@ However, to be sure that data is shared only with companies that match one's req The policies used for sending and receiving notifications and parts have an identical data format, so they can be used for each process interchangeably. The processes itself are different and will be explained here: +== Policy Types +The EDC Connector MUST provide a possibility to restrict the access of a Data Asset to specific business partners by attribute(s), e.g., represented as a VC. +The Connector MUST restrict the data usage to partners and purposes for a specific use case. + +There are two policy types used. +* Access +* Usage + +As specified by the https://github.com/International-Data-Spaces-Association/ids-specification[Dataspace Protocol], one Data Asset MUST refer to at least one Usage Policy, expressed in ODRL. +For additional information refer to https://eclipse-tractusx.github.io/docs-kits/kits/Connector%20Kit/Adoption%20View/connector_kit_adoption_view[Connector KIT] + == Policies for sending and receiving parts [plantuml, target=data-sovereignty-publish-assets, format=svg] .... @@ -18,60 +29,88 @@ include::../../../../uml-diagrams/arc42/runtime-view/data-sovereignty/data-sover [cols="1,5"] |=== -|1, 2 -|Policies can be created by administrators at any time in the administration section of Trace-X. +|1 +|Policies can be created by User with role 'Admin' at any time in the administration section of Trace-X. The policy is created to later used for publishing assets in the current company context. + +|2 +|Policies are stored in the PolicyStore which is a shared component used by Trace-X [A] app and IRS for storing usage and access policies. |3 -|Parts can be imported at any time in the parts section of Trace-X. They will be stored locally at first. +|Policy is created in the policy store. |4 -|Before connected BPNs can access the imported parts, the parts must be published to the EDC and to the Digital Twin Registry (DTR). +|User with role 'Admin' receives feedback that creation of policy was successful. -|5 -|The user must choose the policy that is used for contract negotiation of the selected parts. - -|6 -|The policy is created in the EDC. +|5, 6 +|User with role 'Admin' imports assets in Admin section of Trace-X [A]. Parts can be imported at any time in the parts section of Trace-X. They will be stored locally at first. https://github.com/eclipse-tractusx/traceability-foss/tree/main/tx-backend/testdata[Testdata for asset import] |7 -|Each part is created as a shell in the DTR. This holds all the data of the part. +|User with role 'Admin' selects assets in transient state in application. |8 -|The created part is linked to the policy from the EDC. This is the last step of data provisioning. Trace-X A has done everything to ensure that companies that have a matching policy can access its published parts. +|User with role 'Admin' is requested to define a policy for assets publishing. |9 -|Trace-X B wants to synchronize parts and retrieve available ones from connected BPNs. In this case Trace-X A and Trace-X B have an established connection. +|User with role 'Admin' selects policy under which assets are published. The user must choose the policy that is used for contract negotiation of the selected parts. -|10 -|For part synchronization the Item Relationship Service (IRS) is requested. +|10, 11 +|Assets are created in the EDC. (POST /v3/assets) -|11 -|First the IRS must know the policies that are used by Trace-X B, so it requests them directly. +|12,13 +|Trace-X [A] BE checks if PolicyDefinition for selected policy already exists. -|12 -|Trace-X B returns a list of the configured policies depending on the configuration done by the administrator in step 2. +|14,15 +|In case PolicyDefinition does not exist. New PolicyDefinition is created in EDC [A]. The PolicyDefinition is created in the EDC. -|13 -|The IRS requests the catalog from Trace-X A. In the catalog, all policies of Trace-X A are stored. +|16,17 +|The created part is linked in the PolicyDefinition from the EDC. This is the last step of data provisioning. Trace-X [A] has done everything to ensure that companies that have a matching policy can access its published parts. -|14 -|The EDC of Trace-X A provides the catalog. +|18,19 +|Each part is created as a shell in the DTR. This holds all the data of the part. Before connected BPNs can access the imported parts, the parts must be published to the EDC and to the Digital Twin Registry (DTR). -|15 -|The IRS checks the catalog for the required policies and extracts them. +|20,21 +|User with role 'Admin' in Trace-X [B] creates policy for consuming assets of Trace-X [A]. -|16 +|22 +|Trace-X [B] wants to synchronize parts and retrieve available ones from connected BPNs. In this case Trace-X [A] and Trace-X [B] have an established connection. + +|23,24 +|Trace-X [B] requests for globalAssetIds (unique identifier of digital twins (Asset Administration Shell)) in decentral Digital Twin registry. + +|25 +|For part synchronization a synchronization job is started in the Item Relationship Service (IRS) . + +|26,27 +|IRS requests for CatalogOffer for globalAssetsIds passed by Trace-X [A] + +|28 +|IRS extracts policies from CatalogOffer + +|29,30 +|IRS requests for policies defined for BPNL of Trace-X [A] in PolicyStore of Trace-X [B] + +|31 |Now that the IRS has all the relevant policies of both companies, it can start comparing the linked policy of each part to the policy list of Trace-X B. This works by comparing the included constraints logically. If no policy matches for a part, it will not be imported. -|17, 18 -|If the policy of the part matches with any policy of Trace-X A, a contract agreement is created for both Trace-X A and Trace-X B. It can be viewed in the administration section of Trace-X and documents the data exchange. +|32,33,34 +|If the policy of the part matches with any policy of Trace-X A, a contract agreement is created for both Trace-X A and Trace-X B. It can be viewed in the administration section of Trace-X and documents the data exchange. Since the contractAgreementId will be mapped to an submodel of IRS. The contracts can be seen after IRS responded to Trace-X initial sync call with the submodels including the contractAgreementId. -|19 +|35 |Now that the contract negotiation was successful, the data consumption process can take place for that part. + +|36 +|In case policy does not match IRS created tombstone. + +|37 +|IRS callbacks Trace-X [B] Instance after completing job processing. ContractAgreementId for asset is available in Trace-X passed in IRS JobResponse. |=== It's possible to publish parts with different policies. For this, the user must only publish a limited selection of parts for which he can select a policy. For the parts that must be published with different policies, the user can repeat the process. + +**Note**: +For more detailed information concerning the functionality of IRS please refer to https://eclipse-tractusx.github.io/item-relationship-service/docs/[IRS documentation] + **[Work-in-progress]** The user may also choose parts that have already been published - they can be republished with a different policy. The process for this is identical to the regular publishing process. == Policies for sending and receiving notifications @@ -116,7 +155,7 @@ include::../../../../uml-diagrams/arc42/runtime-view/data-sovereignty/data-sover |If no policies match, an error will be returned to the user. |=== -=== No policies when sending notifications +=== No policies defined for Receiver BPNL when sending notifications [plantuml, target=data-sovereignty-notifications-policy-change, format=svg] .... include::../../../../uml-diagrams/arc42/runtime-view/data-sovereignty/data-sovereignty-notifications-policy-change.puml[] @@ -130,7 +169,7 @@ If no policies are configured for the receiving BPN and a notification is sent t include::../../../../uml-diagrams/arc42/runtime-view/data-sovereignty/data-sovereignty-notifications-policy-expired.puml[] .... -Policies always have an expiration time. When a notification is sent and there are policies configured for the selected BPN with an expiration time in the past, Trace-X will throw an error. In that case, an administrator must either update the policy. Then the policy can be resent. +Policies always have an expiration time defined by the 'validUntil' timestamp. When a notification is sent and there are policies configured for the selected BPN with an expiration time in the past, Trace-X will throw an error. In that case, an administrator must either update the policy. Then the policy can be resent. === Testing policies In order to test the functionality of policies, an administrator can create a policy with test constraints for connected BPNs. When sending notifications to that BPN, the process should be blocked. diff --git a/docs/src/docs/arc42/runtime-view/data-sovereignty/return-asset-contracts.adoc b/docs/src/docs/arc42/runtime-view/data-sovereignty/return-asset-contracts.adoc index 8eeeaaeeda..6770f29140 100644 --- a/docs/src/docs/arc42/runtime-view/data-sovereignty/return-asset-contracts.adoc +++ b/docs/src/docs/arc42/runtime-view/data-sovereignty/return-asset-contracts.adoc @@ -16,3 +16,8 @@ These contract agreement ids will be then requested on EDC side via POST (/manag The contract information is then returned by the endpoint as a pageable result. If no asset ids are provided in the request, 50 contract agreement ids are handled by default. + + + + + diff --git a/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/import-report-receive.puml b/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/import-report-receive.puml index 16ef51edae..068f6df78a 100644 --- a/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/import-report-receive.puml +++ b/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/import-report-receive.puml @@ -1,7 +1,9 @@ @startuml +autonumber "[00]" skinparam monochrome true skinparam shadowing false -autonumber "[000]" +skinparam defaultFontName "Architects daughter" +skinparam linetype ortho actor TraceXApiConsumer activate TraceXApiConsumer diff --git a/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/publish-assets-error.puml b/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/publish-assets-error.puml index 13168bf8b9..b36ec0b2a9 100644 --- a/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/publish-assets-error.puml +++ b/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/publish-assets-error.puml @@ -1,7 +1,9 @@ @startuml +autonumber "[00]" skinparam monochrome true skinparam shadowing false -autonumber "[000]" +skinparam defaultFontName "Architects daughter" +skinparam linetype ortho actor TraceXApiConsumer activate TraceXApiConsumer diff --git a/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/publish-assets.puml b/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/publish-assets.puml index 4136d80469..cbb7354921 100644 --- a/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/publish-assets.puml +++ b/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/publish-assets.puml @@ -1,7 +1,9 @@ @startuml +autonumber "[00]" skinparam monochrome true skinparam shadowing false -autonumber "[000]" +skinparam defaultFontName "Architects daughter" +skinparam linetype ortho actor TraceXApiConsumer activate TraceXApiConsumer diff --git a/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/trace-x-data-import-interface-modul1-sequence.puml b/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/trace-x-data-import-interface-modul1-sequence.puml index 6ac54d0ffb..b522f118b1 100644 --- a/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/trace-x-data-import-interface-modul1-sequence.puml +++ b/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/trace-x-data-import-interface-modul1-sequence.puml @@ -1,4 +1,10 @@ @startuml +autonumber "[00]" +skinparam monochrome true +skinparam shadowing false +skinparam defaultFontName "Architects daughter" +skinparam linetype ortho + participant FE participant BE participant Database diff --git a/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/trace-x-data-import-interface-modul2-sequence.puml b/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/trace-x-data-import-interface-modul2-sequence.puml index 1526c43747..957c7930b3 100644 --- a/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/trace-x-data-import-interface-modul2-sequence.puml +++ b/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/trace-x-data-import-interface-modul2-sequence.puml @@ -1,7 +1,12 @@ @startuml +autonumber "[00]" +skinparam monochrome true +skinparam shadowing false +skinparam defaultFontName "Architects daughter" +skinparam linetype ortho + participant FE participant BE -autonumber "[000]" FE -> BE: request assets: GET/assetsAsxxx BE --> FE: return assets_as_built OR assets_as_planned diff --git a/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/trace-x-data-import-interface-modul3-sequence.puml b/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/trace-x-data-import-interface-modul3-sequence.puml index 9e23bdf92e..2215ea9d48 100644 --- a/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/trace-x-data-import-interface-modul3-sequence.puml +++ b/docs/src/uml-diagrams/arc42/runtime-view/data-provisioning/trace-x-data-import-interface-modul3-sequence.puml @@ -1,10 +1,16 @@ @startuml +autonumber "[00]" +skinparam monochrome true +skinparam shadowing false +skinparam defaultFontName "Architects daughter" +skinparam linetype ortho + participant BE participant EDC participant Registry participant Submodels participant Irs -autonumber "[000]" + BE ->> BE: scheduler job BE ->> BE: receive list of IN_SYNC assets diff --git a/docs/src/uml-diagrams/arc42/runtime-view/data-sovereignty/data-sovereignty-notifications-policy-change.puml b/docs/src/uml-diagrams/arc42/runtime-view/data-sovereignty/data-sovereignty-notifications-policy-change.puml index 6687dcb45a..10af4fb259 100644 --- a/docs/src/uml-diagrams/arc42/runtime-view/data-sovereignty/data-sovereignty-notifications-policy-change.puml +++ b/docs/src/uml-diagrams/arc42/runtime-view/data-sovereignty/data-sovereignty-notifications-policy-change.puml @@ -1,12 +1,18 @@ @startuml -'https://plantuml.com/sequence-diagram -autonumber -title Policies: Sending notifications without policies +autonumber "[00]" +skinparam monochrome true +skinparam shadowing false +skinparam defaultFontName "Architects daughter" +skinparam linetype ortho + + +title Policies: No policies defined for Receiver BPNL when sending notifications actor Admin actor User -participant "Trace-X" as TraceX -participant "Receiver EDC" as EDC +participant "Trace-X \n [A]" as TraceX +participant "Receiver EDC \n [B]" as EDC +participant "Policy Store \n [A]" as PSA Admin -> TraceX: create policies ... @@ -14,14 +20,19 @@ User -> TraceX: send notification to receiver BPN activate TraceX TraceX -> EDC: get catalog of receiver BPN activate EDC -EDC --> TraceX: catalog +EDC --> TraceX: return CatalogOffer deactivate EDC -TraceX -> TraceX: extract required policy definition from catalog -TraceX -> TraceX: get own policy definition for receiver BPN +TraceX -> TraceX: extract required policy from CatalogOffer +TraceX -> PSA: get policy definition for receiver BPN +autonumber stop +TraceX <-- PSA : return policy of BPNL [B] +autonumber resume activate TraceX -TraceX --> TraceX: no policyDefinition for receiver BPN -> use default policy +opt no policyDefinition for receiver BPN + TraceX --> TraceX: use default policy +end opt deactivate TraceX -TraceX -> TraceX: compare policy definition with own default policy +TraceX -> TraceX: compare policy definition of CatalogOffer with policy of BPNL alt policies don't match TraceX --> User: error: policies don't match deactivate TraceX diff --git a/docs/src/uml-diagrams/arc42/runtime-view/data-sovereignty/data-sovereignty-notifications-policy-expired.puml b/docs/src/uml-diagrams/arc42/runtime-view/data-sovereignty/data-sovereignty-notifications-policy-expired.puml index a46c1a3956..71fb160074 100644 --- a/docs/src/uml-diagrams/arc42/runtime-view/data-sovereignty/data-sovereignty-notifications-policy-expired.puml +++ b/docs/src/uml-diagrams/arc42/runtime-view/data-sovereignty/data-sovereignty-notifications-policy-expired.puml @@ -1,8 +1,12 @@ @startuml -'https://plantuml.com/sequence-diagram -autonumber +autonumber "[00]" title: Policies: Sending notifications with expired policy +skinparam monochrome true +skinparam shadowing false +skinparam defaultFontName "Architects daughter" +skinparam linetype ortho + actor Admin actor User participant "Trace-X" as TraceX diff --git a/docs/src/uml-diagrams/arc42/runtime-view/data-sovereignty/data-sovereignty-publishing-assets.puml b/docs/src/uml-diagrams/arc42/runtime-view/data-sovereignty/data-sovereignty-publishing-assets.puml index 3264dce3f9..981eedf0e6 100644 --- a/docs/src/uml-diagrams/arc42/runtime-view/data-sovereignty/data-sovereignty-publishing-assets.puml +++ b/docs/src/uml-diagrams/arc42/runtime-view/data-sovereignty/data-sovereignty-publishing-assets.puml @@ -1,52 +1,167 @@ @startuml -'https://plantuml.com/sequence-diagram -autonumber -title Policies: Send and receive parts -actor "Admin A" as AA +autonumber "[00]" +skinparam monochrome true +skinparam shadowing false +skinparam defaultFontName "Architects daughter" +skinparam linetype ortho + +title Policies: Send and receive assets + +actor "Admin \n [A]" as AA actor User -participant "Trace-X A" as TXA -participant "DTR A" as DTRA -participant "EDC A" as EDCA -participant "IRS B" as IRSB -participant "EDC B" as EDCB -participant "Trace-X B" as TXB +participant "Trace-X \n [A]" as TXA +participant "PolicyStore \n [A]" as PSA +participant "Digital Twin Registry \n [A]" as DTRA +participant "EDC \n [A]" as EDCA +participant "SubmodelServer \n [A]" as SSA +participant "Digital Twin Registry \n [B]" as DTRB +participant "EDC \n [B]" as EDCB +participant "IRS \n [B]" as IRSB +participant "PolicyStore \n [B]" as PSB +participant "Trace-X \n [B]" as TXB actor "Admin B" as AB -AA -> TXA: create policies -AB -> TXB: create policies -... -User -> TXA: import parts +AA -> TXA: create policy +note left + create policy used for publishing + company assets [POLICY_TRACEX-PUBLISH_ASSETS] +end note +activate TXA +TXA -> PSA: create policy for BPNL +activate PSA +TXA <-- PSA: 201 policy created +deactivate PSA +AA <-- TXA: policy created +deactivate TXA + + + ... -User -> TXA: publish selected parts +User -> TXA: import assets (POST /assets/import) activate TXA +User <-- TXA: ok +... + +User -> TXA: publish selected assets in transient state + +note left + POST /assets/publish +end note + +User <-- TXA: request for policy + User --> TXA: select policy to be used -TXA -> EDCA: create policy -loop selected parts -TXA -> DTRA: create part -TXA -> DTRA: link part and policy + +loop selected assets + +TXA -> EDCA: create asset (POST /v3/assets) +note left + create assets and CatalogOffer in EDC +end note +TXA <-- EDCA: 200 Asset was created successfully. + +TXA -> EDCA: PolicyDefinition exists +activate EDCA +TXA <-- EDCA: return PolicyDefinition exists +opt PolicyDefinition not exists +TXA -> EDCA: create PolicyDefinition (/management/v2/policydefinitions) +TXA <-- EDCA: PolicyDefinition created +else + +end opt + +TXA -> EDCA: create ContractDefinition (/management/v2/contractdefinitions) with policy +note left + create ContractDefinition in EDC +end note +TXA <-- EDCA: ContractDefinition created + +TXA -> DTRA: create asset /shell-descriptors +activate DTRA +note left + create asset in DTR +end note +TXA <-- DTRA: 201 : Asset Administration Shell Descriptor created successfully +deactivate DTRA + +TXA -> SSA: create submodels for twin +activate SSA +note left + create submodels in SubmodelServer +end note +TXA <-- SSA: submodels created +deactivate SSA + +deactivate EDCA end + + deactivate TXA + +AB -> TXB: create policy +activate TXB + + +note right + create policy for + BPNL of Trace-X [A] + [POLICY_BPNL_TRACEX_A] +end note +AB <-- TXB: policy created +deactivate TXB + + +ref over TXB + Trace-X [B] publish own assets + +end ref + +note right + Prerequisite is that Trace-X has published own assets. + dDTR of Trace-X B is requested for globalAssetIds of company own assets. +end note + ... -TXB -> TXB: synchronize parts +TXB -> TXB: synchronize assets (assets/as-$/sync) +note left + different endpoints for sync as-built and as-planned assets +end note activate TXB -TXB -> IRSB: start contract negotiation +TXB -> DTRB: GET Asset Administration Shell Descriptors +activate DTRB +TXB <-- DTRB: 200 Requested Asset Administration Shell Descriptors +deactivate DTRB + +TXB -> IRSB: Register job (GET /irs/jobs) - initiate Sync of assets activate IRSB -IRSB -> EDCA: get catalog of Trace-X A +IRSB -> EDCA: GET /v2/catalog/request of Trace-X A +note left + (/v2/catalog/request/querySpec/filterExpression[id:digitalTwinRegistry]) +end note activate EDCA -EDCA --> IRSB: catalog +EDCA --> IRSB: return CatalogOffer deactivate EDCA -IRSB -> IRSB: extract policy definitions from catalog -IRSB -> TXB: get configured policies -activate TXB -TXB --> IRSB: policies -deactivate TXB +IRSB -> IRSB: extract policy definitions from CatalogOffer +IRSB -> PSB: get policies for BPNL + +activate PSB +IRSB <-- PSB: policy for BPNL +deactivate PSB + loop each part -IRSB -> IRSB: compare linked policy definition with own policy list +IRSB -> IRSB: compare ContractOffer policy with Company policy for BPNL alt policies match -IRSB --> EDCA: contract agreement -IRSB --> EDCB: contract agreement -ref over IRSB, TXB: data consumption + IRSB -> EDCB: start contract negotiation + EDCB -> EDCA: contract negotiation + EDCB <-- EDCA: ok contractAgreement + IRSB <-- EDCB: ok contractAgreement + ref over IRSB, TXB: data consumption +else policies does not match + IRSB -> IRSB: create Tombstone with policy (JobResponse) end end + +TXB <-- IRSB : calback job response + @enduml diff --git a/docs/src/uml-diagrams/arc42/runtime-view/data-sovereignty/get-all-contracts-sequenceflow.puml b/docs/src/uml-diagrams/arc42/runtime-view/data-sovereignty/get-all-contracts-sequenceflow.puml index 2413a2a9bf..492828fd0a 100644 --- a/docs/src/uml-diagrams/arc42/runtime-view/data-sovereignty/get-all-contracts-sequenceflow.puml +++ b/docs/src/uml-diagrams/arc42/runtime-view/data-sovereignty/get-all-contracts-sequenceflow.puml @@ -1,49 +1,58 @@ @startuml title - ==POST api/contracts/request + == Endpoint POST /contracts end title +skinparam monochrome true +skinparam shadowing false +skinparam defaultFontName "Architects daughter" +skinparam linetype ortho + autonumber "[00]" -participant "Trace-X Frontend" as FE order 0 -participant "Trace-X Backend" as BE order 1 -participant "Trace-X Database" as DB order 2 +participant "Trace-X \n Frontend" as FE order 0 +participant "Trace-X \n Backend" as BE order 1 +participant "Trace-X \n Database" as DB order 2 participant "EDC" as EDC order 3 -FE -> BE: POST api/contracts/request (limit, offset, sort, filter) +FE -> BE: POST contracts + note left + api endpoint is pageable, + filterable, limitable, sortable + end note activate BE -BE -> DB: Fetch requested distinct contractAgreementIds +BE -> DB: fetch requested distinct contractAgreementIds activate DB autonumber stop -DB --> BE: List(contractAgreementIds) +DB --> BE: list of contractAgreementIds autonumber resume deactivate DB -BE -> EDC: POST tx-edc/management/v2/contractagreements/request \nfiltered by contractAgreementIds +BE -> EDC: POST edc/management/v2/contractagreements/request \nfiltered by contractAgreementIds activate EDC autonumber stop -EDC --> BE: List of ContractAgreement objects +EDC --> BE: list of contractAgreement objects autonumber resume deactivate EDC -BE -> BE: Extract contractSigningDate, policy +BE -> BE: extract contractSigningDate, policy activate BE deactivate BE loop for all contractAgreementIds -BE -> EDC: GET tx-edc/management/v2/contractagreements/{contractAgreementId}/negotiation +BE -> EDC: GET edc/management/v2/contractagreements/{contractAgreementId}/negotiation activate EDC autonumber stop -EDC --> BE: ContractAgreementNegotiation object +EDC --> BE: contractAgreementNegotiation object autonumber resume deactivate EDC -BE -> BE: Extractattributes of response (id, counterPartyAddress, state) +BE -> BE: extract attributes of response (id, counterPartyAddress, state) activate BE deactivate BE end autonumber stop -BE --> FE: Pageable Result of ContractResponse objects +BE --> FE: pageable result of contractResponse objects autonumber resume deactivate BE