From 2c2ef34172d8f5d842c61d58663ff331e9b6eff0 Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Sat, 28 Apr 2007 14:40:15 +0000 Subject: [PATCH] BF [ 1708835 ] Document Status=Completed but Processed=N http://sourceforge.net/tracker/?func=detail&atid=879332&aid=1708835&group_id=176962 Fixed some identation issues. --- base/src/org/compiere/wf/MWFActivity.java | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/base/src/org/compiere/wf/MWFActivity.java b/base/src/org/compiere/wf/MWFActivity.java index 79e68ca7fe..992627e8c5 100644 --- a/base/src/org/compiere/wf/MWFActivity.java +++ b/base/src/org/compiere/wf/MWFActivity.java @@ -709,17 +709,27 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable // Do Work /**** Trx Start ****/ boolean done = performWork(m_trx); - //begin vpj-cd e-evolution 03/08/2005 PostgreSQL + //begin vpj-cd e-evolution 03/08/2005 PostgreSQL // Reason: When is execute setWFState create a transaction for same table is generate a clicle Trx // is cause that PostgreSQL wait into transaction idle //setWFState (done ? StateEngine.STATE_Completed : StateEngine.STATE_Suspended); //end vpj-cd e-evolution 03/08/2005 PostgreSQL + /**** Trx End ****/ - m_trx.commit(true); - m_trx.close(); - m_trx = null; - //begin vpj-cd e-evolution 03/08/2005 PostgreSQL - //Reason: setWFState moved for the first trx be finished + // teo_sarca [ 1708835 ] + // Reason: if the commit fails the document should be put in Invalid state + try { + m_trx.commit(true); + m_trx.close(); + m_trx = null; + } catch (Exception e) { + // If we have a DocStatus, change it to Invalid, and throw the exception to the next level + if (m_docStatus != null) + m_docStatus = DocAction.STATUS_Invalid; + throw e; + } + //begin vpj-cd e-evolution 03/08/2005 PostgreSQL + //Reason: setWFState moved for the first trx be finished setWFState (done ? StateEngine.STATE_Completed : StateEngine.STATE_Suspended); //end vpj-cd e-evolution 03/08/2005 PostgreSQL if (m_postImmediate != null)