public void DoAutoAC(NextStep ns, ActivityConfig.ACSeriesRow asr, int revId, ACEngine.RevType revType, DateTime acDate) { try { if (ns == null) { AutoAC(null, asr, revId, revType, acDate, null, true); } else { AutoAC(ns.prevAc, asr, revId, revType, acDate, ns.FlowQ, true); } CurrentACE = null; FM.GetDocMng().DB.DocContent.AcceptChanges(); } catch (Exception xx) { if (CurrentACE != null) { CurrentACE.Cancel(); } CurrentACE = null; throw xx; } }
public bool AutoNextStep(atriumDB.ActivityRow activity) { //TODO: prevent recursive calls to outofofficereply OutOfOfficeReply(activity); bool any = false; ActivityConfig.ACSeriesRow acsr = FM.AtMng.acMng.DB.ACSeries.FindByACSeriesId(activity.ACSeriesId); if (acsr.GetACDependencyRowsByNextSteps().Length == 0) { ActivityConfig.ACSeriesRow acss = FM.GetActivity().FindParentStep(activity); if (acss != null) { foreach (ActivityConfig.ACDependencyRow acdr in acss.GetACDependencyRowsByNextSteps()) { if (acdr.LinkType == (int)ConnectorType.Auto) { CurrentACE = null; AutoAC(activity, acdr.ACSeriesRowByPreviousSteps, 0, ACEngine.RevType.Nothing); any = true; } } } } else { foreach (ActivityConfig.ACDependencyRow acdr in acsr.GetACDependencyRowsByNextSteps()) { if (acdr.LinkType == (int)ConnectorType.Auto) { if (acdr.ACSeriesRowByPreviousSteps.StepType == (int)StepType.Decision && acdr.ACSeriesRowByPreviousSteps.GetActivityFieldRows().Length > 0) { //handle auto-steps that go to internal decisions //only handles one level and must be a single path bool ok = CurrentACE.SillyQuestion(acdr.ACSeriesRowByPreviousSteps); foreach (ActivityConfig.ACDependencyRow acdrAnswr in acdr.ACSeriesRowByPreviousSteps.GetACDependencyRowsByNextSteps()) { if ((ok && acdrAnswr.DescEng == "Yes") | (!ok && acdrAnswr.DescEng == "No")) { ActivityConfig.ACSeriesRow acs_auto = acdrAnswr.ACSeriesRowByPreviousSteps; CurrentACE = null; AutoAC(activity, acs_auto, 0, ACEngine.RevType.Nothing); any = true; } } } else { CurrentACE = null; AutoAC(activity, acdr.ACSeriesRowByPreviousSteps, 0, ACEngine.RevType.Nothing); any = true; } } } } CurrentACE = null; return(any); }