Skip to content

Commit

Permalink
Merge pull request #10 from EdwinBetanc0urt/feature/imporve-migration
Browse files Browse the repository at this point in the history
feat: Improve peformance migration.
  • Loading branch information
yamelsenih authored Apr 8, 2024
2 parents c99d33e + de0399a commit 483ce35
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static List<Map<String, Object>> generateDependentProcessParameters(MProc
MProcess process = MProcess.get(processParameter.getCtx(), processParameter.getAD_Process_ID());
List<MProcessPara> parametersList = process.getParametersAsList();

parametersList.stream()
parametersList.parallelStream()
.filter(currentParameter -> {
if (!currentParameter.isActive()) {
return false;
Expand Down Expand Up @@ -145,18 +145,18 @@ public static List<Map<String, Object>> generateDependentWindowFields(MField fie
if (tabsList == null) {
return depenentFieldsList;
}
tabsList.stream()
tabsList.parallelStream()
.filter(currentTab -> {
// transaltion tab is not rendering on client
return currentTab.isActive() && !currentTab.isTranslationTab();
return currentTab.isActive() && !currentTab.isTranslationTab() && !currentTab.isSortTab();
})
.forEach(tab -> {
List<MField> fieldsList = Arrays.asList(tab.getFields(false, null));
if (fieldsList == null) {
return;
}

fieldsList.stream()
fieldsList.parallelStream()
.filter(currentField -> {
if (!currentField.isActive()) {
return false;
Expand Down Expand Up @@ -233,7 +233,7 @@ public static List<Map<String, Object>> generateDependentBrowseFields(MBrowseFie
MBrowse browse = MBrowse.get(browseField.getCtx(), browseField.getAD_Browse_ID());
List<MBrowseField> browseFieldsList = browse.getFields();

browseFieldsList.stream()
browseFieldsList.parallelStream()
.filter(currentBrowseField -> {
if(!currentBrowseField.isActive()) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.compiere.model.PO;
import org.compiere.wf.MWorkflow;
import org.spin.eca56.util.support.DictionaryDocument;
import org.spin.util.ASPUtil;
import org.spin.util.AbstractExportFormat;
import org.spin.util.ReportExportHandler;

Expand Down Expand Up @@ -99,7 +98,7 @@ public DictionaryDocument withEntity(PO entity) {
documentDetail.put("form_id", process.getAD_Form_ID());
documentDetail.put("workflow_id", process.getAD_Workflow_ID());
if (process.getAD_Browse_ID() > 0) {
MBrowse browse = ASPUtil.getInstance(process.getCtx()).getBrowse(process.getAD_Browse_ID());
MBrowse browse = MBrowse.get(process.getCtx(), process.getAD_Browse_ID());
documentDetail.put("browse", parseDictionaryEntity(browse));
} else if (process.getAD_Form_ID() > 0) {
MForm form = new MForm(process.getCtx(), process.getAD_Workflow_ID(), null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import org.compiere.model.Query;
import org.compiere.wf.MWorkflow;
import org.spin.eca56.util.support.DictionaryDocument;
import org.spin.util.ASPUtil;

/**
* the document class for Window senders
Expand Down Expand Up @@ -122,7 +121,7 @@ private Map<String, Object> parseTab(MTab tab) {

// Table attributes
if(tab.getAD_Table_ID() > 0) {
MTable table = new MTable(tab.getCtx(), tab.getAD_Table_ID(), null);
MTable table = MTable.get(tab.getCtx(), tab.getAD_Table_ID());
detail.put("table_name", table.getTableName());

Map<String, Object> referenceDetail = new HashMap<>();
Expand Down Expand Up @@ -204,7 +203,7 @@ private Map<String, Object> parseTab(MTab tab) {
}
}
detail.put("processes", convertProcesses(getProcessFromTab(tab)));

// Fields
List<MField> fields = Arrays.asList(tab.getFields(false, null));
detail.put("fields", convertFields(fields));
Expand Down Expand Up @@ -268,7 +267,7 @@ private List<Map<String, Object>> convertProcesses(List<MProcess> processesList)
if(processesList == null || processesList.isEmpty()) {
return processesDetail;
}
processesList.forEach(process -> {
processesList.parallelStream().forEach(process -> {
processesDetail.add(
parseProcess(process)
);
Expand All @@ -290,7 +289,7 @@ private Map<String, Object> parseProcess(MProcess process) {
detail.put("form_id", process.getAD_Form_ID());
detail.put("workflow_id", process.getAD_Workflow_ID());
if (process.getAD_Browse_ID() > 0) {
MBrowse browse = ASPUtil.getInstance(process.getCtx()).getBrowse(process.getAD_Browse_ID());
MBrowse browse = MBrowse.get(process.getCtx(), process.getAD_Browse_ID());
detail.put("browse", parseDictionaryEntity(browse));
} else if (process.getAD_Form_ID() > 0) {
MForm form = new MForm(process.getCtx(), process.getAD_Workflow_ID(), null);
Expand Down

0 comments on commit 483ce35

Please sign in to comment.