protected void CreateModelFromManifest(ModelManifest manifest) { AxUtilContext utilContext = new AxUtilContext(); AxUtilConfiguration config = new AxUtilConfiguration() { Server = dbServer, Database = dbName, ModelArgument = new ModelArgument(manifest), Layer = manifest.Layer.ToString() }; AxUtil util = new AxUtil(); bool created = util.Create(utilContext, config, manifest); if (utilContext.ExecutionStatus == ExecutionStatus.Error) { throw new Exception(string.Format("Model creation failed: {0}", GetUtilContextErrorStr(utilContext))); } if (!created) { throw new Exception("Model creation failed."); } }
public void CreateModel(string manifestFile, string version = "", string description = "") { AxUtilContext utilContext = new AxUtilContext(); AxUtilConfiguration config = new AxUtilConfiguration(); config.AOSConfiguration = AOSName; AxUtil util = new AxUtil(); ModelManifest manifest = ModelManifest.Read(manifestFile); if (!String.IsNullOrEmpty(version)) { manifest.Version = GetModelVersion(version, manifest.Version); } if (!String.IsNullOrEmpty(description)) { manifest.Description = description; } config.ModelArgument = new ModelArgument(manifest.Name, manifest.Publisher); config.Layer = manifest.Layer.ToString(); bool created = util.Create(utilContext, config, manifest); if (utilContext.ExecutionStatus == ExecutionStatus.Error) { foreach (string error in utilContext.Errors) { Console.WriteLine(error); } throw new Exception("Model creation failed."); } if (!created) { throw new Exception("Model creation failed."); } }
public void CreateModel(string modelName, string modelPublisher, string layer, string displayName, string description, string version) { AxUtilContext utilContext = new AxUtilContext(); AxUtilConfiguration config = new AxUtilConfiguration(); config.AOSConfiguration = AOSName; AxUtil util = new AxUtil(); //config.ExportFile = modelFile; config.ModelArgument = new ModelArgument(modelName, modelPublisher); config.Layer = layer; ModelManifest manifest = new ModelManifest(); manifest.Name = modelName; manifest.Publisher = modelPublisher; manifest.Version = version; manifest.DisplayName = displayName; manifest.Description = description; bool created = util.Create(utilContext, config, manifest); if (utilContext.ExecutionStatus == ExecutionStatus.Error) { foreach (string error in utilContext.Errors) { Console.WriteLine(error); } throw new Exception("Model creation failed."); } if (!created) { throw new Exception("Model creation failed."); } }