Skip to content

Activity Callbacks

Activity Callbacks lets administrators inject system-wide logic that runs when selected activity types occur.

Use this page when Emakin needs to trigger custom behavior such as external notifications or integration-side effects whenever a matching activity is recorded.

Typical Use Case

The preserved documentation uses a push-notification scenario as an example: when a work item is assigned, a callback can send a custom notification to another system.

Settings Reference

Is Enabled?

Controls whether the callback is active.

Name

Identifier used to recognize the callback.

Callback Code

Script executed when the callback is triggered.

The preserved predefined variables are:

Variable Name Description
$Targets Array of target identities
$Activity JSON object representing the activity

Example preserved from the existing documentation:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
if ($Activity.objectType == 'workitem' && $Activity['@type'] == 'assign') {

    var payload = {
        targets: $Targets.map(function (identity) {
            return identity.Id;
        }),
        message: $Activity.task + " " + $Activity.instructions
    };

    var client = $Rest.Create('http://localhost/post');

    client.Request().AddObject(payload).ExecuteJson();
}