diff --git a/PresentValueSeries/InitializeData.ipynb b/PresentValueSeries/InitializeData.ipynb index bb01a0f9..691de565 100644 --- a/PresentValueSeries/InitializeData.ipynb +++ b/PresentValueSeries/InitializeData.ipynb @@ -67,7 +67,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"Dimensions.xlsx\").WithFormat(ImportFormats.AocConfiguration).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"Dimensions.xlsx\")", + "\n .WithFormat(ImportFormats.AocConfiguration)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -76,7 +79,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"DataNodes.xlsx\").WithFormat(\"DataNode\").WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"DataNodes.xlsx\")", + "\n .WithFormat(\"DataNode\")", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, diff --git a/PresentValueSeries/PresentValue - Episode 2.ipynb b/PresentValueSeries/PresentValue - Episode 2.ipynb index 804597e7..86c31e3c 100644 --- a/PresentValueSeries/PresentValue - Episode 2.ipynb +++ b/PresentValueSeries/PresentValue - Episode 2.ipynb @@ -168,7 +168,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"YieldCurve.xlsx\").WithType().WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"YieldCurve.xlsx\")", + "\n .WithType()", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -177,7 +180,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"Cashflows.xlsx\").WithFormat(\"Cashflow\").WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"Cashflows.xlsx\")", + "\n .WithFormat(\"Cashflow\")", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, diff --git a/PresentValueSeries/PresentValue - Episode 3.ipynb b/PresentValueSeries/PresentValue - Episode 3.ipynb index 3463cc41..b2438e75 100644 --- a/PresentValueSeries/PresentValue - Episode 3.ipynb +++ b/PresentValueSeries/PresentValue - Episode 3.ipynb @@ -168,7 +168,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"DataNodes_CH.xlsx\").WithFormat(\"DataNode\").WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"DataNodes_CH.xlsx\")", + "\n .WithFormat(\"DataNode\")", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -177,7 +180,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"DataNodes_DE.xlsx\").WithFormat(\"DataNode\").WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"DataNodes_DE.xlsx\")", + "\n .WithFormat(\"DataNode\")", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -186,7 +192,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"YieldCurve.xlsx\").WithType().WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"YieldCurve.xlsx\")", + "\n .WithType()", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -195,7 +204,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"Cashflows.xlsx\").WithFormat(\"Cashflow\").WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"Cashflows.xlsx\")", + "\n .WithFormat(\"Cashflow\")", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -204,7 +216,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"CF_CH_2021_12.xlsx\").WithFormat(\"Cashflow\").WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"CF_CH_2021_12.xlsx\")", + "\n .WithFormat(\"Cashflow\")", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -213,7 +228,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"CF_DE_2021_12.xlsx\").WithFormat(\"Cashflow\").WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"CF_DE_2021_12.xlsx\")", + "\n .WithFormat(\"Cashflow\")", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -222,7 +240,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"CF_DE_2022_12.xlsx\").WithFormat(\"Cashflow\").WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"CF_DE_2022_12.xlsx\")", + "\n .WithFormat(\"Cashflow\")", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Export/MapTemplate.ipynb b/ifrs17-template/Export/MapTemplate.ipynb index 931953b7..a56e1ffe 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 .MainTabConfigurationWoScenario(partition)", - "\n.ExecuteAsync()" + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -240,7 +240,7 @@ "\n .StateEnumConfiguration() ", "\n .DataNodeStateConfiguration(dataNodeStates)", "\n .MainTabConfigurationWoScenario(partition)", - "\n.ExecuteAsync()" + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -326,7 +326,7 @@ "\n .WithSource(Workspace)", "\n .DataNodeParameterConfiguration(dataNodeParameters)", "\n .MainTabConfiguration(partition)", - "\n.ExecuteAsync()" + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Import/CloseImportTemplate.ipynb b/ifrs17-template/Import/CloseImportTemplate.ipynb index 1f9b84ac..aa95ca1d 100644 --- a/ifrs17-template/Import/CloseImportTemplate.ipynb +++ b/ifrs17-template/Import/CloseImportTemplate.ipynb @@ -118,7 +118,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(pathToFile).WithFormat(format).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(pathToFile)", + "\n .WithFormat(format)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -163,7 +166,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(pathToFile).WithFormat(format).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(pathToFile)", + "\n .WithFormat(format)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb index 92447054..84f27378 100644 --- a/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphBaseToMemory.ipynb @@ -77,7 +77,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/DataNodes/DataNodes_CH.csv\").WithFormat(ImportFormats.DataNode).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/DataNodes/DataNodes_CH.csv\")", + "\n .WithFormat(ImportFormats.DataNode)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -86,7 +89,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/DataNodes/DataNodeStates_CH_2020_12.csv\").WithFormat(ImportFormats.DataNodeState).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/DataNodes/DataNodeStates_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.DataNodeState)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -95,7 +101,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/DataNodes/DataNodeParameters_CH_2020_12.csv\").WithFormat(ImportFormats.DataNodeParameter).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/DataNodes/DataNodeParameters_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.DataNodeParameter)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphRefDataToMemory.ipynb index f4c5b6f8..b0fb3cba 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 .ExecuteAsync()" + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -127,7 +127,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/Dimensions.csv\").WithFormat(ImportFormats.AocConfiguration).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/Dimensions.csv\")", + "\n .WithFormat(ImportFormats.AocConfiguration)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -136,7 +139,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/ReportingNodes/ReportingNodes.csv\").WithType().WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/ReportingNodes/ReportingNodes.csv\")", + "\n .WithType()", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -154,13 +160,39 @@ { "cell_type": "code", "source": [ - "var log = await Import.FromFile(\"../Files/Parameters/YieldCurve_2019_12.csv\").WithFormat(ImportFormats.YieldCurve).WithTarget(DataSource).ExecuteAsync();", - "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_1.csv\").WithFormat(ImportFormats.YieldCurve).WithTarget(DataSource).ExecuteAsync());", - "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_3.csv\").WithFormat(ImportFormats.YieldCurve).WithTarget(DataSource).ExecuteAsync());", - "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_12.csv\").WithFormat(ImportFormats.YieldCurve).WithTarget(DataSource).ExecuteAsync());", - "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_3.csv\").WithFormat(ImportFormats.YieldCurve).WithTarget(DataSource).ExecuteAsync());", - "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_6.csv\").WithFormat(ImportFormats.YieldCurve).WithTarget(DataSource).ExecuteAsync());", - "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_12.csv\").WithFormat(ImportFormats.YieldCurve).WithTarget(DataSource).ExecuteAsync());", + "var log = await Import.FromFile(\"../Files/Parameters/YieldCurve_2019_12.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader);", + "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_1.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n );", + "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_3.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n );", + "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_12.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n );", + "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_3.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n );", + "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_6.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n );", + "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_12.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader));", "\nlog" ], "metadata": {}, @@ -170,7 +202,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/Parameters/ExchangeRate.csv\").WithType().WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/Parameters/ExchangeRate.csv\")", + "\n .WithType()", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -179,7 +214,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/Parameters/PartnerRating.csv\").WithType().WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/Parameters/PartnerRating.csv\")", + "\n .WithType()", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -188,7 +226,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/Parameters/CreditDefaultRate.csv\").WithType().WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/Parameters/CreditDefaultRate.csv\")", + "\n .WithType()", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb b/ifrs17-template/Initialization/InitSystemorphToDatabase.ipynb index a8aea982..9d7288c4 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 .ExecuteAsync()" + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -105,7 +105,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/ReportingNodes/ReportingNodes.csv\").WithType().WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/ReportingNodes/ReportingNodes.csv\")", + "\n .WithType()", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -123,13 +126,40 @@ { "cell_type": "code", "source": [ - "var log = await Import.FromFile(\"../Files/Parameters/YieldCurve_2019_12.csv\").WithFormat(ImportFormats.YieldCurve).WithTarget(DataSource).ExecuteAsync();", - "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_1.csv\").WithFormat(ImportFormats.YieldCurve).WithTarget(DataSource).ExecuteAsync());", - "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_3.csv\").WithFormat(ImportFormats.YieldCurve).WithTarget(DataSource).ExecuteAsync());", - "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_12.csv\").WithFormat(ImportFormats.YieldCurve).WithTarget(DataSource).ExecuteAsync());", - "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_3.csv\").WithFormat(ImportFormats.YieldCurve).WithTarget(DataSource).ExecuteAsync());", - "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_6.csv\").WithFormat(ImportFormats.YieldCurve).WithTarget(DataSource).ExecuteAsync());", - "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_12.csv\").WithFormat(ImportFormats.YieldCurve).WithTarget(DataSource).ExecuteAsync());", + "var log = await Import.FromFile(\"../Files/Parameters/YieldCurve_2019_12.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader);", + "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_1.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n );", + "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_3.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n );", + "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2020_12.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n );", + "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_3.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n );", + "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_6.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n );", + "\nlog.Merge(await Import.FromFile(\"../Files/Parameters/YieldCurve_2021_12.csv\")", + "\n .WithFormat(ImportFormats.YieldCurve)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)", + "\n );", "\nlog" ], "metadata": {}, @@ -139,7 +169,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/Parameters/ExchangeRate.csv\").WithType().WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/Parameters/ExchangeRate.csv\")", + "\n .WithType()", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -148,7 +181,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/Parameters/PartnerRating.csv\").WithType().WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/Parameters/PartnerRating.csv\")", + "\n .WithType()", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -157,7 +193,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/Parameters/CreditDefaultRate.csv\").WithType().WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/Parameters/CreditDefaultRate.csv\")", + "\n .WithType()", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -175,7 +214,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/DataNodes/DataNodes_CH.csv\").WithFormat(ImportFormats.DataNode).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/DataNodes/DataNodes_CH.csv\")", + "\n .WithFormat(ImportFormats.DataNode)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -184,7 +226,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/DataNodes/DataNodeStates_CH_2020_12.csv\").WithFormat(ImportFormats.DataNodeState).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/DataNodes/DataNodeStates_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.DataNodeState)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -193,7 +238,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/DataNodes/DataNodeParameters_CH_2020_12.csv\").WithFormat(ImportFormats.DataNodeParameter).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/DataNodes/DataNodeParameters_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.DataNodeParameter)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -211,7 +259,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/Openings_CH_2020_12.csv\").WithFormat(ImportFormats.Opening).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/Openings_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.Opening)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -220,7 +271,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.Cashflow)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -229,7 +283,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.Actual)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -238,7 +295,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2021_3.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2021_3.csv\")", + "\n .WithFormat(ImportFormats.Cashflow)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -247,7 +307,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2021_3.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2021_3.csv\")", + "\n .WithFormat(ImportFormats.Actual)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -256,7 +319,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/SimpleValue_CH_2020_12.csv\").WithFormat(ImportFormats.SimpleValue ).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/SimpleValue_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.SimpleValue )", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -265,7 +331,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12_MTUP10pct.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12_MTUP10pct.csv\")", + "\n .WithFormat(ImportFormats.Cashflow)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb b/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb index f349f687..d82e0186 100644 --- a/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb +++ b/ifrs17-template/Initialization/InitSystemorphToMemory.ipynb @@ -67,7 +67,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/Openings_CH_2020_12.csv\").WithFormat(ImportFormats.Opening).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/Openings_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.Opening)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -76,7 +79,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.Cashflow)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -85,7 +91,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.Actual)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -94,7 +103,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2021_3.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2021_3.csv\")", + "\n .WithFormat(ImportFormats.Cashflow)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -103,7 +115,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2021_3.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2021_3.csv\")", + "\n .WithFormat(ImportFormats.Actual)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -112,7 +127,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/SimpleValue_CH_2020_12.csv\").WithFormat(ImportFormats.SimpleValue ).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/SimpleValue_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.SimpleValue )", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -121,7 +139,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12_MTUP10pct.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12_MTUP10pct.csv\")", + "\n .WithFormat(ImportFormats.Cashflow)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb index 04c02bc4..5db058d3 100644 --- a/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb +++ b/ifrs17-template/PracticalUseCases/ActualsOutsideThePeriod/ActualsUseCaseDataImport.ipynb @@ -74,7 +74,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"DataNodes_ActualsCase_CH.csv\").WithFormat(ImportFormats.DataNode).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"DataNodes_ActualsCase_CH.csv\")", + "\n .WithFormat(ImportFormats.DataNode)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -83,7 +86,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"DataNodeStates_ActualsCase_CH_2020_1.csv\").WithFormat(ImportFormats.DataNodeState).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"DataNodeStates_ActualsCase_CH_2020_1.csv\")", + "\n .WithFormat(ImportFormats.DataNodeState)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -92,7 +98,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"DataNodeParameters_ActualsCase_CH_2020_1.csv\").WithFormat(ImportFormats.DataNodeParameter).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"DataNodeParameters_ActualsCase_CH_2020_1.csv\")", + "\n .WithFormat(ImportFormats.DataNodeParameter)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -119,7 +128,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"NominalCashflows_ActualsCase_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"NominalCashflows_ActualsCase_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.Cashflow)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -128,7 +140,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"Actuals_ActualsCase_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"Actuals_ActualsCase_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.Actual)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -146,7 +161,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"NominalCashflows_ActualsCase_CH_2021_6.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"NominalCashflows_ActualsCase_CH_2021_6.csv\")", + "\n .WithFormat(ImportFormats.Cashflow)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -155,7 +173,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"Actuals_ActualsCase_CH_2021_6.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"Actuals_ActualsCase_CH_2021_6.csv\")", + "\n .WithFormat(ImportFormats.Actual)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -173,7 +194,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"NominalCashflows_ActualsCase_CH_2021_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"NominalCashflows_ActualsCase_CH_2021_12.csv\")", + "\n .WithFormat(ImportFormats.Cashflow)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -182,7 +206,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"Actuals_ActualsCase_CH_2021_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"Actuals_ActualsCase_CH_2021_12.csv\")", + "\n .WithFormat(ImportFormats.Actual)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb index 8e7be7b6..a8493d9b 100644 --- a/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb +++ b/ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchDataImport.ipynb @@ -73,7 +73,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"DataNodes_CsmSwitch_CH.csv\").WithFormat(ImportFormats.DataNode).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"DataNodes_CsmSwitch_CH.csv\")", + "\n .WithFormat(ImportFormats.DataNode)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -82,7 +85,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"DataNodeStates_CsmSwitch_CH_2020_12.csv\").WithFormat(ImportFormats.DataNodeState).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"DataNodeStates_CsmSwitch_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.DataNodeState)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -91,7 +97,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"DataNodeParameters_CsmSwitch_CH_2020_12.csv\").WithFormat(ImportFormats.DataNodeParameter).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"DataNodeParameters_CsmSwitch_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.DataNodeParameter)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -118,7 +127,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"NominalCashflows_CsmSwitch_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"NominalCashflows_CsmSwitch_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.Cashflow)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -127,7 +139,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"Actuals_CsmSwitch_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"Actuals_CsmSwitch_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.Actual)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -136,7 +151,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"NominalCashflows_CsmSwitch_CH_2021_3.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"NominalCashflows_CsmSwitch_CH_2021_3.csv\")", + "\n .WithFormat(ImportFormats.Cashflow)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -145,7 +163,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"Actuals_CsmSwitch_CH_2021_3.csv\").WithFormat(ImportFormats.Actual).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"Actuals_CsmSwitch_CH_2021_3.csv\")", + "\n .WithFormat(ImportFormats.Actual)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -163,7 +184,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"SimpleValue_CsmSwitch_CH_2020_12.csv\").WithFormat(ImportFormats.SimpleValue).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"SimpleValue_CsmSwitch_CH_2020_12.csv\")", + "\n .WithFormat(ImportFormats.SimpleValue)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -172,7 +196,10 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"SimpleValue_CsmSwitch_CH_2021_3.csv\").WithFormat(ImportFormats.SimpleValue).WithTarget(DataSource).ExecuteAsync()" + "await Import.FromFile(\"SimpleValue_CsmSwitch_CH_2021_3.csv\")", + "\n .WithFormat(ImportFormats.SimpleValue)", + "\n .WithTarget(DataSource)", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Test/MapTemplateAndImportTest.ipynb b/ifrs17-template/Test/MapTemplateAndImportTest.ipynb index cd6603fd..95e7e89a 100644 --- a/ifrs17-template/Test/MapTemplateAndImportTest.ipynb +++ b/ifrs17-template/Test/MapTemplateAndImportTest.ipynb @@ -166,7 +166,7 @@ "\n .GroupofContractConfiguration(typeof(ReinsurancePortfolio))", "\n .GroupofContractConfiguration(typeof(InsurancePortfolio))", "\n .MainTabConfigurationWoScenario(partition)", - "\n.ExecuteAsync();", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader);", "\n", "\nexportResult.ActivityLog.Status.Should().Be(ActivityLogStatus.Succeeded);" ], @@ -184,7 +184,7 @@ "\n .GroupofContractConfiguration(typeof(ReinsurancePortfolio))", "\n .GroupofContractConfiguration(typeof(InsurancePortfolio))", "\n .MainTabConfigurationWoScenario(partition)", - "\n.ExecuteAsync()" + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -265,7 +265,7 @@ "\n .StateEnumConfiguration() ", "\n .DataNodeStateConfiguration(dataNodeStates)", "\n .MainTabConfigurationWoScenario(partition)", - "\n.ExecuteAsync();", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader);", "\n", "\nexportResult.ActivityLog.Status.Should().Be(ActivityLogStatus.Succeeded);" ], @@ -281,7 +281,7 @@ "\n .StateEnumConfiguration() ", "\n .DataNodeStateConfiguration(dataNodeStates)", "\n .MainTabConfigurationWoScenario(partition)", - "\n.ExecuteAsync()" + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -357,7 +357,7 @@ "\n .WithSource(Workspace)", "\n .DataNodeParameterConfiguration(dataNodeParameters)", "\n .MainTabConfiguration(partition)", - "\n.ExecuteAsync();", + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader);", "\n", "\nexportResult.ActivityLog.Status.Should().Be(ActivityLogStatus.Succeeded);" ], @@ -372,7 +372,7 @@ "\n .WithSource(Workspace)", "\n .DataNodeParameterConfiguration(dataNodeParameters)", "\n .MainTabConfiguration(partition)", - "\n.ExecuteAsync()" + "\n .ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17-template/Test/SequenceImportTest.ipynb b/ifrs17-template/Test/SequenceImportTest.ipynb index 8a1b0187..e5014953 100644 --- a/ifrs17-template/Test/SequenceImportTest.ipynb +++ b/ifrs17-template/Test/SequenceImportTest.ipynb @@ -55,7 +55,7 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(ws1).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(ws1).ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -64,7 +64,7 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(ws1).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(ws1).ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -112,7 +112,7 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(ws2).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/Actuals_CH_2020_12.csv\").WithFormat(ImportFormats.Actual).WithTarget(ws2).ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, @@ -121,7 +121,7 @@ { "cell_type": "code", "source": [ - "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(ws2).ExecuteAsync()" + "await Import.FromFile(\"../Files/TransactionalData/NominalCashflows_CH_2020_12.csv\").WithFormat(ImportFormats.Cashflow).WithTarget(ws2).ExecuteWithStoreActivityAsync(Session, DataSource, DataSetReader)" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17/CalculationEngine.ipynb b/ifrs17/CalculationEngine.ipynb index 288ee9fb..1cb684b2 100644 --- a/ifrs17/CalculationEngine.ipynb +++ b/ifrs17/CalculationEngine.ipynb @@ -22,7 +22,8 @@ "\n#!import \"Report/ReportMutableScopes\"", "\n#!import \"Import/Importers\"", "\n#!import \"Export/ExportConfiguration\"", - "\n#!import \"Utils/TestHelper\"" + "\n#!import \"Utils/TestHelper\"", + "\n#!import \"Utils/ActivityLogsAndImports\"" ], "metadata": {}, "execution_count": 0, diff --git a/ifrs17/DataModel/DataStructure.ipynb b/ifrs17/DataModel/DataStructure.ipynb index 2521b257..d1d0c2d2 100644 --- a/ifrs17/DataModel/DataStructure.ipynb +++ b/ifrs17/DataModel/DataStructure.ipynb @@ -52,21 +52,22 @@ { "cell_type": "code", "source": [ - "#r \"nuget:Systemorph.Activities,1.6.1\"", - "\n#r \"nuget:Systemorph.Arithmetics,1.6.1\"", - "\n#r \"nuget:Systemorph.Workspace,1.6.0\"", - "\n#r \"nuget:Systemorph.InteractiveObjects,1.6.1\"", - "\n#r \"nuget:Systemorph.SharePoint,1.6.1\"", - "\n#r \"nuget:Systemorph.OneDrive,1.6.1\"", - "\n#r \"nuget:Systemorph.Scopes,1.6.1\"", - "\n#r \"nuget:Systemorph.Import,1.6.2\"", - "\n#r \"nuget:Systemorph.Test,1.6.1\"", - "\n#r \"nuget:Systemorph.Export,1.6.2\"", - "\n#r \"nuget:Systemorph.DataSetReader,1.6.2\"", + "#r \"nuget:Systemorph.Activities,1.6.2\"", + "\n#r \"nuget:Systemorph.Arithmetics,1.6.2\"", + "\n#r \"nuget:Systemorph.Workspace,1.6.1\"", + "\n#r \"nuget:Systemorph.InteractiveObjects,1.6.2\"", + "\n#r \"nuget:Systemorph.SharePoint,1.6.2\"", + "\n#r \"nuget:Systemorph.OneDrive,1.6.2\"", + "\n#r \"nuget:Systemorph.Scopes,1.6.2\"", + "\n#r \"nuget:Systemorph.Import,1.6.4\"", + "\n#r \"nuget:Systemorph.Test,1.6.2\"", + "\n#r \"nuget:Systemorph.Export,1.6.4\"", + "\n#r \"nuget:Systemorph.DataSetReader,1.6.4\"", "\n#r \"nuget:Systemorph.DataSource,1.6.0\"", "\n#r \"nuget:Systemorph.DataSource.Conversions,1.6.0\"", - "\n#r \"nuget:Systemorph.Reporting,1.6.1\"", - "\n#r \"nuget:Systemorph.Charting,1.6.1\"" + "\n#r \"nuget:Systemorph.Reporting,1.6.2\"", + "\n#r \"nuget:Systemorph.Charting,1.6.2\"", + "\n#r \"nuget:Systemorph.SchemaMigrations,1.6.1\"" ], "metadata": {}, "execution_count": 0, @@ -2129,6 +2130,15 @@ "metadata": {}, "execution_count": 0, "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] } ] } \ No newline at end of file diff --git a/ifrs17/Utils/ActivityLogsAndImports.ipynb b/ifrs17/Utils/ActivityLogsAndImports.ipynb new file mode 100644 index 00000000..2ce8b659 --- /dev/null +++ b/ifrs17/Utils/ActivityLogsAndImports.ipynb @@ -0,0 +1,472 @@ +{ + "metadata": { + "authors": [], + "kernelspec": { + "display_name": "Formula Framework", + "language": "C#", + "name": "C#" + }, + "language_info": { + "file_extension": ".cs", + "mimetype": "text/plain", + "name": "C#" + } + }, + "nbformat": 4, + "nbformat_minor": 5, + "cells": [ + { + "cell_type": "code", + "source": [ + "#!import \"../DataModel/DataStructure\"" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "using System.IO;", + "\nusing System.Text;", + "\nusing Systemorph.Vertex.DataSetReader.Csv;", + "\nusing Systemorph.Vertex.Session;", + "\nusing Systemorph.Vertex.Import.Builders;", + "\nusing Systemorph.Vertex.Import.Mappings;", + "\nusing Systemorph.Vertex.DataSetReader;", + "\nusing Systemorph.Vertex.Export.Excel.Builders;", + "\nusing Systemorph.Vertex.Export;", + "\nusing Systemorph.Vertex.Export.Builders;", + "\nusing Systemorph.Vertex.FileStorage;", + "\nusing Systemorph.Vertex.Export.Builders.Interfaces;", + "\n", + "\npublic record StreamWrapper(Stream Stream, bool WillBeReused);", + "\n", + "\npublic static string ProcessNotification(this object obj) => obj is ActivityMessageNotification amn ? amn.Message : \"\"; " + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public record ImportExportActivity : KeyedRecord", + "\n{", + "\n public string Username {get; init;}", + "\n", + "\n public DateTime StartDateTime {get; init;}", + "\n", + "\n public DateTime EndDateTime {get; init;}", + "\n", + "\n public ActivityLogStatus Status {get; init;}", + "\n", + "\n public string Category {get; init;}", + "\n", + "\n [Conversion(typeof(JsonConverter))]", + "\n public string[] ErrorMessages {get; init;}", + "\n", + "\n [Conversion(typeof(JsonConverter))]", + "\n public string[] WarningMessages {get; init;}", + "\n", + "\n [Conversion(typeof(JsonConverter))]", + "\n public string[] InfoMessages {get; init;}", + "\n", + "\n public Guid SourceId {get; init;} ", + "\n ", + "\n public ImportExportActivity(ActivityLog log, ISessionVariable session)", + "\n {", + "\n Id = Guid.NewGuid();", + "\n Username = session.User.Name;", + "\n StartDateTime = log.StartDateTime;", + "\n EndDateTime = log.FinishDateTime;", + "\n Status = log.Status;", + "\n ErrorMessages = log.Errors.Select(x => x.ProcessNotification()).Distinct().ToArray();", + "\n WarningMessages = log.Warnings.Select(x => x.ProcessNotification()).Distinct().ToArray();", + "\n InfoMessages = log.Infos.Select(x => x.ProcessNotification()).Distinct().ToArray();", + "\n }", + "\n", + "\n public ImportExportActivity(Guid id)", + "\n {", + "\n Id = id;", + "\n }", + "\n", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public abstract record KeyedImportExport : KeyedRecord", + "\n{", + "\n public DateTime CreationTime {get; init;}", + "\n public byte[] SerializedContent {get; init;}", + "\n public uint? Length {get; init;}", + "\n public string Format {get; init;}", + "\n protected IDataSetImportVariable DataSetReader {get; set;}", + "\n protected ISessionVariable Session {get; set;}", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public record ExportFile : KeyedImportExport", + "\n{", + "\n protected DocumentBuilder Builder {get; set;}", + "\n", + "\n public string Name {get; init;}", + "\n", + "\n public string ContentType {get; init;}", + "\n", + "\n public ExportFile(DocumentBuilder builder, IDataSetImportVariable importVariable, ISessionVariable session)", + "\n {", + "\n Builder = builder;", + "\n DataSetReader = importVariable;", + "\n Session = session;", + "\n Id = Guid.NewGuid();", + "\n CreationTime = DateTime.UtcNow;", + "\n }", + "\n", + "\n public ExportFile(Guid id)", + "\n {", + "\n Id = id;", + "\n }", + "\n", + "\n public async Task InitializeExportDataAsync()", + "\n {", + "\n byte[] content;", + "\n var mapping = await Builder.GetMappingAsync();", + "\n var storage = mapping.Storage as IFileReadStorage;", + "\n var stream = await storage.ReadAsync(mapping.FileName, Session.CancellationToken);", + "\n using(MemoryStream ms = new MemoryStream())", + "\n {", + "\n await stream.CopyToAsync(ms);", + "\n content = ms.ToArray();", + "\n stream.Close();", + "\n await stream.DisposeAsync();", + "\n }", + "\n return this with {Name = Path.GetFileName(mapping.FileName), ", + "\n ContentType = Path.GetExtension(mapping.FileName),", + "\n SerializedContent = content, ", + "\n Length = content == null ? null : (uint)content.Length,", + "\n Format = mapping.Format};", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public abstract record KeyedImport : KeyedImportExport", + "\n{", + "\n protected ImportOptions Options {get; set;}", + "\n", + "\n public async Task InitializeImportDataAsync()", + "\n {", + "\n var stream = await GenerateStreamWrapperAsync();", + "\n var formatAndContent = await GetInformationFromStreamAsync(stream);", + "\n return this with{CreationTime = DateTime.UtcNow, ", + "\n Format = formatAndContent.Format ?? Options.Format,", + "\n SerializedContent = formatAndContent.Content,", + "\n Length = formatAndContent.Content != null ? (uint)formatAndContent.Content.Length : null,", + "\n };", + "\n }", + "\n", + "\n private async Task GenerateStreamWrapperAsync()", + "\n {", + "\n StreamWrapper stream = Options switch", + "\n {", + "\n FileImportOptions fio => new StreamWrapper(await fio.Storage.ReadAsync(fio.FileName, Session.CancellationToken), true),", + "\n StreamImportOptions streamImportOptions => new StreamWrapper(streamImportOptions.Stream, false),", + "\n StringImportOptions stringImportOptions => new StreamWrapper(new MemoryStream(Encoding.ASCII.GetBytes(stringImportOptions.Content)), true),", + "\n DataSetImportOptions dataSetImportOptions => new StreamWrapper(new MemoryStream(Encoding.ASCII.GetBytes(DataSetCsvSerializer.Serialize(dataSetImportOptions.DataSet))), true),", + "\n _ => null", + "\n };", + "\n return stream;", + "\n }", + "\n", + "\n private async Task<(string Format, byte[] Content)> GetInformationFromStreamAsync(StreamWrapper stream)", + "\n {", + "\n byte[] content;", + "\n string format;", + "\n using (MemoryStream ms = new MemoryStream())", + "\n {", + "\n await stream.Stream.CopyToAsync(ms);", + "\n content = ms.ToArray();", + "\n ms.Position = 0;", + "\n var dsRes = await DataSetReader.ReadFromStream(ms).ExecuteAsync();", + "\n format = dsRes.Format;", + "\n if (stream.WillBeReused)", + "\n stream.Stream.Position = 0;", + "\n else", + "\n {", + "\n stream.Stream.Close();", + "\n await stream.Stream.DisposeAsync();", + "\n }", + "\n }", + "\n return (format, content);", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public record ImportFile : KeyedImport", + "\n{", + "\n public string Name {get; init;}", + "\n", + "\n public string Directory {get; init;}", + "\n ", + "\n public string ContentType {get; init;}", + "\n", + "\n [Conversion(typeof(JsonConverter))]", + "\n public string[] Partition {get; init;}", + "\n", + "\n public string Source {get; init;}", + "\n", + "\n public ImportFile(FileImportOptions options, IDataSetImportVariable importVariable, ISessionVariable session)", + "\n {", + "\n Options = options;", + "\n DataSetReader = importVariable;", + "\n Session = session;", + "\n string fileName = options.FileName; ", + "\n Id = Guid.NewGuid();", + "\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 // Andrey Katz: Options.TargetDataSource.Partion.GetCurrent(?? What do we put here, different classes might posess various partitions, e.g. Yield Curve has none ??)", + "\n }", + "\n", + "\n public ImportFile(Guid id)", + "\n {", + "\n Id = id;", + "\n Options = null;", + "\n DataSetReader = null;", + "\n }", + "\n ", + "\n", + "\n private string[] GetInvolvedPartitions(ImportOptions options)", + "\n {", + "\n // TODO", + "\n //Andrey Katz: Get all the relevant partitions here ", + "\n return null;", + "\n }", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public record ImportString : KeyedImport", + "\n{", + "\n public string Content {get; init;}", + "\n", + "\n public ImportString(StringImportOptions options, IDataSetImportVariable importVariable, ISessionVariable session)", + "\n {", + "\n Options = options;", + "\n DataSetReader = importVariable;", + "\n Session = session;", + "\n Id = Guid.NewGuid();", + "\n Content = options.Content;", + "\n }", + "\n", + "\n public ImportString(Guid id)", + "\n {", + "\n Id = id;", + "\n Options = null;", + "\n DataSetReader = null;", + "\n }", + "\n ", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public record ImportDataSet : KeyedImport", + "\n{", + "\n public ImportDataSet(DataSetImportOptions options, IDataSetImportVariable importVariable, ISessionVariable session)", + "\n {", + "\n Session = session;", + "\n DataSetReader = importVariable;", + "\n Options = options;", + "\n Id = Guid.NewGuid();", + "\n }", + "\n", + "\n public ImportDataSet(Guid id)", + "\n {", + "\n Id = id;", + "\n Options = null;", + "\n DataSetReader = null;", + "\n }", + "\n ", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public record ImportStream : KeyedImport", + "\n{", + "\n public ImportStream(StreamImportOptions options, IDataSetImportVariable importVariable, ISessionVariable session)", + "\n {", + "\n Session = session;", + "\n DataSetReader = importVariable;", + "\n Options = options;", + "\n Id = Guid.NewGuid();", + "\n }", + "\n", + "\n public ImportStream(Guid id)", + "\n {", + "\n Id = id;", + "\n Options = null;", + "\n DataSetReader = null;", + "\n }", + "\n ", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static async Task ExecuteWithStoreActivityAsync(this ImportOptionsBuilder builder, ", + "\n ISessionVariable session, ", + "\n IDataSource dataSource, ", + "\n IDataSetImportVariable importVariable)", + "\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 {", + "\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 }", + "\n catch (Exception)", + "\n {", + "\n importSucceeded = false;", + "\n }", + "\n activity = activity with {SourceId = importFile.Id, ", + "\n Category = \"Import from File\"};", + "\n if (importSucceeded) await dataSource.UpdateAsync(importFile.RepeatOnce());", + "\n break;", + "\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 }", + "\n catch (Exception)", + "\n {", + "\n importSucceeded = false;", + "\n }", + "\n activity = activity with {SourceId = importString.Id, ", + "\n Category = \"Import from String\"};", + "\n if (importSucceeded) await dataSource.UpdateAsync(importString.RepeatOnce());", + "\n break;", + "\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 }", + "\n catch (Exception)", + "\n {", + "\n importSucceeded = false;", + "\n }", + "\n activity = activity with {SourceId = importStream.Id, ", + "\n Category = \"Import from Stream\"};", + "\n if (importSucceeded) await dataSource.UpdateAsync(importStream.RepeatOnce());", + "\n break;", + "\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 }", + "\n catch(Exception)", + "\n {", + "\n importSucceeded = false;", + "\n }", + "\n activity = activity with {SourceId = importDataSet.Id, ", + "\n Category = \"Import from Data Set\"};", + "\n if (importSucceeded) await dataSource.UpdateAsync(importDataSet.RepeatOnce());", + "\n break;", + "\n default:", + "\n throw new Exception(\"Import Options object is not an instance of an appropriate class.\");", + "\n break;", + "\n } ", + "\n await dataSource.UpdateAsync(activity.RepeatOnce());", + "\n await dataSource.CommitAsync(); ", + "\n return log;", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "public static async Task ExecuteWithStoreActivityAsync(this IDocumentBuilder builder, ", + "\n ISessionVariable session, ", + "\n IDataSource dataSource, ", + "\n IDataSetImportVariable importVariable)", + "\n{", + "\n var exportResult = await builder.ExecuteAsync();", + "\n var exportFile = await (new ExportFile(builder as DocumentBuilder, importVariable, session)).InitializeExportDataAsync();", + "\n var activity = new ImportExportActivity(exportResult.ActivityLog, session) with {Category = \"Export to File\", ", + "\n SourceId = exportFile.Id};", + "\n await dataSource.UpdateAsync(exportFile.RepeatOnce());", + "\n await dataSource.UpdateAsync(activity.RepeatOnce());", + "\n await dataSource.CommitAsync();", + "\n return exportResult;", + "\n}" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "" + ], + "metadata": {}, + "execution_count": 0, + "outputs": [] + } + ] +} \ No newline at end of file