-
Notifications
You must be signed in to change notification settings - Fork 5
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
[NAE-1659] Process URI #78
Conversation
- changed process identifiers to URI in engine nets - implemented NavNode and corresponding classes
- changed naming to Uri from Nav - changed uri of processes in default processes - changed Java classes - implemented methods to UriService
- changed method implementation for getOrCreate - added default URI type - added mapping to ElasticsearchRunner
- implemented uri for case
- implemented populating relatives
- implemented service methods
- reverted DemoRunner
- implemented UriController
- implemented action - refactored attribute naming
- added method to ElasticCaseService
- implemented tests - corrected code according to tests
- corrected according to sonar check
- updated according to Sonar analysis
- started documentation
- wrote documentation
- update comments
- modified level and contentType attribute
- implemented new functions for controller
- implemented new functions default uri - implemented UriRunner
- modified getRoot function - modified findByLevel function
- added application property to handle props in UriService - added base64 decoding of process identifier
- removed @JsonIgnore annotation from taskPair in Case.java - changed process ids
- changed process ID
- reverted DemoRunner
- update identifier to uri of some test processes - fix wrong API annotation in UriController - fix method inconsistency in UriNodeRepository
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
-fix test
@@ -3,6 +3,7 @@ package com.netgrif.application.engine.startup | |||
import com.netgrif.application.engine.elastic.domain.ElasticCaseRepository | |||
import com.netgrif.application.engine.elastic.domain.ElasticTaskRepository | |||
import com.netgrif.application.engine.elastic.service.interfaces.IElasticCaseService | |||
import com.netgrif.application.engine.petrinet.domain.PetriNet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
@@ -30,6 +31,9 @@ class ElasticsearchRunner extends AbstractOrderedCommandLineRunner { | |||
@Value('${spring.data.elasticsearch.index.task}') | |||
private String taskIndex | |||
|
|||
@Value('${spring.data.elasticsearch.index.uri}') | |||
private String uriIndex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feedback about property injection via a class was given in person. Commenting just to point out where to make the changes
@@ -25,6 +25,9 @@ public class ElasticsearchConfiguration { | |||
@Value("${spring.data.elasticsearch.index.task}") | |||
private String taskIndex; | |||
|
|||
@Value("${spring.data.elasticsearch.index.uri}") | |||
private String uriIndex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -29,10 +28,16 @@ | |||
@Document | |||
public class PetriNet extends PetriNetObject { | |||
|
|||
|
|||
/*TODO: change on UriNode Move action*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this TODO future work, or must it yet be resolved in this task?
|
||
public boolean containsNet() { | ||
return contentTypes.contains(UriContentType.PROCESS); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how does the DEFAULT UriContentType work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEFAULT UriContentType is reserved for the root node. It will be removed in the future planned refactor.
@@ -10,6 +10,7 @@ spring.data.mongodb.drop=true | |||
spring.data.elasticsearch.drop=true | |||
spring.data.elasticsearch.index.case=${DATABASE_NAME:nae}_dev_case | |||
spring.data.elasticsearch.index.task=${DATABASE_NAME:nae}_dev_task | |||
spring.data.elasticsearch.index.uri=${DATABASE_NAME:nae}_dev_nav |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is the index called _nav when it stores uris?
<!-- TRANSITIONS --> | ||
<transition> | ||
<id>1</id> | ||
<x>379</x> | ||
<y>273</y> | ||
<label>Task - editable</label> | ||
<assignPolicy>auto</assignPolicy> | ||
<usersRef> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why were these userRefs removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For faster testing.
@@ -1,5 +1,6 @@ | |||
<?xml version='1.0' encoding='UTF-8'?> | |||
<document xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='https://petriflow.com/petriflow.schema.xsd'> | |||
<id>leukemia/leu</id> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does an english version of this net exist when it could be internationalised in one process?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The process is for testing purposes only. The original purpose of 'en version' is not known to me.
@ExtendWith(SpringExtension.class) | ||
class UriServiceTest { | ||
|
||
private static final String uriSeparator = "/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the constant from the service should be used instead in my oppinion
@Test | ||
void moveTest() { | ||
UriNode uriNode = uriService.move(testUri1, destination) | ||
assert uriNode.uriPath == destination + uriSeparator + uriNode.name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parent nodes should be checked as well to see if they point to new child correctly
- Disabled test
uriNode.setParentId(null); | ||
} | ||
uriNode.addContentType(UriContentType.DEFAULT); | ||
uriNode = uriNodeRepository.save(uriNode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UP :)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔
add(WebMvcLinkBuilder.linkTo(WebMvcLinkBuilder.methodOn(UriController.class) | ||
.getByLevel(0)).withSelfRel()); | ||
add(WebMvcLinkBuilder.linkTo(WebMvcLinkBuilder.methodOn(UriController.class) | ||
.getByParent(null)).withSelfRel()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
withSelfRel only one
@ApiResponses(value = { | ||
@ApiResponse(code = 200, message = "OK", response = UriNodeResource.class), | ||
}) | ||
@RequestMapping(value = "/root", method = GET, produces = MediaTypes.HAL_JSON_VALUE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- implemented comments from PR
- fix uri move method
Kudos, SonarCloud Quality Gate passed! |
Description
Implement process identifier as URI and URI system into backend.
Implements NAE-1659
Dependencies
No new dependencies were introduced.
Third party dependencies
No new dependencies were introduced.
Blocking Pull requests
There are no dependencies on other PR.
How Has Been This Tested?
This was tested manually.
Test Configuration
Netgrif Backend PR Config
Checklist: