Genpact Cora Knowledge Center

Support

Create Custom Conversation Type

V9.4

Overview

Cora SeQuence provides an option to extend the system conversation types, and add any custom conversation type to Cora SeQuence Solution. These types are added to the Conversations table by default, just by creating and configuring them as below.

Creating custom types

For each type, follow the steps below:

  1. Create a new VS project, using the Class Library (.NET Framework).
  2. Right-click the newly created project, and select NuGet Packages.
    Make sure to have the Cora SeQuence NuGets repository as a Package source.
  3. Click Browse, and search for Conversations.
  4. Install the latest version of Genpact.CoraSeQuence.Converstaions NuGet.
  5. Add a new class to the project, and rename it with a meaningful name.
  6. Set the class to inherit from the ConversationItem class.
    For example, new type called “Request”, will be created in a new file, class name RequestConversationItem that inherits from ConversationItem.
  7. Add property to the newly created class:
    public override string ItemType => <Your type name>

  8. The base ConversationItem class, has the following default properties:
    • CreationDate
    • LastStateDate
    • State
    • Title
    • Body
    • WorkflowInstanceId
    • MasterWFInstanceId
  9. To add any extended property, you can add the property to the class.
    1. Mention the following JsonObject:
    2. Add values to JsonProperty.
    3. Add IgnoreDataMember as value for a property that you don’t want to display in the built-in-command while creating a new instance of the conversation items.

    4. The get and set functions extracts and saves the properties from the propertyBag.
  10. Add customer folders to the shared resources 

    1. Under Components > Conversations folder, create a new folder with the same name as the custom item.
    2. In the folder add a Json file, metadata.json
      • itemType: full type
      • name: unique type name with no spaces. Should be same as the folder name.
      • displayName: text that will appear in the view
      • supportsAttachments: determines whether the item can support attachments or not
      • supportsUICreation: determines whether the Add new action button be created for this item or not
        Example:
        {
         "itemType": "PNMsoft.Sequence.Conversations.EmailConversationItem, PNMsoft.Sequence.Conversations, Version=9.0.0.0, Culture=neutral, PublicKeyToken=0a1a1b90c1c5dca1",
          "name": "Email",
          "displayName":  "Email",
          "supportsAttachments": true,
          "supportsUICreation": true
        }
    3. Create the following templates in the folder:
      • Inline.html
      • Expanded.html
      • Api.js
      • Styles.css
        NOTE
        In order to edit the Kendo html templates, see this page.
    4. Add the relevant icons to the Images folder.
  11. Create a NuGet package, and use the package in the custom app.
  12. In the nuspec file, add the following line to copy the static content to the correct location.
    <file src="folderofstaticcontent\*.*" target="tools\Shared Resources\Components\Conversations\TypeName" />