1. Home
  2. $context

$context

Print Friendly, PDF & Email

◷ 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.

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.

Notification functions

Built-in functions are not supported in JavaScript Engine, instead, use below $context method for JavaScript environment.

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.
Updated on July 22, 2019

Was this article helpful?