private void DoBlock(ActivityConfig.ACSeriesRow acsr, bool HasBlock, int step) { if (HasBlock) { MyACE.LoadDataForStep(step, acsr.ACSeriesId); if (!MyACE.skipBlock) { myRF.DoRelFields(acsr, step); } ; } }
//rules public void EvaluateRule(FileManager fm, appDB.ddRuleRow ddrr, DataRow dr2Validate) { ActivityConfig.ACSeriesRow acsr = fm.AtMng.acMng.DB.ACSeries.FindByACSeriesId(ddrr.ACSeriesId); //we need to endedit on the current record so that it can be evaluated by datatable.select operations dr2Validate.EndEdit(); ACEngine MyACE = new ACEngine(fm); MyACE.myAcSeries = acsr; MyACE.myActivityCode = acsr.ActivityCodeRow; MyACE.AddToRelTables(dr2Validate, "CONTEXT"); //MyACE.LoadDataForStep(-10, acsr.ACSeriesId); MyACE.DoRelFields(); //consider the blocks as short-circuited or's //eg A || B || C //we succeed on the first successful block if (MyACE.HasRel0) { MyACE.LoadDataForStep(0, acsr.ACSeriesId); if (!MyACE.skipBlock) { return; } } if (MyACE.HasRel1) { MyACE.LoadDataForStep(1, acsr.ACSeriesId); if (!MyACE.skipBlock) { return; } } if (MyACE.HasRel2) { MyACE.LoadDataForStep(2, acsr.ACSeriesId); if (!MyACE.skipBlock) { return; } } if (MyACE.HasRel3) { MyACE.LoadDataForStep(3, acsr.ACSeriesId); if (!MyACE.skipBlock) { return; } } if (MyACE.HasRel4) { MyACE.LoadDataForStep(4, acsr.ACSeriesId); if (!MyACE.skipBlock) { return; } } if (MyACE.HasRel5) { MyACE.LoadDataForStep(5, acsr.ACSeriesId); if (!MyACE.skipBlock) { return; } } //rule failed string msg = myA.acMng.DB.ACDocumentation.FindByACDocId(ddrr.MsgId)[myA.Translate("TextEng")].ToString(); throw new AtriumException(msg); }