Skip to content

Commit

Permalink
Merge pull request #6 from tompaana/development
Browse files Browse the repository at this point in the history
The second pre-release snapshot
  • Loading branch information
tompaana authored Aug 29, 2017
2 parents 892d64d + a062795 commit bffbb91
Show file tree
Hide file tree
Showing 13 changed files with 238 additions and 307 deletions.
6 changes: 3 additions & 3 deletions BotMessageRouting/BotMessageRouting.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Storage, Version=8.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\WindowsAzure.Storage.8.3.0\lib\net45\Microsoft.WindowsAzure.Storage.dll</HintPath>
<Reference Include="Microsoft.WindowsAzure.Storage, Version=8.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\WindowsAzure.Storage.8.4.0\lib\net45\Microsoft.WindowsAzure.Storage.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
Expand Down Expand Up @@ -108,7 +108,7 @@
<Compile Include="MessageRouting\IMessageRouterResultHandler.cs" />
<Compile Include="MessageRouting\MessageRouterManager.cs" />
<Compile Include="MessageRouting\MessageRouterResult.cs" />
<Compile Include="Models\EngageableParty.cs" />
<Compile Include="Models\PartyWithTimestamps.cs" />
<Compile Include="Utils\MessagingUtils.cs" />
<Compile Include="Models\Party.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down
6 changes: 3 additions & 3 deletions BotMessageRouting/BotMessageRouting.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
<package >
<metadata>
<id>Underscore.Bot.MessageRouting</id>
<version>0.9.0.0</version>
<version>0.9.2.0</version>
<title>Bot Message Routing component</title>
<authors>See README on project website</authors>
<authors>Tomi Paananen et al. (see README on project website)</authors>
<owners>Tomi Paananen</owners>
<licenseUrl>https://github.com/tompaana/bot-message-routing/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/tompaana/bot-message-routing</projectUrl>
<!-- <iconUrl>http://ICON_URL_HERE_OR_DELETE_THIS_LINE</iconUrl> -->
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Message routing component for chatbots built with Microsoft Bot Framework C# SDK</description>
<releaseNotes>This is the first release.</releaseNotes>
<releaseNotes>This is the second pre-release.</releaseNotes>
<copyright>Copyright 2017 Microsoft</copyright>
<tags>chatbot chatbots bot bots messaging message routing</tags>
</metadata>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public bool AddAggregationParty(Party party)
throw new NotImplementedException();
}

public MessageRouterResult AddEngagementAndClearPendingRequest(Party conversationOwnerParty, Party conversationClientParty)
public MessageRouterResult ConnectAndClearPendingRequest(Party conversationOwnerParty, Party conversationClientParty)
{
throw new NotImplementedException();
}
Expand All @@ -61,7 +61,7 @@ public void DeleteAll()
throw new NotImplementedException();
}

public string EngagementsAsString()
public string ConnectionsToString()
{
throw new NotImplementedException();
}
Expand All @@ -71,7 +71,7 @@ public Party FindBotPartyByChannelAndConversation(string channelId, Conversation
throw new NotImplementedException();
}

public Party FindEngagedPartyByChannel(string channelId, ChannelAccount channelAccount)
public Party FindConnectedPartyByChannel(string channelId, ChannelAccount channelAccount)
{
throw new NotImplementedException();
}
Expand Down Expand Up @@ -101,7 +101,7 @@ public IList<Party> GetBotParties()
throw new NotImplementedException();
}

public Party GetEngagedCounterpart(Party partyWhoseCounterpartToFind)
public Party GetConnectedCounterpart(Party partyWhoseCounterpartToFind)
{
throw new NotImplementedException();
}
Expand All @@ -121,7 +121,7 @@ public bool IsAssociatedWithAggregation(Party party)
throw new NotImplementedException();
}

public bool IsEngaged(Party party, EngagementProfile engagementProfile)
public bool IsConnected(Party party, ConnectionProfile connectionProfile)
{
throw new NotImplementedException();
}
Expand All @@ -131,7 +131,7 @@ public bool RemoveAggregationParty(Party party)
throw new NotImplementedException();
}

public IList<MessageRouterResult> RemoveEngagement(Party party, EngagementProfile engagementProfile)
public IList<MessageRouterResult> Disconnect(Party party, ConnectionProfile connectionProfile)
{
throw new NotImplementedException();
}
Expand Down
47 changes: 23 additions & 24 deletions BotMessageRouting/MessageRouting/DataStore/IRoutingDataManager.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
using Microsoft.Bot.Connector;
using System;
using System.Collections.Generic;
using Underscore.Bot.Models;

namespace Underscore.Bot.MessageRouting.DataStore
{
/// <summary>
/// Defines the type of engagement:
/// - None: No engagement
/// Defines the type of the connection:
/// - None: No connection
/// - Client: E.g. a customer
/// - Owner: E.g. a customer service agent
/// - Any: Either a client or an owner
/// </summary>
public enum EngagementProfile
public enum ConnectionProfile
{
None,
Client,
Expand All @@ -37,7 +36,7 @@ public interface IRoutingDataManager
/// </summary>
/// <param name="newParty">The new party to add.</param>
/// <param name="isUser">If true, will try to add the party to the list of users.
/// If false, will try to add it to the list of bot identities.</param>
/// If false, will try to add it to the list of bot identities. True by default.</param>
/// <returns>True, if the given party was added. False otherwise (was null or already stored).</returns>
bool AddParty(Party newParty, bool isUser = true);

Expand Down Expand Up @@ -98,38 +97,38 @@ bool AddParty(string serviceUrl, string channelId,
bool RemovePendingRequest(Party party);

/// <summary>
/// Checks if the given party is engaged in a 1:1 conversation as defined by the engagement
/// profile (e.g. as a customer, as an agent or either one).
/// Checks if the given party is connected in a 1:1 conversation as defined by
/// the connection profile (e.g. as a customer, as an agent or either one).
/// </summary>
/// <param name="party">The party to check.</param>
/// <param name="engagementProfile">Defines whether to look for clients, owners or both.</param>
/// <returns>True, if the party is engaged as defined by the given engagement profile.
/// <param name="connectionProfile">Defines whether to look for clients, owners or both.</param>
/// <returns>True, if the party is connected as defined by the given connection profile.
/// False otherwise.</returns>
bool IsEngaged(Party party, EngagementProfile engagementProfile);
bool IsConnected(Party party, ConnectionProfile connectionProfile);

/// <summary>
/// Resolves the given party's counterpart in a 1:1 conversation.
/// </summary>
/// <param name="partyWhoseCounterpartToFind">The party whose counterpart to resolve.</param>
/// <returns>The counterpart or null, if not found.</returns>
Party GetEngagedCounterpart(Party partyWhoseCounterpartToFind);
Party GetConnectedCounterpart(Party partyWhoseCounterpartToFind);

/// <summary>
/// Creates a new engagement between the given parties. The method also clears the pending
/// Creates a new connection between the given parties. The method also clears the pending
/// request of the client party, if one exists.
/// </summary>
/// <param name="conversationOwnerParty">The conversation owner party.</param>
/// <param name="conversationClientParty">The conversation client (customer) party.</param>
/// <returns>The result of the operation. The expected result type, when successful, is EngagementAdded.</returns>
MessageRouterResult AddEngagementAndClearPendingRequest(Party conversationOwnerParty, Party conversationClientParty);
/// <returns>The result of the operation. The expected result type, when successful, is Connected.</returns>
MessageRouterResult ConnectAndClearPendingRequest(Party conversationOwnerParty, Party conversationClientParty);

/// <summary>
/// Removes an engagement(s) of the given party i.e. ends the 1:1 conversations.
/// Removes connection(s) of the given party i.e. ends the 1:1 conversations.
/// </summary>
/// <param name="party">The party whose engagements to remove.</param>
/// <param name="engagementProfile">The engagement profile of the party (owner/client/either).</param>
/// <returns>A list of operation results. The expected result types, when successful, are EngagementRemoved.</returns>
IList<MessageRouterResult> RemoveEngagement(Party party, EngagementProfile engagementProfile);
/// <param name="party">The party whose connections to remove.</param>
/// <param name="connectionProfile">The connection profile of the party (owner/client/either).</param>
/// <returns>A list of operation results. The expected result types, when successful, are Disconnected.</returns>
IList<MessageRouterResult> Disconnect(Party party, ConnectionProfile connectionProfile);

/// <summary>
/// Deletes all existing routing data permanently.
Expand Down Expand Up @@ -180,12 +179,12 @@ bool AddParty(string serviceUrl, string channelId,
Party FindBotPartyByChannelAndConversation(string channelId, ConversationAccount conversationAccount);

/// <summary>
/// Tries to find a party engaged in a conversation.
/// Tries to find a party connected in a conversation.
/// </summary>
/// <param name="channelId">The channel ID.</param>
/// <param name="channelAccount">The channel account.</param>
/// <returns>The party matching the given details or null if not found.</returns>
Party FindEngagedPartyByChannel(string channelId, ChannelAccount channelAccount);
Party FindConnectedPartyByChannel(string channelId, ChannelAccount channelAccount);

/// <summary>
/// Finds the parties from the given list that match the channel account (and ID) of the given party.
Expand All @@ -198,9 +197,9 @@ bool AddParty(string serviceUrl, string channelId,

#region Methods for debugging
#if DEBUG
/// <returns>The engagements (parties in conversation) as a string.
/// Will return an empty string, if no engagements exist.</returns>
string EngagementsAsString();
/// <returns>The connections (parties in conversation) as a string.
/// Will return an empty string, if no connections exist.</returns>
string ConnectionsToString();

string GetLastMessageRouterResults();

Expand Down
Loading

0 comments on commit bffbb91

Please sign in to comment.