From 145cafc4f86aabe4a248af17e1178dfbfb20b2b2 Mon Sep 17 00:00:00 2001
From: hongji.li <hongji.a.li@capgemini.com>
Date: 星期四, 07 九月 2023 15:51:20 +0800
Subject: [PATCH] 增加全局数据集

---
 _Main/BL/Type_DMF_CustomLogic/Method_OnFinished.qbl                           |   58 +++++++++++++++++++++++++++++
 _Main/BL/Dataset_GlobalDTOTable/_ROOT_Dataset_GlobalDTOTable.qbl              |    9 ++++
 _var/_Main/ModelSettings/Common/Development/_ROOT_Role_Development.properties |    2 
 _Main/BL/Type_DMF_CustomLogic/_ROOT_Type_DMF_CustomLogic.qbl                  |    6 +++
 _Main/BL/Type_GlobalDTOTable/_ROOT_Type_GlobalDTOTable.qbl                    |    9 ++++
 _Main/BL/Type_GlobalDTOTable/StaticMethod_OnServerStartup.qbl                 |   22 +++++++++++
 6 files changed, 105 insertions(+), 1 deletions(-)

diff --git a/_Main/BL/Dataset_GlobalDTOTable/_ROOT_Dataset_GlobalDTOTable.qbl b/_Main/BL/Dataset_GlobalDTOTable/_ROOT_Dataset_GlobalDTOTable.qbl
new file mode 100644
index 0000000..0a06aa1
--- /dev/null
+++ b/_Main/BL/Dataset_GlobalDTOTable/_ROOT_Dataset_GlobalDTOTable.qbl
@@ -0,0 +1,9 @@
+Quintiq file version 2.0
+#root
+#parent: #DomainModel
+Dataset GlobalDTOTable
+{
+  #keys: '2[414702.0.83354602][414702.0.83354601]'
+  DefaultMDSName: 'GlobalDTOTable'
+  InstanceType: GlobalDTOTable
+}
diff --git a/_Main/BL/Type_DMF_CustomLogic/Method_OnFinished.qbl b/_Main/BL/Type_DMF_CustomLogic/Method_OnFinished.qbl
new file mode 100644
index 0000000..bf05643
--- /dev/null
+++ b/_Main/BL/Type_DMF_CustomLogic/Method_OnFinished.qbl
@@ -0,0 +1,58 @@
+Quintiq file version 2.0
+#parent: #root
+MethodOverride OnFinished #extension
+{
+  TextBody:
+  [*
+    // MODELING HANDLE
+    // The server will create a memory only dataset if the ODBC is not started before the server is started
+    //Enable / disable internal data depending on server startup mode
+    DomainModel::Domain().MDSStorageDefinitionManager().DatabaseEnabled( GlobalParameters_MP::IsFullStorageState() or
+                                                                         GlobalParameters_MP::IsPartialStorageState() or
+                                                                         GlobalParameters_MP::IsCachedStorageState() or
+                                                                         GlobalParameters_MP::IsHybridStorage() );
+    
+    // Create MPDomainHandler
+    MPDomainHandler::OnServerStartup();
+    
+    // Create datasets for DataExchangeFramework, ideally it should be done before loading MacroPlans.
+    LibDEF_API::OnServerStartup();
+    // 3DSpace library, on top of DEF
+    LibInt_IntegratorProxy::InitializeIntegrationLibrary();
+    integratorConfig := select( DomainModel::Domain(), IntegratorConfigManager.IntegratorConfigurations, ic, true );
+    Lib3DS_API::Initialize( integratorConfig.Name() );
+    
+    // Create ScenarioManager
+    ScenarioManager::OnServerStartUp();
+    
+    // 鍒涘缓澶╅┈鍏ㄥ眬鏁版嵁闆�
+    GlobalDTOTable::OnServerStartup();
+    
+    // Create a MemoryOnly-dataset that is used to receive SOAP-calls from the DataManager.
+    MDSScenarioManager::CreateMemoryOnlyMDS( ScenarioManager::GetDatasetNameReceiver() );
+    
+    // Create dataset for MPSync on startup.
+    MPSync::OnServerStartUp();
+    
+    // Create dataset for S&OP Workflow
+    SWF_WorkflowDataset::OnServerStartup( GlobalParameters_MP::GetStorageState(), 
+                                          SWF_Utility::MDSName_WorkflowDatatset() );
+    
+    // Create Communicaiton dataset
+    SWF_CommunicationDataset::OnServerStartup( GlobalParameters_MP::GetStorageState(), 
+                                               SWF_Utility::MDSKind_CommunicationDataset() );
+    // Create or load a dataset for the UnitTestFramework
+    LibUTF::OnServerStartup( MDSInterface::MemoryOnlyState() );
+    
+    LibInt_IntegratorProxy::InitializeIntegrationLibrary();
+    KpiTracker::OnServerStartup();
+    
+    this.OnFinishedCustom();
+    
+    // Create or load a dataset for the Monitoring Library
+    LibMon_Monitor::OnServerStartup( MDSInterface::MemoryOnlyState() ); 
+    smangerOption := DatasetFindOptions::Construct().Kind( typeof( ScenarioManager ).ShortName() );
+    smDataset := MDSScenarioManager::Find( smangerOption );
+    smDataset->LibMon_CollectInfo();
+  *]
+}
diff --git a/_Main/BL/Type_DMF_CustomLogic/_ROOT_Type_DMF_CustomLogic.qbl b/_Main/BL/Type_DMF_CustomLogic/_ROOT_Type_DMF_CustomLogic.qbl
new file mode 100644
index 0000000..00963f9
--- /dev/null
+++ b/_Main/BL/Type_DMF_CustomLogic/_ROOT_Type_DMF_CustomLogic.qbl
@@ -0,0 +1,6 @@
+Quintiq file version 2.0
+#root
+#parent: #DomainModel
+TypeSpecialization DMF_CustomLogic #extension
+{
+}
diff --git a/_Main/BL/Type_GlobalDTOTable/StaticMethod_OnServerStartup.qbl b/_Main/BL/Type_GlobalDTOTable/StaticMethod_OnServerStartup.qbl
new file mode 100644
index 0000000..e8e18e6
--- /dev/null
+++ b/_Main/BL/Type_GlobalDTOTable/StaticMethod_OnServerStartup.qbl
@@ -0,0 +1,22 @@
+Quintiq file version 2.0
+#parent: #root
+StaticMethod OnServerStartup
+{
+  TextBody:
+  [*
+    debuginfo( '// =============================================================== Scenario manager =====================================================================')
+    folder := DomainModel::Domain().MDSFolderDefinitions().FindFolder( "/root" );
+    
+    oinfo := MDSEditor::Editor().ObjectInfos( "GlobalDTOTable", folder.FolderID(), "GlobalDTOTable" );
+    
+    o := select( oinfo, Elements, o, not o.IsLoaded() );
+    if( isnull( o ) )
+    {
+      MDSScenarioManager::CreateMDS( "GlobalDTOTable", GlobalParameters_MP::GetStorageState() );
+    }
+    else
+    {
+      MDSScenarioManager::LoadMDSAndConvert( o.MDSID(), GlobalParameters_MP::GetStorageState() );
+    }
+  *]
+}
diff --git a/_Main/BL/Type_GlobalDTOTable/_ROOT_Type_GlobalDTOTable.qbl b/_Main/BL/Type_GlobalDTOTable/_ROOT_Type_GlobalDTOTable.qbl
new file mode 100644
index 0000000..2fd0e70
--- /dev/null
+++ b/_Main/BL/Type_GlobalDTOTable/_ROOT_Type_GlobalDTOTable.qbl
@@ -0,0 +1,9 @@
+Quintiq file version 2.0
+#root
+#parent: #DomainModel
+Type GlobalDTOTable
+{
+  #keys: '5[414702.0.83354588][414702.0.83354586][0.0.0][414702.0.83354587][414702.0.83354589]'
+  BaseType: Object
+  StructuredName: 'GlobalDTOTables'
+}
diff --git a/_var/_Main/ModelSettings/Common/Development/_ROOT_Role_Development.properties b/_var/_Main/ModelSettings/Common/Development/_ROOT_Role_Development.properties
index c6be9bd..5ecdbaf 100644
--- a/_var/_Main/ModelSettings/Common/Development/_ROOT_Role_Development.properties
+++ b/_var/_Main/ModelSettings/Common/Development/_ROOT_Role_Development.properties
@@ -463,7 +463,7 @@
 domainmodel.mdsstoragedefinitionmanager.audittraillocation=
 domainmodel.mdsstoragedefinitionmanager.databaseenabled=false
 domainmodel.mdsstoragedefinitionmanager.datasetstoredatasource=MacroPlanner
-domainmodel.mdsstoragedefinitionmanager.datasetstoreenabled=true
+domainmodel.mdsstoragedefinitionmanager.datasetstoreenabled=false
 domainmodel.mdsstoragedefinitionmanager.datasetstoreislocal=false
 domainmodel.mdsstoragedefinitionmanager.dbformat=Legacy
 domainmodel.mdsstoragedefinitionmanager.defaultencryptioncertificate=

--
Gitblit v1.9.3