Docs »

Plugins »

Extension Points »

Bot Event

Name: Bot Event
Identifier (ID): devblocks.event


		<extension point="devblocks.event">
			<name>Example bot event</name>
				<param key="contexts">
						<data key=""/>
						<data key=""/>
						<data key="cerberusweb.contexts.role"/>
						<data key="cerberusweb.contexts.worker"/>
				<param key="options">
						<data key="visibility"/>


  • contexts: This event is available for bots owned by one of these contexts.

  • These options configure the event:

    • visibility: The event has public/private variants. This is uncommon.


class Event_Example extends Extension_DevblocksEvent {
	const ID = '';

	 * @return Model_DevblocksEvent
	function generateSampleEventModel(Model_TriggerEvent $trigger) {
		$actions = [];
		return new Model_DevblocksEvent(
				'key' => 'value',
				'actions' => &$actions,
	public function renderEventParams(Model_TriggerEvent $trigger=null) {
	 * @param array $event_params
	 * @param string $error
	 * @return boolean
	public function prepareEventParams(Model_TriggerEvent $behavior=null, &$new_params, &$error) {
		$error = null;
		return true;

	public function setEvent(Model_DevblocksEvent $event_model=null, Model_TriggerEvent $trigger=null) {
		$labels = [];
		$values = [];
		 * Behavior
		$merge_labels = [];
		$merge_values = [];
		CerberusContexts::getContext(CerberusContexts::CONTEXT_BEHAVIOR, $trigger, $merge_labels, $merge_values, null, true);

			// Merge
		// [TODO] Register key/values from the event
		//@$value = $event_model->params['key'];
		//$labels['key'] = 'Key';
		//$values['key'] = $value;
		//$values['_actions'] =& $event_model->params['actions'];
		 * Return

	public function renderSimulatorTarget($trigger, $event_model) {
	function getValuesContexts($trigger) {
		$vals = array(
			'behavior_id' => [
				'label' => 'Behavior',
				'context' => CerberusContexts::CONTEXT_BEHAVIOR,
			'behavior_bot_id' => [
				'label' => 'Bot',
				'context' => CerberusContexts::CONTEXT_BOT,
		$vars = parent::getValuesContexts($trigger);
		$vals_to_ctx = array_merge($vals, $vars);
		DevblocksPlatform::sortObjects($vals_to_ctx, '[label]');
		return $vals_to_ctx;
	public function getConditionExtensions(Model_TriggerEvent $trigger) {
		$labels = $this->getLabels($trigger);
		$types = $this->getTypes();
		$labels['example_condition'] = 'Example Condition';
		$types['example_condition'] = null;
		$conditions = $this->_importLabelsTypesAsConditions($labels, $types);
		return $conditions;
	public function renderConditionExtension($token, $as_token, $trigger, $params=[], $seq=null) {
		$tpl = DevblocksPlatform::services()->template();
		$tpl->assign('params', $params);

		switch($as_token) {
			case 'example_condition':
				// [TODO] Render condition configuration template
	public function runConditionExtension($token, $as_token, $trigger, $params, DevblocksDictionaryDelegate $dict) {
		$pass = true;
		switch($as_token) {
			case 'example_condition':
				// [TODO] Implement condition logic
				$pass = true;
				$pass = false;
		return $pass;
	public function getActionExtensions(Model_TriggerEvent $trigger) {
		$actions =
				'example_action' => array('label' => 'Example Behavior Action'),
		return $actions;

	public function renderActionExtension($token, $trigger, $params=[], $seq=null) {
		$tpl = DevblocksPlatform::services()->template();
		$tpl->assign('params', $params);


		$labels = $this->getLabels($trigger);
		$tpl->assign('token_labels', $labels);
		switch($token) {
			case 'example_action':
				// [TODO] Render action configuration template

	protected function simulateActionExtension($token, $trigger, $params, DevblocksDictionaryDelegate $dict) {
		$out = null;
		switch($token) {
			case 'example_action':
				// [TODO] Output something
				$out = sprintf(">>> Output\n");
		return $out;
	public function runActionExtension($token, $trigger, $params, DevblocksDictionaryDelegate $dict) {
		switch($token) {
			case 'example_action':
				// [TODO] Do something


After message sent from group member
After message sent from worker event.mail.after.sent
Before composing a message reply event.mail.reply.pre.ui.worker
Before composing a new message event.mail.compose.pre.ui.worker
Before message sent by group member
Before message sent by worker event.mail.before.sent
Chat with portal visitor
Chat with worker
Custom API request event.api.custom_request
Dashboard get metric for widget event.dashboard.widget.get_metric
Dashboard render widget event.dashboard.widget.render
Data query datasource
Filter new incoming message
Form interaction event.form.interaction.worker
Get chat interactions for worker event.interactions.get.worker
Handle chat interaction with portal visitor
Handle chat interaction with worker
New JIRA issue wgmjira.event.issue.created
New comment on JIRA issue wgmjira.event.issue.commented
New comment on ticket in group
New contact registered in Support Center
New message added to ticket in group
New message added to ticket event.mail.received
New message on a watched ticket event.mail.received.watcher
New notification for me event.notification.received.worker
New status on JIRA issue wgmjira.event.issue.status.changed
New task created event.task.created.worker
Record changed event.record.changed
Record commented on event.comment.created.worker
Record custom behavior on JIRA issue event.macro.jira_issue
Record custom behavior on JIRA project event.macro.jira_project
Record custom behavior on bot
Record custom behavior on calendar event event.macro.calendar_event
Record custom behavior on calendar event.macro.calendar
Record custom behavior on call
Record custom behavior on contact
Record custom behavior on domain event.macro.domain
Record custom behavior on email address event.macro.address
Record custom behavior on feed item event.macro.feeditem
Record custom behavior on group
Record custom behavior on knowledgebase article event.macro.kb_article
Record custom behavior on message event.macro.message
Record custom behavior on notification event.macro.notification
Record custom behavior on opportunity event.macro.crm.opportunity
Record custom behavior on organization
Record custom behavior on reminder event.macro.reminder
Record custom behavior on sensor event.macro.sensor
Record custom behavior on server event.macro.server
Record custom behavior on task event.macro.task
Record custom behavior on ticket event.macro.ticket
Record custom behavior on time tracking entry event.macro.timetracking
Record custom behavior on worker event.macro.worker
Record editor opened event.ui.card.editor.opened.worker
Record worklist rendered event.ui.worklist.render.worker
Recurrent behavior event.behavior.recurrent
Respond to Ajax HTTP request event.ajax.request
Ticket assigned in group
Ticket closed in group
Ticket moved in group
Ticket profile viewed by a worker event.ticket.viewed.worker
Webhook received event.webhook.received
[DEPRECATED] During a message reply event.mail.reply.during.ui.worker