IDataCubeServiceBuildDataWarehouseAsync Method |
Namespace: Dundas.BI.Entities.DataCubes
Exception | Condition |
---|---|
ArgumentException | dataCubeId is Empty. |
NotFoundException | The data cube could not be found. |
NoPrivilegeException |
None of the following conditions have been met:
|
InvalidSessionException | The caller context is not associated with a valid session. |
This example demonstrates how to get a data cube, set the data cube storage to "warehouse", and then build the data warehouse for the data cube.
using Dundas.BI; using Dundas.BI.AccountServices; using Dundas.BI.Entities.DataCubes; using Dundas.BI.FileSystem; using Dundas.BI.Services; using Dundas.BI.Scheduling; using System.Threading.Tasks; using System.Collections.ObjectModel; ... /* // Note: // This example assumes that the Dundas BI Engine already has started, and the calling user has logged on.*/ // The data cube ID. Guid dataCubeId = new Guid("be130c8d-88b1-4332-a373-a3a0dd7b0485"); // Get the data cube service. IDataCubeService dataCubeService = Engine.Current.GetService<IDataCubeService>(); // Get the file system service. IFileSystemService fileSystemService = Engine.Current.GetService<IFileSystemService>(); // Get the job service. IJobService jobService = Engine.Current.GetService<IJobService>(); // Check out the data cube. CheckOutResult checkOutResult = fileSystemService.CheckOut(dataCubeId); // Get the data cube. var dataCube = dataCubeService.Get(dataCubeId); // Change the storage type to data warehouse. dataCube.Storage = StorageType.DataWarehouse; // Save the data cube. dataCubeService.Save(dataCube); // Check-in the data cube. fileSystemService.CheckIn(dataCubeId, "My CheckInComment"); // Build the data warehouse for the data cube. Task dataCubeBuildTask = dataCubeService.BuildDataWarehouseAsync(dataCubeId);