Class ExpressionManager
OptimaJet.Workflow.Core.CodeActions.ExpressionManager
Compiles, caches, and evaluates workflow expressions for process schemes.
Namespace: OptimaJet.Workflow.Core.CodeActions
public sealed class ExpressionManagerMethods
public Task<TResult> CompileIfNotContainsAndInvokeAsync<TResult>(ProcessInstance processInstance, string expressionString, bool ignoreExceptions, string functionName) #Prepares, compiles, and caches
expressionString for TResult when the corresponding cache entry does not exist, then evaluates the cached delegate against processInstance.Parameters
Name
Type
Description
processInstanceProcessInstanceThe process instance whose scheme is used when the expression is first compiled and which is supplied as the execution context whenever the cached expression is evaluated.
expressionStringStringThe workflow expression to compile and evaluate. Workflow operators and process-parameter references are converted to their C# equivalents before compilation.
ignoreExceptionsBooleanfunctionNameStringA compatibility label passed to the expression compiler. The current compiler does not use its value.
Returns
Type
Description
Task<TResult>The
TResult value produced by the cached or newly compiled delegate.Exceptions
Type
Description
ExceptionThrown when expression compilation fails and
ignoreExceptions is false. Exceptions raised while evaluating the expression or converting the fallback value are also propagated.Remarks
The cache key consists of the exact
expressionString value and TResult. Once that entry is cached, subsequent calls reuse it regardless of the supplied ignoreExceptions and functionName values. ExpressionsCompiler.CompilationEnable must be true when a new expression needs to be compiled.Remarks
The runtime creates an ExpressionManager for each non-subprocess process scheme. Expressions used by a subprocess are compiled and cached by the manager associated with its root process scheme.