/// <summary> /// Get Workflow /// </summary> /// <returns>workflow</returns> private MWorkflow GetWorkflow() { if (_wf == null) { _wf = MWorkflow.Get(GetCtx(), GetAD_Workflow_ID()); } if (_wf.Get_ID() == 0) { //throw new IllegalStateException("Not found - AD_Workflow_ID=" + getAD_Workflow_ID()); throw new Exception("Not found - AD_Workflow_ID=" + GetAD_Workflow_ID()); } return(_wf); }
/// <summary> /// Get Workflow from Cache /// </summary> /// <param name="ctx">context</param> /// <param name="AD_Workflow_ID">id</param> /// <returns>workflow</returns> public static MWorkflow Get(Ctx ctx, int AD_Workflow_ID) { int key = AD_Workflow_ID; MWorkflow retValue = _cache[key]; if (retValue != null) { return(retValue); } retValue = new MWorkflow(ctx, AD_Workflow_ID, null); if (retValue.Get_ID() != 0) { _cache.Add(key, retValue); } return(retValue); }