Create a new instance implementing WorkingContext.
Any input data that needs to be evaluated.
the current workspace, used to access rules, constants, and other shared data.
OptionalsharedData: anyoptional additional data that should be accessible to the output but not altered.
Optionallogger: ILoggeroptional logger instance to use for this context. If not provided, a default logger will be created.
ProtectedcacheProtectedcacheCheck if the context contains a constant for the given key. Nested keys are not allowed.
the key to check in the constants.
true if the constant exists, false otherwise.
Get a constant value from the context using the given key. Nested keys are not allowed.
the key to look up in the constants.
the constant value associated with the key, or undefined if the key is not found.
Check if the context contains data for the given key or path. Nested keys can be accessed using dot notation (e.g., "user.name").
the key to check in the context.
true if the key exists in the context, false otherwise.
Get all data from the context, excluding any shared data.
an object containing all data in the context.
Read data from the context using the given key or path. This method will first attempt to retrieve the value from the context's data. If the value is not found in the data, it will then attempt to retrieve it from the context's constants. Nested keys can be accessed using dot notation (e.g., "user.name").
the key to look up in the context.
the value associated with the key, or undefined if the key is not found.
Get the root-level keys of the context. This can be useful for determining what data is available in the context and for debugging purposes.
an array of root-level keys in the context.
Set an output value in the context with the given key.
the key to associate with the output value.
the value to set for the given key.
Get an output value from the context using the given key, excluding any shared data. Nested keys can be accessed using dot notation (e.g., "result.value"). If no key is provided, all output data will be returned.
Optionalkey: stringthe key to look up in the outputs.
the output value associated with the key, or undefined if the key is not found.
Get the value kept under a given identifer.
the identifer to look for.
the value kept under that identifer, or undefined if the id was not found.
Keep a value under a given identifier.
the identifier to set,
the value to keep for the identifier.
Delete a single identifier and its value, or entirely delete all values.
Optionalid: stringthe identifier to delete. If not provided, the entire cache will be cleared.
Retrieve metrics for this cache instance. This is mainly a debugging/monitoring method.
a metrics object containing sets, hits, and misses.
Add a created exception to the context
the exception to add to the context.
Add an invoked rule and its effect to the audit trail (log) of this context.
the rule that was satisified.
the effect it had on this context.
Delete all rules and effects from the current audit trail (log).
List all rules and their effects collected in this context.
an array of logged rules and effects.
Get the logger implementation used in this object. This can be used to log messages related to this object, such as during type checking or execution.
the logger associated with this object.
A context implementation that should be used whenever input data needs to be processed.