Skip to content

Commit

Permalink
Merge branch 'main' into feat/jsonld-catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
eschrewe authored Jul 9, 2024
2 parents dc0be2f + f3e0575 commit 8dc63aa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
import org.eclipse.tractusx.puris.backend.stock.logic.dto.itemstocksamm.DirectionCharacteristic;
import org.jetbrains.annotations.Nullable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.RequestEntity;
import org.springframework.http.RequestEntity.BodyBuilder;
import org.springframework.stereotype.Service;

import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,18 @@ public MaterialPartnerRelation create(MaterialPartnerRelation materialPartnerRel

/**
* Call this method when a partnerCXId for a Material was needed but not found.
* This method will trigger a new PartTypeInformation Task for any material that
* the given partner supplies, but still misses a partnerCXId.
* This method will trigger a new Task for any material that
* the given partner supplies, but still misses a partnerCXId. This task will
* try to fetch the partner's CX Id for all materials that this partner supplies
* and where this partner's CX Id is still unknown.
*
* This method will block until all tasks have finished, if any.
* <p>
* Please consider that calling this method can only bring any meaningful results, when
* the corresponding material entity is properly registered and there exists a
* MaterialPartnerRelation for the given material and the given partner, where the
* partner is designated as supplier. I.e. please make sure to always keep your masterdata
* entities up-to-date.
*
* @param supplierPartner The supplier partner
*/
Expand All @@ -104,7 +112,7 @@ public void triggerPartTypeRetrievalTask(Partner supplierPartner) {
.stream()
.filter(mpr -> mpr.getPartnerCXNumber() == null)
.filter(mpr -> !currentPartTypeFetches.contains(mpr))
.map(mpr -> executorService.submit(new PartTypeInformationRetrievalTask(mpr, 1)))
.map(mpr -> executorService.submit(new DtrRegistrationTask(mpr, 1)))
.toList();
if (futures.isEmpty()) {
return;
Expand Down

0 comments on commit 8dc63aa

Please sign in to comment.