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) #
Compiles an expression if necessary, then evaluates it against the supplied process.
Parameters
Name
Type
Description
processInstanceProcessInstanceThe process supplying scheme context and current parameter values.
expressionStringStringThe original workflow expression.
ignoreExceptionsBooleanWhether built-in compilation can fall back to a literal. External compiler errors always reach the caller.
functionNameStringThe diagnostic function label, also used as the source name.
Returns
Type
Description
Task<TResult>The value produced by the compiled function.
Remarks
This overload uses ExpressionCompilationPurpose.Custom. Disabling compilation prevents new cache entries. Cached functions can still run if the compiler registration has not changed.
public Task<TResult> CompileIfNotContainsAndInvokeAsync<TResult>(ProcessInstance processInstance, string expressionString, bool ignoreExceptions, string functionName, ExpressionCompilationPurpose purpose, string sourceName) #
Compiles and evaluates an expression with an explicit workflow purpose and source name.
Parameters
Name
Type
Description
processInstanceProcessInstanceThe process supplying scheme context and current parameter values.
expressionStringStringThe original workflow expression.
ignoreExceptionsBooleanWhether built-in compilation can fall back to a literal. External compiler errors always reach the caller.
functionNameStringThe diagnostic function label.
purposeExpressionCompilationPurposeThe workflow feature requesting compilation.
sourceNameStringThe source name used in error messages. It does not grant access to data or code.
Returns
Type
Description
Task<TResult>The value produced by the compiled function.
Exceptions
Type
Description
InvalidOperationExceptionCompilation is disabled, failed, or the compiler registration changed.
Remarks
A root scheme and its subprocesses share a manager. The manager reuses a function when the full compilation request and compiler registration match a cached entry. Concurrent identical requests share one successful compilation. Failed compilations can be retried. The function reads current process values on each call.