action_requestor/1—retrieve the identification of the requestor of an action
The action_requestor/1
primitive retrieves the identification of the requestor of an action.
action_requestor($REQUESTOR)
$REQUESTOR=action_requestor()
action_requestor/1 syntax argument
Argument | Mode | Type | Description |
---|---|---|---|
| output | STRING | The user or rule that requested the action |
Use action_requestor/1
to retrieve the identification of the requestor of the action and return the identification in the $REQUESTOR
argument. The requestor is either the user who performs the action from a console, or if the action is performed from a rule, the requestor is the name of the rule.
action_requestor/1 example
action AssignTo [Name:STRING($USER)] : EVENT($E)
{
action_requestor($REQUESTOR);
$E.administrator = $REQUESTOR;
$E.mc_owner = $USER;
}
END
In this example, the action AssignTo
assigns a selected event to a named owner.
The name of the owner is provided by the console user in the Name field of a dialog box, as specified in the action definition argument list.
When the action is triggered, it retrieves the identification of the requestor and returns it in the $REQUESTOR
variable. This value will be the ID of the console user and is assigned to the administrator
slot of the event.
The provided owner name is assigned to the mc_owner
slot of the event.
Comments
Log in or register to comment.