Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Remove mvp and rule engine stabilization fixes (#2188) #2203

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion backend/Origam.Rule/RuleEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
using Origam.Rule.Xslt;
using Origam.Service.Core;
using Origam.Workbench;
using System.Data.Common;

namespace Origam.Rule
{
Expand Down Expand Up @@ -981,9 +982,13 @@ public void ProcessRuleQueue()
}
}
}
catch
catch (Exception e)
{
row.CancelEdit();
if (log.IsErrorEnabled)
{
log.Error("Exception ocurred during evaluation of rule queue", e);
}
_ruleQueue.Clear();
throw;
}
Expand Down
10 changes: 7 additions & 3 deletions backend/Origam.Rule/Xslt/CompiledXsltEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,13 @@ internal override object GetTransform(string xsl)
public override void Transform(object engine, XsltArgumentList xslArg, XPathDocument sourceXpathDoc, IXmlContainer resultDoc)
{
XslCompiledTransform xslt = engine as XslCompiledTransform;
Mvp.Xml.Common.Xsl.XslReader xslReader = new Mvp.Xml.Common.Xsl.XslReader(xslt);
xslReader.StartTransform(new Mvp.Xml.Common.Xsl.XmlInput(sourceXpathDoc), xslArg);
resultDoc.Load(xslReader);
MemoryStream stream = new MemoryStream();
xslt.Transform(sourceXpathDoc, xslArg, stream);
stream.Position = 0;
using (XmlReader reader = XmlReader.Create(stream))
{
resultDoc.Load(reader);
}
}

public override void Transform(object engine, XsltArgumentList xslArg, XPathDocument sourceXpathDoc, XmlTextWriter xwr)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ public int Priority

public Guid DataStructureEntityId;

private string entityName;

public String EntityName
{
get
{
if (entityName == null)
{
entityName = Entity.Name;
}
return entityName;
}
}

[TypeConverter(typeof(DataQueryEntityConverter))]
[RefreshProperties(RefreshProperties.Repaint)]
[XmlReference("entity", "DataStructureEntityId")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public ArrayList Rules(string entityName)
var result = new ArrayList();
foreach(DataStructureRule rule in Rules())
{
if(rule.Entity.Name == entityName
if(rule.EntityName == entityName
&& rule.RuleDependencies.Count == 0)
{
result.Add(rule);
Expand Down
1 change: 1 addition & 0 deletions backend/Origam.Workflow/ProfilingTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public void Start(int hash)

public Stopwatch Stop(int hash)
{
if (!runningOperations.ContainsKey(hash)) return new Stopwatch();
Stopwatch stopwatch = runningOperations[hash].Stopwatch;
stopwatch.Stop();
runningOperations.Remove(hash);
Expand Down