Skip to content

Commit

Permalink
Merge pull request #3389 from Ginger-Automation/Enhancement/LiteDBUpg…
Browse files Browse the repository at this point in the history
…rade

Enhancement/lite db upgrade
  • Loading branch information
Maheshkale447 authored Jan 9, 2024
2 parents ed2fb3a + e1566e9 commit 673bfbb
Show file tree
Hide file tree
Showing 17 changed files with 776 additions and 795 deletions.
418 changes: 21 additions & 397 deletions Ginger/Ginger/Actions/ActionEditPages/ActDataSourcePage.xaml.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Ginger/Ginger/Ginger.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@
<PackageReference Include="FontAwesome5" Version="2.1.11" />
<PackageReference Include="Gherkin" Version="5.1.0" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.42" />
<PackageReference Include="LiteDB" Version="4.1.4" />
<PackageReference Include="LiteDB" Version="5.0.17" />
<PackageReference Include="LiveCharts.Wpf.NetCore3" Version="0.9.7" />
<PackageReference Include="log4net" Version="2.0.14" />
<PackageReference Include="Magick.NET-Q16-AnyCPU" Version="11.1.1" />
Expand Down
3 changes: 1 addition & 2 deletions Ginger/Ginger/Run/RunSetsExecutionsHistoryPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,7 @@ private void DeleteExecutionReports(System.Collections.IList runSetReports)
{
LiteDbManager dbManager = new LiteDbManager(executionLoggerHelper.GetLoggerDirectory(WorkSpace.Instance.Solution.LoggerConfigurations.CalculatedLoggerFolder));
var result = dbManager.GetRunSetLiteData();
List<LiteDbRunSet> filterData = null;
filterData = result.IncludeAll().Find(a => a._id.ToString() == runSetReport.GUID).ToList();
List<LiteDbRunSet> filterData = LiteDbRunSet.IncludeAllReferences(result).Find(a => a._id.Equals(new LiteDB.ObjectId(runSetReport.GUID))).ToList();

LiteDbConnector dbConnector = new LiteDbConnector(Path.Combine(mRunSetExecsRootFolder, "GingerExecutionResults.db"));
dbConnector.DeleteDocumentByLiteDbRunSet(filterData[0]);
Expand Down
4 changes: 2 additions & 2 deletions Ginger/Ginger/RunSetPageLib/RunnerPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ private void GenerateBFReport(BusinessFlow bf)
LiteDbManager dbManager = new LiteDbManager(WorkSpace.Instance.Solution.SolutionOperations.ConvertSolutionRelativePath(WorkSpace.Instance.Solution.LoggerConfigurations.CalculatedLoggerFolder));
var result = dbManager.GetRunSetLiteData();

List<LiteDbRunSet> filterData = dbManager.FilterCollection(result, Query.All());
List<LiteDbRunSet> filterData = dbManager.FilterCollection<LiteDbRunSet>(LiteDbRunSet.IncludeAllReferences(result), Query.All());

LiteDbRunSet runSetLast = filterData.Last();
//runSetLast._id = new ObjectId();
Expand Down Expand Up @@ -466,7 +466,7 @@ private void GenerateBFReport(BusinessFlow bf)
}
catch (Exception ex)
{

Reporter.ToLog(eLogLevel.ERROR, "Failed to generate business flow report", ex);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Ginger/GingerCoreCommon/GingerCoreCommon.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

<ItemGroup>
<PackageReference Include="Ginger.External" Version="1.0.0" />
<PackageReference Include="LiteDB" Version="4.1.4" />
<PackageReference Include="LiteDB" Version="5.0.17" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="3.7.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="3.7.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.7.0" />
Expand Down
30 changes: 28 additions & 2 deletions Ginger/GingerCoreNET/DataSource/ActDSTableElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ limitations under the License.

using amdocs.ginger.GingerCoreNET;
using Amdocs.Ginger.Common;
using Amdocs.Ginger.Common.Enums;
using Amdocs.Ginger.Common.InterfacesLib;
using Amdocs.Ginger.CoreNET.DataSource;
using Amdocs.Ginger.Repository;
using GingerCore.DataSource;
using GingerCoreNET.SolutionRepositoryLib.RepositoryObjectsLib.PlatformsLib;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Data;
Expand Down Expand Up @@ -86,6 +84,16 @@ public override void Execute()
if (DataSource.DSType == DataSourceBase.eDSType.LiteDataBase)
{
GingerCoreNET.DataSource.GingerLiteDB liteDB = new GingerCoreNET.DataSource.GingerLiteDB();
string value = GetInputParamValue("Value");
if (!string.IsNullOrEmpty(value))
{
ValueExpression mValueExpression = new(WorkSpace.Instance.RunsetExecutor.RunsetExecutionEnvironment, RunOnBusinessFlow, WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems<DataSourceBase>());
mValueExpression.Value = value;
ValueUC = mValueExpression.ValueCalculated;
}

LiteDBSQLTranslator liteDBSQLTranslator = new (this);
this.ValueExp = liteDBSQLTranslator.CreateValueExpression();
string Query = ValueExp.Substring(ValueExp.IndexOf("QUERY=") + 6, ValueExp.Length - (ValueExp.IndexOf("QUERY=") + 7));
liteDB.FileFullPath = WorkSpace.Instance.Solution.SolutionOperations.ConvertSolutionRelativePath(DataSource.FileFullPath);

Expand Down Expand Up @@ -281,6 +289,24 @@ public override void Execute()

}


private string mKeyName;
[IsSerializedForLocalRepository]
public string KeyName
{
get
{
return mKeyName;
}
set
{
if(!string.Equals(mKeyName , value))
{
mKeyName = value;
OnPropertyChanged(nameof(KeyName));
}
}
}
private eControlAction mControlAction;
[IsSerializedForLocalRepository]
public eControlAction ControlAction
Expand Down
Loading

0 comments on commit 673bfbb

Please sign in to comment.