BF [ 2815732 ] MWFNode.getWorkflow not working in trx

https://sourceforge.net/tracker/?func=detail&aid=2815732&group_id=176962&atid=879332
This commit is contained in:
teo_sarca 2009-07-02 11:48:13 +00:00
parent 84874d9638
commit db50e2b2a3
1 changed files with 20 additions and 8 deletions

View File

@ -42,7 +42,9 @@ import org.compiere.util.Msg;
* @version $Id: MWFNode.java,v 1.2 2006/07/30 00:51:05 jjanke Exp $ * @version $Id: MWFNode.java,v 1.2 2006/07/30 00:51:05 jjanke Exp $
* *
* @author Teo Sarca, www.arhipac.ro * @author Teo Sarca, www.arhipac.ro
* <li>FR [ 2214883 ] Remove SQL code and Replace for Query * <li>FR [ 2214883 ] Remove SQL code and Replace for Query
* <li>BF [ 2815732 ] MWFNode.getWorkflow not working in trx
* https://sourceforge.net/tracker/?func=detail&aid=2815732&group_id=176962&atid=879332
*/ */
public class MWFNode extends X_AD_WF_Node public class MWFNode extends X_AD_WF_Node
{ {
@ -426,7 +428,7 @@ public class MWFNode extends X_AD_WF_Node
if (duration == 0) if (duration == 0)
return 0; return 0;
if (m_durationBaseMS == -1) if (m_durationBaseMS == -1)
m_durationBaseMS = getWorkflow().getDurationBaseSec() * 1000; m_durationBaseMS = getAD_Workflow().getDurationBaseSec() * 1000;
return duration * m_durationBaseMS; return duration * m_durationBaseMS;
} // getDurationMS } // getDurationMS
@ -440,7 +442,7 @@ public class MWFNode extends X_AD_WF_Node
if (limit == 0) if (limit == 0)
return 0; return 0;
if (m_durationBaseMS == -1) if (m_durationBaseMS == -1)
m_durationBaseMS = getWorkflow().getDurationBaseSec() * 1000; m_durationBaseMS = getAD_Workflow().getDurationBaseSec() * 1000;
return limit * m_durationBaseMS; return limit * m_durationBaseMS;
} // getLimitMS } // getLimitMS
@ -450,7 +452,7 @@ public class MWFNode extends X_AD_WF_Node
*/ */
public int getDurationCalendarField() public int getDurationCalendarField()
{ {
return getWorkflow().getDurationCalendarField(); return getAD_Workflow().getDurationCalendarField();
} // getDirationCalendarField } // getDirationCalendarField
/** /**
@ -493,14 +495,24 @@ public class MWFNode extends X_AD_WF_Node
} // getParameters } // getParameters
/** /**
* Get Workflow * Get Workflow
* @return workflow * @return workflow
* @deprecated please use {@link #getAD_Window()}
*/ */
public MWorkflow getWorkflow() public MWorkflow getWorkflow()
{ {
return MWorkflow.get(getCtx(), getAD_Workflow_ID()); return getAD_Workflow();
} // getWorkflow } // getWorkflow
@Override
public MWorkflow getAD_Workflow()
{
if (get_TrxName() == null)
return MWorkflow.get(getCtx(), getAD_Workflow_ID());
else
return (MWorkflow)super.getAD_Workflow();
}
/** /**
* String Representation * String Representation
* @return info * @return info
@ -536,7 +548,7 @@ public class MWFNode extends X_AD_WF_Node
@Override @Override
protected boolean beforeSave (boolean newRecord) protected boolean beforeSave (boolean newRecord)
{ {
if(MWorkflow.WORKFLOWTYPE_Manufacturing.equals(getWorkflow().getWorkflowType())) if(MWorkflow.WORKFLOWTYPE_Manufacturing.equals(getAD_Workflow().getWorkflowType()))
{ {
setAction(MWFNode.ACTION_WaitSleep); setAction(MWFNode.ACTION_WaitSleep);
return true; return true;