System Module¶
The System Manager of MIKE Workbench is in charge of handling workspaces, user, settings and associations between users and workspaces.
// Get the system module.
var module = application.Modules.Get("System Manager") as DHI.Solutions.SystemManager.Interfaces.ISystemModule;
// Fetch all users.
var userList = module.UserList.FetchAll();
// Get the system module.
module = app.Modules.Get("System Manager")
# Fetch all users.
userList = module.UserList.FetchAll()
// Get the system module.
module = DHI.Solutions.SystemManager.Interfaces.ISystemModule(app.Modules.Get("System Manager"))
# Fetch all users.
userList = module.UserList.FetchAll()
Module Providers¶
The following providers are included in the system module.
| Provider | Description |
|---|---|
| GlobalRoleList | Manage the global roles. |
| WorkspaceList | Manage workspaces. |
| UserList | Mangage users. |
| WorkspaceRoleList | Manage workspace roles. |
| UserWorkspaceList | Manage user workspaces. |
| DssAdminList | Manage dss admins. |
Read more about using module providers here
Tools¶
The sample below shows how the generic data export tool can be used.
// Get the tool from the tool name.
var tool = application.Tools.CreateNew("Data Export Tool") as DHI.Solutions.SystemManager.Tools.DataExportImportTool.IDataExportTool;
// Set the properties of the tool.
tool.Path = @"c:\Temp\Export";
// Add entities (here a time series) to be exported.
tool.AddEntity(ts);
// Execute the tool exporting the enities added to the path specified.
tool.Execute();
# Get the tool from the tool name.
tool = app.Tools.CreateNew("Data Export Tool")
# Set the properties of the tool.
tool.Path = "c:/Temp/Export";
# Add entities (here a time series) to be exported.
tool.AddEntity(ts)
# Execute the tool exporting the enities added to the path specified.
tool.Execute()
# Get the tool from the tool name.
tool = DHI.Solutions.SystemManager.Tools.DataExportImportTool.IDataExportTool(app.Tools.CreateNew("Data Export Tool"))
# Set the properties of the tool.
tool.Path = "c:/Temp/Export";
# Add entities (here a time series) to be exported.
tool.AddEntity(ts)
# Execute the tool exporting the enities added to the path specified.
tool.Execute()
Archive Tool¶
Tool for archiving entity information (import, export, clean and change log updates and metadata). The tool archives based on an archive configuration in a spreadsheet placed in the spreadsheet manager of MIKE OPERATIONS. The archive configuration spreadsheet must contain the following columns.
- Path: Full path to the entity in the manager of the entity.
- Entity Type: Type of data to be archived (timeseries, timeseriesgroup, featureclass, featureclassgroup, raster, rastergroup, spreadsheet, spreadsheetgroup, scenario).
- Archive: Is archive mode is enabled (TRUE/FALSE).
- Cleanup: Is cleanup mode enabled (TRUE/FALSE).
- Age: The age of the entity
- Age Unit: The age unit (Hours, Days, Weeks, Months).
- Partial: Is partial mode enabled (TRUE/FALSE).
- Archive Changelog: Is archive change log enabled (TRUE/FALSE).
- Delete changelog: Delete the change log (TRUE/FALSE).
- Archive metadata: Archive metadata (TRUE/FALSE)
- FromDate: Date from which to run archive.
- ToDate: Date to which to run archive.
- Active: Is the archive configuration active (TRUE/FALSE).
| Tool Info | Archive Tool |
|---|---|
| NuGet Package | DHI.MikeOperations.SystemManager.Tools.Archive |
| API Reference | DHI.Solutions.SystemManager.Tools.ArchiveTool.IArchiveTool |
| Input Items | No input items required |
| Output Items | No output items |
Tool Properties
- DataExportPath: Gets or sets the path where data will be exported or imported.
- SpreadsheetConfigurationPath: Gets or sets the path where the spreadsheet configuration is stored.
- WorksheetName: Gets or sets the worksheet name where the archive configuration is stored.
- ArchiveMode: Gets or sets the mode that the tool should run with.
- ContinueOnError: Gets or sets a value indicating whether import errors will allow import to continue.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Archive Tool") as DHI.Solutions.SystemManager.Tools.ArchiveTool.IArchiveTool;
# Get the tool.
tool = app.Tools.CreateNew("Archive Tool")
# Get the tool.
tool = DHI.Solutions.SystemManager.Tools.ArchiveTool.IArchiveTool(app.Tools.CreateNew("Archive Tool"))
Data Export Tool¶
Tool for exporting entities from MIKE OPERATIONS managers. The export can be imported into another MIKE OPERATIONS database using the Data Import tool.
| Tool Info | Data Export Tool |
|---|---|
| NuGet Package | DHI.MikeOperations.SystemManager.Tools.DataExportImport |
| API Reference | DHI.Solutions.SystemManager.Tools.DataExportImportTool.IDataExportTool |
| Input Items | No input items required |
| Output Items | No output items |
Tool Properties
- ExportChangeSince: Gets or sets a value indicating whether export change part of entity since a specified time
- ExportSinceDateTime: Gets or sets the date time which entity part has been update since this time can be exported
- Path: Gets or sets the path where data will be exported or imported.
- ExportSession: Gets the export session
- ContinueOnError: Gets or sets a value indicating whether import errors will allow import to continue.
Tool Methods
- AddEntity(DHI.Solutions.Generic.IEntity entity): Add an entity to the list of entities to be exported.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Data Export Tool") as DHI.Solutions.SystemManager.Tools.DataExportImportTool.IDataExportTool;
# Get the tool.
tool = app.Tools.CreateNew("Data Export Tool")
# Get the tool.
tool = DHI.Solutions.SystemManager.Tools.DataExportImportTool.IDataExportTool(app.Tools.CreateNew("Data Export Tool"))
Data Import Tool¶
Tool for importing MIKE OPERATIONS entities exported by the Data Export tool into the managers of MIKE OPERATIONS.
| Tool Info | Data Import Tool |
|---|---|
| NuGet Package | DHI.MikeOperations.SystemManager.Tools.DataExportImport |
| API Reference | DHI.Solutions.SystemManager.Tools.DataExportImportTool.IDataImportTool |
| Input Items | No input items required |
| Output Items | No output items |
Tool Properties
- Overwrite: Gets or sets a value indicating whether overwrite the exist entity or just extend it
- Path: Gets or sets the path where data will be exported or imported.
- ExportSession: Gets the export session
- ContinueOnError: Gets or sets a value indicating whether import errors will allow import to continue.
Code Sample
// Get the tool.
var tool = application.Tools.CreateNew("Data Import Tool") as DHI.Solutions.SystemManager.Tools.DataExportImportTool.IDataImportTool;
# Get the tool.
tool = app.Tools.CreateNew("Data Import Tool")
# Get the tool.
tool = DHI.Solutions.SystemManager.Tools.DataExportImportTool.IDataImportTool(app.Tools.CreateNew("Data Import Tool"))