STAEMAddIn.DeploySVBMonitor
Syntax | Parameters | Return Value |
---|---|---|
Sub STAEMAddIn.DeploySVBMonitor( _ hwndParent As Long, _ flags As DeploySVBMonitorFlags, _ name As String, _ svbText As String, _ extraData As String, _ svbMonSubType As Integer, _ bRMon As Boolean, _ preselect_prof_id As Long, _ ByRef monId As Long) |
The handle of the Statistica application. Type: Long Creation/update flags. Type: DeploySVBMonitorFlags The name of the configuration. Type: String The SVB text of the configuration. Type: String Additional XML data to include in the configuration. For example, if deploying a workspace, the XML from a call to ExportXML will be used here. Type: String The SVB subtype for this configuration. Type: Integer Whether or not this is an R script configuration. Type: Boolean The ID of the data configuration to use for this configuration. Set to zero if not using a data configuration. Type: Long The ID of the created/updated configuration. Type: Long |
This function does not return a value. |
SVB Example
Interactively deploying and updating a workspace:
Sub Main 'Note: you will need to include a reference to the STAEMAddInLib library for this example. Dim oOM As New ObjectManager oOM.Reconnect(Application) 'Open the example workspace "Customer Churn Analysis" Dim churnWrkSp As DataMiner Set churnWrkSp = Application.DataMinerDocs.OpenReadOnly( _ Path & "\Examples\Workspaces\Customer Churn Analysis_Example.sdm", False) 'Deploy the workspace, which will be stored in an SVB analysis configuration (with the SVB subtype of Data Miner Workspace). 'By using the STAEMAddIn interface, the user will have the ability to interactively 'select which folder to place the workspace into, as well as its permissions. 'The rest of the information related to this workspace is specified here. The most relevant is the call to 'DataMiner.ExportXML(), which copies the content of the workspace into the SVB configuration. Dim deploy As New STAEMAddIn Dim wrkSpInEnterpriseID As Long deploy.DeploySVBMonitor(Application.Handle, _ semAllowNoDataConfig Or semDefaultNoDataConfig Or semUpdateExtraData Or semUpdateSVB Or semUpdateSVBMonSubType, _ "Customer Churn Ankalysis.sdm", "", _ churnWrkSp.ExportXML(scDMIncludeCode Or scDMExportCode Or scDMExportResultsDocs Or _ scDMXExportSourceDocs Or scDMBinaryBlob Or scDMIncludeEnterpriseDependencies Or scDMIncludeSummaryReport), _ swcDataMinerWorkspace, False, 0, wrkSpInEnterpriseID) 'the new SVB configuration's ID will be stored in wrkSpInEnterpriseID. churnWrkSp.Close(False) 'After deploying the workspace, open it with the ID returned by DeploySVBMonitor(). Dim wrkSpEnt As Monitor Set wrkSpEnt = oOM.Monitors.ItemByID(wrkSpInEnterpriseID) wrkSpEnt.AutoSave = False 'We now have access to the workspace from Enterprise, but it is in the form of an 'SVB configuration. Convert it back into a workspace (so that we can edit it) by 'importing the XML content from the ExtraData field of the configuration. Dim wrkSp As New DataMiner wrkSp.ImportXML(wrkSpEnt.ExtraData, True) 'Find the node "2D Histograms". Dim histoNode As DataMinerNode Set histoNode = wrkSp.FindSingleNode("2D Histograms") 'Prompt the user to select a ByGroup variable (e.g., "LOCALE"), then run it. histoNode.EditByGroup histoNode.Execute 'Now that the user has edited the workspace, save it back into Enterprise. 'Taking the SVB configuration from before, update its (XML) content by copying the 'workspace's XML back into the ExtraData field. wrkSpEnt.ExtraData = wrkSp.ExportXML(scDMIncludeCode Or scDMExportCode Or scDMExportResultsDocs Or _ scDMXExportSourceDocs Or scDMBinaryBlob Or scDMIncludeEnterpriseDependencies Or scDMIncludeSummaryReport) 'Save our changes back into Enterprise Dim wrkSpUpdate As New MonitorUpdateInfo wrkSpUpdate.AuditLogReason = "Updating workspace" wrkSpEnt.SaveEx(wrkSpUpdate) wrkSp.Close(False) oOM.Disconnect End Sub