2022.3 - rule error

We have problems with evaluating rules on 2022.3. which worked on 2022.1 correctly.

2022-09-22 18:02:18Server error occurred. Please check server log for more details:
Selhalo vykonání pravidla při změně sloupce 'Ceníková cena' v entitě ''Doklad - cenová řádka''.
Vykonání pravidla 'DocumentBillingDetail_CalculateTotals' se nezdařilo.
Alternativní množství není možné zadat, pokud není vybrán produkt.
Selhalo vykonání pravidla.
Input string was not in a correct format.
Transformation result invalid.
2022-09-22 18:02:18,235 [40] ERROR Origam.Server.Controller.AbstractController - Selhalo vykonání pravidla při změně sloupce 'Ceníková cena' v entitě ''Doklad - cenová řádka''.
Origam.Rule.OrigamRuleException: Selhalo vykonání pravidla při změně sloupce 'Ceníková cena' v entitě ''Doklad - cenová řádka''.
 ---> System.Exception: Vykonání pravidla 'DocumentBillingDetail_CalculateTotals' se nezdařilo.
Alternativní množství není možné zadat, pokud není vybrán produkt.
 ---> System.Exception: Selhalo vykonání pravidla.
 ---> System.Exception: Input string was not in a correct format.
 ---> System.Exception: Transformation result invalid.
 ---> System.Xml.Xsl.XsltException: Exception happened during transformation. See inner exception for details:

 ---> System.Xml.Xsl.XslTransformException: An error occurred during a call to extension function 'OrigamRound'. See InnerException for a complete description of the error. ---> System.FormatException: Input string was not in a correct format.
   at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
   at System.Convert.ToDecimal(String value)
   at Origam.Rule.XsltFunctions.LegacyXsltFunctionContainer.OrigamRound(String num, String origamRounding) in D:\a\1\s\backend\Origam.Rule\XsltFunctions\LegacyXsltFunctionContainer.cs:line 575
   --- End of inner exception stack trace ---
   at System.Xml.Xsl.Runtime.XmlExtensionFunction.Invoke(Object extObj, Object[] args)
   at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
   at <xsl:template name="CalculatePriceTotals">(XmlQueryRuntime , XPathNavigator , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , String , String , String , String , String , String , String , String , String , String , String , String , String , String , String , String , String , String , String , String )
   at <xsl:template name="compiler:generated">(XmlQueryRuntime , XPathNavigator )
   at <xsl:template match="Document/DocumentDelivery/DocumentBillingDetail">(XmlQueryRuntime , XPathNavigator )
   at <xsl:template match="ROOT">(XmlQueryRuntime , XPathNavigator )
   at <xsl:apply-templates>(XmlQueryRuntime , XPathNavigator )
   at Root(XmlQueryRuntime )
   at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
   at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
   at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver)
   at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results)
   at Mvp.Xml.Common.Xsl.XslReader.StartTransform()
   --- End of inner exception stack trace ---
   at Mvp.Xml.Common.Xsl.XslReader.TokenPipeMultiThread.Read(XmlNodeType& nodeType, QName& name, String& value)
   at Mvp.Xml.Common.Xsl.XslReader.Read()
   at Origam.Service.Core.XmlReaderCore.Read()
   at System.Xml.XmlReader.MoveToContent()
   at System.Data.DataSet.ReadXml(XmlReader reader, Boolean denyResolving)
   at System.Data.DataSet.ReadXml(XmlReader reader)
   at Origam.Service.Core.DataDocumentCore.Load(XmlReader xmlReader, Boolean doProcessing)
   at Origam.Rule.Xslt.CompiledXsltEngine.Transform(Object engine, XsltArgumentList xslArg, XPathDocument sourceXpathDoc, IXmlContainer resultDoc) in D:\a\1\s\backend\Origam.Rule\Xslt\CompiledXsltEngine.cs:line 76
   at Origam.Rule.Xslt.MicrosoftXsltEngine.Transform(IXmlContainer data, Object xsltEngine, Hashtable parameters, String transactionId, IDataStructure outputStructure, Boolean validateOnly) in D:\a\1\s\backend\Origam.Rule\Xslt\MicrosoftXsltEngine.cs:line 214
   --- End of inner exception stack trace ---
   at Origam.Rule.Xslt.MicrosoftXsltEngine.Transform(IXmlContainer data, Object xsltEngine, Hashtable parameters, String transactionId, IDataStructure outputStructure, Boolean validateOnly) in D:\a\1\s\backend\Origam.Rule\Xslt\MicrosoftXsltEngine.cs:line 238
   --- End of inner exception stack trace ---
   at Origam.Rule.Xslt.MicrosoftXsltEngine.Transform(IXmlContainer data, Object xsltEngine, Hashtable parameters, String transactionId, IDataStructure outputStructure, Boolean validateOnly) in D:\a\1\s\backend\Origam.Rule\Xslt\MicrosoftXsltEngine.cs:line 265
   at Origam.Rule.Xslt.AbstractXsltEngine.Transform(IXmlContainer data, Guid transformationId, Guid retransformationId, Hashtable parameters, String transactionId, Hashtable retransformationParameters, IDataStructure outputStructure, Boolean validateOnly) in D:\a\1\s\backend\Origam.Rule\Xslt\AbstractXsltEngine.cs:line 178
   at Origam.Rule.Xslt.AbstractXsltEngine.Transform(IXmlContainer data, Guid transformationId, Hashtable parameters, String transactionId, IDataStructure outputStructure, Boolean validateOnly) in D:\a\1\s\backend\Origam.Rule\Xslt\AbstractXsltEngine.cs:line 137
   at Origam.Rule.RuleEngine.EvaluateRule(XslRule rule, IXmlContainer context) in D:\a\1\s\backend\Origam.Rule\RuleEngine.cs:line 2189
   --- End of inner exception stack trace ---
   at Origam.Rule.RuleEngine.EvaluateRule(XslRule rule, IXmlContainer context) in D:\a\1\s\backend\Origam.Rule\RuleEngine.cs:line 2199
   at Origam.Rule.RuleEngine.EvaluateRule(IRule rule, Object data, XPathNodeIterator contextPosition, Boolean parentIsTracing) in D:\a\1\s\backend\Origam.Rule\RuleEngine.cs:line 314
   --- End of inner exception stack trace ---
   at Origam.Rule.RuleEngine.EvaluateRule(IRule rule, Object data, XPathNodeIterator contextPosition, Boolean parentIsTracing) in D:\a\1\s\backend\Origam.Rule\RuleEngine.cs:line 314
   at Origam.Rule.RuleEngine.ProcessRulesInternalFinish(ArrayList rules, IDataDocument data, DataRow rowChanged, IOutputPad outputPad, DataStructureRuleSet ruleSet) in D:\a\1\s\backend\Origam.Rule\RuleEngine.cs:line 0
   at Origam.Rule.RuleEngine.ProcessRulesInternal(DataRow rowChanged, IDataDocument data, DataColumn columnChanged, DataStructureRuleSet ruleSet, ICollection columnsChanged, Boolean isFromRuleQueue) in D:\a\1\s\backend\Origam.Rule\RuleEngine.cs:line 1088
   at Origam.Rule.DatasetRuleHandler.OnColumnChanged(DataColumnChangeEventArgs e, IDataDocument data, DataStructureRuleSet ruleSet, RuleEngine ruleEngine) in D:\a\1\s\backend\Origam.Rule\DatasetRuleHandler.cs:line 193
   --- End of inner exception stack trace ---
   at Origam.Rule.DatasetRuleHandler.OnColumnChanged(DataColumnChangeEventArgs e, IDataDocument data, DataStructureRuleSet ruleSet, RuleEngine ruleEngine) in D:\a\1\s\backend\Origam.Rule\DatasetRuleHandler.cs:line 205
   at Origam.Rule.DatasetRuleHandler.table_ColumnChanged(Object sender, DataColumnChangeEventArgs e) in D:\a\1\s\backend\Origam.Rule\DatasetRuleHandler.cs:line 275
   at System.Data.DataRow.set_Item(DataColumn column, Object value)
   at Origam.Rule.RuleEngine.ProcessRulesInternalFinish(ArrayList rules, IDataDocument data, DataRow rowChanged, IOutputPad outputPad, DataStructureRuleSet ruleSet) in D:\a\1\s\backend\Origam.Rule\RuleEngine.cs:line 1505
   at Origam.Rule.RuleEngine.ProcessRulesInternal(DataRow rowChanged, IDataDocument data, DataColumn columnChanged, DataStructureRuleSet ruleSet, ICollection columnsChanged, Boolean isFromRuleQueue) in D:\a\1\s\backend\Origam.Rule\RuleEngine.cs:line 1088
   at Origam.Rule.DatasetRuleHandler.OnColumnChanged(DataColumnChangeEventArgs e, IDataDocument data, DataStructureRuleSet ruleSet, RuleEngine ruleEngine) in D:\a\1\s\backend\Origam.Rule\DatasetRuleHandler.cs:line 193
   at Origam.Rule.DatasetRuleHandler.table_ColumnChanged(Object sender, DataColumnChangeEventArgs e) in D:\a\1\s\backend\Origam.Rule\DatasetRuleHandler.cs:line 275
   at System.Data.DataRow.set_Item(DataColumn column, Object value)
   at Origam.Server.SessionStore.UpdateRowValue(String property, Object newValue, DataRow row) in D:\a\1\s\backend\Origam.Server\Session Stores\SessionStore.cs:line 1742
   at Origam.Server.SessionStore.UpdateRowColumn(String property, Object newValue, UserProfile profile, DataRow row) in D:\a\1\s\backend\Origam.Server\Session Stores\SessionStore.cs:line 1702
   at Origam.Server.SessionStore.UpdateObject(String entity, Object id, String property, Object newValue) in D:\a\1\s\backend\Origam.Server\Session Stores\SessionStore.cs:line 1619
   at Origam.Server.SaveableSessionStore.UpdateObject(String entity, Object id, String property, Object newValue) in D:\a\1\s\backend\Origam.Server\Session Stores\SaveableSessionStore.cs:line 271
   at Origam.Server.SessionStore.UpdateObjectBatch(String entity, UpdateData[] updateDataArray) in D:\a\1\s\backend\Origam.Server\Session Stores\SessionStore.cs:line 2200
   at Origam.Server.ServerCoreUIService.UpdateObject(UpdateObjectInput input) in D:\a\1\s\backend\Origam.Server\ServerCoreUIService.cs:line 366
   at Origam.Server.Controller.UIServiceController.<>c__DisplayClass23_0.<UpdateObject>b__0() in D:\a\1\s\backend\Origam.Server\Controller\UIServiceController.cs:line 222
   at Origam.Server.Controller.AbstractController.RunWithErrorHandler(Func`1 func) in D:\a\1\s\backend\Origam.Server\Controller\AbstractController.cs:line 115
2022-09-22 18:02:18,657 [4] ERROR Origam.Server.Controller.AbstractController - Selhalo vykonání pravidla při změně sloupce 'Cena/j' v entitě ''Doklad - cenová řádka''.
Origam.Rule.OrigamRuleException: Selhalo vykonání pravidla při změně sloupce 'Cena/j' v entitě ''Doklad - cenová řádka''.
 ---> System.Exception: Vykonání pravidla 'DocumentBillingDetail_CalculateTotals' se nezdařilo.
Alternativní množství není možné zadat, pokud není vybrán produkt.
 ---> System.Exception: Selhalo vykonání pravidla.
 ---> System.Exception: Input string was not in a correct format.
 ---> System.Exception: Transformation result invalid.
 ---> System.Xml.Xsl.XsltException: Exception happened during transformation. See inner exception for details:

 ---> System.Xml.Xsl.XslTransformException: An error occurred during a call to extension function 'OrigamRound'. See InnerException for a complete description of the error. ---> System.FormatException: Input string was not in a correct format.
   at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
   at System.Convert.ToDecimal(String value)
   at Origam.Rule.XsltFunctions.LegacyXsltFunctionContainer.OrigamRound(String num, String origamRounding) in D:\a\1\s\backend\Origam.Rule\XsltFunctions\LegacyXsltFunctionContainer.cs:line 575
   --- End of inner exception stack trace ---
   at System.Xml.Xsl.Runtime.XmlExtensionFunction.Invoke(Object extObj, Object[] args)
   at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
   at <xsl:template name="CalculatePriceTotals">(XmlQueryRuntime , XPathNavigator , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , IList`1 , String , String , String , String , String , String , String , String , String , String , String , String , String , String , String , String , String , String , String , String )
   at <xsl:template name="compiler:generated">(XmlQueryRuntime , XPathNavigator )
   at <xsl:template match="Document/DocumentDelivery/DocumentBillingDetail">(XmlQueryRuntime , XPathNavigator )
   at <xsl:template match="ROOT">(XmlQueryRuntime , XPathNavigator )
   at <xsl:apply-templates>(XmlQueryRuntime , XPathNavigator )
   at Root(XmlQueryRuntime )
   at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
   at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
   at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver)
   at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results)
   at Mvp.Xml.Common.Xsl.XslReader.StartTransform()
   --- End of inner exception stack trace ---
   at Mvp.Xml.Common.Xsl.XslReader.TokenPipeMultiThread.Read(XmlNodeType& nodeType, QName& name, String& value)
   at Mvp.Xml.Common.Xsl.XslReader.Read()
   at Origam.Service.Core.XmlReaderCore.Read()
   at System.Data.DataSet.ReadXml(XmlReader reader, Boolean denyResolving)
   at System.Data.DataSet.ReadXml(XmlReader reader)
   at Origam.Service.Core.DataDocumentCore.Load(XmlReader xmlReader, Boolean doProcessing)
   at Origam.Rule.Xslt.CompiledXsltEngine.Transform(Object engine, XsltArgumentList xslArg, XPathDocument sourceXpathDoc, IXmlContainer resultDoc) in D:\a\1\s\backend\Origam.Rule\Xslt\CompiledXsltEngine.cs:line 76
   at Origam.Rule.Xslt.MicrosoftXsltEngine.Transform(IXmlContainer data, Object xsltEngine, Hashtable parameters, String transactionId, IDataStructure outputStructure, Boolean validateOnly) in D:\a\1\s\backend\Origam.Rule\Xslt\MicrosoftXsltEngine.cs:line 214
   --- End of inner exception stack trace ---
   at Origam.Rule.Xslt.MicrosoftXsltEngine.Transform(IXmlContainer data, Object xsltEngine, Hashtable parameters, String transactionId, IDataStructure outputStructure, Boolean validateOnly) in D:\a\1\s\backend\Origam.Rule\Xslt\MicrosoftXsltEngine.cs:line 238
   --- End of inner exception stack trace ---
   at Origam.Rule.Xslt.MicrosoftXsltEngine.Transform(IXmlContainer data, Object xsltEngine, Hashtable parameters, String transactionId, IDataStructure outputStructure, Boolean validateOnly) in D:\a\1\s\backend\Origam.Rule\Xslt\MicrosoftXsltEngine.cs:line 265
   at Origam.Rule.Xslt.AbstractXsltEngine.Transform(IXmlContainer data, Guid transformationId, Guid retransformationId, Hashtable parameters, String transactionId, Hashtable retransformationParameters, IDataStructure outputStructure, Boolean validateOnly) in D:\a\1\s\backend\Origam.Rule\Xslt\AbstractXsltEngine.cs:line 178
   at Origam.Rule.Xslt.AbstractXsltEngine.Transform(IXmlContainer data, Guid transformationId, Hashtable parameters, String transactionId, IDataStructure outputStructure, Boolean validateOnly) in D:\a\1\s\backend\Origam.Rule\Xslt\AbstractXsltEngine.cs:line 137
   at Origam.Rule.RuleEngine.EvaluateRule(XslRule rule, IXmlContainer context) in D:\a\1\s\backend\Origam.Rule\RuleEngine.cs:line 2189
   --- End of inner exception stack trace ---
   at Origam.Rule.RuleEngine.EvaluateRule(XslRule rule, IXmlContainer context) in D:\a\1\s\backend\Origam.Rule\RuleEngine.cs:line 2199
   at Origam.Rule.RuleEngine.EvaluateRule(IRule rule, Object data, XPathNodeIterator contextPosition, Boolean parentIsTracing) in D:\a\1\s\backend\Origam.Rule\RuleEngine.cs:line 314
   --- End of inner exception stack trace ---
   at Origam.Rule.RuleEngine.EvaluateRule(IRule rule, Object data, XPathNodeIterator contextPosition, Boolean parentIsTracing) in D:\a\1\s\backend\Origam.Rule\RuleEngine.cs:line 314
   at Origam.Rule.RuleEngine.ProcessRulesInternalFinish(ArrayList rules, IDataDocument data, DataRow rowChanged, IOutputPad outputPad, DataStructureRuleSet ruleSet) in D:\a\1\s\backend\Origam.Rule\RuleEngine.cs:line 0
   at Origam.Rule.RuleEngine.ProcessRulesInternal(DataRow rowChanged, IDataDocument data, DataColumn columnChanged, DataStructureRuleSet ruleSet, ICollection columnsChanged, Boolean isFromRuleQueue) in D:\a\1\s\backend\Origam.Rule\RuleEngine.cs:line 1088
   at Origam.Rule.RuleEngine.ProcessRulesInternalFinish(ArrayList rules, IDataDocument data, DataRow rowChanged, IOutputPad outputPad, DataStructureRuleSet ruleSet) in D:\a\1\s\backend\Origam.Rule\RuleEngine.cs:line 1468
   at Origam.Rule.RuleEngine.ProcessRulesInternal(DataRow rowChanged, IDataDocument data, DataColumn columnChanged, DataStructureRuleSet ruleSet, ICollection columnsChanged, Boolean isFromRuleQueue) in D:\a\1\s\backend\Origam.Rule\RuleEngine.cs:line 1088
   at Origam.Rule.DatasetRuleHandler.OnColumnChanged(DataColumnChangeEventArgs e, IDataDocument data, DataStructureRuleSet ruleSet, RuleEngine ruleEngine) in D:\a\1\s\backend\Origam.Rule\DatasetRuleHandler.cs:line 193
   --- End of inner exception stack trace ---
   at Origam.Rule.DatasetRuleHandler.OnColumnChanged(DataColumnChangeEventArgs e, IDataDocument data, DataStructureRuleSet ruleSet, RuleEngine ruleEngine) in D:\a\1\s\backend\Origam.Rule\DatasetRuleHandler.cs:line 205
   at Origam.Rule.DatasetRuleHandler.table_ColumnChanged(Object sender, DataColumnChangeEventArgs e) in D:\a\1\s\backend\Origam.Rule\DatasetRuleHandler.cs:line 275
   at System.Data.DataRow.set_Item(DataColumn column, Object value)
   at Origam.Server.SessionStore.UpdateRowValue(String property, Object newValue, DataRow row) in D:\a\1\s\backend\Origam.Server\Session Stores\SessionStore.cs:line 1742
   at Origam.Server.SessionStore.UpdateRowColumn(String property, Object newValue, UserProfile profile, DataRow row) in D:\a\1\s\backend\Origam.Server\Session Stores\SessionStore.cs:line 1702
   at Origam.Server.SessionStore.UpdateObject(String entity, Object id, String property, Object newValue) in D:\a\1\s\backend\Origam.Server\Session Stores\SessionStore.cs:line 1619
   at Origam.Server.SaveableSessionStore.UpdateObject(String entity, Object id, String property, Object newValue) in D:\a\1\s\backend\Origam.Server\Session Stores\SaveableSessionStore.cs:line 271
   at Origam.Server.SessionStore.UpdateObjectBatch(String entity, UpdateData[] updateDataArray) in D:\a\1\s\backend\Origam.Server\Session Stores\SessionStore.cs:line 2200
   at Origam.Server.ServerCoreUIService.UpdateObject(UpdateObjectInput input) in D:\a\1\s\backend\Origam.Server\ServerCoreUIService.cs:line 366
   at Origam.Server.Controller.UIServiceController.<>c__DisplayClass23_0.<UpdateObject>b__0() in D:\a\1\s\backend\Origam.Server\Controller\UIServiceController.cs:line 222
   at Origam.Server.Controller.AbstractController.RunWithErrorHandler(Func`1 func) in D:\a\1\s\backend\Origam.Server\Controller\AbstractController.cs:line 115

So the problem occurs in OrigamRound function.

Can you confirm that you send numbers to both parameters? It’s failing while being converted to a number.

The second parameter of AS:OrigamRound is GUID with reference to type of round.
When I use the xml source data for the previous rule (from rule debug log) and try to transform in architect, it works without error and generates xml output…

We identified that the problem is caused by using Convert instead of XmlConvert class. It depends on a locale so on Czech locale it tries to parse a number with a decimal comma while being provided with a decimal point.

Here

@jsusen - please could you fix 2022.3 as well?
Thanks.

@jsusen let’s do 2022.x.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.