diff --git a/org.adempiere.base/src/org/compiere/model/GridTab.java b/org.adempiere.base/src/org/compiere/model/GridTab.java index a825f2f3ce..fe4c3c97bf 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTab.java +++ b/org.adempiere.base/src/org/compiere/model/GridTab.java @@ -111,7 +111,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable /** * */ - private static final long serialVersionUID = -2946624717834888117L; + private static final long serialVersionUID = -3115353522698098211L; public static final String DEFAULT_STATUS_MESSAGE = "NavigateOrUpdate"; @@ -3300,7 +3300,16 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable public boolean isNew() { return isOpen() && getCurrentRow() >= 0 && getCurrentRow() == m_mTable.getNewRow(); } - + + public String getAD_Tab_UU() { + return m_vo.AD_Tab_UU; + } + + public String getAD_Process_UU() + { + return m_vo.AD_Process_UU; + } + public boolean isUpdateWindowContext() { return m_updateWindowContext ; diff --git a/org.adempiere.base/src/org/compiere/model/GridTabVO.java b/org.adempiere.base/src/org/compiere/model/GridTabVO.java index bfcb216252..fae6f358d1 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTabVO.java +++ b/org.adempiere.base/src/org/compiere/model/GridTabVO.java @@ -41,7 +41,7 @@ public class GridTabVO implements Evaluatee, Serializable /** * */ - private static final long serialVersionUID = -7973388282943436222L; + private static final long serialVersionUID = -1353087123788176368L; /************************************************************************** * Create MTab VO @@ -458,7 +458,9 @@ public class GridTabVO implements Evaluatee, Serializable public boolean IsHighVolume = false; /** Process */ public int AD_Process_ID = 0; - /** Commot Warning */ + /** Process UUID */ + public String AD_Process_UU; + /** Commit Warning */ public String CommitWarning; /** Where */ public String WhereClause; diff --git a/org.adempiere.base/src/org/compiere/model/MProcess.java b/org.adempiere.base/src/org/compiere/model/MProcess.java index cad10b3dad..724c27c790 100644 --- a/org.adempiere.base/src/org/compiere/model/MProcess.java +++ b/org.adempiere.base/src/org/compiere/model/MProcess.java @@ -26,6 +26,7 @@ import org.compiere.process.ProcessInfo; import org.compiere.util.CCache; import org.compiere.util.DB; import org.compiere.util.Trx; +import org.compiere.util.Util; import org.compiere.wf.MWFNode; /** @@ -43,8 +44,7 @@ public class MProcess extends X_AD_Process /** * */ - private static final long serialVersionUID = 6665942554198058466L; - + private static final long serialVersionUID = -7234986583327689692L; /** * Get MProcess from Cache @@ -64,6 +64,24 @@ public class MProcess extends X_AD_Process return retValue; } // get + /** + * Get MProcess from Cache based on UUID + * @param ctx context + * @param AD_Process_UU UUID + * @return MProcess + */ + public static MProcess get (Properties ctx, String AD_Process_UU) + { + MProcess retValue = s_cacheUU.get(AD_Process_UU); + if (retValue != null) + return retValue; + int id = DB.getSQLValueEx(null, "SELECT AD_Process_ID FROM AD_Process WHERE AD_Process_UU = ? ", AD_Process_UU); + retValue = new MProcess (ctx, id, null); + if (!Util.isEmpty(retValue.getAD_Process_UU())) + s_cacheUU.put (retValue.getAD_Process_UU(), retValue); + return retValue; + } // get + /** * Get MProcess from Menu * @param ctx context @@ -85,8 +103,10 @@ public class MProcess extends X_AD_Process } // getFromMenu - /** Cache */ + /** Cache ID */ private static CCache s_cache = new CCache(Table_Name, 20); + /** Cache UUID */ + private static CCache s_cacheUU = new CCache(Table_Name, 20); /************************************************************************** diff --git a/org.adempiere.base/src/org/compiere/process/ProcessInfo.java b/org.adempiere.base/src/org/compiere/process/ProcessInfo.java index 10e74c4a2a..6b097479df 100644 --- a/org.adempiere.base/src/org/compiere/process/ProcessInfo.java +++ b/org.adempiere.base/src/org/compiere/process/ProcessInfo.java @@ -40,11 +40,10 @@ import org.compiere.util.Util; */ public class ProcessInfo implements Serializable { - /** * */ - private static final long serialVersionUID = -7810177110347837681L; + private static final long serialVersionUID = 2167823616151648814L; /** * Constructor @@ -65,6 +64,9 @@ public class ProcessInfo implements Serializable m_printPreview = false; } // ProcessInfo + /** Process UUID */ + private String m_AD_Process_UU; + /** * Constructor * @param Title Title @@ -694,6 +696,15 @@ public class ProcessInfo implements Serializable return m_transactionName; } + public String getAD_Process_UU() + { + return m_AD_Process_UU; + } + + public void setAD_Process_UU(String AD_Process_UU) + { + m_AD_Process_UU = AD_Process_UU; + } /** * Set transaction name from this process * @param trxName diff --git a/org.adempiere.base/src/org/compiere/process/ServerProcessCtl.java b/org.adempiere.base/src/org/compiere/process/ServerProcessCtl.java index c8196e3961..096e78df8a 100644 --- a/org.adempiere.base/src/org/compiere/process/ServerProcessCtl.java +++ b/org.adempiere.base/src/org/compiere/process/ServerProcessCtl.java @@ -139,8 +139,8 @@ public class ServerProcessCtl implements Runnable { // String sql = "SELECT p.Name, p.ProcedureName,p.ClassName, p.AD_Process_ID," // 1..4 + " p.isReport,p.IsDirectPrint,p.AD_ReportView_ID,p.AD_Workflow_ID," // 5..8 - + " CASE WHEN COALESCE(p.Statistic_Count,0)=0 THEN 0 ELSE p.Statistic_Seconds/p.Statistic_Count END CASE," - + " p.IsServerProcess, p.JasperReport " + + " CASE WHEN COALESCE(p.Statistic_Count,0)=0 THEN 0 ELSE p.Statistic_Seconds/p.Statistic_Count END CASE," // 9 + + " p.IsServerProcess, p.JasperReport, p.AD_Process_UU " // 10..12 + "FROM AD_Process p" + " INNER JOIN AD_PInstance i ON (p.AD_Process_ID=i.AD_Process_ID) " + "WHERE p.IsActive='Y'" @@ -148,8 +148,8 @@ public class ServerProcessCtl implements Runnable { if (!Env.isBaseLanguage(Env.getCtx(), "AD_Process")) sql = "SELECT t.Name, p.ProcedureName,p.ClassName, p.AD_Process_ID," // 1..4 + " p.isReport, p.IsDirectPrint,p.AD_ReportView_ID,p.AD_Workflow_ID," // 5..8 - + " CASE WHEN COALESCE(p.Statistic_Count,0)=0 THEN 0 ELSE p.Statistic_Seconds/p.Statistic_Count END CASE," - + " p.IsServerProcess, p.JasperReport " + + " CASE WHEN COALESCE(p.Statistic_Count,0)=0 THEN 0 ELSE p.Statistic_Seconds/p.Statistic_Count END CASE," // 9 + + " p.IsServerProcess, p.JasperReport, p.AD_Process_UU " // 10..12 + "FROM AD_Process p" + " INNER JOIN AD_PInstance i ON (p.AD_Process_ID=i.AD_Process_ID) " + " INNER JOIN AD_Process_Trl t ON (p.AD_Process_ID=t.AD_Process_ID" @@ -171,6 +171,7 @@ public class ServerProcessCtl implements Runnable { ProcedureName = rs.getString(2); m_pi.setClassName (rs.getString(3)); m_pi.setAD_Process_ID (rs.getInt(4)); + m_pi.setAD_Process_UU (rs.getString(12)); // Report if ("Y".equals(rs.getString(5))) { diff --git a/org.adempiere.base/src/org/compiere/report/FinReportJasper.java b/org.adempiere.base/src/org/compiere/report/FinReportJasper.java index b9b5c22d4f..b60797e30b 100644 --- a/org.adempiere.base/src/org/compiere/report/FinReportJasper.java +++ b/org.adempiere.base/src/org/compiere/report/FinReportJasper.java @@ -76,6 +76,7 @@ public class FinReportJasper extends FinReport poInfo.setRecord_ID(getRecord_ID()); poInfo.setAD_Process_ID(proc.getAD_Process_ID()); poInfo.setAD_PInstance_ID(instance.getAD_PInstance_ID()); + poInfo.setAD_Process_UU(proc.getAD_Process_UU()); // need to commit in order to allow jasper to view the data Trx trx = Trx.get(get_TrxName(), true); diff --git a/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java b/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java index 80399205b1..1230844383 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java @@ -170,6 +170,7 @@ public class Scheduler extends AdempiereServer pi.setAD_User_ID(getAD_User_ID()); pi.setAD_Client_ID(get(getCtx(), AD_Scheduler_ID).getAD_Client_ID()); pi.setAD_PInstance_ID(pInstance.getAD_PInstance_ID()); + pi.setAD_Process_UU(process.getAD_Process_UU()); pi.setIsBatch(true); pi.setPrintPreview(true); MUser from = new MUser(getCtx(), pi.getAD_User_ID(), null); diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java b/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java index 10fc4565f1..81517a24c0 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java @@ -2439,6 +2439,7 @@ public final class APanel extends CPanel pi.setAD_User_ID (Env.getAD_User_ID(m_ctx)); pi.setAD_Client_ID (Env.getAD_Client_ID(m_ctx)); pi.setPrintPreview(printPreview); + pi.setAD_Process_UU(m_curTab.getAD_Process_UU()); ClientProcessCtrl.process(this, m_curWindowNo, pi, null); // calls lockUI, unlockUI statusBar.setStatusLine(pi.getSummary(), pi.isError()); @@ -2872,6 +2873,7 @@ public final class APanel extends CPanel ProcessInfo pi = new ProcessInfo (title, processID, table_ID, record_ID); pi.setAD_User_ID (Env.getAD_User_ID(m_ctx)); pi.setAD_Client_ID (Env.getAD_Client_ID(m_ctx)); + pi.setAD_Process_UU(pr.getAD_Process_UU()); ff.setProcessInfo(pi); ff.openForm(form_ID, m_curTab); ff.pack(); diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ProcessModalDialog.java b/org.adempiere.ui.swing/src/org/compiere/apps/ProcessModalDialog.java index 7c27f62ebc..d215a0c35e 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ProcessModalDialog.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/ProcessModalDialog.java @@ -111,6 +111,7 @@ public class ProcessModalDialog extends CDialog private StringBuffer m_messageText = new StringBuffer(); private String m_ShowHelp = null; // Determine if a Help Process Window is shown private boolean m_valid = true; + private String m_AD_Process_UU; /** Logger */ private static CLogger log = CLogger.getCLogger(ProcessDialog.class); @@ -247,11 +248,11 @@ public class ProcessModalDialog extends CDialog log.config(""); // boolean trl = !Env.isBaseLanguage(m_ctx, "AD_Process"); - String sql = "SELECT Name, Description, Help, IsReport, ShowHelp " + String sql = "SELECT Name, Description, Help, IsReport, ShowHelp, AD_Process_UU " + "FROM AD_Process " + "WHERE AD_Process_ID=?"; if (trl) - sql = "SELECT t.Name, t.Description, t.Help, p.IsReport, p.ShowHelp " + sql = "SELECT t.Name, t.Description, t.Help, p.IsReport, p.ShowHelp, AD_Process_UU " + "FROM AD_Process p, AD_Process_Trl t " + "WHERE p.AD_Process_ID=t.AD_Process_ID" + " AND p.AD_Process_ID=? AND t.AD_Language=?"; @@ -280,6 +281,8 @@ public class ProcessModalDialog extends CDialog s = rs.getString(3); // Help if (!rs.wasNull()) m_messageText.append("

").append(s).append("

"); + + m_AD_Process_UU = rs.getString(6); } } catch (SQLException e) @@ -301,6 +304,7 @@ public class ProcessModalDialog extends CDialog // Move from APanel.actionButton m_pi = new ProcessInfo(m_Name, m_AD_Process_ID, m_tableId, m_recordId); + m_pi.setAD_Process_UU(m_AD_Process_UU); m_pi.setAD_User_ID (Env.getAD_User_ID(Env.getCtx())); m_pi.setAD_Client_ID(Env.getAD_Client_ID(Env.getCtx())); parameterPanel = new ProcessParameterPanel(m_WindowNo, m_pi); diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/VPaySelect.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/VPaySelect.java index c0e9f6a1d3..7135fb4829 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/VPaySelect.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/form/VPaySelect.java @@ -49,6 +49,8 @@ import org.compiere.grid.ed.VComboBox; import org.compiere.grid.ed.VDate; import org.compiere.minigrid.MiniTable; import static org.compiere.model.SystemIDs.*; + +import org.compiere.model.MProcess; import org.compiere.model.X_C_PaySelection; import org.compiere.plaf.CompiereColor; import org.compiere.process.ProcessInfo; @@ -373,6 +375,7 @@ public class VPaySelect extends PaySelect implements FormPanel, ActionListener, X_C_PaySelection.Table_ID, m_ps.getC_PaySelection_ID()); pi.setAD_User_ID (Env.getAD_User_ID(Env.getCtx())); pi.setAD_Client_ID(Env.getAD_Client_ID(Env.getCtx())); + pi.setAD_Process_UU(new MProcess(Env.getCtx(), AD_Proces_ID, null).getAD_Process_UU()); ProcessParameterPanel pp = new ProcessParameterPanel(m_WindowNo, pi); // Execute Process diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AbstractProcessDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AbstractProcessDialog.java index 026c80f83c..0b636cff00 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AbstractProcessDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AbstractProcessDialog.java @@ -100,11 +100,11 @@ import org.zkoss.zul.Vlayout; public abstract class AbstractProcessDialog extends Window implements IProcessUI, EventListener { - /** * */ - private static final long serialVersionUID = 8307953279095577359L; + private static final long serialVersionUID = 2821858988648268894L; + private static final String ON_COMPLETE = "onComplete"; private static final String ON_STATUS_UPDATE = "onStatusUpdate"; @@ -132,6 +132,7 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI private Future future; private List downloadFiles; private boolean m_locked = false; + private String m_AD_Process_UU = ""; protected AbstractProcessDialog() { @@ -161,11 +162,11 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI log.config(""); // boolean trl = !Env.isBaseLanguage(m_ctx, "AD_Process"); - String sql = "SELECT Name, Description, Help, IsReport, ShowHelp " + String sql = "SELECT Name, Description, Help, IsReport, ShowHelp, AD_Process_UU " + "FROM AD_Process " + "WHERE AD_Process_ID=?"; if (trl) - sql = "SELECT t.Name, t.Description, t.Help, p.IsReport, p.ShowHelp " + sql = "SELECT t.Name, t.Description, t.Help, p.IsReport, p.ShowHelp, AD_Process_UU " + "FROM AD_Process p, AD_Process_Trl t " + "WHERE p.AD_Process_ID=t.AD_Process_ID" + " AND p.AD_Process_ID=? AND t.AD_Language=?"; @@ -196,6 +197,7 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI s = rs.getString(3); // Help if (!rs.wasNull()) buildMsg.append("

").append(s).append("

"); + m_AD_Process_UU = rs.getString(6); } initialMessage = buildMsg.toString(); @@ -221,6 +223,7 @@ public abstract class AbstractProcessDialog extends Window implements IProcessUI m_pi.setAD_User_ID (Env.getAD_User_ID(Env.getCtx())); m_pi.setAD_Client_ID(Env.getAD_Client_ID(Env.getCtx())); m_pi.setTitle(m_Name); + m_pi.setAD_Process_UU(m_AD_Process_UU); parameterPanel = new ProcessParameterPanel(m_WindowNo, m_pi); if ( !parameterPanel.init() ) { diff --git a/org.adempiere.ui/src/org/compiere/apps/AbstractProcessCtl.java b/org.adempiere.ui/src/org/compiere/apps/AbstractProcessCtl.java index 0ccdb99872..1646848d30 100644 --- a/org.adempiere.ui/src/org/compiere/apps/AbstractProcessCtl.java +++ b/org.adempiere.ui/src/org/compiere/apps/AbstractProcessCtl.java @@ -127,8 +127,8 @@ public abstract class AbstractProcessCtl implements Runnable // String sql = "SELECT p.Name, p.ProcedureName,p.ClassName, p.AD_Process_ID," // 1..4 + " p.isReport,p.IsDirectPrint,p.AD_ReportView_ID,p.AD_Workflow_ID," // 5..8 - + " CASE WHEN COALESCE(p.Statistic_Count,0)=0 THEN 0 ELSE p.Statistic_Seconds/p.Statistic_Count END CASE," - + " p.IsServerProcess, p.JasperReport " + + " CASE WHEN COALESCE(p.Statistic_Count,0)=0 THEN 0 ELSE p.Statistic_Seconds/p.Statistic_Count END CASE," // 9 + + " p.IsServerProcess, p.JasperReport, p.AD_Process_UU " // 10..12 + "FROM AD_Process p" + " INNER JOIN AD_PInstance i ON (p.AD_Process_ID=i.AD_Process_ID) " + "WHERE p.IsActive='Y'" @@ -136,8 +136,8 @@ public abstract class AbstractProcessCtl implements Runnable if (!Env.isBaseLanguage(Env.getCtx(), "AD_Process")) sql = "SELECT t.Name, p.ProcedureName,p.ClassName, p.AD_Process_ID," // 1..4 + " p.isReport, p.IsDirectPrint,p.AD_ReportView_ID,p.AD_Workflow_ID," // 5..8 - + " CASE WHEN COALESCE(p.Statistic_Count,0)=0 THEN 0 ELSE p.Statistic_Seconds/p.Statistic_Count END CASE," - + " p.IsServerProcess, p.JasperReport " + + " CASE WHEN COALESCE(p.Statistic_Count,0)=0 THEN 0 ELSE p.Statistic_Seconds/p.Statistic_Count END CASE," // 9 + + " p.IsServerProcess, p.JasperReport, p.AD_Process_UU " // 10..12 + "FROM AD_Process p" + " INNER JOIN AD_PInstance i ON (p.AD_Process_ID=i.AD_Process_ID) " + " INNER JOIN AD_Process_Trl t ON (p.AD_Process_ID=t.AD_Process_ID" @@ -160,6 +160,7 @@ public abstract class AbstractProcessCtl implements Runnable ProcedureName = rs.getString(2); m_pi.setClassName (rs.getString(3)); m_pi.setAD_Process_ID (rs.getInt(4)); + m_pi.setAD_Process_UU(rs.getString(12)); // Report if ("Y".equals(rs.getString(5))) {