Key Takeaways
- Voice control provides a new and in some situations very appealing and convenient access to a webshop.
- As with many Azure and Microsoft platforms being in use today, Cortana is just a voice command away.
- Providing a Cortana skill to your customers adds well-wished services your customers might enjoy.
- The Intershop Commerce Management ships with all technological tools and interfaces needed for integrating Cortana skills into your webshop.
Voice Control
It does not seem far away when mobile applications first appeared. Being laughed at because of the tiny display and the not really appealing interfaces, it didn’t take long before the term Mobile First was coined. Mobile First wants us to ensure that the special role of mobile applications is to be considered in any strategic and technological decision we make. Thanks to responsive design technologies we have already forgotten about it and should better call our approaches now Mobile Only or maybe, All-Inclusive.
Voice control is not in any way different. Yes, Device, play my music list might not be the service we as customers urgently need. But the potential that this technology bears is enormous and has clear reasons. It is not surprising that Gartner [1] already by now states that voice control is one of the top ten technology trends in 2018. Yes, 2018, not 2020!
And, as I realized later: It’s fun to code, too.
Hands-free
One very convincing reason I find in all those numerous situations when we need or want to trigger an action but our hands are occupied. Just imagine yourself driving a car and being reminded of the flour you should better put on your shopping list. Obeying the laws of the road traffic act you either stop the car within the next minutes and take the note or you try to memorize it risking to forget it later and a potential disaster on your upcoming party which will now have to take place without your amazing cakes.
Think about a doctor operating a patients heart. Or anybody working with a heavy tool. While the hands are occupied, still some actions need to be triggered. A machine needs to be started or stopped, ingredients/medicine added or taken away.
Avoiding mental switches
I do not belong to any of above-mentioned professions. I am not a doctor, machine worker and seldom bake a cake. I develop software. Still, I see a similar and convincing reason within my daily work routine that I find attractive and interesting. We all know how much time it costs to mentally switch between activities. (Some say, more than twenty minutes, see [2] and [3] for interesting insights into true costs of mental switches). However, thoughts appear and actions have to be taken. In my opinion, if we could quickly say the needed action instead of having to open the respective program, to log on, to search for the right menu item, etc. we would clearly not fall into that trap of mental cost.
If I could say: Evernote, copy this first paragraph. inTRONICS add the Canon camera to my wishlist. Outlook, send eMail to Peter that the svn repository needs to be backed up. and then continue my work without much interruption – Cool! I would certainly use that.
The UseCase
Let us harness the power of Cortana and have her connected to the Intershop Commerce Management. I was thinking about a wish list that might allow the customer to store ideas and shopping items. Next time, the customer logs on, all those items are presented and can be directly put into the basket.

The Setup
Will it be hard to implement it? How much time will I need? Let us look at the following terms I discovered when reading about developing my first Cortana skill.
- Bot: Also known as an intelligent agent. A bot can be understood as a small program that is running in the cloud and can connect to a number of endpoints (or, channels in Azure terminology). Here you code (compute) your response.
- Channel: Any endpoint a bot can be connected with. Most important for us now: the Cortana channel.
- Bot Connector: Between the bot and the endpoint we find the bot connector. It defines the routing of the messages. If you use the Azure portal, it is all set up automatically when connecting your bot to the channel.
- Azure portal: While not needed for developing bots, I recommend to use the Azure portal for your first bot. The Azure cloud portal has a number of templates for bots to choose from making the start of the development easy. (
portal.azure.com
) - Knowledge Store: Here you define how the skill can be used: its display name, its invocator word (which wakes up the skill) and who can see and use your skill (
my.knowledge.store
)
The user wakes up the skill using the invocator word defined in the knowledge store. Then the bot connected to that channel and invocator computes the response with the help of data from the ICM.

The Implementation
Cortana
Actually, while you can develop your first bot also without the Azure portal, it greatly assists you. Just open your account, type in the search on top Web App Bot and create your first bot. The name is only technical nature, I used lunch_is_ready
. Azure recommends some templates, I would not go for the very simple template, rather one that has already some code for a simple conversation included.

Under Channels I connected my bot to the Cortana channel. Then I opened the knowledge store and defined who can see my bot (at least me, Publish to self
) and what display name (Wishlisting Skill
) and invocator word (Intronics
) shall be used.

That was a piece of cake, wasn’t it? All the magic happens then in the response, my bot’s code. So, I went back to the Azure portal and my created bot. Then I opened the code using Build | Open Online Code Editor. In the EchoDialog.cs
class I coded the response as follows
namespace Microsoft.Bot.Sample.SimpleEchoBot { [Serializable] public class EchoDialog : IDialog { public async Task MessageReceivedAsync(IDialogContext context, IAwaitable argument) { var message = await argument; string phrase = message.Text; string[] words = phrase.Split(' '); string introMessage = "Let me call the intronics store and add " + words[1] + " to your list."; string ret = string.Empty; // Here just calling via GET, replace with POST later HttpClient client = new HttpClient(); HttpResponseMessage response = await client.GetAsync("http://...TUNNELING.../INTERSHOP/rest/WFS/inSPIRED-inTRONICS-Site/-/wishlist/" + message.Text); if (response.IsSuccessStatusCode) { ret = await response.Content.ReadAsStringAsync(); } await context.PostAsync(introMessage + " Done. You will find all your wishlist items in your personal account. "); } ... }
As can be seen above, I just forward the second word (via word[1]
) to a REST server at the ICM. In other words, the user has to say something like: Cortana, use inTRONICS. Add canon to my wish list.
Then canon
will be sent to the ICM. There is surely room for improvement as the user might use a different phrase or more words. Here is where all the work starts when developing skills. Voice control is about playing with the possible sentences being said.
ICM
On the Intershop side, I need to provide the above-seen REST service. As mentioned already in other posts: The Intershop REST framework provides exactly what you need. There has been never an easier way to add REST services to your Intershop 7 installation than now. To complete above case, I only needed a simple resource class that expects the call from Cortana and places the item into the database.
@GET @Path("{" + "product" + ":[^/]*}") @Produces({ MediaType.APPLICATION_JSON, MediaType.TEXT_XML }) public AbstractResourceObject addProductToWishList(@PathParam("product") String product) { ApplicationBO applicationBO = applicationBOProvider.get(); WishlistBORepository boRepository = applicationBO.getRepository(WishlistBORepository.EXTENSION_ID); String productsku = .... String productspoken = product; String customerNo = .... WishlistBO wishlistBO = boRepository.createWishlistBO(productsku, productspoken, customerNo); WishlistRO wishlistRO = new WishlistRO(wishlistBO); return wishlistRO; }
Finally, I added a storefront component to make the stored wish list items visible to the customer. In this first attempt, I used a JavaScript call for getting the items and plain text for display.
you added the following products using Cortana. Here you can make modifications and add them to your shopping cart.<br> <span id="wishlistItems"> <script> (function() { var theDiv = document.getElementById("wishlistItems"); var all_items = "<ul>"; var url = "/INTERSHOP/rest/WFS/#CurrentDomain:DisplayName#/-/wishlist"; $.getJSON( url, { format: "json" }).done(function( data ) { $.each( data.elements, function( i, element ) {all_items += "<li>" + element.attributes[0].value + "</li>"; }); theDiv.innerHTML = all_items + "</ul>"; }); })(); </script>
Shall we try it?
This is Patricia Miller’s account by now. As you can see, she has already one item in her Cortana wishlist.

Let me use the simulator for calling Cortana. Patricia Miller just recalled that she needs to buy a Harry Potter book because she is invited to a birthday party.

Let’s go back to the storefront. Refresh! And here we have Patricia Miller’s account as it shows now the just added item to the wish list.

Perfect!
Where to go from here?
As with all other devices before, new patterns will arise. Some researchers argue that menus will be again flatter and that the power of voice will bring us more conversations with the tools rather than answers to one-command-requests. Thinking about the above-presented use case the logic could then be extended. As a very first step, we should extend the presentation of the wishlist. Below the text, I would hope to find suggested products with ready-made links to place those items in the cart. Cortana should also intend to start a follow-up conversation and ask whether another item should be added. Or, Cortana might inform about prices and upcoming promotions on similar product items. Or ask for the quantity and propose discounts.
Shall we do this together in one of our training classes?
Call the training department and secure your seat in one of the next sessions.
Intershop Technical Training
[1] https://www.gartner.com/smarterwithgartner/gartner-top-10-strategic-technology-trends-for-2018/
[2] Gabriela Motroc: And it’s gone —The true cost of interruptions, https://jaxenter.com/aaaand-gone-true-cost-interruptions-128741.html
[3] Gloria Mark, Daniela Gudith, Ulrich Klocke: The Cost of Interrupted Work: More Speed and Stress, https://www.ics.uci.edu/~gmark/chi08-mark.pdf