WorkflowService

Class finesse.workflow.WorkflowService

Provides an API which consists of methods that allow a gadget to submit the workflow task.

Example

Code Snippet
Copyvar containerServices = finesse.containerservices.ContainerServices.init();
workflowService = finesse.workflow.WorkflowService.init(containerServices);
var payload = {
    "dialogId": "email1",
    "mediaType": "email",
    "state": "EMAIL_READ",
    "taskVariables": {
        "from": "mme@cisco.com",
        "cc": "yyy@cisco.com"
    }
}
workflowService.submitTask(payload);

Methods

init(containerServices)

Initiates the WorkflowService and accepts finesse.containerservices.ContainerServices as a parameter.

Example
Code Snippet
Copyvar containerServices = finesse.containerservices.ContainerServices.init();
workflowService = finesse.workflow.WorkflowService.init(containerServices);

Parameters

Name

Type

Description

Required

ContainerServices

Function

Provides container level services for gadget developers. Gadgets can utilize the container dialogs and event handling to add or remove a service.

Yes

submitTask(payload)

Allows to trigger workflow for digital channels.

Example
Code Snippet
Copyvar payload = {
    "dialogId": "email1",
    "mediaType": "email",
    "state": "EMAIL_READ",
    "taskVariables": {
        "from": "mme@cisco.com",
        "cc": "yyy@cisco.com"
    }
}
workflowService.submitTask(payload);

Parameters

Name

Type

Description

Required

payload

Object

The action data of the JSON object as per the specification.

Yes

-->dialogId

String

Unique identifier of the dialog that helps in debugging an error. For example, dialogId, eventId, chatId and so on.

Yes

-->mediaType

String

The type of media under which the dialog is classified. For example, CHAT and EMAIL.

Yes

-->state

Enum

The workflow statuses are based on the task that is run.

Values for Unified CCX are:

  • CHAT

    • CHAT_PRESENTED

    • CHAT_ACCEPTED

    • CHAT_HANDLED

    • CHAT_DECLINED

    • CHAT_LEAVE

  • EMAIL

    • EMAIL_PRESENTED

    • EMAIL_READ

    • EMAIL_DISCARDED

    • EMAIL_REPLIED

    • EMAIL_FORWARDED

    • EMAIL_REQUEUED

Values for Unified CCE are:

  • TASK_OFFERED

  • TASK_ACCEPTED

  • TASK_ACTIVE

  • TASK_PAUSED

  • TASK_INTERRUPTED

  • TASK_CLOSED

Yes

-->taskVariables

Array

The corresponding value of the workflow name for the individual task. For example, the keys of the callVariables are callVariable name and callVariable value.

No