diff --git a/org.adempiere.base/src/org/compiere/wf/MWFNode.java b/org.adempiere.base/src/org/compiere/wf/MWFNode.java index 34c1824201..042b441174 100644 --- a/org.adempiere.base/src/org/compiere/wf/MWFNode.java +++ b/org.adempiere.base/src/org/compiere/wf/MWFNode.java @@ -186,7 +186,8 @@ public class MWFNode extends X_AD_WF_Node */ private void loadNext() { - m_next = new Query(getCtx(), MWFNodeNext.Table_Name, "AD_WF_Node_ID=?", get_TrxName()) + m_next = new Query(getCtx(), MWFNodeNext.Table_Name, "AD_WF_NodeNext.AD_WF_Node_ID=?", get_TrxName()) + .addJoinClause(" JOIN AD_WF_Node ON (AD_WF_Node.AD_WF_Node_ID=AD_WF_NodeNext.AD_WF_Next_ID AND AD_WF_Node.IsActive='Y')") .setParameters(new Object[]{get_ID()}) .setOnlyActiveRecords(true) .setOrderBy(MWFNodeNext.COLUMNNAME_SeqNo) diff --git a/org.adempiere.base/src/org/compiere/wf/MWorkflow.java b/org.adempiere.base/src/org/compiere/wf/MWorkflow.java index 0d1577b623..5583fc6935 100644 --- a/org.adempiere.base/src/org/compiere/wf/MWorkflow.java +++ b/org.adempiere.base/src/org/compiere/wf/MWorkflow.java @@ -435,7 +435,7 @@ public class MWorkflow extends X_AD_Workflow for (int i = 0; i < nexts.length; i++) { MWFNode child = getNode (nexts[i].getAD_WF_Next_ID()); - if (!child.isActive()) + if (child == null || !child.isActive()) continue; if (child.getAD_Client_ID() == 0 || child.getAD_Client_ID() == AD_Client_ID)