Update of /cvsroot/compiere/base/src/org/compiere/wf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21193/base/src/org/compiere/wf Modified Files: MWFResponsible.java MWFEventAudit.java MWFNodeNext.java WFProcessManage.java MWFNextCondition.java MWFBlock.java WFActivityManage.java MWorkflowProcessor.java MWFNode.java WorkflowMoveToClient.java WorkflowServer.java MWFNodePara.java MWorkflow.java MWFProcess.java MWorkflowProcessorLog.java MWFActivity.java MWorkflowAccess.java Log Message: New constructors Trx implementation in Process calls Index: MWFResponsible.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/wf/MWFResponsible.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MWFResponsible.java 5 Jan 2005 04:21:34 -0000 1.2 --- MWFResponsible.java 18 Feb 2005 13:16:39 -0000 1.3 *************** *** 40,44 **** if (retValue != null) return retValue; ! retValue = new MWFResponsible (ctx, AD_WF_Responsible_ID); if (retValue.getID () != 0) s_cache.put (key, retValue); --- 40,44 ---- if (retValue != null) return retValue; ! retValue = new MWFResponsible (ctx, AD_WF_Responsible_ID, null); if (retValue.getID () != 0) s_cache.put (key, retValue); *************** *** 55,61 **** * @param AD_WF_Responsible_ID id */ ! public MWFResponsible (Properties ctx, int AD_WF_Responsible_ID) { ! super (ctx, AD_WF_Responsible_ID); } // MWFResponsible --- 55,61 ---- * @param AD_WF_Responsible_ID id */ ! public MWFResponsible (Properties ctx, int id, String trxName) { ! super (ctx, id, trxName); } // MWFResponsible *************** *** 65,71 **** * @param rs result set */ ! public MWFResponsible (Properties ctx, ResultSet rs) { ! super (ctx, rs); } // MWFResponsible --- 65,71 ---- * @param rs result set */ ! public MWFResponsible (Properties ctx, ResultSet rs, String trxName) { ! super(ctx, rs, trxName); } // MWFResponsible Index: MWFEventAudit.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/wf/MWFEventAudit.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MWFEventAudit.java 5 Jan 2005 04:21:34 -0000 1.4 --- MWFEventAudit.java 18 Feb 2005 13:16:39 -0000 1.5 *************** *** 53,57 **** ResultSet rs = pstmt.executeQuery (); while (rs.next ()) ! list.add (new MWFEventAudit (ctx, rs)); rs.close (); pstmt.close (); --- 53,57 ---- ResultSet rs = pstmt.executeQuery (); while (rs.next ()) ! list.add (new MWFEventAudit (ctx, rs, null)); rs.close (); pstmt.close (); *************** *** 86,90 **** public static MWFEventAudit[] get (Properties ctx, int AD_WF_Process_ID) { ! return get(ctx, AD_WF_Process_ID, 0); } // get --- 86,90 ---- public static MWFEventAudit[] get (Properties ctx, int AD_WF_Process_ID) { ! return get(ctx, AD_WF_Process_ID); } // get *************** *** 98,104 **** * @param AD_WF_EventAudit_ID id */ ! public MWFEventAudit (Properties ctx, int AD_WF_EventAudit_ID) { ! super (ctx, AD_WF_EventAudit_ID); } // MWFEventAudit --- 98,104 ---- * @param AD_WF_EventAudit_ID id */ ! public MWFEventAudit (Properties ctx, int AD_WF_EventAudit_ID, String trxName) { ! super (ctx, AD_WF_EventAudit_ID, trxName); } // MWFEventAudit *************** *** 108,114 **** * @param rs result set */ ! public MWFEventAudit (Properties ctx, ResultSet rs) { ! super (ctx, rs); } // MWFEventAudit --- 108,114 ---- * @param rs result set */ ! public MWFEventAudit (Properties ctx, ResultSet rs, String trxName) { ! super(ctx, rs, trxName); } // MWFEventAudit *************** *** 119,123 **** public MWFEventAudit (MWFActivity activity) { ! super (activity.getCtx(), 0); setAD_WF_Process_ID (activity.getAD_WF_Process_ID()); setAD_WF_Node_ID (activity.getAD_WF_Node_ID()); --- 119,123 ---- public MWFEventAudit (MWFActivity activity) { ! super (activity.getCtx(), 0, activity.get_TrxName()); setAD_WF_Process_ID (activity.getAD_WF_Process_ID()); setAD_WF_Node_ID (activity.getAD_WF_Node_ID()); Index: MWFNodeNext.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/wf/MWFNodeNext.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** MWFNodeNext.java 5 Jan 2005 04:21:34 -0000 1.13 --- MWFNodeNext.java 18 Feb 2005 13:16:39 -0000 1.14 *************** *** 35,41 **** * @param AD_WF_NodeNext_ID id */ ! public MWFNodeNext (Properties ctx, int AD_WF_NodeNext_ID) { ! super (ctx, AD_WF_NodeNext_ID); if (AD_WF_NodeNext_ID == 0) { --- 35,41 ---- * @param AD_WF_NodeNext_ID id */ ! public MWFNodeNext (Properties ctx, int AD_WF_NodeNext_ID, String trxName) { ! super (ctx, AD_WF_NodeNext_ID, trxName); if (AD_WF_NodeNext_ID == 0) { *************** *** 53,59 **** * @param rs result set to load info from */ ! public MWFNodeNext (Properties ctx, ResultSet rs) { ! super (ctx, rs); } // MWFNodeNext --- 53,59 ---- * @param rs result set to load info from */ ! public MWFNodeNext (Properties ctx, ResultSet rs, String trxName) { ! super(ctx, rs, trxName); } // MWFNodeNext *************** *** 67,71 **** public MWFNodeNext (Properties ctx, int AD_WF_Node_ID, int AD_WF_Next_ID, int SeqNo) { ! super (ctx, 0); setAD_WF_Node_ID(AD_WF_Node_ID); setAD_WF_Next_ID(AD_WF_Next_ID); --- 67,71 ---- public MWFNodeNext (Properties ctx, int AD_WF_Node_ID, int AD_WF_Next_ID, int SeqNo) { ! super(ctx, 0, null); setAD_WF_Node_ID(AD_WF_Node_ID); setAD_WF_Next_ID(AD_WF_Next_ID); *************** *** 117,125 **** try { ! pstmt = DB.prepareStatement (sql); pstmt.setInt (1, getAD_WF_NodeNext_ID()); ResultSet rs = pstmt.executeQuery (); while (rs.next ()) ! list.add(new MWFNextCondition(getCtx(), rs)); rs.close (); pstmt.close (); --- 117,125 ---- try { ! pstmt = DB.prepareStatement (sql, get_TrxName()); pstmt.setInt (1, getAD_WF_NodeNext_ID()); ResultSet rs = pstmt.executeQuery (); while (rs.next ()) ! list.add(new MWFNextCondition(getCtx(), rs, get_TrxName())); rs.close (); pstmt.close (); Index: WFProcessManage.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/wf/WFProcessManage.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WFProcessManage.java 5 Jan 2005 04:21:34 -0000 1.2 --- WFProcessManage.java 18 Feb 2005 13:16:39 -0000 1.3 *************** *** 65,69 **** protected String doIt() throws Exception { ! MWFProcess process = new MWFProcess (getCtx(), p_AD_WF_Process_ID); log.info("doIt - " + process); --- 65,69 ---- protected String doIt() throws Exception { ! MWFProcess process = new MWFProcess (getCtx(), p_AD_WF_Process_ID, get_TrxName()); log.info("doIt - " + process); Index: MWFNextCondition.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/wf/MWFNextCondition.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MWFNextCondition.java 5 Jan 2005 04:21:34 -0000 1.5 --- MWFNextCondition.java 18 Feb 2005 13:16:39 -0000 1.6 *************** *** 33,39 **** * @param AD_WF_NextCondition_ID id */ ! public MWFNextCondition (Properties ctx, int AD_WF_NextCondition_ID) { ! super (ctx, AD_WF_NextCondition_ID); } // MWFNextCondition --- 33,39 ---- * @param AD_WF_NextCondition_ID id */ ! public MWFNextCondition (Properties ctx, int id, String trxName) { ! super (ctx, id, trxName); } // MWFNextCondition *************** *** 43,49 **** * @param rs result set */ ! public MWFNextCondition (Properties ctx, ResultSet rs) { ! super (ctx, rs); } // MWFNextCondition --- 43,49 ---- * @param rs result set */ ! public MWFNextCondition (Properties ctx, ResultSet rs, String trxName) { ! super(ctx, rs, trxName); } // MWFNextCondition Index: MWFBlock.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/wf/MWFBlock.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MWFBlock.java 5 Jan 2005 04:21:34 -0000 1.2 --- MWFBlock.java 18 Feb 2005 13:16:39 -0000 1.3 *************** *** 40,44 **** if (retValue != null) return retValue; ! retValue = new MWFBlock (ctx, AD_WF_Block_ID); if (retValue.getID () != 0) s_cache.put (key, retValue); --- 40,44 ---- if (retValue != null) return retValue; ! retValue = new MWFBlock (ctx, AD_WF_Block_ID, null); if (retValue.getID () != 0) s_cache.put (key, retValue); *************** *** 55,61 **** * @param AD_WF_Block_ID id */ ! public MWFBlock (Properties ctx, int AD_WF_Block_ID) { ! super (ctx, AD_WF_Block_ID); } // MWFBlock --- 55,61 ---- * @param AD_WF_Block_ID id */ ! public MWFBlock (Properties ctx, int id, String trxName) { ! super (ctx, id, trxName); } // MWFBlock *************** *** 65,71 **** * @param rs result set */ ! public MWFBlock (Properties ctx, ResultSet rs) { ! super (ctx, rs); } // MWFBlock --- 65,71 ---- * @param rs result set */ ! public MWFBlock (Properties ctx, ResultSet rs, String trxName) { ! super(ctx, rs, trxName); } // MWFBlock Index: WFActivityManage.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/wf/WFActivityManage.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WFActivityManage.java 5 Jan 2005 04:21:34 -0000 1.2 --- WFActivityManage.java 18 Feb 2005 13:16:39 -0000 1.3 *************** *** 65,69 **** protected String doIt() throws Exception { ! MWFActivity activity = new MWFActivity (getCtx(), p_AD_WF_Activity_ID); log.info("doIt - " + activity); --- 65,69 ---- protected String doIt() throws Exception { ! MWFActivity activity = new MWFActivity (getCtx(), p_AD_WF_Activity_ID, get_TrxName()); log.info("doIt - " + activity); Index: MWorkflowProcessor.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/wf/MWorkflowProcessor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MWorkflowProcessor.java 5 Jan 2005 04:21:34 -0000 1.4 --- MWorkflowProcessor.java 18 Feb 2005 13:16:39 -0000 1.5 *************** *** 45,49 **** ResultSet rs = pstmt.executeQuery (); while (rs.next ()) ! list.add (new MWorkflowProcessor (ctx, rs)); rs.close (); pstmt.close (); --- 45,49 ---- ResultSet rs = pstmt.executeQuery (); while (rs.next ()) ! list.add (new MWorkflowProcessor (ctx, rs, null)); rs.close (); pstmt.close (); *************** *** 79,85 **** * @param AD_WorkflowProcessor_ID id */ ! public MWorkflowProcessor (Properties ctx, int AD_WorkflowProcessor_ID) { ! super (ctx, AD_WorkflowProcessor_ID); } // MWorkflowProcessor --- 79,85 ---- * @param AD_WorkflowProcessor_ID id */ ! public MWorkflowProcessor (Properties ctx, int id, String trxName) { ! super (ctx, id, trxName); } // MWorkflowProcessor *************** *** 89,95 **** * @param rs result set */ ! public MWorkflowProcessor (Properties ctx, ResultSet rs) { ! super (ctx, rs); } // MWorkflowProcessor --- 89,95 ---- * @param rs result set */ ! public MWorkflowProcessor (Properties ctx, ResultSet rs, String trxName) { ! super(ctx, rs, trxName); } // MWorkflowProcessor *************** *** 129,137 **** try { ! pstmt = DB.prepareStatement (sql); pstmt.setInt (1, getAD_WorkflowProcessor_ID()); ResultSet rs = pstmt.executeQuery (); while (rs.next ()) ! list.add (new MWorkflowProcessorLog (getCtx(), rs)); rs.close (); pstmt.close (); --- 129,137 ---- try { ! pstmt = DB.prepareStatement (sql, get_TrxName()); pstmt.setInt (1, getAD_WorkflowProcessor_ID()); ResultSet rs = pstmt.executeQuery (); while (rs.next ()) ! list.add (new MWorkflowProcessorLog (getCtx(), rs, get_TrxName())); rs.close (); pstmt.close (); *************** *** 168,172 **** + "WHERE AD_WorkflowProcessor_ID=" + getAD_WorkflowProcessor_ID() + " AND (Created+" + getKeepLogDays() + ") < SysDate"; ! int no = DB.executeUpdate(sql); return 0; } // deleteLog --- 168,172 ---- + "WHERE AD_WorkflowProcessor_ID=" + getAD_WorkflowProcessor_ID() + " AND (Created+" + getKeepLogDays() + ") < SysDate"; ! int no = DB.executeUpdate(sql, get_TrxName()); return 0; } // deleteLog Index: MWFNode.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/wf/MWFNode.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** MWFNode.java 8 Feb 2005 07:11:49 -0000 1.20 --- MWFNode.java 18 Feb 2005 13:16:39 -0000 1.21 *************** *** 42,46 **** if (retValue != null) return retValue; ! retValue = new MWFNode (ctx, AD_WF_Node_ID); if (retValue.getID () != 0) s_cache.put (key, retValue); --- 42,46 ---- if (retValue != null) return retValue; ! retValue = new MWFNode (ctx, AD_WF_Node_ID, null); if (retValue.getID () != 0) s_cache.put (key, retValue); *************** *** 57,63 **** * @param AD_WF_Node_ID id */ ! public MWFNode (Properties ctx, int AD_WF_Node_ID) { ! super (ctx, AD_WF_Node_ID); if (AD_WF_Node_ID == 0) { --- 57,63 ---- * @param AD_WF_Node_ID id */ ! public MWFNode (Properties ctx, int AD_WF_Node_ID, String trxName) { ! super (ctx, AD_WF_Node_ID, trxName); if (AD_WF_Node_ID == 0) { *************** *** 91,95 **** public MWFNode (MWorkflow wf, String Value, String Name) { ! this (wf.getCtx(), 0); setClientOrg(wf); setAD_Workflow_ID (wf.getAD_Workflow_ID()); --- 91,95 ---- public MWFNode (MWorkflow wf, String Value, String Name) { ! this (wf.getCtx(), 0, wf.get_TrxName()); setClientOrg(wf); setAD_Workflow_ID (wf.getAD_Workflow_ID()); *************** *** 104,110 **** * @param rs result set to load info from */ ! public MWFNode (Properties ctx, ResultSet rs) { ! super (ctx, rs); loadNext(); loadTrl(); --- 104,110 ---- * @param rs result set to load info from */ ! public MWFNode (Properties ctx, ResultSet rs, String trxName) { ! super(ctx, rs, trxName); loadNext(); loadTrl(); *************** *** 141,150 **** try { ! PreparedStatement pstmt = DB.prepareStatement(sql); pstmt.setInt(1, getID()); ResultSet rs = pstmt.executeQuery(); while (rs.next()) { ! MWFNodeNext next = new MWFNodeNext (getCtx(), rs); next.setFromSplitAnd(splitAnd); m_next.add(next); --- 141,150 ---- try { ! PreparedStatement pstmt = DB.prepareStatement(sql, get_TrxName()); pstmt.setInt(1, getID()); ResultSet rs = pstmt.executeQuery(); while (rs.next()) { ! MWFNodeNext next = new MWFNodeNext (getCtx(), rs, get_TrxName()); next.setFromSplitAnd(splitAnd); m_next.add(next); *************** *** 170,174 **** try { ! PreparedStatement pstmt = DB.prepareStatement(sql); pstmt.setInt(1, getID()); pstmt.setString(2, Env.getAD_Language(getCtx())); --- 170,174 ---- try { ! PreparedStatement pstmt = DB.prepareStatement(sql, get_TrxName()); pstmt.setInt(1, getID()); pstmt.setString(2, Env.getAD_Language(getCtx())); Index: WorkflowMoveToClient.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/wf/WorkflowMoveToClient.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WorkflowMoveToClient.java 5 Jan 2005 04:21:34 -0000 1.2 --- WorkflowMoveToClient.java 18 Feb 2005 13:16:39 -0000 1.3 *************** *** 65,69 **** + " WHERE AD_Client_ID=0 AND EntityType NOT IN ('D','C')" + " AND AD_Workflow_ID=" + p_AD_Workflow_ID; ! int no = DB.executeUpdate(sql); if (no == -1) throw new CompiereSystemError ("Error updating Workflow"); --- 65,69 ---- + " WHERE AD_Client_ID=0 AND EntityType NOT IN ('D','C')" + " AND AD_Workflow_ID=" + p_AD_Workflow_ID; ! int no = DB.executeUpdate(sql, get_TrxName()); if (no == -1) throw new CompiereSystemError ("Error updating Workflow"); *************** *** 74,78 **** + " WHERE AD_Client_ID=0 AND EntityType NOT IN ('D','C')" + " AND AD_Workflow_ID=" + p_AD_Workflow_ID; ! no = DB.executeUpdate(sql); if (no == -1) throw new CompiereSystemError ("Error updating Workflow Node"); --- 74,78 ---- + " WHERE AD_Client_ID=0 AND EntityType NOT IN ('D','C')" + " AND AD_Workflow_ID=" + p_AD_Workflow_ID; ! no = DB.executeUpdate(sql, get_TrxName()); if (no == -1) throw new CompiereSystemError ("Error updating Workflow Node"); *************** *** 85,89 **** + ") OR AD_WF_Next_ID IN (SELECT AD_WF_Node_ID FROM AD_WF_Node WHERE AD_Workflow_ID=" + p_AD_Workflow_ID + "))"; ! no = DB.executeUpdate(sql); if (no == -1) throw new CompiereSystemError ("Error updating Workflow Transition"); --- 85,89 ---- + ") OR AD_WF_Next_ID IN (SELECT AD_WF_Node_ID FROM AD_WF_Node WHERE AD_Workflow_ID=" + p_AD_Workflow_ID + "))"; ! no = DB.executeUpdate(sql, get_TrxName()); if (no == -1) throw new CompiereSystemError ("Error updating Workflow Transition"); *************** *** 95,99 **** + " AND AD_WF_Node_ID IN (SELECT AD_WF_Node_ID FROM AD_WF_Node WHERE AD_Workflow_ID=" + p_AD_Workflow_ID + ")"; ! no = DB.executeUpdate(sql); if (no == -1) throw new CompiereSystemError ("Error updating Workflow Node Parameters"); --- 95,99 ---- + " AND AD_WF_Node_ID IN (SELECT AD_WF_Node_ID FROM AD_WF_Node WHERE AD_Workflow_ID=" + p_AD_Workflow_ID + ")"; ! no = DB.executeUpdate(sql, get_TrxName()); if (no == -1) throw new CompiereSystemError ("Error updating Workflow Node Parameters"); *************** *** 108,112 **** + ") OR AD_WF_Next_ID IN (SELECT AD_WF_Node_ID FROM AD_WF_Node WHERE AD_Workflow_ID=" + p_AD_Workflow_ID + "))"; ! no = DB.executeUpdate(sql); if (no == -1) throw new CompiereSystemError ("Error updating Workflow Transition Condition"); --- 108,112 ---- + ") OR AD_WF_Next_ID IN (SELECT AD_WF_Node_ID FROM AD_WF_Node WHERE AD_Workflow_ID=" + p_AD_Workflow_ID + "))"; ! no = DB.executeUpdate(sql, get_TrxName()); if (no == -1) throw new CompiereSystemError ("Error updating Workflow Transition Condition"); Index: WorkflowServer.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/wf/WorkflowServer.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** WorkflowServer.java 5 Jan 2005 04:21:34 -0000 1.3 --- WorkflowServer.java 18 Feb 2005 13:16:39 -0000 1.4 *************** *** 102,106 **** org.compiere.Compiere.startup(true); ! MWorkflowProcessor processor = new MWorkflowProcessor (Env.getCtx(), 100); CompiereService cs = new CompiereService(processor, WorkflowServer.class); cs.start(); --- 102,106 ---- org.compiere.Compiere.startup(true); ! MWorkflowProcessor processor = new MWorkflowProcessor (Env.getCtx(), 100, null); CompiereService cs = new CompiereService(processor, WorkflowServer.class); cs.start(); Index: MWFNodePara.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/wf/MWFNodePara.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MWFNodePara.java 5 Jan 2005 04:21:34 -0000 1.3 --- MWFNodePara.java 18 Feb 2005 13:16:39 -0000 1.4 *************** *** 48,52 **** ResultSet rs = pstmt.executeQuery (); while (rs.next ()) ! list.add(new MWFNodePara (ctx, rs)); rs.close (); pstmt.close (); --- 48,52 ---- ResultSet rs = pstmt.executeQuery (); while (rs.next ()) ! list.add(new MWFNodePara (ctx, rs, null)); rs.close (); pstmt.close (); *************** *** 81,87 **** * @param AD_WF_Node_Para_ID id */ ! public MWFNodePara (Properties ctx, int AD_WF_Node_Para_ID) { ! super (ctx, AD_WF_Node_Para_ID); } // MWFNodePara --- 81,87 ---- * @param AD_WF_Node_Para_ID id */ ! public MWFNodePara (Properties ctx, int id, String trxName) { ! super (ctx, id, trxName); } // MWFNodePara *************** *** 91,97 **** * @param rs result set */ ! public MWFNodePara (Properties ctx, ResultSet rs) { ! super (ctx, rs); } // MWFNodePara --- 91,97 ---- * @param rs result set */ ! public MWFNodePara (Properties ctx, ResultSet rs, String trxName) { ! super(ctx, rs, trxName); } // MWFNodePara *************** *** 107,111 **** { if (m_processPara == null) ! m_processPara = new MProcessPara (getCtx(), getAD_Process_Para_ID()); return m_processPara; } // getProcessPara --- 107,111 ---- { if (m_processPara == null) ! m_processPara = new MProcessPara (getCtx(), getAD_Process_Para_ID(), get_TrxName()); return m_processPara; } // getProcessPara Index: MWorkflow.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/wf/MWorkflow.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** MWorkflow.java 14 Jan 2005 07:07:07 -0000 1.25 --- MWorkflow.java 18 Feb 2005 13:16:39 -0000 1.26 *************** *** 41,45 **** if (retValue != null) return retValue; ! retValue = new MWorkflow (ctx, AD_Workflow_ID); if (retValue.getID() != 0) s_cache.put(key, retValue); --- 41,45 ---- if (retValue != null) return retValue; ! retValue = new MWorkflow (ctx, AD_Workflow_ID, null); if (retValue.getID() != 0) s_cache.put(key, retValue); *************** *** 69,73 **** while (rs.next ()) { ! MWorkflow wf = new MWorkflow (ctx, rs); String key = "C" + wf.getAD_Client_ID() + "T" + wf.getAD_Table_ID(); s_cacheDocValue.put (key, wf); --- 69,73 ---- while (rs.next ()) { ! MWorkflow wf = new MWorkflow (ctx, rs, null); String key = "C" + wf.getAD_Client_ID() + "T" + wf.getAD_Table_ID(); s_cacheDocValue.put (key, wf); *************** *** 112,118 **** * @param AD_Workflow_ID ID */ ! public MWorkflow (Properties ctx, int AD_Workflow_ID) { ! super (ctx, AD_Workflow_ID); if (AD_Workflow_ID == 0) { --- 112,118 ---- * @param AD_Workflow_ID ID */ ! public MWorkflow (Properties ctx, int AD_Workflow_ID, String trxName) { ! super (ctx, AD_Workflow_ID, trxName); if (AD_Workflow_ID == 0) { *************** *** 141,147 **** * @param rs result set */ ! public MWorkflow (Properties ctx, ResultSet rs) { ! super (ctx, rs); } // Workflow --- 141,147 ---- * @param rs result set */ ! public MWorkflow (Properties ctx, ResultSet rs, String trxName) { ! super(ctx, rs, trxName); } // Workflow *************** *** 199,207 **** try { ! PreparedStatement pstmt = DB.prepareStatement(sql); pstmt.setInt(1, getID()); ResultSet rs = pstmt.executeQuery(); while (rs.next()) ! m_nodes.add (new MWFNode (getCtx(), rs)); rs.close(); pstmt.close(); --- 199,207 ---- try { ! PreparedStatement pstmt = DB.prepareStatement(sql, get_TrxName()); pstmt.setInt(1, getID()); ResultSet rs = pstmt.executeQuery(); while (rs.next()) ! m_nodes.add (new MWFNode (getCtx(), rs, get_TrxName())); rs.close(); pstmt.close(); *************** *** 685,689 **** // Create Standard Document Process ! MWorkflow wf = new MWorkflow(Env.getCtx(), 0); wf.setValue ("Process_xx"); wf.setName (wf.getValue()); --- 685,689 ---- // Create Standard Document Process ! MWorkflow wf = new MWorkflow(Env.getCtx(), 0, null); wf.setValue ("Process_xx"); wf.setName (wf.getValue()); Index: MWFProcess.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/wf/MWFProcess.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** MWFProcess.java 14 Feb 2005 02:23:09 -0000 1.19 --- MWFProcess.java 18 Feb 2005 13:16:39 -0000 1.20 *************** *** 35,41 **** * @param AD_WF_Process_ID process */ ! public MWFProcess (Properties ctx, int AD_WF_Process_ID) { ! super (ctx, AD_WF_Process_ID); if (AD_WF_Process_ID == 0) throw new IllegalArgumentException ("Cannot create new WF Process directly"); --- 35,41 ---- * @param AD_WF_Process_ID process */ ! public MWFProcess (Properties ctx, int AD_WF_Process_ID, String trxName) { ! super (ctx, AD_WF_Process_ID, trxName); if (AD_WF_Process_ID == 0) throw new IllegalArgumentException ("Cannot create new WF Process directly"); *************** *** 48,54 **** * @param rs result set */ ! public MWFProcess (Properties ctx, ResultSet rs) { ! super (ctx, rs); m_state = new StateEngine (getWFState()); } // MWFProcess --- 48,54 ---- * @param rs result set */ ! public MWFProcess (Properties ctx, ResultSet rs, String trxName) { ! super(ctx, rs, trxName); m_state = new StateEngine (getWFState()); } // MWFProcess *************** *** 61,65 **** public MWFProcess (MWorkflow wf, ProcessInfo pi) throws Exception { ! super (wf.getCtx(), 0); if (!TimeUtil.isValid(wf.getValidFrom(), wf.getValidTo())) throw new IllegalStateException("Workflow not valid"); --- 61,65 ---- public MWFProcess (MWorkflow wf, ProcessInfo pi) throws Exception { ! super (wf.getCtx(), 0, wf.get_TrxName()); if (!TimeUtil.isValid(wf.getValidFrom(), wf.getValidTo())) throw new IllegalStateException("Workflow not valid"); *************** *** 114,122 **** try { ! pstmt = DB.prepareStatement (sql); pstmt.setInt (1, getAD_WF_Process_ID()); ResultSet rs = pstmt.executeQuery (); while (rs.next ()) ! list.add (new MWFActivity(getCtx(), rs)); rs.close (); pstmt.close (); --- 114,122 ---- try { ! pstmt = DB.prepareStatement (sql, get_TrxName()); pstmt.setInt (1, getAD_WF_Process_ID()); ResultSet rs = pstmt.executeQuery (); while (rs.next ()) ! list.add (new MWFActivity(getCtx(), rs, get_TrxName())); rs.close (); pstmt.close (); Index: MWorkflowProcessorLog.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/wf/MWorkflowProcessorLog.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MWorkflowProcessorLog.java 5 Jan 2005 04:21:34 -0000 1.2 --- MWorkflowProcessorLog.java 18 Feb 2005 13:16:39 -0000 1.3 *************** *** 34,40 **** * @param AD_WorkflowProcessorLog_ID id */ ! public MWorkflowProcessorLog (Properties ctx, int AD_WorkflowProcessorLog_ID) { ! super (ctx, AD_WorkflowProcessorLog_ID); if (AD_WorkflowProcessorLog_ID == 0) { --- 34,40 ---- * @param AD_WorkflowProcessorLog_ID id */ ! public MWorkflowProcessorLog (Properties ctx, int AD_WorkflowProcessorLog_ID, String trxName) { ! super (ctx, AD_WorkflowProcessorLog_ID, trxName); if (AD_WorkflowProcessorLog_ID == 0) { *************** *** 48,54 **** * @param rs result set */ ! public MWorkflowProcessorLog (Properties ctx, ResultSet rs) { ! super (ctx, rs); } // MWorkflowProcessorLog --- 48,54 ---- * @param rs result set */ ! public MWorkflowProcessorLog (Properties ctx, ResultSet rs, String trxName) { ! super(ctx, rs, trxName); } // MWorkflowProcessorLog *************** *** 60,64 **** public MWorkflowProcessorLog (MWorkflowProcessor parent, String Summary) { ! this (parent.getCtx(), 0); setClientOrg(parent); setAD_WorkflowProcessor_ID(parent.getAD_WorkflowProcessor_ID()); --- 60,64 ---- public MWorkflowProcessorLog (MWorkflowProcessor parent, String Summary) { ! this (parent.getCtx(), 0, parent.get_TrxName()); setClientOrg(parent); setAD_WorkflowProcessor_ID(parent.getAD_WorkflowProcessor_ID()); Index: MWFActivity.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/wf/MWFActivity.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** MWFActivity.java 14 Feb 2005 02:23:09 -0000 1.29 --- MWFActivity.java 18 Feb 2005 13:16:39 -0000 1.30 *************** *** 58,62 **** ResultSet rs = pstmt.executeQuery (); while (rs.next ()) ! list.add(new MWFActivity (ctx, rs)); rs.close (); pstmt.close (); --- 58,62 ---- ResultSet rs = pstmt.executeQuery (); while (rs.next ()) ! list.add(new MWFActivity (ctx, rs, null)); rs.close (); pstmt.close (); *************** *** 115,121 **** * @param AD_WF_Activity_ID id */ ! public MWFActivity (Properties ctx, int AD_WF_Activity_ID) { ! super (ctx, AD_WF_Activity_ID); if (AD_WF_Activity_ID == 0) throw new IllegalArgumentException ("Cannot create new WF Activity directly"); --- 115,121 ---- * @param AD_WF_Activity_ID id */ ! public MWFActivity (Properties ctx, int AD_WF_Activity_ID, String trxName) { ! super (ctx, AD_WF_Activity_ID, trxName); if (AD_WF_Activity_ID == 0) throw new IllegalArgumentException ("Cannot create new WF Activity directly"); *************** *** 128,134 **** * @param rs result set */ ! public MWFActivity (Properties ctx, ResultSet rs) { ! super (ctx, rs); m_state = new StateEngine (getWFState()); } // MWFActivity --- 128,134 ---- * @param rs result set */ ! public MWFActivity (Properties ctx, ResultSet rs, String trxName) { ! super(ctx, rs, trxName); m_state = new StateEngine (getWFState()); } // MWFActivity *************** *** 141,145 **** public MWFActivity (MWFProcess process, int AD_WF_Node_ID) { ! super (process.getCtx(), 0); setAD_WF_Process_ID (process.getAD_WF_Process_ID()); setPriority(process.getPriority()); --- 141,145 ---- public MWFActivity (MWFProcess process, int AD_WF_Node_ID) { ! super (process.getCtx(), 0, process.get_TrxName()); setAD_WF_Process_ID (process.getAD_WF_Process_ID()); setPriority(process.getPriority()); *************** *** 219,223 **** // Inform Process if (m_process == null) ! m_process = new MWFProcess (getCtx(), getAD_WF_Process_ID()); m_process.checkActivities(); } --- 219,223 ---- // Inform Process if (m_process == null) ! m_process = new MWFProcess (getCtx(), getAD_WF_Process_ID(), null); m_process.checkActivities(); } *************** *** 282,289 **** /************************************************************************** ! * Get Persistent Object * @return po */ ! public PO getPO() { if (m_po != null) --- 282,289 ---- /************************************************************************** ! * Get Persistent Object in Transaction * @return po */ ! public PO getPO(Trx trx) { if (m_po != null) *************** *** 291,298 **** M_Table table = M_Table.get (getCtx(), getAD_Table_ID()); ! m_po = table.getPO(getRecord_ID(), get_TrxName()); return m_po; } // getPO /** * Get Attribute Value (based on Node) of PO --- 291,310 ---- M_Table table = M_Table.get (getCtx(), getAD_Table_ID()); ! if (trx != null) ! m_po = table.getPO(getRecord_ID(), trx.getTrxName()); ! else ! m_po = table.getPO(getRecord_ID(), null); return m_po; } // getPO + /************************************************************************** + * Get Persistent Object + * @return po + */ + public PO getPO() + { + return getPO(null); + } + /** * Get Attribute Value (based on Node) of PO *************** *** 441,447 **** String oldText = getTextMsg(); if (oldText == null || oldText.length() == 0) ! super.setTextMsg (TextMsg); else if (TextMsg != null && TextMsg.length() > 0) ! super.setTextMsg (oldText + "\n - " + TextMsg); } // setTextMsg --- 453,459 ---- String oldText = getTextMsg(); if (oldText == null || oldText.length() == 0) ! super.setTextMsg (StringUtil.trim(TextMsg,1000)); else if (TextMsg != null && TextMsg.length() > 0) ! super.setTextMsg (StringUtil.trim(oldText + "\n - " + TextMsg,1000)); } // setTextMsg *************** *** 479,485 **** String oldText = getTextMsg(); if (oldText == null || oldText.length() == 0) ! super.setTextMsg (TextMsg.toString()); else if (TextMsg != null && TextMsg.length() > 0) ! super.setTextMsg (oldText + "\n - " + TextMsg.toString()); } // setTextMsg --- 491,497 ---- String oldText = getTextMsg(); if (oldText == null || oldText.length() == 0) ! super.setTextMsg(StringUtil.trim(TextMsg.toString(),1000)); else if (TextMsg != null && TextMsg.length() > 0) ! super.setTextMsg(StringUtil.trim(oldText + "\n - " + TextMsg.toString(),1000)); } // setTextMsg *************** *** 671,675 **** String processMsg = e.getLocalizedMessage(); if (processMsg == null || processMsg.length() == 0) ! processMsg = e.toString(); setTextMsg(processMsg); addTextMsg(e); --- 683,687 ---- String processMsg = e.getLocalizedMessage(); if (processMsg == null || processMsg.length() == 0) ! processMsg = e.getMessage(); setTextMsg(processMsg); addTextMsg(e); *************** *** 708,712 **** { log.fine("performWork - DocumentAction=" + m_node.getDocAction()); ! getPO(); if (m_po == null) throw new Exception("Persistent Object not found - AD_Table_ID=" --- 720,724 ---- { log.fine("performWork - DocumentAction=" + m_node.getDocAction()); ! getPO(trx); if (m_po == null) throw new Exception("Persistent Object not found - AD_Table_ID=" *************** *** 759,763 **** pi.setAD_Client_ID(getAD_Client_ID()); MPInstance pInstance = new MPInstance(process, getRecord_ID()); ! fillParameter(pInstance); pi.setAD_PInstance_ID(pInstance.getAD_PInstance_ID()); // Report --- 771,775 ---- pi.setAD_Client_ID(getAD_Client_ID()); MPInstance pInstance = new MPInstance(process, getRecord_ID()); ! fillParameter(pInstance, trx); pi.setAD_PInstance_ID(pInstance.getAD_PInstance_ID()); // Report *************** *** 768,772 **** // Notice int AD_Message_ID = 753; // HARDCODED WorkflowResult ! MNote note = new MNote(getCtx(), AD_Message_ID, getAD_User_ID()); note.setTextMsg(m_node.getName(true)); note.setDescription(m_node.getDescription(true)); --- 780,784 ---- // Notice int AD_Message_ID = 753; // HARDCODED WorkflowResult ! MNote note = new MNote(getCtx(), AD_Message_ID, getAD_User_ID(), trx.getTrxName()); note.setTextMsg(m_node.getName(true)); note.setDescription(m_node.getDescription(true)); *************** *** 774,778 **** note.save(); // Attachment ! MAttachment attachment = new MAttachment (getCtx(), MNote.Table_ID, note.getAD_Note_ID()); attachment.addEntry(report); attachment.setTextMsg(m_node.getName(true)); --- 786,790 ---- note.save(); // Attachment ! MAttachment attachment = new MAttachment (getCtx(), MNote.Table_ID, note.getAD_Note_ID(), get_TrxName()); attachment.addEntry(report); attachment.setTextMsg(m_node.getName(true)); *************** *** 793,799 **** pi.setAD_Client_ID(getAD_Client_ID()); MPInstance pInstance = new MPInstance(process, getRecord_ID()); ! fillParameter(pInstance); pi.setAD_PInstance_ID(pInstance.getAD_PInstance_ID()); ! return process.processIt(pi); } --- 805,811 ---- pi.setAD_Client_ID(getAD_Client_ID()); MPInstance pInstance = new MPInstance(process, getRecord_ID()); ! fillParameter(pInstance, trx); pi.setAD_PInstance_ID(pInstance.getAD_PInstance_ID()); ! return process.processIt(pi, trx); } *************** *** 1034,1040 **** * @param pInstance process instance */ ! private void fillParameter(MPInstance pInstance) { ! getPO(); // MWFNodePara[] nParams = m_node.getParameters(); --- 1046,1052 ---- * @param pInstance process instance */ ! private void fillParameter(MPInstance pInstance, Trx trx) { ! getPO(trx); // MWFNodePara[] nParams = m_node.getParameters(); Index: MWorkflowAccess.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/wf/MWorkflowAccess.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MWorkflowAccess.java 5 Jan 2005 04:21:34 -0000 1.2 --- MWorkflowAccess.java 18 Feb 2005 13:16:39 -0000 1.3 *************** *** 33,39 **** * @param ignored - */ ! public MWorkflowAccess (Properties ctx, int ignored) { ! super (ctx, 0); if (ignored != 0) throw new IllegalArgumentException("Multi-Key"); --- 33,39 ---- * @param ignored - */ ! public MWorkflowAccess (Properties ctx, int ignored, String trxName) { ! super(ctx, 0, trxName); if (ignored != 0) throw new IllegalArgumentException("Multi-Key"); *************** *** 51,57 **** * @param rs result set */ ! public MWorkflowAccess (Properties ctx, ResultSet rs) { ! super (ctx, rs); } // MWorkflowAccess --- 51,57 ---- * @param rs result set */ ! public MWorkflowAccess (Properties ctx, ResultSet rs, String trxName) { ! super(ctx, rs, trxName); } // MWorkflowAccess *************** *** 63,67 **** public MWorkflowAccess (MWorkflow parent, int AD_Role_ID) { ! super (parent.getCtx(), 0); setClientOrg(parent); setAD_Workflow_ID(parent.getAD_Workflow_ID()); --- 63,67 ---- public MWorkflowAccess (MWorkflow parent, int AD_Role_ID) { ! super (parent.getCtx(), 0, parent.get_TrxName()); setClientOrg(parent); setAD_Workflow_ID(parent.getAD_Workflow_ID()); |