diff --git a/ifrs17-template/Export/MapTemplate.ipynb b/ifrs17-template/Export/MapTemplate.ipynb index eb986486..9ac9a85b 100644 --- a/ifrs17-template/Export/MapTemplate.ipynb +++ b/ifrs17-template/Export/MapTemplate.ipynb @@ -155,7 +155,7 @@ "\n .GroupofContractConfiguration(typeof(ReinsurancePortfolio))", "\n .GroupofContractConfiguration(typeof(InsurancePortfolio))", "\n .MainTabConfiguration(partition)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -241,7 +241,7 @@ "\n .StateEnumConfiguration() ", "\n .DataNodeStateConfiguration(dataNodeStates)", "\n .MainTabConfiguration(partition)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -328,7 +328,7 @@ "\n .WithSource(Workspace)", "\n .DataNodeParameterConfiguration(dataNodeParameters)", "\n .MainTabConfiguration(partition)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17-template/Import/CloseImportTemplate.ipynb b/ifrs17-template/Import/CloseImportTemplate.ipynb index 4070701a..98e156c8 100644 --- a/ifrs17-template/Import/CloseImportTemplate.ipynb +++ b/ifrs17-template/Import/CloseImportTemplate.ipynb @@ -121,7 +121,7 @@ "await Import.FromFile(pathToFile)", "\n .WithFormat(format)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -170,7 +170,7 @@ "await Import.FromFile(pathToFile)", "\n .WithFormat(format)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb index 412f644a..de4c15af 100644 --- a/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb @@ -80,7 +80,7 @@ "await Import.FromFile(\"../Files/DataNodes/DataNodes_CH.csv\")", "\n .WithFormat(ImportFormats.DataNode)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -93,7 +93,7 @@ "await Import.FromFile(\"../Files/DataNodes/DataNodeStates_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeState)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -106,7 +106,7 @@ "await Import.FromFile(\"../Files/DataNodes/DataNodeParameters_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeParameter)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb index d406a80d..29276b04 100644 --- a/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb @@ -118,7 +118,7 @@ "\n .WithType()", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -131,7 +131,7 @@ "await Import.FromFile(\"../Files/Dimensions.csv\")", "\n .WithFormat(ImportFormats.AocConfiguration)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -144,7 +144,7 @@ "await Import.FromFile(\"../Files/ReportingNodes/ReportingNodes.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -166,42 +166,42 @@ "var log = await Import.FromFile(\"../Files/Parameters/YieldCurve_2019_12.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync();", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_1.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_3.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_12.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_3.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_6.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_12.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync());", "\nlog" ], @@ -215,7 +215,7 @@ "await Import.FromFile(\"../Files/Parameters/ExchangeRate.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -228,7 +228,7 @@ "await Import.FromFile(\"../Files/Parameters/PartnerRating.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -241,7 +241,7 @@ "await Import.FromFile(\"../Files/Parameters/CreditDefaultRate.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb b/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb index ecb29f00..e8bec1bd 100644 --- a/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb @@ -96,7 +96,7 @@ "\n .WithType()", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -109,7 +109,7 @@ "await Import.FromFile(\"../Files/ReportingNodes/ReportingNodes.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -131,42 +131,42 @@ "var log = await Import.FromFile(\"../Files/Parameters/YieldCurve_2019_12.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync();", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_1.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_3.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_12.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_3.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_6.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_12.csv\")", "\n .WithFormat(ImportFormats.YieldCurve)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()", "\n );", "\nlog" @@ -181,7 +181,7 @@ "await Import.FromFile(\"../Files/Parameters/ExchangeRate.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -194,7 +194,7 @@ "await Import.FromFile(\"../Files/Parameters/PartnerRating.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -207,7 +207,7 @@ "await Import.FromFile(\"../Files/Parameters/CreditDefaultRate.csv\")", "\n .WithType()", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -229,7 +229,7 @@ "await Import.FromFile(\"../Files/DataNodes/DataNodes_CH.csv\")", "\n .WithFormat(ImportFormats.DataNode)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -242,7 +242,7 @@ "await Import.FromFile(\"../Files/DataNodes/DataNodeStates_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeState)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -255,7 +255,7 @@ "await Import.FromFile(\"../Files/DataNodes/DataNodeParameters_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeParameter)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -277,7 +277,7 @@ "await Import.FromFile(\"../Files/TransactionalData/Openings_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Opening)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -290,7 +290,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -303,7 +303,7 @@ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -316,7 +316,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -329,7 +329,7 @@ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -342,7 +342,7 @@ "await Import.FromFile(\"../Files/TransactionalData/SimpleValue_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.SimpleValue )", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -355,7 +355,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12_MTUP10pct.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb index f5a7d4bc..cb39d2f2 100644 --- a/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb @@ -70,7 +70,7 @@ "await Import.FromFile(\"../Files/TransactionalData/Openings_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Opening)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -83,7 +83,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -96,7 +96,7 @@ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -109,7 +109,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -122,7 +122,7 @@ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -135,7 +135,7 @@ "await Import.FromFile(\"../Files/TransactionalData/SimpleValue_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.SimpleValue )", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -148,7 +148,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12_MTUP10pct.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb index f3066174..e71da8f0 100644 --- a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb +++ b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb @@ -77,7 +77,7 @@ "await Import.FromFile(\"DataNodes_ActualsCase_CH.csv\")", "\n .WithFormat(ImportFormats.DataNode)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -90,7 +90,7 @@ "await Import.FromFile(\"DataNodeStates_ActualsCase_CH_2020_1.csv\")", "\n .WithFormat(ImportFormats.DataNodeState)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -103,7 +103,7 @@ "await Import.FromFile(\"DataNodeParameters_ActualsCase_CH_2020_1.csv\")", "\n .WithFormat(ImportFormats.DataNodeParameter)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -134,7 +134,7 @@ "await Import.FromFile(\"NominalCashflows_ActualsCase_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -147,7 +147,7 @@ "await Import.FromFile(\"Actuals_ActualsCase_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -169,7 +169,7 @@ "await Import.FromFile(\"NominalCashflows_ActualsCase_CH_2021_6.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -182,7 +182,7 @@ "await Import.FromFile(\"Actuals_ActualsCase_CH_2021_6.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -204,7 +204,7 @@ "await Import.FromFile(\"NominalCashflows_ActualsCase_CH_2021_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -217,7 +217,7 @@ "await Import.FromFile(\"Actuals_ActualsCase_CH_2021_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb index a0d0556a..7f14af98 100644 --- a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb +++ b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb @@ -76,7 +76,7 @@ "await Import.FromFile(\"DataNodes_CsmSwitch_CH.csv\")", "\n .WithFormat(ImportFormats.DataNode)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -89,7 +89,7 @@ "await Import.FromFile(\"DataNodeStates_CsmSwitch_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeState)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -102,7 +102,7 @@ "await Import.FromFile(\"DataNodeParameters_CsmSwitch_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.DataNodeParameter)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -133,7 +133,7 @@ "await Import.FromFile(\"NominalCashflows_CsmSwitch_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -146,7 +146,7 @@ "await Import.FromFile(\"Actuals_CsmSwitch_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -159,7 +159,7 @@ "await Import.FromFile(\"NominalCashflows_CsmSwitch_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -172,7 +172,7 @@ "await Import.FromFile(\"Actuals_CsmSwitch_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -194,7 +194,7 @@ "await Import.FromFile(\"SimpleValue_CsmSwitch_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.SimpleValue)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -207,7 +207,7 @@ "await Import.FromFile(\"SimpleValue_CsmSwitch_CH_2021_3.csv\")", "\n .WithFormat(ImportFormats.SimpleValue)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17-template/Test/Data/InitSystemorphToMemoryForTesting.ipynb b/ifrs17-template/Test/Data/InitSystemorphToMemoryForTesting.ipynb index 36b1ed2a..47edc4ec 100644 --- a/ifrs17-template/Test/Data/InitSystemorphToMemoryForTesting.ipynb +++ b/ifrs17-template/Test/Data/InitSystemorphToMemoryForTesting.ipynb @@ -30,7 +30,7 @@ "await Import.FromFile(\"Actuals_CH_2020_12_MTUP10pct.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(DataSource)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17-template/Test/SequenceImportTest.ipynb b/ifrs17-template/Test/SequenceImportTest.ipynb index fec21ac1..754e3954 100644 --- a/ifrs17-template/Test/SequenceImportTest.ipynb +++ b/ifrs17-template/Test/SequenceImportTest.ipynb @@ -58,7 +58,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(ws1)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -71,7 +71,7 @@ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(ws1)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -132,7 +132,7 @@ "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Actual)", "\n .WithTarget(ws2)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, @@ -145,7 +145,7 @@ "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\")", "\n .WithFormat(ImportFormats.Cashflow)", "\n .WithTarget(ws2)", - "\n .WithActivityLog(Session, DataSource, DataSetReader)", + "\n .WithActivityLog()", "\n .ExecuteAsync()" ], "metadata": {}, diff --git a/ifrs17/Utils/ActivityLog.ipynb b/ifrs17/Utils/ActivityLog.ipynb index 4bd9a413..03176664 100644 --- a/ifrs17/Utils/ActivityLog.ipynb +++ b/ifrs17/Utils/ActivityLog.ipynb @@ -79,7 +79,7 @@ "cell_type": "markdown", "source": [ "## Import Export Activity ", - "\nEvery activity to and from (import or export) the DataSource is tracked by recording an ImportExportActivity. Among other information this record tracks the user who performs the action, the timestamp, the activity log, and a unique identifier which can be used to retrieve the data subject of the activity. " + "\nEvery activity to and from (import or export) the DataSource is tracked by recording an ImportExportActivity. Among other information this record tracks the user who performs the action, the timestamp, the activity log, and the unique identifier which can be used to retrieve the data subject of the activity. " ], "metadata": {}, "execution_count": 0, @@ -157,6 +157,11 @@ "\n public string Format {get; init;}", "\n protected IDataSetImportVariable DataSetReader {get; set;}", "\n protected ISessionVariable Session {get; set;}", + "\n", + "\n public KeyedImportExport() ", + "\n { ", + "\n Id = Guid.NewGuid();", + "\n }", "\n}" ], "metadata": {}, @@ -220,6 +225,14 @@ "\n{", "\n protected ImportOptions Options {get; set;}", "\n", + "\n public KeyedImport() {Id = Guid.NewGuid();}", + "\n", + "\n public abstract KeyedImport WithOptions(ImportOptions options);", + "\n", + "\n public KeyedImport WithSession(ISessionVariable session) => this with {Session = session};", + "\n", + "\n public KeyedImport WithDataSetReader(IDataSetImportVariable importVariable) => this with {DataSetReader = importVariable};", + "\n", "\n public async Task InitializeImportDataAsync()", "\n {", "\n var stream = await GenerateStreamWrapperAsync();", @@ -287,6 +300,8 @@ "\n", "\n public string Source {get; init;}", "\n", + "\n public ImportFile() : base(){;}", + "\n", "\n public ImportFile(FileImportOptions options, IDataSetImportVariable importVariable, ISessionVariable session)", "\n {", "\n Options = options;", @@ -299,7 +314,26 @@ "\n ContentType = Path.GetExtension(fileName);", "\n Source = options.Storage.GetType().Name; ", "\n Partition = GetInvolvedPartitions(options);", - "\n // Andrey Katz: Options.TargetDataSource.Partion.GetCurrent(?? What do we put here, different classes might posess various partitions, e.g. Yield Curve has none ??)", + "\n // Andrey Katz: Options.TargetDataSource.Partion.GetCurrentPartitions(?? What do we put here, different classes might posess various partitions, e.g. Yield Curve has none ??)", + "\n }", + "\n", + "\n public override ImportFile WithOptions(ImportOptions options)", + "\n {", + "\n if (options is FileImportOptions fio)", + "\n {", + "\n string fileName = fio.FileName;", + "\n return this with{Options = fio,", + "\n Name = Path.GetFileName(fileName),", + "\n Directory = Path.GetDirectoryName(fileName),", + "\n ContentType = Path.GetExtension(fileName),", + "\n Source = options.Storage.GetType().Name,", + "\n Partition = GetInvolvedPartitions(options)", + "\n };", + "\n }", + "\n else", + "\n {", + "\n throw new Exception(\"The import options must be of file import options type\");", + "\n }", "\n }", "\n", "\n public ImportFile(Guid id)", @@ -329,6 +363,8 @@ "\n{", "\n public string Content {get; init;}", "\n", + "\n public ImportString() : base(){;}", + "\n", "\n public ImportString(StringImportOptions options, IDataSetImportVariable importVariable, ISessionVariable session)", "\n {", "\n Options = options;", @@ -338,6 +374,13 @@ "\n Content = options.Content;", "\n }", "\n", + "\n public override ImportString WithOptions(ImportOptions options)", + "\n {", + "\n if (options is StringImportOptions sgio) return this with {Options = sgio, ", + "\n Content = sgio.Content};", + "\n else throw new Exception(\"The import options must be of string import options type\");", + "\n }", + "\n", "\n public ImportString(Guid id)", "\n {", "\n Id = id;", @@ -364,6 +407,14 @@ "\n Id = Guid.NewGuid();", "\n }", "\n", + "\n public ImportDataSet() : base() {;}", + "\n", + "\n public override ImportDataSet WithOptions(ImportOptions options)", + "\n {", + "\n if (options is DataSetImportOptions dsio) return this with {Options = dsio};", + "\n else throw new Exception(\"The import options must be of data set import options type\");", + "\n }", + "\n", "\n public ImportDataSet(Guid id)", "\n {", "\n Id = id;", @@ -390,6 +441,14 @@ "\n Id = Guid.NewGuid();", "\n }", "\n", + "\n public ImportStream() : base() {;}", + "\n", + "\n public override ImportStream WithOptions(ImportOptions options)", + "\n {", + "\n if (options is StreamImportOptions smio) return this with {Options = smio};", + "\n else throw new Exception(\"The import options must be of stream import options type\");", + "\n }", + "\n", "\n public ImportStream(Guid id)", "\n {", "\n Id = id;", @@ -415,92 +474,58 @@ { "cell_type": "code", "source": [ - "public record ImportBuilderWriter(ImportOptionsBuilder Builder, ", - "\n ISessionVariable Session, ", - "\n IDataSource DataSource, ", - "\n IDataSetImportVariable ImportVariable)", + "public record ImportBuilderWriter(ImportOptionsBuilder Builder) ", "\n{", + "\n public static ISessionVariable Session {get; set;}", + "\n public static IDataSource DataSource {get; set;}", + "\n public static IDataSetImportVariable ImportVariable {get; set;}", + "\n", "\n public async Task ExecuteAsync()", "\n {", "\n var log = await Builder.ExecuteAsync();", "\n var options = Builder.GetImportOptions();", - "\n var activity = new ImportExportActivity(log, Session);", - "\n bool importSucceeded = true;", - "\n switch(options)", + "\n var activity = options switch", "\n {", - "\n case FileImportOptions fio:", - "\n var importFile = new ImportFile(Guid.NewGuid());", - "\n try", - "\n {", - "\n importFile = await (new ImportFile(fio, ImportVariable, Session)).InitializeImportDataAsync() as ImportFile;", - "\n activity = activity with {SourceId = importFile.Id};", - "\n }", - "\n catch (Exception e)", - "\n {", - "\n importSucceeded = false;", - "\n activity = activity with {SourceId = null, ExceptionMessage = e.Message};", - "\n }", - "\n activity = activity with {Category = \"Import from File\"};", - "\n if (importSucceeded) await DataSource.UpdateAsync(importFile.RepeatOnce());", - "\n break;", - "\n", - "\n case StringImportOptions sgio:", - "\n var importString = new ImportString(Guid.NewGuid());", - "\n try", - "\n {", - "\n importString = await (new ImportString(sgio, ImportVariable, Session)).InitializeImportDataAsync() as ImportString;", - "\n activity = activity with {SourceId = importString.Id};", - "\n }", - "\n catch (Exception e)", - "\n {", - "\n importSucceeded = false;", - "\n activity = activity with {SourceId = null, ExceptionMessage = e.Message};", - "\n }", - "\n activity = activity with {Category = \"Import from String\"};", - "\n if (importSucceeded) await DataSource.UpdateAsync(importString.RepeatOnce());", - "\n break;", - "\n ", - "\n case StreamImportOptions smio:", - "\n var importStream = new ImportStream(Guid.NewGuid());", - "\n try", - "\n {", - "\n importStream = await (new ImportStream(smio, ImportVariable, Session)).InitializeImportDataAsync() as ImportStream;", - "\n activity = activity with {SourceId = importStream.Id};", - "\n }", - "\n catch (Exception e)", - "\n {", - "\n importSucceeded = false;", - "\n activity = activity with {SourceId = null, ExceptionMessage = e.Message};", - "\n }", - "\n activity = activity with {Category = \"Import from Stream\"};", - "\n if (importSucceeded) await DataSource.UpdateAsync(importStream.RepeatOnce());", - "\n break;", - "\n", - "\n case DataSetImportOptions dsio:", - "\n var importDataSet = new ImportDataSet(Guid.NewGuid());", - "\n try", - "\n {", - "\n importDataSet = await (new ImportDataSet(dsio, ImportVariable, Session)).InitializeImportDataAsync() as ImportDataSet;", - "\n activity = activity with {SourceId = importDataSet.Id};", - "\n }", - "\n catch (Exception e)", - "\n {", - "\n importSucceeded = false;", - "\n activity = activity with {SourceId = null, ExceptionMessage = e.Message};", - "\n }", - "\n activity = activity with {Category = \"Import from Data Set\"};", - "\n if (importSucceeded) await DataSource.UpdateAsync(importDataSet.RepeatOnce());", - "\n break;", - "\n", - "\n default:", - "\n throw new Exception(\"Import Options object is not an instance of an appropriate class.\");", - "\n break;", - "\n }", + "\n FileImportOptions fio => await ReportInputAndUpdateActivityAsync(log, fio, \"Import from File \"),", + "\n StringImportOptions sgio => await ReportInputAndUpdateActivityAsync(log, sgio, \"Import from String\"),", + "\n StreamImportOptions smio => await ReportInputAndUpdateActivityAsync(log, smio, \"Import from Stream\"),", + "\n DataSetImportOptions dsio => await ReportInputAndUpdateActivityAsync(log, dsio, \"Import from Data Set\"),", + "\n _ => null,", + "\n };", + "\n if (activity is null) throw new Exception(\"Import Options object is not an instance of an appropriate class.\");", "\n await DataSource.UpdateAsync(activity.RepeatOnce());", "\n await DataSource.CommitAsync();", "\n return log;", "\n }", - "\n}" + "\n", + "\n private async Task ReportInputAndUpdateActivityAsync(ActivityLog log, TOptions options, string categoryMessage)", + "\n where TOptions: ImportOptions", + "\n where TImport: KeyedImport, new()", + "\n {", + "\n var activity = new ImportExportActivity(log, Session);", + "\n try", + "\n {", + "\n var import = new TImport();", + "\n import = await import.WithSession(Session)", + "\n .WithDataSetReader(ImportVariable)", + "\n .WithOptions(options)", + "\n .InitializeImportDataAsync() as TImport;", + "\n activity = activity with {SourceId = import.Id, Category = categoryMessage};", + "\n await DataSource.UpdateAsync(import.RepeatOnce());", + "\n }", + "\n catch (Exception e)", + "\n {", + "\n activity = activity with {SourceId = null, ", + "\n Category = categoryMessage, ", + "\n ExceptionMessage = e.Message};", + "\n }", + "\n return activity;", + "\n }", + "\n}", + "\n", + "\nImportBuilderWriter.Session = Session;", + "\nImportBuilderWriter.DataSource = DataSource;", + "\nImportBuilderWriter.ImportVariable = DataSetReader;" ], "metadata": {}, "execution_count": 0, @@ -509,11 +534,11 @@ { "cell_type": "code", "source": [ - "public record ExportBuilderWriter(DocumentBuilder Builder, ", - "\n ISessionVariable Session, ", - "\n IDataSource DataSource, ", - "\n IDataSetImportVariable ImportVariable)", + "public record ExportBuilderWriter(DocumentBuilder Builder)", "\n{", + "\n public static ISessionVariable Session {get; set;}", + "\n public static IDataSetImportVariable ImportVariable {get; set;}", + "\n public static IDataSource DataSource {get; set;}", "\n public async Task ExecuteAsync()", "\n {", "\n var exportResult = await Builder.ExecuteAsync();", @@ -525,7 +550,10 @@ "\n await DataSource.CommitAsync();", "\n return exportResult;", "\n }", - "\n}" + "\n}", + "\nExportBuilderWriter.Session = Session;", + "\nExportBuilderWriter.DataSource = DataSource;", + "\nExportBuilderWriter.ImportVariable = DataSetReader;" ], "metadata": {}, "execution_count": 0, @@ -534,11 +562,7 @@ { "cell_type": "code", "source": [ - "public static ImportBuilderWriter WithActivityLog(this ImportOptionsBuilder builder, ", - "\n ISessionVariable session, ", - "\n IDataSource dataSource, ", - "\n IDataSetImportVariable importVariable) => ", - "\n new ImportBuilderWriter(builder, session, dataSource, importVariable);" + "public static ImportBuilderWriter WithActivityLog(this ImportOptionsBuilder builder) => new ImportBuilderWriter(builder);" ], "metadata": {}, "execution_count": 0, @@ -547,11 +571,7 @@ { "cell_type": "code", "source": [ - "public static ExportBuilderWriter WithActivityLog(this IDocumentBuilder builder, ", - "\n ISessionVariable session, ", - "\n IDataSource dataSource, ", - "\n IDataSetImportVariable importVariable) =>", - "\n new ExportBuilderWriter(builder as DocumentBuilder, session, dataSource, importVariable);" + "public static ExportBuilderWriter WithActivityLog(this IDocumentBuilder builder) => new ExportBuilderWriter(builder as DocumentBuilder);" ], "metadata": {}, "execution_count": 0,