-
Notifications
You must be signed in to change notification settings - Fork 2
Move shortcircuit parameters #569
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced May 27, 2024
Closed
c67a7da to
aa038ff
Compare
TheMaskedTurtle
requested changes
Jun 4, 2024
src/test/java/org/gridsuite/study/server/utils/WireMockUtils.java
Outdated
Show resolved
Hide resolved
src/test/java/org/gridsuite/study/server/repository/RepositoriesTest.java
Show resolved
Hide resolved
Contributor
Author
324f5d7 to
4c4e6f0
Compare
TheMaskedTurtle
previously requested changes
Jun 13, 2024
src/test/java/org/gridsuite/study/server/utils/WireMockUtils.java
Outdated
Show resolved
Hide resolved
56f705f to
43b122d
Compare
de1cee5 to
f4770e7
Compare
|
ayolab
approved these changes
Jun 19, 2024
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



Move entity and related functions to shortcircuit-server and link to new endpoints.
cf gridsuite/shortcircuit-server#81
Sequences
sequenceDiagram box rgb(75,75,75) study-server participant Controller participant StudySrv participant StudyRepository participant SCService end participant SCServer #autonumber Note over Controller,StudySrv: PUT /studies/{studyUuid}/nodes/{nodeUuid}/shortcircuit/run Note right of Controller: runShortCircuit(studyUuid, nodeUuid, busId?, userId) Controller-->>StudySrv: studyService.assertIsNodeNotReadOnly activate Controller Controller-->>+StudySrv: runShortCircuit(studyUuid, nodeUuid, userId, busId?) StudySrv->>+StudyRepository: findById(studyUuid) StudyRepository-->>-StudySrv: optional<entity> alt old: entity repo StudySrv->>+SCService: fromEntity(studyEntity.shortCircuitParameters) SCService-->>-StudySrv: powsybl obj params StudySrv->>+SCService: runShortCircuit(studyUuid, nodeUuid, busId, objParameters, userId) else new: rest service StudySrv->>+SCService: runShortCircuit(studyUuid, nodeUuid, busId, parametersUuid, withFortescueResult, userId) end SCService->>+SCServer: /vX/networks/{networkUuid}/run-and-save SCServer-->>-SCService: uuid result SCService-->>-StudySrv: uuid result StudySrv->>StudySrv: updateComputationResultUuid(...) Note over StudySrv: notificationService.emitElementUpdated(studyUuid, userId) StudySrv-->>-Controller: uuid deactivate ControllersequenceDiagram box rgb(75,75,75) study-server participant Controller participant StudySrv participant StudyRepository participant SCService end participant SCServer Note over Controller,StudySrv: POST /studies/{studyUuid}/short-circuit-analysis/parameters Note right of Controller: setShortCircuitParameters(studyUuid, shortCircuitParametersInfos, userId) activate Controller Controller-->>+StudySrv: setShortCircuitParameters(studyUuid, shortCircuitParametersInfos, userId) alt old: entity repo StudySrv->>+SCService: toEntity(dto.parameters, dto.predefinedParameters) SCService-->>-StudySrv: entity %%StudySrv->>+StudySrv: updateShortCircuitParameters(studyUuid, shortCircuitParametersEntity) StudySrv->>+StudyRepository: findById(studyUuid) StudyRepository-->>-StudySrv: optional<entity> StudySrv->>StudyRepository: entity.setShortCircuitParameters(scParametersEntity) %%deactivate StudySrv else new: rest service StudySrv->>+StudyRepository: findById(studyUuid) StudyRepository-->>-StudySrv: optional<entity> alt studyEntity.shortCircuitParametersUuid != null StudySrv->>SCService: updateParameters(paramsUuid, params) SCService->>SCServer: uuid <br/> + sc parameters else studyEntity.shortCircuitParametersUuid == null StudySrv->>+SCService: createParameters(shortCircuitParametersInfos) SCService->>+SCServer: sc parameters SCServer-->>-SCService: uuid SCService-->>-StudySrv: uuid StudySrv->>StudyRepository: entity.setShortCircuitParametersUuid(uuid) end end Note right of StudySrv: notificationService.emitElementUpdated(studyUuid, userId) StudySrv->>-Controller: dto deactivate ControllersequenceDiagram box rgb(75,75,75) study-server participant Controller participant StudySrv participant StudyRepository participant SCService end participant SCServer Note over Controller,StudySrv: GET /studies/{studyUuid}/short-circuit-analysis/parameters Note right of Controller: getShortCircuitParameters(studyUuid) activate Controller Controller->>+StudySrv: getShortCircuitParametersInfo(studyUuid) #activate StudySrv StudySrv->>+StudyRepository: findById(studyUuid) StudyRepository-->>-StudySrv: optional<entity> alt old: entity repo StudySrv->>+StudyRepository: entity.getShortCircuitParameters() StudyRepository-->>-StudySrv: ShortCircuitParametersEntity <br/> or new+saved default params StudySrv->>+SCService: toShortCircuitParametersInfo(scp_entity) SCService-->>-StudySrv: dto else new: rest service #create participant SCServer alt studyEntity.shortCircuitParametersUuid == null StudySrv->>+SCService: createParameters() SCService->>+SCServer: createParameters SCServer-->>-SCService: uuid SCService-->>-StudySrv: uuid StudySrv->>StudyRepository: entity.setShortCircuitParametersUuid(uuid) end StudySrv->>+SCService: getOrCreateParameters(entity.shortCircuitParametersUuid) SCService-)+SCServer: study uuid SCServer--)-SCService: dto SCService-->>-StudySrv: dto #destroy participant SCServer end StudySrv->>-Controller: dto #deactivate StudySrv deactivate ControllersequenceDiagram box rgb(75,75,75) study-server participant Controller participant StudySrv participant StudyRepository participant SCService end participant SCServer Note over Controller,StudySrv: /studies Note right of Controller: duplicateStudy(studyUuid) activate Controller Controller->>+StudySrv: duplicateStudy(...) StudySrv->>+StudyRepository: findById(studyUuid) StudyRepository-->>-StudySrv: optional<entity> StudySrv->>StudySrv: insertStudyCreationRequest(studyEntity) StudySrv->>StudySrv: toBasicStudyInfos(StudyCreationRequestEntity) StudySrv-->>-Controller: uuid StudySrv->>+StudySrv: duplicateStudyAsync(...) deactivate Controller StudySrv->>+StudySrv: insertDuplicatedStudy(...) StudySrv->>+StudyRepository: findById(studyUuid) StudyRepository-->>-StudySrv: optional<entity> StudySrv->>StudySrv: [...] alt old: entity repo StudySrv->>+SCService: fromEntity(sourceStudy.shortCircuitParameters) SCService-->>-StudySrv: dto StudySrv->>+SCService: toEntity(sourceStudy.shortCircuitParameters) SCService-->>-StudySrv: entity StudySrv->>StudyRepository: ... else new: rest service StudySrv->>+SCService: duplicateParameters(uuid) SCService->>+SCServer: parameters uuid SCServer-->>-SCService: new uuid SCService-->>-StudySrv: uuid StudySrv->>StudyRepository: ... end StudySrv->>StudySrv: reindexStudy(entity) deactivate StudySrv deactivate StudySrvsequenceDiagram box rgb(75,75,75) study-server participant ConsumerSrv participant StudySrv participant StudyRepository participant SCService end participant SCServer Note right of ConsumerSrv: consumeCaseImportSucceeded() activate ConsumerSrv ConsumerSrv->>ConsumerSrv: [...] ConsumerSrv->>+StudyRepository: findById(studyUuid) StudyRepository-->>-ConsumerSrv: optional<entity> alt entity != null ConsumerSrv->>StudySrv: updateStudyNetwork(studyEntity, ...) else entity == null ConsumerSrv->>ConsumerSrv: [...] alt old: entity repo ConsumerSrv->>+SCService: getDefaultShortCircuitParameters() SCService-->>-ConsumerSrv: powsybl obj ConsumerSrv->>+SCService: toEntity(powsyblParams) SCService-->>-ConsumerSrv: entity ConsumerSrv->>+StudySrv: insertStudy(..., scEntity, ...) else new: rest service ConsumerSrv->>+SCService: createDefaultParameters() SCService-->>-ConsumerSrv: uuid ConsumerSrv->>+StudySrv: insertStudy(..., scParamsUuid, ...) end StudySrv->>StudyRepository: save(new entity) deactivate StudySrv end