Class

ChatOrchestrator

ChatOrchestrator

Members

"AddToChatChannel" | "DeactivateChatChannel" | "LeaveChatChannel"

# static exports.ChatOrchestration

ChatOrchestration
Properties:
Name Type Description
AddToChatChannel "AddToChatChannel"
DeactivateChatChannel "DeactivateChatChannel"
LeaveChatChannel "LeaveChatChannel"

Methods

# static clearAllOrchestrations()

Clears / disables all orchestrations for chat
Example
import { ChatOrchestrator } from "@twilio/flex-ui";
ChatOrchestrator.clearAllOrchestrations();

# static getOrchestrations(event) → {Array.<ChatOrchestrator.ChatOrchestration>|ChatOrchestrator.ChatOrchestrationsCallback}

Get orchestrations or orchestrations callback for a reservation event
Parameters:
Name Type Description
event "accepted" | "wrapup" | "completed" to get orchestrations for
Array.<ChatOrchestrator.ChatOrchestration> | ChatOrchestrator.ChatOrchestrationsCallback
Example
import { ChatOrchestrator } from "@twilio/flex-ui";
ChatOrchestrator.getOrchestrations("accepted");

# static orchestrateCompleteTask(task) → {Promise.<boolean>}

Orchestrates Task complete action
Parameters:
Name Type Description
task ITask task to orchestrate
promise with boolean indicating if orchestration happened
Promise.<boolean>
Example
import { ChatOrchestrator } from "@twilio/flex-ui";
ChatOrchestrator.orchestrateCompleteTask(taskObject);

# static orchestrateWrapupTask(task) → {Promise.<boolean>}

Orchestrates Task wrapup action
Parameters:
Name Type Description
task ITask task to orchestrate
promise with boolean indicating if orchestration happened
Promise.<boolean>
Example
import { ChatOrchestrator } from "@twilio/flex-ui";
ChatOrchestrator.orchestrateWrapupTask(taskObject);

# static setOrchestrations(event, orchestrations)

Set orchestrations for a reservation event
Parameters:
Name Type Description
event "accepted" | "wrapup" | "completed" to get orchestrations for
orchestrations Array.<ChatOrchestrator.ChatOrchestration> | ChatOrchestrator.ChatOrchestrationsCallback to set for
Example
import { ChatOrchestrator } from "@twilio/flex-ui";
const orchestrationsCallback = (task) => {
  if (task.sid === "WT12345") {
     return [];
  }
};
ChatOrchestrator.setOrchestrations("accepted", orchestrationsCallback);

Type Definitions

# ChatOrchestrationsEvents

Properties:
Name Type Description
accepted Set.<ChatOrchestrator.ChatOrchestration> | ChatOrchestrator.ChatOrchestrationsCallback orchestrations for reservation accepted events
wrapup Set.<ChatOrchestrator.ChatOrchestration> | ChatOrchestrator.ChatOrchestrationsCallback orchestrations for reservation wrapup events
completed Set.<ChatOrchestrator.ChatOrchestration> | ChatOrchestrator.ChatOrchestrationsCallback orchestrations for reservation completed events

# ChatOrchestrationsCallback(task) → {Array.<ChatOrchestrator.ChatOrchestration>}

Callback that returns an array of orchestrations based on a task
Parameters:
Name Type Description
task ITask task
Array.<ChatOrchestrator.ChatOrchestration>