◷ Reading Time: 3 minutes
At runtime, the parameter $context will be injected into an execution context that allows the retrieval of some information from the execution as well as adding notifications to the context.
Properties
Some properties of the $context are relevant to all types of logic (i.e., Decision Table, Natural Language, Flow, etc.), but some of them are specific to a particular type of logic.
Common
DocumentName
This refers to the name of the logic document. This is the name attribute of the root tag of the logic document. During the load, if ruleset is used it will be the name of the file that has the logic content.
LogicName
In both Decision Table and Natural language, this refers to the rule name.
For example, when we have a Rule Name column, we can use the value in Rule Name using $context.LogicName.

LogicUid
In Natural Language, a when-then-end logic can have a UID
attribute and is going to be set in the context as the business rule unique identifier.
Exception
This property holds the exception on the execution.
Workflow
This information (properties) is relevant only in the execution of a Workflow.
WorkflowInstanceId
When a workflow instance is loaded or stored this refers to the persistent identifier of the instance in the database.
Outcome
On both human and receive tasks, this refers to the outcome of a chosen task
History
This is the history of Flow execution, which is an instance of IHistoryQuery
Behaviours
Notifications
You can use built-in functions to write and retrieve notifications.
WriteError
Allows writing an Error notice in a notification.
WriteError(groupName, message)
- groupName can be null.
WriteInfo
Allows writing an Information notice in a notification.
WriteError(groupName, message)
- groupName can be null.
WriteWarning
Allows writing a Warning notice in a notification.
WriteError(groupName, message)
- groupName can be null.