示例#1
0
 /// <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);
 }
示例#2
0
        private EntitySchemaQuery GetCFSchemaDataEsq(EntitySchema modelRootSchema, string cfColumnPath,
                                                     string filterData)
        {
            EntitySchema cfColumnSchema = modelRootSchema.GetSchemaColumnByPath(cfColumnPath).ReferenceSchema;
            var          esq            = new EntitySchemaQuery(cfColumnSchema);

            esq.PrimaryQueryColumn.IsAlwaysSelect = true;
            var converter = new FilterEditConverter(UserConnection);
            IEntitySchemaQueryFilterItem filter = converter.ConvertToEntitySchemaQueryFilterItem(esq, Owner,
                                                                                                 filterData);

            if (!filter.GetFilterInstances().IsEmpty())
            {
                esq.Filters.Add(filter);
            }
            return(esq);
        }