Skip to content

Commit

Permalink
rename ServiceBpmn -> service
Browse files Browse the repository at this point in the history
  • Loading branch information
ddecrulle committed Dec 23, 2022
1 parent f784155 commit adcf396
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 43 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>fr.insee.knowledge</groupId>
<artifactId>knowledge</artifactId>
<version>0.4.3</version>
<version>0.4.4</version>
<packaging>jar</packaging>
<name>Knowledge-Back-Office</name>
<description>Back-office services for Knowledge</description>
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/fr/insee/knowledge/domain/Function.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ public class Function extends GenericIDLabel {
private List<ProductOrGsbpm> products;
private List<Task> tasks;

private ServiceBpmn serviceBpmn;
private Service serviceBpmn;

public Function(String id, String label, String description, int dispo, ProductOrGsbpm gsbpm, String idProduct, List<GenericIDLabel> users, List<ProductOrGsbpm> tools, List<Task> tasks, ServiceBpmn serviceBpmn) {
public Function(String id, String label, String description, int dispo, ProductOrGsbpm gsbpm, String idProduct, List<GenericIDLabel> users, List<ProductOrGsbpm> tools, List<Task> tasks, Service serviceBpmn) {
super(id, label);
this.description = description;
this.dispo = dispo;
Expand Down Expand Up @@ -85,11 +85,11 @@ public void setTasks(List<Task> tasks) {
this.tasks = tasks;
}

public ServiceBpmn getServiceBpmn() {
public Service getServiceBpmn() {
return serviceBpmn;
}

public void setServiceBpmn(ServiceBpmn serviceBpmn) {
this.serviceBpmn = serviceBpmn;
public void setServiceBpmn(Service service) {
this.serviceBpmn = service;
}
}
33 changes: 33 additions & 0 deletions src/main/java/fr/insee/knowledge/domain/Service.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package fr.insee.knowledge.domain;

public class Service extends GenericIDLabel {

private Service service;
private String description;

public Service(Service service, String description, String id, String label) {
super(id, label);
this.service = service;
this.description = description;
}

public Service() {
}

public Service getService() {
return service;
}

public void setService(Service service) {
this.service = service;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

}
32 changes: 0 additions & 32 deletions src/main/java/fr/insee/knowledge/domain/ServiceBpmn.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import fr.insee.knowledge.constants.Constants;
import fr.insee.knowledge.dao.FunctionDAO;
import fr.insee.knowledge.domain.Function;
import fr.insee.knowledge.domain.ServiceBpmn;
import fr.insee.knowledge.domain.Service;
import fr.insee.knowledge.service.ImportFunctionService;

import java.io.IOException;
Expand Down Expand Up @@ -37,13 +37,13 @@ private List<Function> getListFunctionsFromJsonNode(JsonNode rootNode) throws Js
List<Function> listFunction = new ArrayList<>();
if (rootNode.isArray()) {
for (JsonNode node : rootNode) {
recursiveMapping(listFunction, node, new ServiceBpmn());
recursiveMapping(listFunction, node, new Service());
}
}
return listFunction;
}

private void recursiveMapping(List<Function> functionList, JsonNode jsonNode, ServiceBpmn currentService) throws JsonProcessingException {
private void recursiveMapping(List<Function> functionList, JsonNode jsonNode, Service currentService) throws JsonProcessingException {
currentService.setId(jsonNode.get(Constants.idField).asText());
currentService.setLabel(jsonNode.get(Constants.labelField).asText());

Expand All @@ -58,9 +58,9 @@ private void recursiveMapping(List<Function> functionList, JsonNode jsonNode, Se
JsonNode node = jsonNode.get(Constants.serviceField);
if (node != null) {
for (JsonNode serviceNode : node) {
ServiceBpmn service = new ServiceBpmn();
Service service = new Service();
//TODO test if service exist in database
service.setServiceBpmn(currentService);
service.setService(currentService);
recursiveMapping(functionList, serviceNode, service);
}
}
Expand Down

0 comments on commit adcf396

Please sign in to comment.