commit
83f85ac1b8
64 changed files with 396 additions and 967 deletions
|
|
@ -9,7 +9,6 @@ import org.apache.kafka.clients.producer.ProducerConfig;
|
|||
import org.apache.kafka.common.serialization.StringDeserializer;
|
||||
import org.apache.kafka.common.serialization.StringSerializer;
|
||||
import org.chtijbug.drools.KieContainerResponse;
|
||||
import org.chtijbug.drools.KieContainerUpdate;
|
||||
import org.chtijbug.drools.ReverseProxyUpdate;
|
||||
import org.chtijbug.drools.common.KafkaTopicConstants;
|
||||
import org.chtijbug.drools.console.middle.DababaseContentInit;
|
||||
|
|
@ -129,30 +128,14 @@ public class DroolsSpringBootConsoleApplication extends SpringBootServletInitial
|
|||
JsonSerializer.class);
|
||||
return new DefaultKafkaProducerFactory<>(configProps);
|
||||
}
|
||||
@Bean
|
||||
public ProducerFactory<String, KieContainerUpdate> producerKieContainerUpdateFactory() {
|
||||
Map<String, Object> configProps = new HashMap<>();
|
||||
configProps.put(
|
||||
ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,
|
||||
bootstrapAddress);
|
||||
configProps.put(
|
||||
ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG,
|
||||
StringSerializer.class);
|
||||
configProps.put(
|
||||
ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG,
|
||||
JsonSerializer.class);
|
||||
return new DefaultKafkaProducerFactory<>(configProps);
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public KafkaTemplate<String, ReverseProxyUpdate> kafkaTemplate() {
|
||||
return new KafkaTemplate<>(producerFactory());
|
||||
}
|
||||
|
||||
@Bean
|
||||
public KafkaTemplate<String, KieContainerUpdate> kafkaKieContainerUpdateTemplate() {
|
||||
return new KafkaTemplate<>(producerKieContainerUpdateFactory());
|
||||
}
|
||||
|
||||
|
||||
|
||||
public ConsumerFactory<String, KieContainerResponse> greetingConsumerFactory() {
|
||||
|
|
|
|||
|
|
@ -4,11 +4,13 @@ import org.apache.poi.ss.usermodel.*;
|
|||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.chtijbug.drools.console.service.model.kie.KieConfigurationData;
|
||||
import org.chtijbug.drools.console.service.util.AppContext;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.service.dtmodel.ColumnDefinition;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.service.dtmodel.DecisionTable;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.service.dtmodel.GuidedException;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentview.service.dtmodel.ColumnDefinition;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentview.service.dtmodel.DecisionTable;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentview.service.dtmodel.GuidedException;
|
||||
import org.drools.workbench.models.guided.dtable.backend.GuidedDTXMLPersistence;
|
||||
import org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.DependsOn;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -22,6 +24,8 @@ import java.util.List;
|
|||
@DependsOn("applicationContext")
|
||||
public class DecisionTableExcelService {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(DecisionTableExcelService.class);
|
||||
|
||||
@Value("${adminConsole.tmpdir}")
|
||||
public String tmpDir;
|
||||
|
||||
|
|
@ -75,6 +79,7 @@ public class DecisionTableExcelService {
|
|||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
logger.error("IOException","ImportExcell",e);
|
||||
throw e;
|
||||
} finally {
|
||||
if (workbook != null) {
|
||||
|
|
@ -99,7 +104,7 @@ public class DecisionTableExcelService {
|
|||
try {
|
||||
workbook = new XSSFWorkbook();
|
||||
DecisionTable decisionTable = new DecisionTable(model);
|
||||
CreationHelper createHelper = workbook.getCreationHelper();
|
||||
workbook.getCreationHelper();
|
||||
Sheet sheet = workbook.createSheet(nameTemplate);
|
||||
|
||||
Font headerFont = workbook.createFont();
|
||||
|
|
@ -111,27 +116,26 @@ public class DecisionTableExcelService {
|
|||
|
||||
Row headerRow = sheet.createRow(0);
|
||||
|
||||
if (decisionTable.getRows() != null && decisionTable.getRows().size() != 0) {
|
||||
int columnIndex = 0;
|
||||
if (decisionTable.getRows() != null && !decisionTable.getRows().isEmpty()) {
|
||||
|
||||
int j = 0;
|
||||
for (ColumnDefinition columnDefinition : decisionTable.getColumnDefinitionList()) {
|
||||
if (columnDefinition.isHideColumn() == false) {
|
||||
if (!columnDefinition.isHideColumn()) {
|
||||
Cell cell = headerRow.createCell(j);
|
||||
cell.setCellValue(columnDefinition.getHeader());
|
||||
cell.setCellStyle(headerCellStyle);
|
||||
j++;
|
||||
}
|
||||
columnIndex++;
|
||||
}
|
||||
int rowIndex = 1;
|
||||
|
||||
for (int i = 0; i < decisionTable.getRows().size(); i++) {
|
||||
org.chtijbug.drools.console.vaadinComponent.componentView.service.dtmodel.Row row = decisionTable.getRows().get(i);
|
||||
org.chtijbug.drools.console.vaadincomponent.componentview.service.dtmodel.Row row = decisionTable.getRows().get(i);
|
||||
int k = 0;
|
||||
int jj = 0;
|
||||
Row r = sheet.createRow(rowIndex);
|
||||
for (ColumnDefinition columnDefinition : decisionTable.getColumnDefinitionList()) {
|
||||
if (columnDefinition.isHideColumn() == false) {
|
||||
if (!columnDefinition.isHideColumn()) {
|
||||
Cell cell = r.createCell(k);
|
||||
cell.setCellValue(row.getRowElements().get(jj).getValue());
|
||||
cell.setCellStyle(headerCellStyle);
|
||||
|
|
@ -144,32 +148,16 @@ public class DecisionTableExcelService {
|
|||
|
||||
}
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
try {
|
||||
ByteArrayInputStream is = null;
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(tmpDir + "/" + nameTemplate + ".xlsx");
|
||||
workbook.write(fileOutputStream);
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
workbook.write(bos);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
byte[] barray = bos.toByteArray();
|
||||
ByteArrayInputStream is = new ByteArrayInputStream(barray);
|
||||
|
||||
try {
|
||||
is = new ByteArrayInputStream(barray);
|
||||
workbook.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return is;
|
||||
|
||||
} catch (GuidedException e) {
|
||||
e.printStackTrace();
|
||||
} catch (GuidedException | IOException e) {
|
||||
logger.error("new FileOutputStream", e);
|
||||
} finally {
|
||||
if (workbook != null) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class GitLabRepositoryService {
|
|||
public List<GroupElementResponse> getListGitRepostitories(String url, String token, String groupName) {
|
||||
|
||||
String completeurl = url + "/groups/" + groupName + "/projects";
|
||||
logger.info("url gitlab : " + completeurl);
|
||||
logger.info("url gitlab : {}" , completeurl);
|
||||
ResponseEntity<List<GroupElementResponse>> response = restTemplateKiewb
|
||||
.execute(completeurl, HttpMethod.GET, requestCallback(null, token), clientHttpResponse -> {
|
||||
List<GroupElementResponse> extractedResponse = null;
|
||||
|
|
@ -43,8 +43,7 @@ public class GitLabRepositoryService {
|
|||
GroupElementResponse[] values = mapper.readValue(result, GroupElementResponse[].class);
|
||||
extractedResponse = Arrays.asList(values);
|
||||
}
|
||||
ResponseEntity<List<GroupElementResponse>> extractedValue = new ResponseEntity<>(extractedResponse, clientHttpResponse.getHeaders(), clientHttpResponse.getStatusCode());
|
||||
return extractedValue;
|
||||
return new ResponseEntity<>(extractedResponse, clientHttpResponse.getHeaders(), clientHttpResponse.getStatusCode());
|
||||
});
|
||||
List<GroupElementResponse> reponseMoteur;
|
||||
|
||||
|
|
@ -55,7 +54,7 @@ public class GitLabRepositoryService {
|
|||
public GroupElementResponse createProjectForUser(String url, String token, String projectName) {
|
||||
|
||||
String completeurl = url + "/projects?name=" + projectName;
|
||||
logger.info("url moteur reco : " + completeurl);
|
||||
logger.info("url moteur reco : {}", completeurl);
|
||||
ResponseEntity<GroupElementResponse> response = restTemplateKiewb
|
||||
.execute(completeurl, HttpMethod.POST, requestCallback(null, token), clientHttpResponse -> {
|
||||
GroupElementResponse extractedResponse = null;
|
||||
|
|
@ -64,8 +63,7 @@ public class GitLabRepositoryService {
|
|||
String result = s.hasNext() ? s.next() : "";
|
||||
extractedResponse = mapper.readValue(result, GroupElementResponse.class);
|
||||
}
|
||||
ResponseEntity<GroupElementResponse> extractedValue = new ResponseEntity<>(extractedResponse, clientHttpResponse.getHeaders(), clientHttpResponse.getStatusCode());
|
||||
return extractedValue;
|
||||
return new ResponseEntity<>(extractedResponse, clientHttpResponse.getHeaders(), clientHttpResponse.getStatusCode());
|
||||
});
|
||||
GroupElementResponse reponseMoteur;
|
||||
|
||||
|
|
@ -76,7 +74,7 @@ public class GitLabRepositoryService {
|
|||
public ProjectMoveResponse moveProjectTpGroup(String url, String token, String projectid, String groupName) {
|
||||
|
||||
String completeurl = url + "/groups/" + groupName + "/projects/" + projectid;
|
||||
logger.info("url moteur reco : " + completeurl);
|
||||
logger.info("url moteur reco : {}" , completeurl);
|
||||
ResponseEntity<ProjectMoveResponse> response = restTemplateKiewb
|
||||
.execute(completeurl, HttpMethod.POST, requestCallback(null, token), clientHttpResponse -> {
|
||||
ProjectMoveResponse extractedResponse = null;
|
||||
|
|
@ -85,8 +83,7 @@ public class GitLabRepositoryService {
|
|||
String result = s.hasNext() ? s.next() : "";
|
||||
extractedResponse = mapper.readValue(result, ProjectMoveResponse.class);
|
||||
}
|
||||
ResponseEntity<ProjectMoveResponse> extractedValue = new ResponseEntity<>(extractedResponse, clientHttpResponse.getHeaders(), clientHttpResponse.getStatusCode());
|
||||
return extractedValue;
|
||||
return new ResponseEntity<>(extractedResponse, clientHttpResponse.getHeaders(), clientHttpResponse.getStatusCode());
|
||||
});
|
||||
ProjectMoveResponse reponseMoteur;
|
||||
|
||||
|
|
@ -105,7 +102,7 @@ public class GitLabRepositoryService {
|
|||
clientHttpRequest.getHeaders().add(
|
||||
HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON_VALUE);
|
||||
|
||||
String authHeader = new String(token);
|
||||
String authHeader = token;
|
||||
clientHttpRequest.getHeaders().add(
|
||||
"Private-Token", authHeader);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package org.chtijbug.drools.console.service;
|
|||
|
||||
import com.vaadin.flow.component.UI;
|
||||
import com.vaadin.flow.server.VaadinSession;
|
||||
import org.chtijbug.drools.KieContainerUpdate;
|
||||
import org.chtijbug.drools.ReverseProxyUpdate;
|
||||
import org.chtijbug.drools.common.KafkaTopicConstants;
|
||||
import org.chtijbug.drools.console.AddLog;
|
||||
|
|
@ -61,8 +60,7 @@ public class ProjectPersistService {
|
|||
@Autowired
|
||||
private KafkaTemplate<String, ReverseProxyUpdate> kafkaTemplateProxyUpdate;
|
||||
|
||||
@Autowired
|
||||
private KafkaTemplate<String, KieContainerUpdate> kafkaKieContainerUpdateTemplate;
|
||||
|
||||
|
||||
public ProjectPersistService() {
|
||||
this.config = AppContext.getApplicationContext().getBean(KieConfigurationData.class);
|
||||
|
|
@ -215,18 +213,7 @@ public class ProjectPersistService {
|
|||
runtimePojoPersist.setStatus(ContainerRuntimePojoPersist.STATUS.TODEPLOY.name());
|
||||
containerRuntimeRepository.save(runtimePojoPersist);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
KieContainerUpdate kieContainerUpdate = new KieContainerUpdate();
|
||||
kieContainerUpdate.setMainClass(projectPersist.getMainClass());
|
||||
kieContainerUpdate.setArtifactID(projectPersist.getArtifactID());
|
||||
kieContainerUpdate.setGroupID(projectPersist.getGroupID());
|
||||
kieContainerUpdate.setProjectVersion(projectPersist.getProjectVersion());
|
||||
kieContainerUpdate.setContainerID(projectPersist.getContainerID());
|
||||
kieContainerUpdate.setAction(KieContainerUpdate.STATUS.TODEPLOY);
|
||||
kafkaKieContainerUpdateTemplate.send(serverName,kieContainerUpdate);
|
||||
workOnGoingView.addRow("Deploy Request="+kieContainerUpdate,ui);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@ package org.chtijbug.drools.console.util;
|
|||
|
||||
import com.vaadin.flow.data.validator.RegexpValidator;
|
||||
|
||||
public class hostnameValidator extends RegexpValidator {
|
||||
public class HostnameValidator extends RegexpValidator {
|
||||
|
||||
private static final String PATTERN ="(^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])$)";
|
||||
|
||||
public hostnameValidator(String errorMessage) {
|
||||
public HostnameValidator(String errorMessage) {
|
||||
super(errorMessage, PATTERN, true);
|
||||
}
|
||||
}
|
||||
|
|
@ -7,6 +7,6 @@ public class PasswordValidator extends RegexpValidator {
|
|||
private static final String PATTERN = "[a-zA-Z0-9_@./*#&+-]{4,30}";
|
||||
|
||||
public PasswordValidator(String errorMessage) {
|
||||
super(errorMessage, "[a-zA-Z0-9_@./#*&+-]{4,30}", true);
|
||||
super(errorMessage, PATTERN, true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,13 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.Squelette;
|
||||
package org.chtijbug.drools.console.vaadincomponent.Squelette;
|
||||
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
import com.vaadin.flow.component.splitlayout.SplitLayout;
|
||||
import org.chtijbug.drools.console.service.UserConnectedService;
|
||||
import org.chtijbug.drools.console.service.util.AppContext;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.ConsoleDeploy;
|
||||
import org.chtijbug.drools.console.vaadinComponent.leftMenu.LeftMenuGlobal;
|
||||
import org.chtijbug.drools.console.vaadinComponent.menu.*;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentview.ConsoleDeploy;
|
||||
import org.chtijbug.drools.console.vaadincomponent.leftMenu.LeftMenuGlobal;
|
||||
import org.chtijbug.drools.console.vaadincomponent.menu.*;
|
||||
import org.chtijbug.drools.console.view.DeploymentView;
|
||||
|
||||
@StyleSheet("css/accueil.css")
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.ComponentPerso;
|
||||
package org.chtijbug.drools.console.vaadincomponent.componentperso;
|
||||
|
||||
|
||||
import com.vaadin.flow.component.combobox.ComboBox;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.ComponentPerso;
|
||||
package org.chtijbug.drools.console.vaadincomponent.componentperso;
|
||||
|
||||
import com.vaadin.flow.component.datepicker.DatePicker;
|
||||
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.ComponentPerso;
|
||||
package org.chtijbug.drools.console.vaadincomponent.componentperso;
|
||||
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.ComponentPerso;
|
||||
package org.chtijbug.drools.console.vaadincomponent.componentperso;
|
||||
|
||||
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||
import com.vaadin.flow.component.icon.Icon;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.ComponentPerso;
|
||||
package org.chtijbug.drools.console.vaadincomponent.componentperso;
|
||||
|
||||
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||
import com.vaadin.flow.component.icon.Icon;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.componentView;
|
||||
package org.chtijbug.drools.console.vaadincomponent.componentview;
|
||||
|
||||
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||
import com.vaadin.flow.component.grid.Grid;
|
||||
|
|
@ -7,8 +7,8 @@ import org.chtijbug.drools.console.service.KieRepositoryService;
|
|||
import org.chtijbug.drools.console.service.UserConnectedService;
|
||||
import org.chtijbug.drools.console.service.model.kie.KieConfigurationData;
|
||||
import org.chtijbug.drools.console.service.util.AppContext;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.service.GuidedDecisionTableModelTransformer;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.service.GuidedRuleTemplateModelTransformer;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentview.service.GuidedDecisionTableModelTransformer;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentview.service.GuidedRuleTemplateModelTransformer;
|
||||
import org.drools.workbench.models.guided.dtable.backend.GuidedDTXMLPersistence;
|
||||
import org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52;
|
||||
import org.drools.workbench.models.guided.template.backend.RuleTemplateModelXMLPersistenceImpl;
|
||||
|
|
@ -21,10 +21,11 @@ import java.util.Map;
|
|||
@StyleSheet("css/accueil.css")
|
||||
public class AssetEdit extends Grid<HashMap<String, Object>> {
|
||||
|
||||
private KieRepositoryService kieRepositoryService;
|
||||
private KieConfigurationData config;
|
||||
private transient KieRepositoryService kieRepositoryService;
|
||||
|
||||
private UserConnectedService userConnectedService;
|
||||
private transient KieConfigurationData config;
|
||||
|
||||
private transient UserConnectedService userConnectedService;
|
||||
|
||||
public AssetEdit() {
|
||||
|
||||
|
|
@ -43,7 +44,7 @@ public class AssetEdit extends Grid<HashMap<String, Object>> {
|
|||
Binder<HashMap<String, Object>> binder = new Binder<>();
|
||||
getEditor().setBinder(binder);
|
||||
setClassName("grid-perso");
|
||||
if (assetContent.startsWith("<decision-table52")==true){
|
||||
if (assetContent.startsWith("<decision-table52")){
|
||||
GuidedDecisionTable52 model = GuidedDTXMLPersistence.getInstance().unmarshal(assetContent);
|
||||
GuidedDecisionTableModelTransformer transform = new GuidedDecisionTableModelTransformer(model, binder, this);
|
||||
transform.run();
|
||||
|
|
@ -68,7 +69,7 @@ public class AssetEdit extends Grid<HashMap<String, Object>> {
|
|||
Binder<HashMap<String, Object>> binder = new Binder<>();
|
||||
getEditor().setBinder(binder);
|
||||
|
||||
if(objects.size()>0){
|
||||
if(!objects.isEmpty()){
|
||||
for(Map.Entry<String,Object> t:objects.get(0).entrySet()){
|
||||
addColumn(hashmap -> hashmap.get(t.getKey())).setHeader(t.getKey());
|
||||
|
||||
|
|
@ -78,10 +79,5 @@ public class AssetEdit extends Grid<HashMap<String, Object>> {
|
|||
setItems(objects);
|
||||
}
|
||||
|
||||
public void maj(List<HashMap<String, Object>> objects){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.componentView;
|
||||
package org.chtijbug.drools.console.vaadincomponent.componentview;
|
||||
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
import com.vaadin.flow.component.dialog.Dialog;
|
||||
|
|
@ -24,7 +24,7 @@ public class AssociateProjectKie extends VerticalLayout {
|
|||
|
||||
private Button associer;
|
||||
|
||||
private ProjectPersistService projectPersistService;
|
||||
private transient ProjectPersistService projectPersistService;
|
||||
|
||||
public AssociateProjectKie(DeploymentView deploymentView, Dialog dialog, ProjectPersist projectPersist) {
|
||||
|
||||
|
|
@ -52,11 +52,11 @@ public class AssociateProjectKie extends VerticalLayout {
|
|||
for (RuntimePersist runtimePersist : gridRuntime.getSelectedItems()) {
|
||||
lstToSave.add(runtimePersist);
|
||||
}
|
||||
if (lstToSave.size()>0) {
|
||||
if (!lstToSave.isEmpty()) {
|
||||
|
||||
boolean tmp = projectPersistService.associate(projectPersist,lstToSave);
|
||||
boolean tmp = projectPersistService.associate(projectPersist, lstToSave);
|
||||
|
||||
if (tmp == true) {
|
||||
if (tmp) {
|
||||
deploymentView.setDataProvider();
|
||||
dialog.close();
|
||||
} else {
|
||||
|
|
@ -67,12 +67,7 @@ public class AssociateProjectKie extends VerticalLayout {
|
|||
});
|
||||
|
||||
gridRuntime.addSelectionListener(selectionEvent -> {
|
||||
if ( selectionEvent.getFirstSelectedItem().isPresent()) {
|
||||
|
||||
associer.setEnabled(true);
|
||||
} else {
|
||||
associer.setEnabled(false);
|
||||
}
|
||||
associer.setEnabled(selectionEvent.getFirstSelectedItem().isPresent());
|
||||
});
|
||||
|
||||
|
||||
|
|
@ -1,96 +1,96 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.componentView;
|
||||
package org.chtijbug.drools.console.vaadincomponent.componentview;
|
||||
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
import com.vaadin.flow.component.html.Label;
|
||||
import com.vaadin.flow.component.icon.VaadinIcon;
|
||||
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
import com.vaadin.flow.component.html.Label;
|
||||
import com.vaadin.flow.component.page.Push;
|
||||
import org.chtijbug.drools.console.AddLog;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class ConsoleDeploy extends HorizontalLayout {
|
||||
|
||||
public VerticalLayout outilsBar;
|
||||
private static String activeClass = "active";
|
||||
|
||||
public VerticalLayout content;
|
||||
private transient VerticalLayout outilsBar;
|
||||
|
||||
public HorizontalLayout titleContent;
|
||||
private transient VerticalLayout content;
|
||||
|
||||
public VerticalLayout logContent;
|
||||
private transient HorizontalLayout titleContent;
|
||||
|
||||
public Button menu;
|
||||
private transient VerticalLayout logContent;
|
||||
|
||||
public Button clear;
|
||||
private transient Button menu;
|
||||
|
||||
private Label title;
|
||||
private transient Button clear;
|
||||
|
||||
public ConsoleDeploy(){
|
||||
private transient Label title;
|
||||
|
||||
public ConsoleDeploy() {
|
||||
|
||||
setClassName("console-content-all");
|
||||
setVisible(false);
|
||||
|
||||
outilsBar=new VerticalLayout();
|
||||
outilsBar = new VerticalLayout();
|
||||
outilsBar.setClassName("console-outilsBar-content");
|
||||
add(outilsBar);
|
||||
|
||||
menu=new Button("",VaadinIcon.MENU.create());
|
||||
menu = new Button("", VaadinIcon.MENU.create());
|
||||
menu.setClassName("console-button");
|
||||
menu.addClickListener(buttonClickEvent -> {
|
||||
if(isActive()){
|
||||
if (isActive()) {
|
||||
removeActive();
|
||||
content.setVisible(false);
|
||||
}else {
|
||||
} else {
|
||||
active();
|
||||
content.setVisible(true);
|
||||
}
|
||||
});
|
||||
outilsBar.add(menu);
|
||||
|
||||
clear=new Button("", VaadinIcon.PANEL.create());
|
||||
clear = new Button("", VaadinIcon.PANEL.create());
|
||||
clear.setClassName("console-button");
|
||||
clear.addClickListener(buttonClickEvent -> {
|
||||
logContent.removeAll();
|
||||
});
|
||||
clear.addClickListener(buttonClickEvent ->
|
||||
logContent.removeAll()
|
||||
);
|
||||
outilsBar.add(clear);
|
||||
|
||||
content=new VerticalLayout();
|
||||
content = new VerticalLayout();
|
||||
content.setClassName("console-content");
|
||||
add(content);
|
||||
content.setVisible(false);
|
||||
|
||||
|
||||
titleContent=new HorizontalLayout();
|
||||
titleContent = new HorizontalLayout();
|
||||
titleContent.setClassName("console-content-title");
|
||||
content.add(titleContent);
|
||||
|
||||
title=new Label("Console : ");
|
||||
title = new Label("Console : ");
|
||||
title.setClassName("console-title");
|
||||
titleContent.add(title);
|
||||
|
||||
logContent=new VerticalLayout();
|
||||
logContent = new VerticalLayout();
|
||||
logContent.setClassName("console-log-content");
|
||||
content.add(logContent);
|
||||
}
|
||||
private boolean isActive(){
|
||||
return getClassNames().contains("active");
|
||||
|
||||
private boolean isActive() {
|
||||
return getClassNames().contains(activeClass);
|
||||
}
|
||||
|
||||
private void removeActive() {
|
||||
|
||||
if(getClassNames().contains("active")){
|
||||
getClassNames().remove("active");
|
||||
if (getClassNames().contains(activeClass)) {
|
||||
getClassNames().remove(activeClass);
|
||||
}
|
||||
}
|
||||
private void active(){
|
||||
|
||||
private void active() {
|
||||
removeActive();
|
||||
|
||||
getClassNames().add("active");
|
||||
getClassNames().add(activeClass);
|
||||
}
|
||||
|
||||
public void setTtile(String nameProject){
|
||||
title.setText("Console : "+nameProject);
|
||||
public void setTtile(String nameProject) {
|
||||
title.setText("Console : " + nameProject);
|
||||
}
|
||||
|
||||
public VerticalLayout getLogContent() {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.componentView;
|
||||
package org.chtijbug.drools.console.vaadincomponent.componentview;
|
||||
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
import com.vaadin.flow.component.dialog.Dialog;
|
||||
|
|
@ -8,10 +8,9 @@ import com.vaadin.flow.component.notification.Notification;
|
|||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
import com.vaadin.flow.data.value.ValueChangeMode;
|
||||
import org.chtijbug.drools.console.service.ProjectPersistService;
|
||||
import org.chtijbug.drools.console.service.UserConnectedService;
|
||||
import org.chtijbug.drools.console.service.util.AppContext;
|
||||
import org.chtijbug.drools.console.vaadinComponent.ComponentPerso.ComboBoxPerso;
|
||||
import org.chtijbug.drools.console.vaadinComponent.ComponentPerso.TextFieldPerso;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentperso.ComboBoxPerso;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentperso.TextFieldPerso;
|
||||
import org.chtijbug.drools.console.view.DeploymentView;
|
||||
import org.chtijbug.drools.proxy.persistence.model.ProjectPersist;
|
||||
|
||||
|
|
@ -31,16 +30,12 @@ public class DefineProject extends VerticalLayout {
|
|||
|
||||
private Button valider;
|
||||
|
||||
//METIER
|
||||
|
||||
private UserConnectedService userConnectedService;
|
||||
|
||||
private ProjectPersistService projectPersistService;
|
||||
private transient ProjectPersistService projectPersistService;
|
||||
private boolean createMode;
|
||||
|
||||
public DefineProject(DeploymentView deploymentView,Dialog dialog, ProjectPersist projectPersist){
|
||||
|
||||
userConnectedService= AppContext.getApplicationContext().getBean(UserConnectedService.class);
|
||||
|
||||
projectPersistService=AppContext.getApplicationContext().getBean(ProjectPersistService.class);
|
||||
|
||||
setClassName("creation-runtime-content");
|
||||
|
|
@ -76,7 +71,7 @@ public class DefineProject extends VerticalLayout {
|
|||
mainClass.getComboBox().setRequired(true);
|
||||
if (projectPersist.getMainClass()!= null
|
||||
&& projectPersist.getMainClass().length()>0){
|
||||
mainClass.getComboBox().setValue("class="+(String)projectPersist.getMainClass());
|
||||
mainClass.getComboBox().setValue("class="+projectPersist.getMainClass());
|
||||
}
|
||||
mainClass.getComboBox().addValueChangeListener(textFieldStringComponentValueChangeEvent -> {
|
||||
verify();
|
||||
|
|
@ -114,7 +109,7 @@ public class DefineProject extends VerticalLayout {
|
|||
}
|
||||
valider.setClassName("login-application-connexion");
|
||||
valider.addClickListener(buttonClickEvent -> {
|
||||
if (createMode==true) {
|
||||
if (createMode) {
|
||||
projectPersist.setStatus(ProjectPersist.DEFINI);
|
||||
}
|
||||
projectPersistService.addProjectToSession(projectPersist,true);
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.componentView;
|
||||
package org.chtijbug.drools.console.vaadincomponent.componentview;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
|
@ -16,7 +16,7 @@ import com.vaadin.flow.data.value.ValueChangeMode;
|
|||
import com.vaadin.flow.function.SerializablePredicate;
|
||||
import org.chtijbug.drools.console.service.IndexerService;
|
||||
import org.chtijbug.drools.console.service.util.AppContext;
|
||||
import org.chtijbug.drools.console.vaadinComponent.ComponentPerso.DialogPerso;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentperso.DialogPerso;
|
||||
import org.chtijbug.drools.logging.Fact;
|
||||
import org.chtijbug.drools.proxy.persistence.model.BusinessTransactionAction;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
|
|
@ -52,11 +52,11 @@ public class GridActionLogging extends Grid<BusinessTransactionAction> {
|
|||
private ListDataProvider<BusinessTransactionAction> dataProvider;
|
||||
private ConfigurableFilterDataProvider<BusinessTransactionAction, Void, SerializablePredicate<BusinessTransactionAction>> filterDataProvider;
|
||||
|
||||
private IndexerService indexerService;
|
||||
private transient IndexerService indexerService;
|
||||
|
||||
public GridActionLogging(String idRequest) {
|
||||
|
||||
mapper.setDateFormat( new SimpleDateFormat("dd-MM-yyyy hh:mm"));
|
||||
mapper.setDateFormat(new SimpleDateFormat("dd-MM-yyyy hh:mm"));
|
||||
indexerService = AppContext.getApplicationContext().getBean(IndexerService.class);
|
||||
|
||||
setClassName("action-log-grid-perso");
|
||||
|
|
@ -87,43 +87,43 @@ public class GridActionLogging extends Grid<BusinessTransactionAction> {
|
|||
Grid.Column<BusinessTransactionAction> enventTypeC = addColumn(runtimePersist -> runtimePersist.getEventType());
|
||||
this.eventType = new TextField(strEventType);
|
||||
this.eventType.setValueChangeMode(ValueChangeMode.EAGER);
|
||||
this.eventType.addValueChangeListener(e -> {
|
||||
refreshtGrid(this.eventType.getValue(), strEventType);
|
||||
});
|
||||
this.eventType.addValueChangeListener(e ->
|
||||
refreshtGrid(this.eventType.getValue(), strEventType)
|
||||
);
|
||||
enventTypeC.setHeader(this.eventType).setResizable(true);
|
||||
|
||||
Grid.Column<BusinessTransactionAction> positionC = addColumn(runtimePersist -> runtimePersist.getEventNumber());
|
||||
|
||||
positionExecution = new TextField(strPositionExecution);
|
||||
positionExecution.setValueChangeMode(ValueChangeMode.EAGER);
|
||||
positionExecution.addValueChangeListener(e -> {
|
||||
refreshtGrid(positionExecution.getValue(), strPositionExecution);
|
||||
});
|
||||
positionExecution.addValueChangeListener(e ->
|
||||
refreshtGrid(positionExecution.getValue(), strPositionExecution)
|
||||
);
|
||||
positionC.setHeader(positionExecution).setResizable(true);
|
||||
positionC.setWidth("3%");
|
||||
|
||||
Grid.Column<BusinessTransactionAction> ruleNameC = addColumn(runtimePersist -> runtimePersist.getRuleExecution() != null ? runtimePersist.getRuleExecution().getRuleName() : "");
|
||||
ruleName = new TextField(strRuleName);
|
||||
ruleName.setValueChangeMode(ValueChangeMode.EAGER);
|
||||
ruleName.addValueChangeListener(e -> {
|
||||
refreshtGrid(ruleName.getValue(), strRuleName);
|
||||
});
|
||||
ruleName.addValueChangeListener(e ->
|
||||
refreshtGrid(ruleName.getValue(), strRuleName)
|
||||
);
|
||||
ruleNameC.setHeader(ruleName).setResizable(true);
|
||||
|
||||
Grid.Column<BusinessTransactionAction> versionC = addColumn(runtimePersist -> runtimePersist.getRuleExecution() != null ? runtimePersist.getRuleExecution().getPackageName() : "");
|
||||
packageName = new TextField(strPackageName);
|
||||
packageName.setValueChangeMode(ValueChangeMode.EAGER);
|
||||
packageName.addValueChangeListener(e -> {
|
||||
refreshtGrid(packageName.getValue(), strPackageName);
|
||||
});
|
||||
packageName.addValueChangeListener(e ->
|
||||
refreshtGrid(packageName.getValue(), strPackageName)
|
||||
);
|
||||
versionC.setHeader(packageName).setResizable(true);
|
||||
|
||||
Grid.Column<BusinessTransactionAction> ruleflowC = addColumn(runtimePersist -> runtimePersist.getRuleflowGroupName() != null ? runtimePersist.getRuleflowGroupName() : "");
|
||||
ruleFlowGroup = new TextField(strRuleFlowGroup);
|
||||
ruleFlowGroup.setValueChangeMode(ValueChangeMode.EAGER);
|
||||
ruleFlowGroup.addValueChangeListener(e -> {
|
||||
refreshtGrid(ruleFlowGroup.getValue(), strRuleFlowGroup);
|
||||
});
|
||||
ruleFlowGroup.addValueChangeListener(e ->
|
||||
refreshtGrid(ruleFlowGroup.getValue(), strRuleFlowGroup)
|
||||
);
|
||||
ruleflowC.setHeader(ruleFlowGroup).setResizable(true);
|
||||
|
||||
addColumn(new ComponentRenderer<>(runtimePersist -> {
|
||||
|
|
@ -140,21 +140,21 @@ public class GridActionLogging extends Grid<BusinessTransactionAction> {
|
|||
if (b != null && b.getInputData() != null && b.getInputData().getRealFact() != null) {
|
||||
|
||||
VerticalLayout verticalLayout = new VerticalLayout();
|
||||
Label label = new Label(b.getEventType().name() );
|
||||
Label label = new Label(b.getEventType().name());
|
||||
label.setClassName("creation-runtime-title");
|
||||
verticalLayout.add(label);
|
||||
verticalLayout.setClassName("content-action-logging");
|
||||
|
||||
TextArea textArea = new TextArea(b.getInputData().getFactType().name()+"-"+b.getInputData().getFullClassName());
|
||||
TextArea textArea = new TextArea(b.getInputData().getFactType().name() + "-" + b.getInputData().getFullClassName());
|
||||
textArea.setReadOnly(true);
|
||||
textArea.setClassName("content-log");
|
||||
try {
|
||||
mapper.setDateFormat( new SimpleDateFormat("dd-MM-yyyy hh:mm"));
|
||||
mapper.setDateFormat(new SimpleDateFormat("dd-MM-yyyy hh:mm"));
|
||||
String text = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(b.getInputData().getRealFact());
|
||||
textArea.setValue(text);
|
||||
} catch (JsonProcessingException e) {
|
||||
textArea.setValue(
|
||||
b.getInputData().getRealFact().toString().replaceAll(",", ",\n")
|
||||
b.getInputData().getRealFact().toString().replace(",", ",\n")
|
||||
.replaceAll("\\{", "\\{\n")
|
||||
.replaceAll("\\}", "\n\\}")
|
||||
.replaceAll("\\[", "\n\\[")
|
||||
|
|
@ -186,7 +186,7 @@ public class GridActionLogging extends Grid<BusinessTransactionAction> {
|
|||
verticalLayout.add(label);
|
||||
verticalLayout.setClassName("content-action-logging");
|
||||
|
||||
TextArea textArea = new TextArea(b.getFact().getFactType().name()+"-"+b.getFact().getFullClassName());
|
||||
TextArea textArea = new TextArea(b.getFact().getFactType().name() + "-" + b.getFact().getFullClassName());
|
||||
textArea.setReadOnly(true);
|
||||
textArea.setClassName("content-log");
|
||||
try {
|
||||
|
|
@ -194,10 +194,10 @@ public class GridActionLogging extends Grid<BusinessTransactionAction> {
|
|||
textArea.setValue(text);
|
||||
} catch (JsonProcessingException e) {
|
||||
textArea.setValue(
|
||||
b.getFact().getRealFact().toString().replaceAll(",", ",\n")
|
||||
.replaceAll("\\{", "\\{\n")
|
||||
.replaceAll("\\}", "\n\\}")
|
||||
.replaceAll("\\[", "\n\\[")
|
||||
b.getFact().getRealFact().toString().replace(",", ",\n")
|
||||
.replace("\\{", "\\{\n")
|
||||
.replace("\\}", "\n\\}")
|
||||
.replace("\\[", "\n\\[")
|
||||
|
||||
);
|
||||
}
|
||||
|
|
@ -209,7 +209,7 @@ public class GridActionLogging extends Grid<BusinessTransactionAction> {
|
|||
});
|
||||
horizontalLayout.add(realFact);
|
||||
}
|
||||
if (runtimePersist.getRuleExecution() != null && runtimePersist.getRuleExecution().getThenFacts() != null && runtimePersist.getRuleExecution().getThenFacts().size() > 0) {
|
||||
if (runtimePersist.getRuleExecution() != null && runtimePersist.getRuleExecution().getThenFacts() != null && !runtimePersist.getRuleExecution().getThenFacts().isEmpty()) {
|
||||
Button whenFact = new Button("When Data");
|
||||
whenFact.setClassName("menu-button");
|
||||
whenFact.setEnabled(true);
|
||||
|
|
@ -228,7 +228,7 @@ public class GridActionLogging extends Grid<BusinessTransactionAction> {
|
|||
for (Fact fact : b.getRuleExecution().getWhenFacts()) {
|
||||
if (fact != null && fact.getRealFact() != null) {
|
||||
|
||||
TextArea textArea = new TextArea(fact.getFactType().name()+"-"+fact.getFullClassName());
|
||||
TextArea textArea = new TextArea(fact.getFactType().name() + "-" + fact.getFullClassName());
|
||||
textArea.setReadOnly(true);
|
||||
textArea.setClassName("content-log");
|
||||
try {
|
||||
|
|
@ -236,10 +236,10 @@ public class GridActionLogging extends Grid<BusinessTransactionAction> {
|
|||
textArea.setValue(text);
|
||||
} catch (JsonProcessingException e) {
|
||||
textArea.setValue(
|
||||
fact.getRealFact().toString().replaceAll(",", ",\n")
|
||||
.replaceAll("\\{", "\\{\n")
|
||||
.replaceAll("\\}", "\n\\}")
|
||||
.replaceAll("\\[", "\n\\[")
|
||||
fact.getRealFact().toString().replace(",", ",\n")
|
||||
.replace("\\{", "\\{\n")
|
||||
.replace("\\}", "\n\\}")
|
||||
.replace("\\[", "\n\\[")
|
||||
|
||||
);
|
||||
}
|
||||
|
|
@ -253,7 +253,8 @@ public class GridActionLogging extends Grid<BusinessTransactionAction> {
|
|||
});
|
||||
horizontalLayout.add(whenFact);
|
||||
}
|
||||
if (runtimePersist.getRuleExecution() != null && runtimePersist.getRuleExecution().getThenFacts() != null && runtimePersist.getRuleExecution().getThenFacts().size() > 0) {
|
||||
if (runtimePersist.getRuleExecution() != null && runtimePersist.getRuleExecution().getThenFacts() != null
|
||||
&& !runtimePersist.getRuleExecution().getThenFacts().isEmpty()) {
|
||||
|
||||
Button thenFact = new Button("Then data");
|
||||
thenFact.setClassName("menu-button");
|
||||
|
|
@ -263,7 +264,8 @@ public class GridActionLogging extends Grid<BusinessTransactionAction> {
|
|||
|
||||
BusinessTransactionAction b = runtimePersist;
|
||||
|
||||
if (b != null && b.getRuleExecution() != null && b.getRuleExecution().getThenFacts() != null) {
|
||||
if (b != null && b.getRuleExecution() != null
|
||||
&& b.getRuleExecution().getThenFacts() != null) {
|
||||
|
||||
VerticalLayout verticalLayout = new VerticalLayout();
|
||||
Label label = new Label(b.getEventType().name() + " - " + (b.getRuleExecution() != null && b.getRuleExecution().getRuleName() != null ? b.getRuleExecution().getRuleName() : ""));
|
||||
|
|
@ -273,7 +275,7 @@ public class GridActionLogging extends Grid<BusinessTransactionAction> {
|
|||
for (Fact fact : b.getRuleExecution().getThenFacts()) {
|
||||
if (fact != null && fact.getRealFact() != null) {
|
||||
|
||||
TextArea textArea = new TextArea(fact.getFactType().name()+"-"+fact.getFullClassName());
|
||||
TextArea textArea = new TextArea(fact.getFactType().name() + "-" + fact.getFullClassName());
|
||||
textArea.setReadOnly(true);
|
||||
textArea.setClassName("content-log");
|
||||
try {
|
||||
|
|
@ -281,10 +283,10 @@ public class GridActionLogging extends Grid<BusinessTransactionAction> {
|
|||
textArea.setValue(text);
|
||||
} catch (JsonProcessingException e) {
|
||||
textArea.setValue(
|
||||
fact.getRealFact().toString().replaceAll(",", ",\n")
|
||||
.replaceAll("\\{", "\\{\n")
|
||||
.replaceAll("\\}", "\n\\}")
|
||||
.replaceAll("\\[", "\n\\[")
|
||||
fact.getRealFact().toString().replace(",", ",\n")
|
||||
.replace("\\{", "\\{\n")
|
||||
.replace("\\}", "\n\\}")
|
||||
.replace("\\[", "\n\\[")
|
||||
|
||||
);
|
||||
}
|
||||
|
|
@ -309,12 +311,12 @@ public class GridActionLogging extends Grid<BusinessTransactionAction> {
|
|||
if (b != null && b.getOutputData() != null && b.getOutputData().getRealFact() != null) {
|
||||
|
||||
VerticalLayout verticalLayout = new VerticalLayout();
|
||||
Label label = new Label(b.getEventType().name() );
|
||||
Label label = new Label(b.getEventType().name());
|
||||
label.setClassName("creation-runtime-title");
|
||||
verticalLayout.add(label);
|
||||
verticalLayout.setClassName("content-action-logging");
|
||||
|
||||
TextArea textArea = new TextArea(b.getOutputData().getFactType().name()+"-"+b.getOutputData().getFullClassName());
|
||||
TextArea textArea = new TextArea(b.getOutputData().getFactType().name() + "-" + b.getOutputData().getFullClassName());
|
||||
textArea.setReadOnly(true);
|
||||
textArea.setClassName("content-log");
|
||||
try {
|
||||
|
|
@ -322,10 +324,10 @@ public class GridActionLogging extends Grid<BusinessTransactionAction> {
|
|||
textArea.setValue(text);
|
||||
} catch (JsonProcessingException e) {
|
||||
textArea.setValue(
|
||||
b.getOutputData().getRealFact().toString().replaceAll(",", ",\n")
|
||||
.replaceAll("\\{", "\\{\n")
|
||||
.replaceAll("\\}", "\n\\}")
|
||||
.replaceAll("\\[", "\n\\[")
|
||||
b.getOutputData().getRealFact().toString().replace(",", ",\n")
|
||||
.replace("\\{", "\\{\n")
|
||||
.replace("\\}", "\n\\}")
|
||||
.replace("\\[", "\n\\[")
|
||||
|
||||
);
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.componentView;
|
||||
package org.chtijbug.drools.console.vaadincomponent.componentview;
|
||||
|
||||
import com.vaadin.flow.component.grid.Grid;
|
||||
import com.vaadin.flow.component.html.Label;
|
||||
|
|
@ -43,7 +43,7 @@ public class GridLogging extends Grid<BusinessTransactionPersistence> {
|
|||
private ListDataProvider<BusinessTransactionPersistence> dataProvider;
|
||||
private ConfigurableFilterDataProvider<BusinessTransactionPersistence,Void,SerializablePredicate<BusinessTransactionPersistence>> filterDataProvider;
|
||||
|
||||
private IndexerService indexerService;
|
||||
private transient IndexerService indexerService;
|
||||
|
||||
public GridLogging(){
|
||||
|
||||
|
|
@ -54,10 +54,7 @@ public class GridLogging extends Grid<BusinessTransactionPersistence> {
|
|||
|
||||
|
||||
addColumn(new ComponentRenderer<>(runtimePersist -> {
|
||||
|
||||
Label label=new Label(runtimePersist.getHour()+":"+runtimePersist.getMinute()+":"+runtimePersist.getMillis()+" ->"+runtimePersist.getDay()+"/"+runtimePersist.getMonth()+"/"+runtimePersist.getYear());
|
||||
|
||||
return label;
|
||||
return new Label(runtimePersist.getHour()+":"+runtimePersist.getMinute()+":"+runtimePersist.getMillis()+" ->"+runtimePersist.getDay()+"/"+runtimePersist.getMonth()+"/"+runtimePersist.getYear());
|
||||
})).setHeader("Date");
|
||||
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.componentView;
|
||||
package org.chtijbug.drools.console.vaadincomponent.componentview;
|
||||
|
||||
import com.vaadin.flow.component.grid.Grid;
|
||||
import com.vaadin.flow.component.html.Label;
|
||||
|
|
@ -41,8 +41,8 @@ public class GridRuntime extends Grid<RuntimePersist> {
|
|||
|
||||
private String strStatus = "State";
|
||||
|
||||
private ProjectPersistService projectPersistService;
|
||||
private RuntimeService runtimeService;
|
||||
private transient ProjectPersistService projectPersistService;
|
||||
private transient RuntimeService runtimeService;
|
||||
|
||||
private ListDataProvider<RuntimePersist> dataProvider;
|
||||
private ConfigurableFilterDataProvider<RuntimePersist, Void, SerializablePredicate<RuntimePersist>> filterDataProvider;
|
||||
|
|
@ -1,19 +1,16 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.componentView.service;
|
||||
package org.chtijbug.drools.console.vaadincomponent.componentview.service;
|
||||
|
||||
import com.vaadin.flow.data.binder.Binder;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.AssetEdit;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.service.dtmodel.ColumnDefinition;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.service.dtmodel.DecisionTable;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.service.dtmodel.GuidedException;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.service.dtmodel.Row;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentview.AssetEdit;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentview.service.dtmodel.ColumnDefinition;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentview.service.dtmodel.DecisionTable;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentview.service.dtmodel.GuidedException;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentview.service.dtmodel.Row;
|
||||
import org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class GuidedDecisionTableModelTransformer {
|
||||
|
||||
|
|
@ -33,7 +30,7 @@ public class GuidedDecisionTableModelTransformer {
|
|||
try {
|
||||
DecisionTable decisionTable = new DecisionTable(model);
|
||||
for (ColumnDefinition columnDefinition : decisionTable.getColumnDefinitionList()) {
|
||||
if (columnDefinition.isHideColumn()==false) {
|
||||
if (!columnDefinition.isHideColumn()) {
|
||||
assetEdit.addColumn(hashmap -> hashmap.get(columnDefinition.getHeader())).setHeader(columnDefinition.getHeader());
|
||||
}
|
||||
}
|
||||
|
|
@ -45,9 +42,6 @@ public class GuidedDecisionTableModelTransformer {
|
|||
}
|
||||
|
||||
private void fillTable(DecisionTable decisionTable) {
|
||||
List<ColumnDefinition> columnDefinitions = decisionTable.getColumnDefinitionList();
|
||||
|
||||
DateFormat format = new SimpleDateFormat("dd-MMM-yyyy", Locale.FRANCE);
|
||||
List<HashMap<String, Object>> rows = new ArrayList<>();
|
||||
for (int i = 0; i < decisionTable.getRows().size(); i++) {
|
||||
Row row = decisionTable.getRows().get(i);
|
||||
|
|
@ -1,16 +1,13 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.componentView.service;
|
||||
package org.chtijbug.drools.console.vaadincomponent.componentview.service;
|
||||
|
||||
import com.vaadin.flow.data.binder.Binder;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.AssetEdit;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentview.AssetEdit;
|
||||
import org.drools.workbench.models.datamodel.rule.InterpolationVariable;
|
||||
import org.drools.workbench.models.guided.template.shared.TemplateModel;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class GuidedRuleTemplateModelTransformer {
|
||||
|
||||
|
|
@ -34,7 +31,6 @@ public class GuidedRuleTemplateModelTransformer {
|
|||
}
|
||||
private void fillTable(TemplateModel model) {
|
||||
InterpolationVariable[] variablesList = model.getInterpolationVariablesList();
|
||||
DateFormat format = new SimpleDateFormat("dd-MMM-yyyy", Locale.FRANCE);
|
||||
String[][] contenuTable = model.getTableAsArray();
|
||||
List<HashMap<String, Object>> rows = new ArrayList<>();
|
||||
for (int i = 0; i < model.getRowsCount(); i++) {
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.chtijbug.drools.console.vaadinComponent.componentView.service.dtmodel;
|
||||
package org.chtijbug.drools.console.vaadincomponent.componentview.service.dtmodel;
|
||||
|
||||
|
||||
import org.drools.workbench.models.guided.dtable.shared.model.*;
|
||||
|
|
@ -43,25 +43,25 @@ public class ColumnDefinition {
|
|||
|
||||
public ColumnDefinition(int columnNumber, RowNumberCol52 rowNumberCol52) {
|
||||
this.columnNumber = columnNumber;
|
||||
this.columnType = ColumnType.rowNumber;
|
||||
this.fieldType = DataType.TYPE_NUMERIC_INTEGER.toString();
|
||||
this.columnType = ColumnType.ROW_NUMBER;
|
||||
this.fieldType = DataType.TYPE_NUMERIC_INTEGER;
|
||||
this.rowNumberCol52 = rowNumberCol52;
|
||||
this.header = rowNumberCol52.getHeader();
|
||||
}
|
||||
|
||||
public ColumnDefinition(int columnNumber, DescriptionCol52 descriptionCol52) {
|
||||
this.columnNumber = columnNumber;
|
||||
this.columnType = ColumnType.description;
|
||||
this.columnType = ColumnType.DESCRIPTION;
|
||||
this.header = descriptionCol52.getHeader();
|
||||
this.fieldType = DataType.TYPE_STRING.toString();
|
||||
this.fieldType = DataType.TYPE_STRING;
|
||||
this.descriptionCol52 = descriptionCol52;
|
||||
}
|
||||
|
||||
public ColumnDefinition(int columnNumber, AttributeCol52 attributeCol52) {
|
||||
this.attributeCol52 = attributeCol52;
|
||||
this.columnNumber = columnNumber;
|
||||
this.columnType = ColumnType.attribute;
|
||||
this.fieldType = DataType.TYPE_STRING.toString();
|
||||
this.columnType = ColumnType.ATTRIBUTE;
|
||||
this.fieldType = DataType.TYPE_STRING;
|
||||
if (attributeCol52.getDefaultValue() != null) {
|
||||
this.hasDefaultValue = true;
|
||||
this.defaultValueCell = attributeCol52.getDefaultValue();
|
||||
|
|
@ -74,7 +74,7 @@ public class ColumnDefinition {
|
|||
public ColumnDefinition(int columnNumber, ConditionCol52 conditionCol52) {
|
||||
this.conditionCol52 = conditionCol52;
|
||||
this.columnNumber = columnNumber;
|
||||
this.columnType = ColumnType.condition;
|
||||
this.columnType = ColumnType.CONDITION;
|
||||
this.fieldType = conditionCol52.getFieldType();
|
||||
if (conditionCol52.getDefaultValue() != null) {
|
||||
this.hasDefaultValue = true;
|
||||
|
|
@ -83,34 +83,34 @@ public class ColumnDefinition {
|
|||
this.hideColumn = conditionCol52.isHideColumn();
|
||||
this.header = conditionCol52.getHeader();
|
||||
}
|
||||
|
||||
public ColumnDefinition(int columnNumber, ActionSetFieldCol52 actionSetFieldCol52) {
|
||||
this.actionSetFieldCol52 = actionSetFieldCol52;
|
||||
this.columnNumber = columnNumber;
|
||||
this.columnType = ColumnType.action;
|
||||
this.columnType = ColumnType.ACTION;
|
||||
this.fieldType = actionSetFieldCol52.getType();
|
||||
this.header = actionSetFieldCol52.getHeader();
|
||||
if (actionSetFieldCol52.getDefaultValue() != null) {
|
||||
DTCellValue52 defaultValue = actionSetFieldCol52.getDefaultValue();
|
||||
if (!(DataType.DataTypes.STRING.equals(defaultValue.getDataType()) && defaultValue.getStringValue().isEmpty())) {
|
||||
if (actionSetFieldCol52.getDefaultValue() != null
|
||||
&& !(DataType.DataTypes.STRING.equals(actionSetFieldCol52.getDefaultValue().getDataType()) && actionSetFieldCol52.getDefaultValue().getStringValue().isEmpty())) {
|
||||
this.hasDefaultValue = true;
|
||||
this.defaultValue = getValue(actionSetFieldCol52.getDefaultValue());
|
||||
}
|
||||
|
||||
}
|
||||
this.hideColumn = actionSetFieldCol52.isHideColumn();
|
||||
this.header = actionSetFieldCol52.getHeader();
|
||||
}
|
||||
|
||||
public ColumnDefinition(int columnNumber, ActionInsertFactCol52 actionInsertFact52) {
|
||||
this.actionInsertFact52 = actionInsertFact52;
|
||||
this.columnNumber = columnNumber;
|
||||
this.columnType = ColumnType.action;
|
||||
this.columnType = ColumnType.ACTION;
|
||||
this.fieldType = actionInsertFact52.getType();
|
||||
this.header = actionInsertFact52.getHeader();
|
||||
if (actionInsertFact52.getDefaultValue() != null) {
|
||||
DTCellValue52 defaultValue = actionInsertFact52.getDefaultValue();
|
||||
if (!(DataType.DataTypes.STRING.equals(defaultValue.getDataType()) && defaultValue.getStringValue().isEmpty())) {
|
||||
if (actionInsertFact52.getDefaultValue() != null
|
||||
&& !(DataType.DataTypes.STRING.equals(actionInsertFact52.getDefaultValue().getDataType()) && actionInsertFact52.getDefaultValue().getStringValue().isEmpty())) {
|
||||
this.hasDefaultValue = true;
|
||||
this.defaultValue = getValue(actionInsertFact52.getDefaultValue());
|
||||
}
|
||||
|
||||
}
|
||||
this.hideColumn = actionInsertFact52.isHideColumn();
|
||||
this.header = actionInsertFact52.getHeader();
|
||||
|
|
@ -123,43 +123,45 @@ public class ColumnDefinition {
|
|||
value = Boolean.toString(cell.getBooleanValue());
|
||||
break;
|
||||
case NUMERIC_BIGDECIMAL:
|
||||
if (cell.getNumericValue()!= null) {
|
||||
if (cell.getNumericValue() != null) {
|
||||
value = cell.getNumericValue().toString();
|
||||
}else{
|
||||
value="";
|
||||
} else {
|
||||
value = "";
|
||||
}
|
||||
break;
|
||||
case NUMERIC:
|
||||
if (cell.getNumericValue()!= null) {
|
||||
if (cell.getNumericValue() != null) {
|
||||
value = cell.getNumericValue().toString();
|
||||
}else{
|
||||
value="";
|
||||
} else {
|
||||
value = "";
|
||||
}
|
||||
break;
|
||||
case NUMERIC_INTEGER:
|
||||
if (cell.getNumericValue()!= null) {
|
||||
if (cell.getNumericValue() != null) {
|
||||
value = cell.getNumericValue().toString();
|
||||
}else{
|
||||
value="";
|
||||
} else {
|
||||
value = "";
|
||||
}
|
||||
break;
|
||||
case NUMERIC_DOUBLE:
|
||||
if (cell.getNumericValue()!= null) {
|
||||
if (cell.getNumericValue() != null) {
|
||||
value = cell.getNumericValue().toString();
|
||||
}else{
|
||||
value="";
|
||||
} else {
|
||||
value = "";
|
||||
}
|
||||
break;
|
||||
case STRING:
|
||||
value = cell.getStringValue();
|
||||
break;
|
||||
case DATE:
|
||||
if (cell.getDateValue()!= null) {
|
||||
if (cell.getDateValue() != null) {
|
||||
value = cell.getDateValue().toString();
|
||||
}else{
|
||||
value="";
|
||||
} else {
|
||||
value = "";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
/**
|
||||
* STRING,
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.chtijbug.drools.console.vaadinComponent.componentView.service.dtmodel;
|
||||
package org.chtijbug.drools.console.vaadincomponent.componentview.service.dtmodel;
|
||||
|
||||
/**
|
||||
* Created by IntelliJ IDEA.
|
||||
|
|
@ -22,5 +22,5 @@ package org.chtijbug.drools.console.vaadinComponent.componentView.service.dtmode
|
|||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
public enum ColumnType {
|
||||
rowNumber, description, attribute, condition, action
|
||||
ROW_NUMBER, DESCRIPTION, ATTRIBUTE, CONDITION, ACTION
|
||||
}
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.chtijbug.drools.console.vaadinComponent.componentView.service.dtmodel;
|
||||
package org.chtijbug.drools.console.vaadincomponent.componentview.service.dtmodel;
|
||||
|
||||
|
||||
import org.drools.workbench.models.guided.dtable.shared.model.*;
|
||||
|
|
@ -24,8 +24,8 @@ import java.util.List;
|
|||
public class DecisionTable {
|
||||
private String name;
|
||||
private GuidedDecisionTable52 guidedDecisionTable52;
|
||||
private List<ColumnDefinition> columnDefinitionList = new ArrayList<ColumnDefinition>();
|
||||
private List<Row> rows = new ArrayList<Row>();
|
||||
private List<ColumnDefinition> columnDefinitionList = new ArrayList<>();
|
||||
private List<Row> rows = new ArrayList<>();
|
||||
|
||||
public DecisionTable(GuidedDecisionTable52 guidedDecisionTable52) throws GuidedException {
|
||||
this.guidedDecisionTable52 = guidedDecisionTable52;
|
||||
|
|
@ -67,7 +67,6 @@ public class DecisionTable {
|
|||
for (List<DTCellValue52> line : this.guidedDecisionTable52.getData()) {
|
||||
try {
|
||||
Row newRow = new Row(line, this);
|
||||
//Row newRow = fillRow(line);
|
||||
rows.add(newRow);
|
||||
} catch (GuidedException e) {
|
||||
GuidedException chtijbugDroolsRestException = new GuidedException(e);
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.chtijbug.drools.console.vaadinComponent.componentView.service.dtmodel;
|
||||
package org.chtijbug.drools.console.vaadincomponent.componentview.service.dtmodel;
|
||||
|
||||
public class GuidedException extends Exception {
|
||||
private String className;
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.chtijbug.drools.console.vaadinComponent.componentView.service.dtmodel;
|
||||
package org.chtijbug.drools.console.vaadincomponent.componentview.service.dtmodel;
|
||||
|
||||
import org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52;
|
||||
|
||||
|
|
@ -22,13 +22,13 @@ import java.util.List;
|
|||
|
||||
public class Row {
|
||||
private DecisionTable decisionTable;
|
||||
private List<RowElement> rowElements = new ArrayList<RowElement>();
|
||||
private List<RowElement> rowElements = new ArrayList<>();
|
||||
private List<DTCellValue52> cellValue52List;
|
||||
|
||||
|
||||
protected Row(DecisionTable decisionTable, int rowNumber) throws GuidedException {
|
||||
this.decisionTable = decisionTable;
|
||||
this.cellValue52List = new ArrayList<DTCellValue52>();
|
||||
this.cellValue52List = new ArrayList<>();
|
||||
for (ColumnDefinition col : this.decisionTable.getColumnDefinitionList()) {
|
||||
RowElement newRowElement = new RowElement(col);
|
||||
this.cellValue52List.add(newRowElement.getDtCellValue52());
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.chtijbug.drools.console.vaadinComponent.componentView.service.dtmodel;
|
||||
package org.chtijbug.drools.console.vaadincomponent.componentview.service.dtmodel;
|
||||
|
||||
|
||||
import org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52;
|
||||
|
|
@ -31,10 +31,14 @@ import java.util.Date;
|
|||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
public class RowElement {
|
||||
private static String rowEelement ="RowElement";
|
||||
|
||||
private ColumnDefinition columnDefinition;
|
||||
private String value = "";
|
||||
private DTCellValue52 dtCellValue52;
|
||||
|
||||
|
||||
|
||||
public RowElement(ColumnDefinition columnDefinition, DTCellValue52 dtCellValue52) throws GuidedException {
|
||||
this.columnDefinition = columnDefinition;
|
||||
this.dtCellValue52 = dtCellValue52;
|
||||
|
|
@ -47,40 +51,40 @@ public class RowElement {
|
|||
|
||||
if (this.columnDefinition.isHasDefaultValue()) {
|
||||
this.value = this.columnDefinition.getDefaultValue();
|
||||
if (this.columnDefinition.getColumnDefinition() == ColumnType.rowNumber) {
|
||||
int rowNumber = new Integer(value).intValue();
|
||||
if (this.columnDefinition.getColumnDefinition() == ColumnType.ROW_NUMBER) {
|
||||
int rowNumber = Integer.parseInt(value);
|
||||
this.dtCellValue52.setNumericValue(rowNumber + 1);
|
||||
this.value = value;
|
||||
} else if (this.columnDefinition.getColumnDefinition() == ColumnType.description) {
|
||||
} else if (this.columnDefinition.getColumnDefinition() == ColumnType.DESCRIPTION) {
|
||||
this.dtCellValue52.setStringValue(value);
|
||||
|
||||
} else if (this.columnDefinition.getColumnDefinition() == ColumnType.attribute) {
|
||||
} else if (this.columnDefinition.getColumnDefinition() == ColumnType.ATTRIBUTE) {
|
||||
this.dtCellValue52.setStringValue(value);
|
||||
try {
|
||||
setValuedtCell(this.value);
|
||||
} catch (Exception e) {
|
||||
GuidedException chtijbugDroolsRestException = new GuidedException(e);
|
||||
chtijbugDroolsRestException.setClassName("RowElement");
|
||||
chtijbugDroolsRestException.setClassName(rowEelement);
|
||||
chtijbugDroolsRestException.setAttribute(this.columnDefinition.toString());
|
||||
chtijbugDroolsRestException.setValue(this.value);
|
||||
throw chtijbugDroolsRestException;
|
||||
}
|
||||
} else if (this.columnDefinition.getColumnDefinition() == ColumnType.condition) {
|
||||
} else if (this.columnDefinition.getColumnDefinition() == ColumnType.CONDITION) {
|
||||
try {
|
||||
setValuedtCell(this.value);
|
||||
} catch (Exception e) {
|
||||
GuidedException chtijbugDroolsRestException = new GuidedException(e);
|
||||
chtijbugDroolsRestException.setClassName("RowElement");
|
||||
chtijbugDroolsRestException.setClassName(rowEelement);
|
||||
chtijbugDroolsRestException.setAttribute(this.columnDefinition.toString());
|
||||
chtijbugDroolsRestException.setValue(this.value);
|
||||
throw chtijbugDroolsRestException;
|
||||
}
|
||||
} else if (this.columnDefinition.getColumnDefinition() == ColumnType.action) {
|
||||
} else if (this.columnDefinition.getColumnDefinition() == ColumnType.ACTION) {
|
||||
try {
|
||||
setValuedtCell(this.value);
|
||||
} catch (Exception e) {
|
||||
GuidedException chtijbugDroolsRestException = new GuidedException(e);
|
||||
chtijbugDroolsRestException.setClassName("RowElement");
|
||||
chtijbugDroolsRestException.setClassName(rowEelement);
|
||||
chtijbugDroolsRestException.setAttribute(this.columnDefinition.toString());
|
||||
chtijbugDroolsRestException.setValue(this.value);
|
||||
throw chtijbugDroolsRestException;
|
||||
|
|
@ -108,35 +112,35 @@ public class RowElement {
|
|||
}
|
||||
|
||||
private void setValuedtCell(String aValue) throws Exception {
|
||||
if (this.columnDefinition.getFieldType().toUpperCase().equals(DataType.TYPE_STRING.toString())) {
|
||||
if (this.columnDefinition.getFieldType().equalsIgnoreCase(DataType.TYPE_STRING)) {
|
||||
this.dtCellValue52.setStringValue(aValue);
|
||||
|
||||
} else if (this.columnDefinition.getFieldType().toUpperCase().equals(DataType.TYPE_NUMERIC_BIGDECIMAL.toString())) {
|
||||
} else if (this.columnDefinition.getFieldType().equalsIgnoreCase(DataType.TYPE_NUMERIC_BIGDECIMAL)) {
|
||||
this.dtCellValue52.setNumericValue(new BigDecimal(aValue));
|
||||
} else if (this.columnDefinition.getFieldType().toUpperCase().equals(DataType.TYPE_NUMERIC_BIGINTEGER.toString())) {
|
||||
} else if (this.columnDefinition.getFieldType().equalsIgnoreCase(DataType.TYPE_NUMERIC_BIGINTEGER)) {
|
||||
this.dtCellValue52.setNumericValue(new BigInteger(aValue));
|
||||
} else if (this.columnDefinition.getFieldType().toUpperCase().equals(DataType.TYPE_NUMERIC_BYTE.toString())) {
|
||||
this.dtCellValue52.setNumericValue(new Byte(aValue));
|
||||
} else if (this.columnDefinition.getFieldType().toUpperCase().equals(DataType.TYPE_NUMERIC_DOUBLE.toString())) {
|
||||
this.dtCellValue52.setNumericValue(new Double(aValue));
|
||||
} else if (this.columnDefinition.getFieldType().toUpperCase().equals("DOUBLE")) {
|
||||
this.dtCellValue52.setNumericValue(new Double(aValue));
|
||||
} else if (this.columnDefinition.getFieldType().toUpperCase().equals(DataType.TYPE_NUMERIC_FLOAT.toString())) {
|
||||
this.dtCellValue52.setNumericValue(new Float(aValue));
|
||||
} else if (this.columnDefinition.getFieldType().toUpperCase().equals(DataType.TYPE_NUMERIC_INTEGER.toString())) {
|
||||
this.dtCellValue52.setNumericValue(new Integer(aValue));
|
||||
} else if (this.columnDefinition.getFieldType().toUpperCase().equals(DataType.TYPE_NUMERIC_LONG.toString())) {
|
||||
this.dtCellValue52.setNumericValue(new Long(aValue));
|
||||
} else if (this.columnDefinition.getFieldType().toUpperCase().equals(DataType.TYPE_NUMERIC_SHORT.toString())) {
|
||||
this.dtCellValue52.setNumericValue(new Short(aValue));
|
||||
} else if (this.columnDefinition.getFieldType().toUpperCase().equals(DataType.TYPE_DATE.toString())) {
|
||||
} else if (this.columnDefinition.getFieldType().equalsIgnoreCase(DataType.TYPE_NUMERIC_BYTE)) {
|
||||
this.dtCellValue52.setNumericValue(Byte.parseByte(aValue));
|
||||
} else if (this.columnDefinition.getFieldType().equalsIgnoreCase(DataType.TYPE_NUMERIC_DOUBLE)) {
|
||||
this.dtCellValue52.setNumericValue( Double.parseDouble(aValue));
|
||||
} else if (this.columnDefinition.getFieldType().equalsIgnoreCase("DOUBLE")) {
|
||||
this.dtCellValue52.setNumericValue(Double.parseDouble(aValue));
|
||||
} else if (this.columnDefinition.getFieldType().equalsIgnoreCase(DataType.TYPE_NUMERIC_FLOAT)) {
|
||||
this.dtCellValue52.setNumericValue(Float.parseFloat(aValue));
|
||||
} else if (this.columnDefinition.getFieldType().equalsIgnoreCase(DataType.TYPE_NUMERIC_INTEGER)) {
|
||||
this.dtCellValue52.setNumericValue(Integer.parseInt(aValue));
|
||||
} else if (this.columnDefinition.getFieldType().equalsIgnoreCase(DataType.TYPE_NUMERIC_LONG)) {
|
||||
this.dtCellValue52.setNumericValue( Long.parseLong(aValue));
|
||||
} else if (this.columnDefinition.getFieldType().equalsIgnoreCase(DataType.TYPE_NUMERIC_SHORT)) {
|
||||
this.dtCellValue52.setNumericValue(Short.parseShort(aValue));
|
||||
} else if (this.columnDefinition.getFieldType().equalsIgnoreCase(DataType.TYPE_DATE)) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat();
|
||||
Date newDate = sdf.parse(aValue);
|
||||
this.dtCellValue52.setDateValue(newDate);
|
||||
} else if (this.columnDefinition.getFieldType().toUpperCase().equals(DataType.TYPE_BOOLEAN.toString())) {
|
||||
this.dtCellValue52.setBooleanValue(new Boolean(aValue));
|
||||
} else if (this.columnDefinition.getFieldType().toUpperCase().equals(DataType.TYPE_NUMERIC.toString())) {
|
||||
this.dtCellValue52.setNumericValue(new Double(aValue));
|
||||
} else if (this.columnDefinition.getFieldType().equalsIgnoreCase(DataType.TYPE_BOOLEAN)) {
|
||||
this.dtCellValue52.setBooleanValue( Boolean.parseBoolean(aValue));
|
||||
} else if (this.columnDefinition.getFieldType().equalsIgnoreCase(DataType.TYPE_NUMERIC)) {
|
||||
this.dtCellValue52.setNumericValue( Double.parseDouble(aValue));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.leftMenu.Action;
|
||||
package org.chtijbug.drools.console.vaadincomponent.leftMenu.Action;
|
||||
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
import com.vaadin.flow.component.icon.VaadinIcon;
|
||||
|
|
@ -7,8 +7,8 @@ import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
|||
import com.vaadin.flow.data.value.ValueChangeMode;
|
||||
import org.chtijbug.drools.console.service.IndexerService;
|
||||
import org.chtijbug.drools.console.service.util.AppContext;
|
||||
import org.chtijbug.drools.console.vaadinComponent.ComponentPerso.DialogPerso;
|
||||
import org.chtijbug.drools.console.vaadinComponent.ComponentPerso.TextFieldPerso;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentperso.DialogPerso;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentperso.TextFieldPerso;
|
||||
import org.chtijbug.drools.console.view.ActionLoggingView;
|
||||
import org.chtijbug.drools.console.view.LoggingView;
|
||||
import org.chtijbug.drools.proxy.persistence.model.BusinessTransactionPersistence;
|
||||
|
|
@ -1,19 +1,16 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.leftMenu.Action;
|
||||
package org.chtijbug.drools.console.vaadincomponent.leftMenu.Action;
|
||||
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
import com.vaadin.flow.component.icon.VaadinIcon;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
import org.chtijbug.drools.KieContainerResponse;
|
||||
import org.chtijbug.drools.common.KafkaTopicConstants;
|
||||
import org.chtijbug.drools.console.service.ProjectPersistService;
|
||||
import org.chtijbug.drools.console.service.util.AppContext;
|
||||
import org.chtijbug.drools.console.vaadinComponent.ComponentPerso.DialogPerso;
|
||||
import org.chtijbug.drools.console.vaadinComponent.Squelette.SqueletteComposant;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.AssociateProjectKie;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.DefineProject;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentperso.DialogPerso;
|
||||
import org.chtijbug.drools.console.vaadincomponent.Squelette.SqueletteComposant;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentview.AssociateProjectKie;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentview.DefineProject;
|
||||
import org.chtijbug.drools.console.view.DeploymentView;
|
||||
import org.chtijbug.drools.proxy.persistence.model.ProjectPersist;
|
||||
import org.springframework.kafka.annotation.KafkaListener;
|
||||
|
||||
public class DeploymentAction extends VerticalLayout {
|
||||
|
||||
|
|
@ -80,14 +77,7 @@ public class DeploymentAction extends VerticalLayout {
|
|||
|
||||
}
|
||||
|
||||
@KafkaListener(
|
||||
topics = KafkaTopicConstants.RESPONSE_DEPLOY_TOPIC,groupId = "Console",
|
||||
containerFactory = "ruleKafkaListenerKieContainerUpdateFactory")
|
||||
public void updateKieServerLogInfo(KieContainerResponse kieContainerResponse){
|
||||
if (getUI().isPresent()) {
|
||||
deploymentView.addRow("Deploy Response=" + kieContainerResponse.toString(), getUI().get());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private boolean isActive(Button button){
|
||||
return button.getClassNames().contains("active");
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.leftMenu.Action;
|
||||
package org.chtijbug.drools.console.vaadincomponent.leftMenu.Action;
|
||||
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
import org.chtijbug.drools.console.vaadinComponent.Squelette.SqueletteComposant;
|
||||
import org.chtijbug.drools.console.vaadincomponent.Squelette.SqueletteComposant;
|
||||
|
||||
public class RuntimesAction extends VerticalLayout {
|
||||
|
||||
|
|
@ -1,10 +1,9 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.leftMenu.Action;
|
||||
package org.chtijbug.drools.console.vaadincomponent.leftMenu.Action;
|
||||
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
import com.vaadin.flow.component.combobox.ComboBox;
|
||||
import com.vaadin.flow.component.icon.VaadinIcon;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
import org.chtijbug.drools.console.vaadinComponent.ComponentPerso.ComboBoxPerso;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentperso.ComboBoxPerso;
|
||||
import org.chtijbug.drools.console.view.TemplateView;
|
||||
import org.chtijbug.guvnor.server.jaxrs.model.PlatformProjectResponse;
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.leftMenu;
|
||||
package org.chtijbug.drools.console.vaadincomponent.leftMenu;
|
||||
|
||||
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||
import com.vaadin.flow.component.html.Image;
|
||||
|
|
@ -1,10 +1,7 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.leftMenu;
|
||||
package org.chtijbug.drools.console.vaadincomponent.leftMenu;
|
||||
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||
import com.vaadin.flow.component.html.Anchor;
|
||||
import com.vaadin.flow.component.icon.Icon;
|
||||
import com.vaadin.flow.component.icon.VaadinIcon;
|
||||
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.login;
|
||||
package org.chtijbug.drools.console.vaadincomponent.login;
|
||||
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||
|
|
@ -14,8 +14,8 @@ import org.chtijbug.drools.console.service.model.UserConnected;
|
|||
import org.chtijbug.drools.console.service.model.kie.KieConfigurationData;
|
||||
import org.chtijbug.drools.console.service.util.AppContext;
|
||||
import org.chtijbug.drools.console.util.PasswordValidator;
|
||||
import org.chtijbug.drools.console.vaadinComponent.ComponentPerso.PasswordFieldPerso;
|
||||
import org.chtijbug.drools.console.vaadinComponent.ComponentPerso.TextFieldPerso;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentperso.PasswordFieldPerso;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentperso.TextFieldPerso;
|
||||
|
||||
@StyleSheet("css/accueil.css")
|
||||
public class FormulaireComposant extends VerticalLayout {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.login;
|
||||
package org.chtijbug.drools.console.vaadincomponent.login;
|
||||
|
||||
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
|
|
@ -1,8 +1,7 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.login;
|
||||
package org.chtijbug.drools.console.vaadincomponent.login;
|
||||
|
||||
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
|
||||
@StyleSheet("css/accueil.css")
|
||||
public class LoginComponent extends HorizontalLayout {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.login;
|
||||
package org.chtijbug.drools.console.vaadincomponent.login;
|
||||
|
||||
import com.vaadin.flow.component.checkbox.Checkbox;
|
||||
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.menu;
|
||||
package org.chtijbug.drools.console.vaadincomponent.menu;
|
||||
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||
|
|
@ -10,7 +10,7 @@ import com.vaadin.flow.server.InputStreamFactory;
|
|||
import com.vaadin.flow.server.StreamResource;
|
||||
import org.chtijbug.drools.console.service.UserConnectedService;
|
||||
import org.chtijbug.drools.console.service.util.AppContext;
|
||||
import org.chtijbug.drools.console.vaadinComponent.Squelette.SqueletteComposant;
|
||||
import org.chtijbug.drools.console.vaadincomponent.Squelette.SqueletteComposant;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.menu;
|
||||
package org.chtijbug.drools.console.vaadincomponent.menu;
|
||||
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||
import com.vaadin.flow.component.icon.VaadinIcon;
|
||||
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
|
||||
import org.chtijbug.drools.console.vaadinComponent.Squelette.SqueletteComposant;
|
||||
import org.chtijbug.drools.console.vaadinComponent.leftMenu.Action.DeploymentAction;
|
||||
import org.chtijbug.drools.console.vaadincomponent.Squelette.SqueletteComposant;
|
||||
import org.chtijbug.drools.console.vaadincomponent.leftMenu.Action.DeploymentAction;
|
||||
import org.chtijbug.drools.console.view.DeploymentView;
|
||||
|
||||
@StyleSheet("css/accueil.css")
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.menu;
|
||||
package org.chtijbug.drools.console.vaadincomponent.menu;
|
||||
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||
import com.vaadin.flow.component.icon.VaadinIcon;
|
||||
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
|
||||
import org.chtijbug.drools.console.vaadinComponent.Squelette.SqueletteComposant;
|
||||
import org.chtijbug.drools.console.vaadinComponent.leftMenu.Action.TemplatesAction;
|
||||
import org.chtijbug.drools.console.vaadincomponent.Squelette.SqueletteComposant;
|
||||
import org.chtijbug.drools.console.vaadincomponent.leftMenu.Action.TemplatesAction;
|
||||
import org.chtijbug.drools.console.view.TemplateView;
|
||||
|
||||
@StyleSheet("css/accueil.css")
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.menu;
|
||||
package org.chtijbug.drools.console.vaadincomponent.menu;
|
||||
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||
|
|
@ -1,16 +1,12 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.menu;
|
||||
package org.chtijbug.drools.console.vaadincomponent.menu;
|
||||
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||
import com.vaadin.flow.component.icon.VaadinIcon;
|
||||
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
import org.chtijbug.drools.console.vaadinComponent.Squelette.SqueletteComposant;
|
||||
import org.chtijbug.drools.console.vaadinComponent.leftMenu.Action.ActionLogging;
|
||||
import org.chtijbug.drools.console.vaadinComponent.leftMenu.Action.RuntimesAction;
|
||||
import org.chtijbug.drools.console.view.DeploymentView;
|
||||
import org.chtijbug.drools.console.vaadincomponent.Squelette.SqueletteComposant;
|
||||
import org.chtijbug.drools.console.vaadincomponent.leftMenu.Action.ActionLogging;
|
||||
import org.chtijbug.drools.console.view.LoggingView;
|
||||
import org.chtijbug.drools.console.view.RuntimesView;
|
||||
|
||||
@StyleSheet("css/accueil.css")
|
||||
public class MenuSecondaireLogging extends HorizontalLayout {
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
package org.chtijbug.drools.console.vaadinComponent.menu;
|
||||
package org.chtijbug.drools.console.vaadincomponent.menu;
|
||||
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||
import com.vaadin.flow.component.icon.VaadinIcon;
|
||||
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
|
||||
import org.chtijbug.drools.console.vaadinComponent.Squelette.SqueletteComposant;
|
||||
import org.chtijbug.drools.console.vaadinComponent.leftMenu.Action.RuntimesAction;
|
||||
import org.chtijbug.drools.console.vaadincomponent.Squelette.SqueletteComposant;
|
||||
import org.chtijbug.drools.console.vaadincomponent.leftMenu.Action.RuntimesAction;
|
||||
import org.chtijbug.drools.console.view.DeploymentView;
|
||||
import org.chtijbug.drools.console.view.RuntimesView;
|
||||
|
||||
|
|
@ -8,7 +8,7 @@ import com.vaadin.flow.router.BeforeEnterEvent;
|
|||
import com.vaadin.flow.router.BeforeEnterObserver;
|
||||
import com.vaadin.flow.router.Route;
|
||||
import com.vaadin.flow.shared.communication.PushMode;
|
||||
import org.chtijbug.drools.console.vaadinComponent.Squelette.SqueletteComposant;
|
||||
import org.chtijbug.drools.console.vaadincomponent.Squelette.SqueletteComposant;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ import com.vaadin.flow.server.StreamResource;
|
|||
import org.apache.commons.io.IOUtils;
|
||||
import org.chtijbug.drools.console.service.IndexerService;
|
||||
import org.chtijbug.drools.console.service.util.AppContext;
|
||||
import org.chtijbug.drools.console.vaadinComponent.ComponentPerso.DialogPerso;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.GridActionLogging;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentperso.DialogPerso;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentview.GridActionLogging;
|
||||
import org.chtijbug.drools.logging.Fact;
|
||||
import org.chtijbug.drools.proxy.persistence.model.BusinessTransactionAction;
|
||||
import org.chtijbug.drools.proxy.persistence.model.BusinessTransactionPersistence;
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ import com.vaadin.flow.shared.communication.PushMode;
|
|||
import org.chtijbug.drools.console.AddLog;
|
||||
import org.chtijbug.drools.console.service.ProjectPersistService;
|
||||
import org.chtijbug.drools.console.service.util.AppContext;
|
||||
import org.chtijbug.drools.console.vaadinComponent.Squelette.SqueletteComposant;
|
||||
import org.chtijbug.drools.console.vaadinComponent.leftMenu.Action.DeploymentAction;
|
||||
import org.chtijbug.drools.console.vaadincomponent.Squelette.SqueletteComposant;
|
||||
import org.chtijbug.drools.console.vaadincomponent.leftMenu.Action.DeploymentAction;
|
||||
import org.chtijbug.drools.proxy.persistence.model.ProjectPersist;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
|
|||
|
|
@ -16,12 +16,12 @@ import org.chtijbug.drools.console.service.KieRepositoryService;
|
|||
import org.chtijbug.drools.console.service.UserConnectedService;
|
||||
import org.chtijbug.drools.console.service.model.kie.KieConfigurationData;
|
||||
import org.chtijbug.drools.console.service.util.AppContext;
|
||||
import org.chtijbug.drools.console.vaadinComponent.ComponentPerso.DialogPerso;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.AssetEdit;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.service.dtmodel.ColumnDefinition;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.service.dtmodel.DecisionTable;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.service.dtmodel.GuidedException;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.service.dtmodel.Row;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentperso.DialogPerso;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentview.AssetEdit;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentview.service.dtmodel.ColumnDefinition;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentview.service.dtmodel.DecisionTable;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentview.service.dtmodel.GuidedException;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentview.service.dtmodel.Row;
|
||||
import org.drools.workbench.models.datamodel.rule.InterpolationVariable;
|
||||
import org.drools.workbench.models.guided.dtable.backend.GuidedDTXMLPersistence;
|
||||
import org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52;
|
||||
|
|
@ -156,7 +156,7 @@ public class EditTemplateView extends VerticalLayout {
|
|||
add(assetEdit);
|
||||
String assetSource=this.getAssetContent();
|
||||
GuidedDecisionTable52 model = GuidedDTXMLPersistence.getInstance().unmarshal(assetSource);
|
||||
org.chtijbug.drools.console.vaadinComponent.componentView.service.dtmodel.DecisionTable decisionTable = new DecisionTable(model);
|
||||
org.chtijbug.drools.console.vaadincomponent.componentview.service.dtmodel.DecisionTable decisionTable = new DecisionTable(model);
|
||||
decisionTable.getRows().clear();
|
||||
List<ColumnDefinition> columnDefinitions = decisionTable.getColumnDefinitionList();
|
||||
int k=0;
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ package org.chtijbug.drools.console.view;
|
|||
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||
import com.vaadin.flow.component.html.Label;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.GridLogging;
|
||||
import org.chtijbug.drools.console.vaadinComponent.leftMenu.Action.ActionLogging;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentview.GridLogging;
|
||||
import org.chtijbug.drools.console.vaadincomponent.leftMenu.Action.ActionLogging;
|
||||
|
||||
@StyleSheet("css/accueil.css")
|
||||
public class LoggingView extends VerticalLayout {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package org.chtijbug.drools.console.view;
|
||||
|
||||
import com.vaadin.flow.component.button.Button;
|
||||
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||
import com.vaadin.flow.component.html.Anchor;
|
||||
import com.vaadin.flow.component.html.Image;
|
||||
|
|
@ -9,8 +8,8 @@ import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
|||
import com.vaadin.flow.router.Route;
|
||||
import com.vaadin.flow.server.InputStreamFactory;
|
||||
import com.vaadin.flow.server.StreamResource;
|
||||
import org.chtijbug.drools.console.vaadinComponent.login.LoginComponent;
|
||||
import org.chtijbug.drools.console.vaadinComponent.login.TextInfoComponent;
|
||||
import org.chtijbug.drools.console.vaadincomponent.login.LoginComponent;
|
||||
import org.chtijbug.drools.console.vaadincomponent.login.TextInfoComponent;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package org.chtijbug.drools.console.view;
|
|||
import com.vaadin.flow.component.dependency.StyleSheet;
|
||||
import com.vaadin.flow.component.html.Label;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
import org.chtijbug.drools.console.vaadinComponent.componentView.GridRuntime;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentview.GridRuntime;
|
||||
|
||||
@StyleSheet("css/accueil.css")
|
||||
public class RuntimesView extends VerticalLayout {
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ import org.chtijbug.drools.console.service.UserConnectedService;
|
|||
import org.chtijbug.drools.console.service.model.UserConnected;
|
||||
import org.chtijbug.drools.console.service.model.kie.KieConfigurationData;
|
||||
import org.chtijbug.drools.console.service.util.AppContext;
|
||||
import org.chtijbug.drools.console.vaadinComponent.ComponentPerso.DialogPerso;
|
||||
import org.chtijbug.drools.console.vaadinComponent.leftMenu.Action.TemplatesAction;
|
||||
import org.chtijbug.drools.console.vaadincomponent.componentperso.DialogPerso;
|
||||
import org.chtijbug.drools.console.vaadincomponent.leftMenu.Action.TemplatesAction;
|
||||
import org.chtijbug.guvnor.server.jaxrs.jaxb.Asset;
|
||||
import org.chtijbug.guvnor.server.jaxrs.model.PlatformProjectResponse;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package org.chtijbug.drools.common;
|
|||
|
||||
public class KafkaTopicConstants {
|
||||
public final static String LOGING_TOPIC ="logging";
|
||||
public final static String RESPONSE_TOPIC ="Response";
|
||||
public final static String RESPONSE_DEPLOY_TOPIC ="ResponseDeploy";
|
||||
public final static String REVERSE_PROXY="proxy";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,11 +74,15 @@ public class AssetService {
|
|||
private List<PlatformProjectResponse> getSpace(OrganizationalUnit ou) {
|
||||
|
||||
final List<PlatformProjectResponse> repoNames = new ArrayList<>();
|
||||
try {
|
||||
for (WorkspaceProject workspaceProject : workspaceProjectService.getAllWorkspaceProjects(ou)) {
|
||||
for (Branch branch : workspaceProject.getRepository().getBranches()) {
|
||||
repoNames.add(getProjectResponse(workspaceProject, branch));
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
logger.info("getSpace error "+ou.getName(),e);
|
||||
}
|
||||
return repoNames;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ import org.chtijbug.drools.proxy.persistence.model.BusinessTransactionPersistenc
|
|||
import org.chtijbug.drools.proxy.persistence.model.EventType;
|
||||
import org.chtijbug.drools.proxy.persistence.repository.BusinessTransactionActionRepository;
|
||||
import org.chtijbug.drools.proxy.persistence.repository.BusinessTransactionPersistenceRepository;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.kafka.annotation.KafkaListener;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -18,6 +20,8 @@ import java.util.*;
|
|||
@Service("storeService")
|
||||
public class StoreLoggingService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(StoreLoggingService.class);
|
||||
|
||||
@Autowired
|
||||
private BusinessTransactionPersistenceRepository transactionRepository;
|
||||
|
||||
|
|
@ -26,7 +30,7 @@ public class StoreLoggingService {
|
|||
|
||||
|
||||
@KafkaListener(
|
||||
topics = KafkaTopicConstants.LOGING_TOPIC,groupId = "${kafka.index.groupid}",
|
||||
topics = KafkaTopicConstants.LOGING_TOPIC, groupId = "${kafka.index.groupid}",
|
||||
containerFactory = "ruleKafkaListenerContainerFactory")
|
||||
public void store(ChtijbugObjectRequest result) {
|
||||
if (result != null) {
|
||||
|
|
@ -150,22 +154,15 @@ public class StoreLoggingService {
|
|||
businessTransactionoutput.setEventNumber(ii++);
|
||||
actions.put(businessTransactionoutput.getEventNumber(), businessTransactionoutput);
|
||||
}
|
||||
List<Long> keys = new ArrayList<Long>(actions.keySet());
|
||||
List<Long> keys = new ArrayList<>(actions.keySet());
|
||||
Collections.sort(keys);
|
||||
List<BusinessTransactionAction> sortedList = new LinkedList<>();
|
||||
for (Long i : keys) {
|
||||
sortedList.add(actions.get(i));
|
||||
}
|
||||
transactionRepository.save(item);
|
||||
Iterable<BusinessTransactionAction> toto = actionRepository.saveAll(sortedList);
|
||||
System.out.println("");
|
||||
|
||||
|
||||
//item.setContent(fileContent);
|
||||
|
||||
// repository.save(item);
|
||||
actionRepository.saveAll(sortedList);
|
||||
logger.info("Logging transaction {}", result.getTransactionID());
|
||||
}
|
||||
|
||||
System.out.println("coucou");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,65 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>drools-framework-business-proxy-parent</artifactId>
|
||||
<groupId>com.pymmasoftware.jbpm</groupId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>drools-framework-business-indexer-persistence</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-logging</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-elasticsearch</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
<version>${spring.boot-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-elasticsearch</artifactId>
|
||||
<version>3.1.11.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>2.9.7</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>2.9.7</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.pymmasoftware.jbpm</groupId>
|
||||
<artifactId>drools-framework-runtime-entity</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${maven.plugin.version}</version>
|
||||
<configuration>
|
||||
<source>${pymma.java.version}</source>
|
||||
<target>${pymma.java.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
package org.chtijbug.drools.indexer.persistence;
|
||||
|
||||
import org.elasticsearch.client.transport.TransportClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.transport.TransportAddress;
|
||||
import org.elasticsearch.transport.client.PreBuiltTransportClient;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
public class MainClass {
|
||||
public static void main(String[] args) throws UnknownHostException {
|
||||
Settings settings = Settings.builder()
|
||||
.put("cluster.name", "myClusterName").build();
|
||||
TransportClient client = null;
|
||||
PreBuiltTransportClient preBuiltTransportClient=null;
|
||||
try {
|
||||
preBuiltTransportClient = new PreBuiltTransportClient(settings);
|
||||
client = preBuiltTransportClient
|
||||
.addTransportAddress(new TransportAddress(InetAddress.getByName("localhost"), 9300));
|
||||
} finally {
|
||||
if (client != null) {
|
||||
client.close();
|
||||
}
|
||||
if (preBuiltTransportClient!=null){
|
||||
preBuiltTransportClient.close();
|
||||
}
|
||||
}
|
||||
// on shutdown
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,136 +0,0 @@
|
|||
package org.chtijbug.drools.indexer.persistence.model;
|
||||
|
||||
|
||||
import org.chtijbug.drools.logging.Fact;
|
||||
import org.chtijbug.drools.logging.RuleExecution;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
import org.springframework.data.elasticsearch.annotations.Field;
|
||||
import org.springframework.data.elasticsearch.annotations.FieldType;
|
||||
|
||||
@Document(indexName = "droolsaction", type = "droolsAction")
|
||||
public class BusinessTransactionAction {
|
||||
@Id
|
||||
private String id;
|
||||
|
||||
@Field(type = FieldType.Text)
|
||||
private EventType eventType;
|
||||
|
||||
private long eventNumber;
|
||||
|
||||
private String businessTransactionId;
|
||||
|
||||
@Field(type = FieldType.Object, includeInParent = true)
|
||||
private Fact inputData;
|
||||
|
||||
@Field(type = FieldType.Object, includeInParent = true)
|
||||
private Fact outputData;
|
||||
|
||||
@Field(type = FieldType.Object, includeInParent = true)
|
||||
private RuleExecution ruleExecution;
|
||||
|
||||
@Field(type = FieldType.Object, includeInParent = true)
|
||||
private Fact fact;
|
||||
|
||||
|
||||
private String processID;
|
||||
|
||||
private String ruleflowGroupName;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public EventType getEventType() {
|
||||
return eventType;
|
||||
}
|
||||
|
||||
public void setEventType(EventType eventType) {
|
||||
this.eventType = eventType;
|
||||
}
|
||||
|
||||
public long getEventNumber() {
|
||||
return eventNumber;
|
||||
}
|
||||
|
||||
public void setEventNumber(long eventNumber) {
|
||||
this.eventNumber = eventNumber;
|
||||
}
|
||||
|
||||
public String getBusinessTransactionId() {
|
||||
return businessTransactionId;
|
||||
}
|
||||
|
||||
public void setBusinessTransactionId(String businessTransactionId) {
|
||||
this.businessTransactionId = businessTransactionId;
|
||||
}
|
||||
|
||||
public Fact getInputData() {
|
||||
return inputData;
|
||||
}
|
||||
|
||||
public void setInputData(Fact inputData) {
|
||||
this.inputData = inputData;
|
||||
}
|
||||
|
||||
public Fact getOutputData() {
|
||||
return outputData;
|
||||
}
|
||||
|
||||
public void setOutputData(Fact outputData) {
|
||||
this.outputData = outputData;
|
||||
}
|
||||
|
||||
public RuleExecution getRuleExecution() {
|
||||
return ruleExecution;
|
||||
}
|
||||
|
||||
public void setRuleExecution(RuleExecution ruleExecution) {
|
||||
this.ruleExecution = ruleExecution;
|
||||
}
|
||||
|
||||
public String getProcessID() {
|
||||
return processID;
|
||||
}
|
||||
|
||||
public void setProcessID(String processID) {
|
||||
this.processID = processID;
|
||||
}
|
||||
|
||||
public String getRuleflowGroupName() {
|
||||
return ruleflowGroupName;
|
||||
}
|
||||
|
||||
public void setRuleflowGroupName(String ruleflowGroupName) {
|
||||
this.ruleflowGroupName = ruleflowGroupName;
|
||||
}
|
||||
|
||||
public Fact getFact() {
|
||||
return fact;
|
||||
}
|
||||
|
||||
public void setFact(Fact fact) {
|
||||
this.fact = fact;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuffer sb = new StringBuffer("BusinessTransactionAction{");
|
||||
sb.append("id='").append(id).append('\'');
|
||||
sb.append(", eventType=").append(eventType);
|
||||
sb.append(", eventNumber=").append(eventNumber);
|
||||
sb.append(", businessTransactionId='").append(businessTransactionId).append('\'');
|
||||
sb.append(", inputData=").append(inputData);
|
||||
sb.append(", outputData=").append(outputData);
|
||||
sb.append(", ruleExecution=").append(ruleExecution);
|
||||
sb.append(", fact=").append(fact);
|
||||
sb.append(", processID='").append(processID).append('\'');
|
||||
sb.append(", ruleflowGroupName='").append(ruleflowGroupName).append('\'');
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,154 +0,0 @@
|
|||
package org.chtijbug.drools.indexer.persistence.model;
|
||||
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
|
||||
@Document(indexName = "droolstransaction", type = "droolsTransaction")
|
||||
public class BusinessTransactionPersistence {
|
||||
|
||||
@Id
|
||||
private String id;
|
||||
|
||||
private String transactionId;
|
||||
|
||||
private Integer year;
|
||||
|
||||
private Integer month;
|
||||
|
||||
private Integer day;
|
||||
|
||||
private Integer hour;
|
||||
|
||||
private Integer minute;
|
||||
|
||||
private Integer second;
|
||||
|
||||
private Integer millis;
|
||||
|
||||
private String groupID;
|
||||
|
||||
private String artefactID;
|
||||
|
||||
private String version;
|
||||
|
||||
private String containerId;
|
||||
|
||||
private String serverName;
|
||||
|
||||
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTransactionId() {
|
||||
return transactionId;
|
||||
}
|
||||
|
||||
public void setTransactionId(String transactionId) {
|
||||
this.transactionId = transactionId;
|
||||
}
|
||||
|
||||
public Integer getYear() {
|
||||
return year;
|
||||
}
|
||||
|
||||
public void setYear(Integer year) {
|
||||
this.year = year;
|
||||
}
|
||||
|
||||
public Integer getMonth() {
|
||||
return month;
|
||||
}
|
||||
|
||||
public void setMonth(Integer month) {
|
||||
this.month = month;
|
||||
}
|
||||
|
||||
public Integer getDay() {
|
||||
return day;
|
||||
}
|
||||
|
||||
public void setDay(Integer day) {
|
||||
this.day = day;
|
||||
}
|
||||
|
||||
public Integer getHour() {
|
||||
return hour;
|
||||
}
|
||||
|
||||
public void setHour(Integer hour) {
|
||||
this.hour = hour;
|
||||
}
|
||||
|
||||
public Integer getMinute() {
|
||||
return minute;
|
||||
}
|
||||
|
||||
public void setMinute(Integer minute) {
|
||||
this.minute = minute;
|
||||
}
|
||||
|
||||
public Integer getSecond() {
|
||||
return second;
|
||||
}
|
||||
|
||||
public void setSecond(Integer second) {
|
||||
this.second = second;
|
||||
}
|
||||
|
||||
public Integer getMillis() {
|
||||
return millis;
|
||||
}
|
||||
|
||||
public void setMillis(Integer millis) {
|
||||
this.millis = millis;
|
||||
}
|
||||
|
||||
public String getGroupID() {
|
||||
return groupID;
|
||||
}
|
||||
|
||||
public void setGroupID(String groupID) {
|
||||
this.groupID = groupID;
|
||||
}
|
||||
|
||||
public String getArtefactID() {
|
||||
return artefactID;
|
||||
}
|
||||
|
||||
public void setArtefactID(String artefactID) {
|
||||
this.artefactID = artefactID;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getContainerId() {
|
||||
return containerId;
|
||||
}
|
||||
|
||||
public void setContainerId(String containerId) {
|
||||
this.containerId = containerId;
|
||||
}
|
||||
|
||||
public String getServerName() {
|
||||
return serverName;
|
||||
}
|
||||
|
||||
public void setServerName(String serverName) {
|
||||
this.serverName = serverName;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
package org.chtijbug.drools.indexer.persistence.model;
|
||||
|
||||
public enum EventType {
|
||||
INPUT,OUPUT,INSERTFACT, UPDATEFACTOLDVALUE, UPDATEFACTNEWVALUE,RETRACTFACT,RULE,STARTPROCESS,STOPPROCESS, STARTRULEFLOWGROUP,STOPTRULEFLOWGROUP
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
package org.chtijbug.drools.indexer.persistence.repository;
|
||||
|
||||
import org.chtijbug.drools.indexer.persistence.model.BusinessTransactionAction;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface BusinessTransactionActionRepository extends ElasticsearchRepository<BusinessTransactionAction,String> {
|
||||
|
||||
public List<BusinessTransactionAction> findAllByBusinessTransactionId(String businessTransactionId, Sort sort, PageRequest pageRequest);
|
||||
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
package org.chtijbug.drools.indexer.persistence.repository;
|
||||
|
||||
import org.chtijbug.drools.indexer.persistence.model.BusinessTransactionPersistence;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface BusinessTransactionPersistenceRepository extends ElasticsearchRepository<BusinessTransactionPersistence,String> {
|
||||
|
||||
public BusinessTransactionPersistence findAllById(String id, PageRequest pageRequest);
|
||||
|
||||
public List<BusinessTransactionPersistence> findAllByTransactionId(String transactionId, PageRequest pageRequest);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -21,13 +21,10 @@ import com.fasterxml.jackson.databind.SerializationFeature;
|
|||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import org.apache.kafka.clients.admin.AdminClientConfig;
|
||||
import org.apache.kafka.clients.admin.NewTopic;
|
||||
import org.apache.kafka.clients.consumer.ConsumerConfig;
|
||||
import org.apache.kafka.clients.producer.ProducerConfig;
|
||||
import org.apache.kafka.common.serialization.StringDeserializer;
|
||||
import org.apache.kafka.common.serialization.StringSerializer;
|
||||
import org.chtijbug.drools.ChtijbugObjectRequest;
|
||||
import org.chtijbug.drools.KieContainerResponse;
|
||||
import org.chtijbug.drools.KieContainerUpdate;
|
||||
import org.chtijbug.drools.common.KafkaTopicConstants;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
|
|
@ -35,11 +32,12 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.kafka.annotation.EnableKafka;
|
||||
import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory;
|
||||
import org.springframework.kafka.core.*;
|
||||
import org.springframework.kafka.support.serializer.JsonDeserializer;
|
||||
import org.springframework.kafka.core.DefaultKafkaProducerFactory;
|
||||
import org.springframework.kafka.core.KafkaAdmin;
|
||||
import org.springframework.kafka.core.KafkaTemplate;
|
||||
import org.springframework.kafka.core.ProducerFactory;
|
||||
import org.springframework.kafka.support.serializer.JsonSerializer;
|
||||
import org.springframework.kafka.transaction.KafkaTransactionManager;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
|
|
@ -50,6 +48,7 @@ import java.util.Map;
|
|||
@SpringBootApplication
|
||||
@Configuration
|
||||
@EnableKafka
|
||||
@EnableScheduling
|
||||
public class DroolsBusinessProxyServer {
|
||||
|
||||
@Value(value = "${org.kie.server.id}")
|
||||
|
|
@ -70,10 +69,7 @@ public class DroolsBusinessProxyServer {
|
|||
return new NewTopic(KafkaTopicConstants.LOGING_TOPIC, 1, (short) 1);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public NewTopic actionResponseTopic() {
|
||||
return new NewTopic(KafkaTopicConstants.RESPONSE_TOPIC, 1, (short) 1);
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public ProducerFactory<String, ChtijbugObjectRequest> producerFactory() {
|
||||
|
|
@ -90,7 +86,7 @@ public class DroolsBusinessProxyServer {
|
|||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
objectMapper.registerModule(new JavaTimeModule());
|
||||
objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
|
||||
new DefaultKafkaProducerFactory<>(configProps, new StringSerializer(), new JsonSerializer<ChtijbugObjectRequest>(objectMapper));
|
||||
new DefaultKafkaProducerFactory<>(configProps, new StringSerializer(), new JsonSerializer<>(objectMapper));
|
||||
return new DefaultKafkaProducerFactory<>(configProps);
|
||||
}
|
||||
@Bean
|
||||
|
|
@ -110,46 +106,19 @@ public class DroolsBusinessProxyServer {
|
|||
producer.setTransactionIdPrefix("trans");
|
||||
return producer;
|
||||
}
|
||||
@Bean
|
||||
public KafkaTransactionManager transactionManager(ProducerFactory producerFactory) {
|
||||
KafkaTransactionManager manager = new KafkaTransactionManager(producerKieContainerResponseactory());
|
||||
return manager;
|
||||
}
|
||||
@Bean
|
||||
public KafkaTemplate<String, KieContainerResponse> kafkaKieContainerUpdateResponsableTemplate() {
|
||||
return new KafkaTemplate<>(producerKieContainerResponseactory());
|
||||
}
|
||||
|
||||
@Bean(name="deployFinish")
|
||||
public NewTopic actionDeployResponseTopic() {
|
||||
return new NewTopic(KafkaTopicConstants.RESPONSE_DEPLOY_TOPIC, 1, (short) 1);
|
||||
}
|
||||
|
||||
|
||||
public ConsumerFactory<String, KieContainerUpdate> greetingConsumerFactory() {
|
||||
Map<String, Object> props = new HashMap<>();
|
||||
props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapAddress);
|
||||
props.put(ConsumerConfig.GROUP_ID_CONFIG, groupID);
|
||||
return new DefaultKafkaConsumerFactory<>(props, new StringDeserializer(), new JsonDeserializer<>(KieContainerUpdate.class));
|
||||
}
|
||||
@Bean
|
||||
public ConcurrentKafkaListenerContainerFactory<String, KieContainerUpdate>
|
||||
ruleKafkaListenerKieContainerUpdateFactory() {
|
||||
|
||||
ConcurrentKafkaListenerContainerFactory<String, KieContainerUpdate> factory =
|
||||
new ConcurrentKafkaListenerContainerFactory<>();
|
||||
factory.setConsumerFactory(greetingConsumerFactory());
|
||||
return factory;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public KafkaTemplate<String, ChtijbugObjectRequest> kafkaTemplate() {
|
||||
return new KafkaTemplate<>(producerFactory());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Main method to start the application.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -15,13 +15,9 @@
|
|||
|
||||
package org.chtijbug.drools.proxy.service;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.apache.camel.CamelContext;
|
||||
import org.apache.camel.Route;
|
||||
import org.apache.kafka.clients.admin.NewTopic;
|
||||
import org.chtijbug.drools.KieContainerResponse;
|
||||
import org.chtijbug.drools.KieContainerUpdate;
|
||||
import org.chtijbug.drools.common.KafkaTopicConstants;
|
||||
import org.chtijbug.drools.proxy.PlatfomKieServerStateRepository;
|
||||
import org.chtijbug.drools.proxy.camel.DroolsRouter;
|
||||
import org.chtijbug.drools.proxy.persistence.model.ContainerPojoPersist;
|
||||
|
|
@ -37,15 +33,13 @@ import org.kie.server.services.api.KieServerExtension;
|
|||
import org.kie.server.services.api.KieServerRegistry;
|
||||
import org.kie.server.services.impl.KieContainerInstanceImpl;
|
||||
import org.kie.server.services.impl.KieServerImpl;
|
||||
import org.kie.server.services.impl.marshal.MarshallerHelper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.kafka.annotation.KafkaListener;
|
||||
import org.springframework.kafka.core.KafkaTemplate;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
|
@ -61,13 +55,16 @@ public class KieServiceCommon {
|
|||
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(KieServiceCommon.class);
|
||||
|
||||
@Autowired
|
||||
CamelContext camelContext;
|
||||
|
||||
private KieServerImpl server;
|
||||
private MarshallerHelper marshallerHelper;
|
||||
|
||||
private KieServerRegistry registry;
|
||||
private ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
private DroolsChtijbugRulesExecutionService droolsChtijbugRulesExecutionService = null;
|
||||
|
||||
private DroolsChtijbugKieServerExtension droolsChtijbugKieServerExtension;
|
||||
@Inject
|
||||
private ContainerRepository containerRepository;
|
||||
|
|
@ -87,19 +84,19 @@ public class KieServiceCommon {
|
|||
|
||||
@Autowired
|
||||
private ApplicationContext appContext;
|
||||
|
||||
private String hostName = "localhost";
|
||||
private Map<String, DroolsRouter> routes = new HashMap<>();
|
||||
|
||||
@Autowired
|
||||
KafkaTemplate<String, KieContainerResponse> kafkaKieContainerUpdateResponseTemplate;
|
||||
|
||||
|
||||
|
||||
@Qualifier("deployFinish")
|
||||
@Autowired
|
||||
NewTopic responseTopic;
|
||||
|
||||
public KieServiceCommon() {
|
||||
// for now, if no server impl is passed as parameter, create one
|
||||
// this.server = KieServerLocator.getInstance();
|
||||
//Needed
|
||||
}
|
||||
|
||||
public static String getKieServerID() {
|
||||
|
|
@ -127,8 +124,6 @@ public class KieServiceCommon {
|
|||
}
|
||||
}
|
||||
|
||||
this.marshallerHelper = new MarshallerHelper(this.server.getServerRegistry());
|
||||
|
||||
String serverName = KieServiceCommon.getKieServerID();
|
||||
|
||||
|
||||
|
|
@ -144,11 +139,11 @@ public class KieServiceCommon {
|
|||
}else{
|
||||
itIsMes = runtimeRepository.findByServerName(serverName);
|
||||
}
|
||||
|
||||
RuntimePersist runtimePersist;
|
||||
ServiceResponse<KieServerInfo> result = server.getInfo();
|
||||
String version = result.getResult().getVersion();
|
||||
if (itIsMes.isEmpty()) {
|
||||
RuntimePersist runtimePersist = new RuntimePersist(serverName, version, hostName,
|
||||
runtimePersist = new RuntimePersist(serverName, version, hostName,
|
||||
String.valueOf(serverPort), null,
|
||||
hostName, RuntimePersist.STATUS.UP.toString());
|
||||
if (runtimePort!=-1){
|
||||
|
|
@ -156,24 +151,26 @@ public class KieServiceCommon {
|
|||
runtimePersist.setServerPort(String.valueOf(runtimePort));
|
||||
}
|
||||
String isSwarm = System.getProperty("org.kie.server.swarm");
|
||||
String swarmPort=System.getProperty("org.kie.server.swarm.port");
|
||||
String baseurl="http://";
|
||||
if ("1".equals(isSwarm)) {
|
||||
if (System.getProperty("org.kie.server.swarm.port")!= null &&
|
||||
System.getProperty("org.kie.server.swarm.port").length()>0){
|
||||
runtimePersist.setServerUrl("http://" + serverName + ":" + System.getProperty("org.kie.server.swarm.port"));
|
||||
if (swarmPort!= null &&
|
||||
swarmPort.length()>0){
|
||||
runtimePersist.setServerUrl(baseurl + serverName + ":" + swarmPort);
|
||||
}else{
|
||||
runtimePersist.setServerUrl("http://" + serverName + ":" + serverPort);
|
||||
runtimePersist.setServerUrl(baseurl + serverName + ":" + serverPort);
|
||||
}
|
||||
|
||||
} else {
|
||||
if (runtimePort==-1) {
|
||||
runtimePersist.setServerUrl("http://" + hostName + ":" + serverPort);
|
||||
runtimePersist.setServerUrl(baseurl + hostName + ":" + serverPort);
|
||||
}else{
|
||||
runtimePersist.setServerUrl("http://" + runtimeServer + ":" + runtimePort);
|
||||
runtimePersist.setServerUrl(baseurl + runtimeServer + ":" + runtimePort);
|
||||
}
|
||||
}
|
||||
runtimeRepository.save(runtimePersist);
|
||||
} else {
|
||||
RuntimePersist runtimePersist = itIsMes.get(0);
|
||||
runtimePersist = itIsMes.get(0);
|
||||
runtimePersist.setStatus(RuntimePersist.STATUS.UP.toString());
|
||||
runtimeRepository.save(runtimePersist);
|
||||
}
|
||||
|
|
@ -254,7 +251,7 @@ public class KieServiceCommon {
|
|||
try {
|
||||
Set<Class<?>> classes = kieContainerInstance.getExtraClasses();
|
||||
String className = container.getClassName();
|
||||
Class foundClass = this.getClassFromName(classes, className);
|
||||
Class<Object> foundClass = this.getClassFromName(classes, className);
|
||||
if (foundClass != null) {
|
||||
ClassLoader classLoader = foundClass.getClassLoader();
|
||||
Class<?> theClass = classLoader.loadClass(className);
|
||||
|
|
@ -310,57 +307,6 @@ public class KieServiceCommon {
|
|||
}
|
||||
|
||||
|
||||
@KafkaListener(
|
||||
topics = "${org.kie.server.id}", groupId = "${org.kie.server.id}",
|
||||
containerFactory = "ruleKafkaListenerKieContainerUpdateFactory")
|
||||
public void updateConfig(KieContainerUpdate update) {
|
||||
try {
|
||||
String serverName = KieServiceCommon.getKieServerID();
|
||||
if (update.getAction().equals(KieContainerUpdate.STATUS.TODEPLOY)) {
|
||||
this.disposeContainer(update.getContainerID());
|
||||
KieContainerResource newContainer = new KieContainerResource();
|
||||
newContainer.setContainerId(update.getContainerID());
|
||||
newContainer.setReleaseId(new ReleaseId());
|
||||
newContainer.getReleaseId().setArtifactId(update.getArtifactID());
|
||||
newContainer.getReleaseId().setGroupId(update.getGroupID());
|
||||
newContainer.getReleaseId().setVersion(update.getProjectVersion());
|
||||
this.createContainer(update.getContainerID(), newContainer);
|
||||
ContainerPojoPersist containerIds = containerRepository.findByServerNameAndContainerId(serverName, update.getContainerID());
|
||||
this.initCamelBusinessRoute(containerIds);
|
||||
List<ContainerRuntimePojoPersist> containers = containerRuntimeRepository.findByServerNameAndContainerId(serverName, update.getContainerID());
|
||||
for (ContainerRuntimePojoPersist element : containers) {
|
||||
element.setStatus(ContainerRuntimePojoPersist.STATUS.UP.toString());
|
||||
containerRuntimeRepository.save(element);
|
||||
}
|
||||
} else {
|
||||
this.disposeContainer(update.getContainerID());
|
||||
this.deleteCamelBusinessRoute(update.getContainerID());
|
||||
ContainerPojoPersist containerIds = containerRepository.findByServerNameAndContainerId(serverName, update.getContainerID());
|
||||
List<ContainerRuntimePojoPersist> containers = containerRuntimeRepository.findByServerNameAndContainerId(serverName, update.getContainerID());
|
||||
for (ContainerRuntimePojoPersist element : containers) {
|
||||
element.setStatus(ContainerRuntimePojoPersist.STATUS.UP.toString());
|
||||
containerRuntimeRepository.save(element);
|
||||
}
|
||||
containerRepository.delete(containerIds);
|
||||
}
|
||||
KieContainerResponse kieContainerResponse = new KieContainerResponse();
|
||||
kieContainerResponse.setStatus(KieContainerResponse.STATUS.SUCCESS);
|
||||
kafkaKieContainerUpdateResponseTemplate.executeInTransaction(kt ->
|
||||
kt.send(KafkaTopicConstants.RESPONSE_DEPLOY_TOPIC,kieContainerResponse));
|
||||
|
||||
}catch (Exception e){
|
||||
KieContainerResponse kieContainerResponse = new KieContainerResponse();
|
||||
kieContainerResponse.setStatus(KieContainerResponse.STATUS.ERROR);
|
||||
kieContainerResponse.setKieContainerUpdate(update);
|
||||
kieContainerResponse.setMessageError(e.getMessage());
|
||||
for (StackTraceElement stackTraceElement : e.getStackTrace()){
|
||||
kieContainerResponse.getErrorMessages().add(stackTraceElement.toString());
|
||||
}
|
||||
kafkaKieContainerUpdateResponseTemplate.executeInTransaction(kt ->
|
||||
kt.send(KafkaTopicConstants.RESPONSE_DEPLOY_TOPIC,kieContainerResponse));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public KieContainerResource createContainerWithRestBusinessService(String id, KieContainerResource container, String className, String processID) {
|
||||
|
|
@ -401,8 +347,6 @@ public class KieServiceCommon {
|
|||
this.initCamelBusinessRoute(containerPojoPersist);
|
||||
containerRepository.save(containerPojoPersist);
|
||||
|
||||
} catch (ClassNotFoundException e) {
|
||||
logger.error("createContainerWithRestBusinessService", e);
|
||||
} catch (Exception e) {
|
||||
logger.error("createContainerWithRestBusinessService", e);
|
||||
} finally {
|
||||
|
|
@ -437,20 +381,16 @@ public class KieServiceCommon {
|
|||
|
||||
|
||||
public ServiceResponse<KieContainerResource> activateContainer(String id) {
|
||||
ServiceResponse<KieContainerResource> response = server.activateContainer(id);
|
||||
|
||||
return response;
|
||||
return server.activateContainer(id);
|
||||
}
|
||||
|
||||
|
||||
public ServiceResponse<KieContainerResource> deactivateContainer(String id) {
|
||||
ServiceResponse<KieContainerResource> response = server.deactivateContainer(id);
|
||||
return response;
|
||||
return server.deactivateContainer(id);
|
||||
}
|
||||
|
||||
public ServiceResponse<KieContainerResource> getContainerInfo(String id) {
|
||||
ServiceResponse<KieContainerResource> result = server.getContainerInfo(id);
|
||||
return result;
|
||||
return server.getContainerInfo(id);
|
||||
}
|
||||
|
||||
public ServiceResponse<Void> disposeContainer(String id) {
|
||||
|
|
@ -465,25 +405,20 @@ public class KieServiceCommon {
|
|||
|
||||
|
||||
public ServiceResponse<KieServerStateInfo> getServerState(@Context HttpHeaders headers) {
|
||||
ServiceResponse<KieServerStateInfo> result = server.getServerState();
|
||||
return result;
|
||||
return server.getServerState();
|
||||
}
|
||||
|
||||
public boolean readycheck() {
|
||||
boolean result = server.isKieServerReady();
|
||||
return result;
|
||||
return server.isKieServerReady();
|
||||
}
|
||||
|
||||
|
||||
public List<Message> healthcheck(boolean report) {
|
||||
List<Message> healthMessages = server.healthCheck(report);
|
||||
|
||||
|
||||
return healthMessages;
|
||||
return server.healthCheck(report);
|
||||
}
|
||||
|
||||
private Class getClassFromName(Set<Class<?>> classes, String name) {
|
||||
Class result = null;
|
||||
private Class<Object> getClassFromName(Set<Class<?>> classes, String name) {
|
||||
Class<Object> result = null;
|
||||
for (Class c : classes) {
|
||||
if (c.getCanonicalName() != null
|
||||
&& c.getCanonicalName().equals(name)) {
|
||||
|
|
@ -493,4 +428,41 @@ public class KieServiceCommon {
|
|||
}
|
||||
return result;
|
||||
}
|
||||
@Scheduled(fixedDelay = 5000)
|
||||
public void updateConfig(){
|
||||
|
||||
|
||||
try {
|
||||
|
||||
String serverName = KieServiceCommon.getKieServerID();
|
||||
List<ContainerRuntimePojoPersist> containerRuntimePojoPersists = containerRuntimeRepository.findByServerNameAndHostname(serverName, hostName);
|
||||
for (ContainerRuntimePojoPersist element : containerRuntimePojoPersists) {
|
||||
ContainerPojoPersist containerPojoPersist = containerRepository.findByServerNameAndContainerId(serverName, element.getContainerId());
|
||||
if (element.getStatus().equals(ContainerRuntimePojoPersist.STATUS.TODEPLOY.name())) {
|
||||
this.disposeContainer(element.getContainerId());
|
||||
KieContainerResource newContainer = new KieContainerResource();
|
||||
newContainer.setContainerId(element.getContainerId());
|
||||
newContainer.setReleaseId(new ReleaseId());
|
||||
newContainer.getReleaseId().setArtifactId(containerPojoPersist.getArtifactId());
|
||||
newContainer.getReleaseId().setGroupId(containerPojoPersist.getGroupId());
|
||||
newContainer.getReleaseId().setVersion(containerPojoPersist.getVersion());
|
||||
this.createContainer(element.getContainerId(), newContainer);
|
||||
this.initCamelBusinessRoute(containerPojoPersist);
|
||||
element.setStatus(ContainerRuntimePojoPersist.STATUS.UP.toString());
|
||||
containerRuntimeRepository.save(element);
|
||||
|
||||
} else if (element.getStatus().equals(ContainerRuntimePojoPersist.STATUS.TODELETE.name())) {
|
||||
this.disposeContainer(element.getContainerId());
|
||||
this.deleteCamelBusinessRoute(element.getContainerId());
|
||||
element.setStatus(ContainerRuntimePojoPersist.STATUS.DOWN.toString());
|
||||
containerRuntimeRepository.save(element);
|
||||
}
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
logger.error("KieServerCommon",e);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
<module>drools-framework-business-proxy-app</module>
|
||||
<module>drools-framework-business-proxy-persistence</module>
|
||||
<module>drools-framework-business-indexer-app</module>
|
||||
<module>drools-framework-business-indexer-persistence</module>
|
||||
<module>drools-framework-business-reverse-proxy</module>
|
||||
</modules>
|
||||
</project>
|
||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue