IDEMPIERE-5643 - Error during document's workflows are not displayed on Workflow Activities form. (#1756)

* IDEMPIERE-5643 - Allows Workflow Activities form to throw Exceptions if an error occurs after user's approval

* IDEMPIERE-5643 - show message in wf activity

---------

Co-authored-by: matheus.marcelino <matheus.marcelino@devcoffee.com.br>
This commit is contained in:
Marcos Gabriel de Oliveira Favaretto 2023-06-07 16:48:59 -03:00 committed by GitHub
parent 2911b1f421
commit 43800e2540
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View File

@ -85,7 +85,7 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable
/** /**
* *
*/ */
private static final long serialVersionUID = 8180781075902940080L; private static final long serialVersionUID = -9119089506977887142L;
private static final String CURRENT_WORKFLOW_PROCESS_INFO_ATTR = "Workflow.ProcessInfo"; private static final String CURRENT_WORKFLOW_PROCESS_INFO_ATTR = "Workflow.ProcessInfo";
@ -2171,4 +2171,12 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable
return where; return where;
} }
public String getProcessMsg() {
if (m_process == null)
return null;
return m_process.getProcessMsg();
}
} // MWFActivity } // MWFActivity

View File

@ -673,11 +673,14 @@ public class WWFActivity extends ADForm implements EventListener<Event>
m_activity.setUserChoice(AD_User_ID, value, dt, textMsg); m_activity.setUserChoice(AD_User_ID, value, dt, textMsg);
MWFProcess wfpr = new MWFProcess(m_activity.getCtx(), m_activity.getAD_WF_Process_ID(), m_activity.get_TrxName()); MWFProcess wfpr = new MWFProcess(m_activity.getCtx(), m_activity.getAD_WF_Process_ID(), m_activity.get_TrxName());
wfpr.checkCloseActivities(m_activity.get_TrxName()); wfpr.checkCloseActivities(m_activity.get_TrxName());
if (!Util.isEmpty(m_activity.getProcessMsg(), true))
Dialog.error(m_WindowNo, m_activity.getProcessMsg());
} }
catch (Exception e) catch (Exception e)
{ {
log.log(Level.SEVERE, node.getName(), e); log.log(Level.SEVERE, node.getName(), e);
Dialog.error(m_WindowNo, "Error", e.toString()); Dialog.error(m_WindowNo, "Error", e.getLocalizedMessage() != null ? e.getLocalizedMessage() : e.getMessage());
trx.rollback(); trx.rollback();
trx.close(); trx.close();
return; return;
@ -693,6 +696,9 @@ public class WWFActivity extends ADForm implements EventListener<Event>
m_activity.setUserConfirmation(AD_User_ID, textMsg); m_activity.setUserConfirmation(AD_User_ID, textMsg);
MWFProcess wfpr = new MWFProcess(m_activity.getCtx(), m_activity.getAD_WF_Process_ID(), m_activity.get_TrxName()); MWFProcess wfpr = new MWFProcess(m_activity.getCtx(), m_activity.getAD_WF_Process_ID(), m_activity.get_TrxName());
wfpr.checkCloseActivities(m_activity.get_TrxName()); wfpr.checkCloseActivities(m_activity.get_TrxName());
if (!Util.isEmpty(m_activity.getProcessMsg(), true))
Dialog.error(m_WindowNo, m_activity.getProcessMsg());
} }
catch (Exception e) catch (Exception e)
{ {