/// <summary> /// Executes current flow element. /// </summary> /// <returns><c>true</c>, if element was successfully executed and conditions for moving to the next step were /// satisfied. Otherwise - <c>false</c>.</returns> protected override bool InternalExecute(ProcessExecutingContext context) { if (IsBatchPrediction) { var batchPredictionJob = ClassFactory.Get <IMLBatchPredictionJob>(); var converter = new FilterEditConverter(UserConnection); var filterEditData = converter.Convert(Owner, PredictionFilterData); batchPredictionJob.ProcessModel(UserConnection, MLModelId, filterEditData); } else { var constructorArgument = new ConstructorArgument("userConnection", UserConnection); var predictor = ClassFactory.Get <MLEntityPredictor>(constructorArgument); predictor.UseAdminRights = GlobalAppSettings.FeatureUseAdminRightsInEmbeddedLogic; if (GetIsCFModel()) { PredictForCFModel(predictor); } else { predictor.PredictEntityValueAndSaveResult(MLModelId, RecordId); } } return(true); }