You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Fix#717, #711, #714, #704, #624: bug bash batch
#624: ActionBase.ExecuteAndReturnResultAsync silently captured every
exception into result.Exception regardless of EnableExceptionAsErrorMessage,
so an action throwing inside Run() never propagated when the setting was
false. Add ThrowIfActionExceptionShouldPropagate in RulesEngine to honor
the contract documented on ReSettings.
#711: OutputExpressionAction emitted a cryptic
"Expression is missing an 'as' clause" when users wrote C#-style anonymous
objects (`new { X = ... } as Result`). Detect the pattern and wrap the
parse exception with a clear hint pointing at the Dynamic.Core syntax
(`new (value as Name, ...)`).
#714: Global params were re-evaluated for every rule in the workflow,
so `Utils.FromDb(myInput)` ran N times per ExecuteAllRulesAsync call.
Move the global-params compilation+evaluation to workflow scope: compile
a single delegate at RegisterRule time, store it in RulesCache, evaluate
once in ExecuteAllRuleByWorkflow and append the result as RuleParameters
to each compiled rule. Preserve the existing per-rule error messages when
global compilation or evaluation fails. ExecuteActionWorkflowAsync
(which bypasses RulesCache) evaluates globals ad-hoc.
#704: Utils.CreateAbstractClassType used only list[0] when generating the
CLR type for a heterogeneous IList of ExpandoObject/Dictionary, so any
property appearing only in later elements was dropped. Walk every element
and union the schema; recursively merge nested dictionaries.
#717: Methods declared to return `object` cannot have their result
members accessed in Dynamic.Core expressions — the parser errors with
"exists in type 'Object'" or "is not defined for the types 'System.Object'".
We can't unbox at parse time, but the error message gave no clue what was
wrong. Detect those patterns in LambdaExpressionBuilder and append a
hint to change the method's return type to the concrete class.
All 144 tests pass on net6.0 / net8.0 / net9.0 / net10.0.
* Deduplicate helpers introduced in the batch fix
- RulesEngine.cs: ApplyGlobalParams and EvaluateGlobalsAdHoc both built
RuleParameters from a globals delegate and concatenated them with the
user's inputs. Extracted AppendGlobals (delegate-invoke + concat tail)
and CompileGlobalParamsDelegate (GetRuleExpressionParameters + CompileScopedParams).
- Utils.cs: MergeListElementSchemas and MergeTwoDictionaries shared the
same pair-merge logic. Replaced both with MergeDictionaries (n-ary fold)
+ MergeValues (handles dict/dict, list/list, and first-non-null fallback).
The latter also makes nested list-concatenation consistent across all
call sites.
No behavior change. All 144 tests still pass on net6/8/9/10.
---------
Co-authored-by: Yogesh Prajapati <yogeshcprajapati@outlook.com>
0 commit comments