Skip to content
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

[DATA_SOV] Creation of CatlogOffers for notifications at runtime #1190

Closed
5 tasks done
mkanal opened this issue Jul 9, 2024 · 3 comments · Fixed by #1214 or #1233
Closed
5 tasks done

[DATA_SOV] Creation of CatlogOffers for notifications at runtime #1190

mkanal opened this issue Jul 9, 2024 · 3 comments · Fixed by #1214 or #1233
Assignees
Labels

Comments

@mkanal
Copy link
Contributor

mkanal commented Jul 9, 2024

As admin
I want CatalogOffers for notifications are created at runtime
so that CatalogOffers for notifications are using always the current policy defined for the receiver BPNL

Hints / Details

Test-Scenario:

  1. TXa and TXb have the same policy, notification sending works without problems
  2. TXb creates a new policy that points to the own BPN of TXb
  3. The catalog offers for negotiations are updated for TXb
  4. TXa is no longer able to send notifications to TXb, since the offer from TXb does not match the default policy of TXa
  5. TXb is still able to send notifications to TXa
  6. TXa also creates a policy that matches the new policy of TXb
  7. TXa is now able to send notifications again to TXb

Acceptance Criteria

  • CatalogOffer for notifications are always created or updated when notification to be sent on latest policy for BPNL or default policy
  • GIVEN notification to be sent WHEN no policy defined for receiver BPNL THEN Notification CatalogOffer is created with default policy
  • GIVEN notification to be sent WHEN policy defined for receiver BPNL THEN Notification CatalogOffer is created with policy defined for receiver BPNL
  • Removing the logic for creatiom of notification CatalogOffers at app startup
  • Dynamic creation of CatlogOffers for notifications in runtime with corresponding policies

Notification-Flow

Company BMW (BPNL0000BMW) sends notification to ZF (BPNL0000ZF)

sequenceDiagram
%%{init: {'theme': 'dark', 'themeVariables': { 'fontSize': '15px'}}}%%
autonumber

actor Superior
participant Trace_X_FE as "Trace-X"
participant Trace_X as "Trace-X BMW"
participant EDC_S as "EDC Supplier"
participant  PolicyStore

Superior ->> Trace_X_FE: Send notification
Trace_X_FE ->> Trace_X : Send notification
Trace_X ->> EDC_S : Get Notification CatalogOffer of EDC_S
EDC_S -->> Trace_X : return CatalogOffer
Trace_X -->> PolicyStore : Get Policy for BPNL or default policy
Trace_X -->> Trace_X: check Policy of CatalogOffer with Policy from PolicyStore
alt valid
Trace_X ->> EDC_S : negotiateContract
EDC_S -->> Trace_X: contract negotation successful
Trace_X ->> EDC_S :  send notification
EDC_S --> Trace_X: ok
else
Trace_X -> Trace_X : create tombstone
Trace_X -->> Trace_X_FE : show  policy mismatch
Trace_X_FE -->> Superior : show  policy mismatch
end

Loading

Company Superior BMW edits policy (not default)

sequenceDiagram
    %%{init: {'theme': 'dark', 'themeVariables': { 'fontSize': '15px'}}}%%
    autonumber

    actor Superior
    participant Trace_X
    participant PolicyStore
    participant EDC


    Superior ->> Trace_X: Edit an existing policy
    Superior ->> Trace_X: Check whether the policy is linked to a published notification CatlogOffer.
    alt true
        Trace_X -->> EDC : Update notification DataOffers to new policy (PUT /v2/contractdefinitions)
        EDC -->> Trace_X : ok
        Trace_X ->> PolicyStore : save policy
        PolicyStore -->> Trace_X : ok
        Trace_X -->> Superior : policy saved
    else false
        Trace_X ->> PolicyStore : edit policy
        PolicyStore -->> Trace_X : ok
        Trace_X -->> Superior : policy saved
    end

Loading

Company SuperiorBMW deletes policy (not default)

sequenceDiagram
    %%{init: {'theme': 'dark', 'themeVariables': { 'fontSize': '15px'}}}%%
    autonumber

    actor Superior
    participant Trace_X
    participant PolicyStore
    participant EDC


    Superior ->> Trace_X: Delete an existing policy
    Superior ->> Trace_X: Check whether the policy is linked to a notification .
    alt true
       Trace_X -->> EDC : Delete outdated DataOffer in EDC
        EDC -->> Trace_X : ok
        Trace_X -->> EDC : Update  DataOffer to defaul policy in EDC (PUT /v2/contractdefinitions)
        EDC -->> Trace_X : ok
        Trace_X ->> PolicyStore : delete policy
        PolicyStore -->> Trace_X : ok
        Trace_X -->> Superior : policy delete
    else false
        Trace_X ->> PolicyStore : delete policy
        PolicyStore -->> Trace_X : ok
        Trace_X -->> Superior : policy deleted
    end
Loading

Out of Scope

  • ...
@mkanal mkanal added this to Trace-X Jul 9, 2024
@mkanal mkanal moved this to backlog in Trace-X Jul 9, 2024
@mkanal mkanal moved this from backlog to next in Trace-X Jul 9, 2024
@ds-lcapellino ds-lcapellino self-assigned this Jul 9, 2024
@ds-lcapellino ds-lcapellino moved this from next to wip in Trace-X Jul 10, 2024
ds-lcapellino added a commit to eclipse-tractusx/item-relationship-service that referenced this issue Jul 11, 2024
…ition and deleteContractDefinition functionality
ds-lcapellino added a commit to eclipse-tractusx/item-relationship-service that referenced this issue Jul 12, 2024
…ition and deleteContractDefinition functionality
ds-lcapellino added a commit to eclipse-tractusx/item-relationship-service that referenced this issue Jul 12, 2024
…ition and deleteContractDefinition functionality
ds-lcapellino added a commit to eclipse-tractusx/item-relationship-service that referenced this issue Jul 15, 2024
…ition and deleteContractDefinition functionality
ds-lcapellino added a commit to eclipse-tractusx/item-relationship-service that referenced this issue Jul 15, 2024
…ition and deleteContractDefinition functionality
ds-lcapellino added a commit to eclipse-tractusx/item-relationship-service that referenced this issue Jul 15, 2024
ds-lcapellino added a commit to eclipse-tractusx/item-relationship-service that referenced this issue Jul 16, 2024
…ition and deleteContractDefinition functionality
ds-lcapellino added a commit to eclipse-tractusx/item-relationship-service that referenced this issue Jul 16, 2024
ds-lcapellino added a commit to eclipse-tractusx/item-relationship-service that referenced this issue Jul 16, 2024
…ition and deleteContractDefinition functionality
ds-lcapellino added a commit to eclipse-tractusx/item-relationship-service that referenced this issue Jul 16, 2024
…ition and deleteContractDefinition functionality
ds-lcapellino added a commit that referenced this issue Jul 16, 2024
feature: #1190 store accepted policies in catalog offers on startup
ds-lcapellino added a commit that referenced this issue Jul 17, 2024
feature: #1190 store accepted policies in catalog offers on startup
ds-lcapellino added a commit that referenced this issue Jul 18, 2024
feature: #1190 store accepted policies in catalog offers on startup
@ds-mwesener ds-mwesener moved this from wip to test in Trace-X Jul 18, 2024
ds-lcapellino added a commit that referenced this issue Jul 18, 2024
feature: #1190 store accepted policies in catalog offers on startup
ds-lcapellino added a commit that referenced this issue Jul 18, 2024
feature: #1190 store accepted policies in catalog offers on startup
ds-lcapellino added a commit that referenced this issue Jul 18, 2024
feature: #1190 store accepted policies in catalog offers on startup
ds-lcapellino added a commit that referenced this issue Jul 18, 2024
ds-mwesener added a commit that referenced this issue Jul 18, 2024
@ds-lcapellino
Copy link
Contributor

ds-lcapellino commented Jul 18, 2024

Things to consider / findings after this story:

  • on a clean environment, the default policy is created on startup. If we add a new policy with a BPN that doesn't match the own policy, the default policy is deleted and only the new policy with another BPN is shown. This does not cause any updated on the catalog offers.
  • Trace-X currently does not care about the BPN in the policy. For example, if you create a policy for BPNX, and want to send a notification to BPNX, all policies in the policy store are checked and the first matching will be taken.
  • we can create multiple policies for a BPN. How should this be handled? We implemented the following for updating notification offers: If a second policy is created for the own BPN, the newest policy for the own BPN will be used for updating notification offers

@mkanal mkanal reopened this Jul 22, 2024
@mkanal mkanal added the spillover temporary label for spill over label Jul 23, 2024
@ds-crehm
Copy link
Contributor

Replicated the test scenario successfully on e2e.
After creating a policy for TX-B, TX-A -> TX-B notifications were not possible anymore but the other way still worked.
After creating the same policy for TX-A, sending the notification worked:
grafik

Ready for review.

@ds-crehm ds-crehm moved this from test to review in Trace-X Jul 23, 2024
@ds-crehm ds-crehm assigned mkanal and unassigned ds-crehm Jul 23, 2024
@mkanal mkanal moved this from review to done in Trace-X Jul 24, 2024
@mkanal
Copy link
Contributor Author

mkanal commented Jul 24, 2024

LGFM. PO acceptance in behalf of @jzbmw.
Data sov clear

@mkanal mkanal closed this as completed Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: done
3 participants