Repository navigation
Make root network applicabilities explicit - #932
Conversation
Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…t-network-applicabilities Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
| } | ||
|
|
||
| /** | ||
| * Makes the modification applicable on the root network tag, unless it already holds an applicability for it. |
There was a problem hiding this comment.
Too verbose ?
The code is pretty self-explanatory here
| } | ||
|
|
||
| /** | ||
| * @return the root network tags the modification is associated with, that is the ones it holds an applicability for |
There was a problem hiding this comment.
Too verbose ?
The code is pretty self-explanatory here
There was a problem hiding this comment.
I think a sentence is faster to read but as discussed OK
| AND NOT EXISTS (SELECT 1 FROM ModificationRootNetworkApplicabilityEntity a | ||
| WHERE a.modification = m AND a.rootNetworkTag = :tag) | ||
| """) | ||
| void setDefaultApplicabilityIfMissing(@Param("ids") Collection<UUID> ids, @Param("tag") String tag); |
There was a problem hiding this comment.
Rather do this in java to simplify the code ?
There was a problem hiding this comment.
I don't think we need performance optimization here
There was a problem hiding this comment.
You're right it's useless here I remove it
| if (sharedUuids.isEmpty()) { | ||
| return; | ||
| } | ||
| Set<UUID> sharedTreesUuids = getSharedModificationTreesFrom(sharedUuids).allUuids(); |
There was a problem hiding this comment.
You could do something like :
List<ModificationEntity> sharedTreeModifications = modificationRepository.findAllWithApplicabilitiesByIdIn(sharedTreesUuids);
sharedTreeModifications.stream()
.filter(modification -> !(modification instanceof ModificationReferenceEntity))
.forEach(modification -> rootNetworkTags.forEach(modification::setDefaultApplicabilityIfMissing));
There was a problem hiding this comment.
And with such code you could have only one method for modification and shared ones in setDefaultApplicabilitiesIfMissing(List<ModificationEntity> modificationEntities, Collection<String> rootNetworkTags)
There was a problem hiding this comment.
Ok I merged them
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
|



Upgrades network-modification to 2.3.0, which includes gridsuite/network-modification#249: a modification must hold an applicability for every root network tag it is applied on.
Written modifications (creation, duplication, group duplication, composite split and insertion) are associated with the root network tags of the application contexts before being applied, down to their content and the shared modifications they point to. A modification moved into a composite, or the content replacing the one of a composite, is associated with the tags of the composite; an assembled composite with the tags of its content.
POST /groups/{uuid}/duplicatetakes therootNetworkTagsof the target study.