Writing Avaya Breeze Snap-Ins Using Engagement Designer — Part Six

Welcome to “An Introduction to Avaya Breeze Events,” the final installment in my introductory series of videos exploring Avaya Breeze™ from a development point of view.

My first three videos showed you how to create a simple Snap-in that made a call, played an announcement, collected a DTMF digit, and took action based on that digit. In Part 4 you saw how to intercept and process an incoming call. In Part 5 I presented the basics of cloud services integration.

In this video I tackle Breeze Events and extend the cloud discussion by showing you how web services can be used to invoke a Snap-in. This remote invocation is exactly what Jean Turgeon is speaking of in Enabling Smart Vertical Solutions in a Smart Digital World. This is where the rubber hits the road with Avaya Breeze.

The video series:

Part 1: Avaya Breeze Basics

Part 2: Avaya Breeze Workflow Properties

Part 3: Avaya Breeze Prompts and Gateways

Part 4: Avaya Breeze Call Intercept

Part 5: Web Services

Part 6: Snap-In Events and Remote Invocation


Andrew Prokop is the Director of Vertical Industries at Arrow Systems Integration. Andrew is an active blogger and his widely-read blog, SIP Adventures, discusses every imaginable topic in the world of unified communications. Follow Andrew on Twitter at @ajprokop, and read his blog, SIP Adventures.

Related Articles:

How-to’s: Introducing REST Web Services Capabilities of Avaya Breeze

With the Avaya Breeze Platform™ developers can easily create new and innovative communication solutions using telephony and HTTP(S)-based applications. With web service applications, REST (Representational State Transfer) has become the predominant design model for delivery of services. Avaya Breeze includes JAX-RS-based REST web service capabilities right out of the box. While there are a large number of freely available tutorials about creating JAX-RS-based REST web services, this blog gives a brief introduction to REST capabilities of Avaya Breeze.

REST APIs are designed around resources that are somewhat like Java classes, where each resource has a URI that references it. These resources can include create, read, update and delete (CRUD) requests using corresponding HTTP operations like GET, POST, PUT and DELETE. With JAX-RS, the implementation of REST is simplified through runtime annotations in your classes, which create helper classes and artifacts associated with your resources. These annotations include the notion of a base URI for your application, where you annotate your classes with the resource name that will follow that base URI.

Creating REST-based web services with Avaya Breeze is a snap. Applications running within the Avaya Breeze environment are called “Snap-ins” because new capabilities can be easily snapped into the environment as needed. Creating Snap-ins is a simple exercise thanks to Maven and the Avaya-provided archetype artifact that automatically generates the Java Snap-in project. Included in the generated project are functional examples of Snap-in invocation. These include classes supporting call processing, HTTP web service or web page, and of course a default JAX-RS based-REST web service using Jersey annotations. (Learn more about creating Snap-ins at Avaya DevConnect.)

For this blog, I’ve created a new Snap-in named BreezeRestExample. All of the classes generated by the archetype are located in the project’s WAR module where two classes, namely MyApplication and MyResource, constitute the Snap-in’s sample REST interface.

The MyApplication class below forms the base resource path for the Snap-in’s REST interface with the @ApplicationPath("/ws")annotation.

package com.avaya.BreezeRestExample;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
public class MyApplication extends Application
     //Don’t need to implement getClasses

The “/ws” value can be changed where the default Breeze REST path is:
http(s)://<IP Address or FQDN of the Breeze cluster>/services/<snap-in name>/ws/myResource.

But where is the “/myResource” portion of the URL actually defined? In the same folder, the MyResource class defines the Snap-in’s single REST resource using the JAX-RS @Path(“/myResource”) annotation. This resource includes the @GET annotation associating the doGet() method with HTTP GET operations. When invoked, the resource returns a simple “Hello World” string.

package com.avaya.BreezeRestExample;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
public class MyResource {
     public String doGet(){
           return “Hello World”;

Exercising the Snap-in’s sample web service resource can be done from your favorite Browser or REST client like Postman using the Snap-in’s full URI:
http(s)://<IP Address or FQDN of the Breezecluster>/services/BreezeRestExample/ws/myResource.
200 OK
Hello World!

Adding resources to the Snap-in’s web service is easy. Additional resource operations (like those supporting GET and POST) could be placed into the MyResource class, but this is an example class. Instead, creating classes that both define the resources, their paths, and capabilities delivered is likely a better choice. This practice is also aligned with Object Oriented Programming principals. Following the latter approach, I created the new class below called Message.

package com.avaya.BreezeRestExample;
import javax.enterprise.context.ApplicationScoped;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
public class Message {
      * String to store the Message of the Day.
      * */
  private String msgOfTheDay = “No message today”;
  public String getMessage(){
      return “The Message of the Day is: ” + msgOfTheDay;
  public String setMessage(@PathParam (“msgText”)String msgText) {
     msgOfTheDay = msgText;
     return “Got it! The New Message of the Day is: ” + msgOfTheDay;

You will notice familiar annotations in this the Message class, but also a few new annotations. First with the annotations already discussed, the Message class includes the @Path(“message/”) annotation forming a new URL to the Message class resource operations, defined later in the Class.

http(s)://<IP Address or FQDN of the Breezecluster>/services/BreezeRestExample/ws/message/

The first operation in our new resource can be found with the familiar @GET annotation that associates the public String getMessage() method with HTTP GET operations. This method returns a string value representing the Message of the Day. The msgOfTheDay String is a class member variable used to store the Message of the Day value between different REST requests.

You might ask, aren’t REST web services by nature stateless? Yes, the default scope of @Dependant is automatically used unless otherwise defined. With the @Dependant scope, the object exists to serve exactly one client (bean) and has the same lifecycle as that client (bean). (See Oracle, January 1, 2013. The Java EE 6 Tutorial, retrieved September 27, 2017, from https://docs.oracle.com/javaee/6/tutorial/doc/gjbbk.html.)

Since the Message of the Day string will need to persist between REST requests, the @ApplicationScoped annotation is used. This is declared just prior to the class definition allowing the class instance to be shared across all users’ of the web application, thereby functioning as a Singleton object. In addition, the application must contain a beans.xml file in the project’s WEB-INF folder forcing the web server (Websphere in this case) to scan the project for Contexts and Dependency Injection (CDI) annotations like @ApplicationScoped. For reference, the beans.xml file is listed below:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/
XMLSchema-instance" xsi:schemeLocation="http://java.sun.com/xml/ns/javaee http://
<!-- This is empty on purpose. -->

The second supported operation of our Message resource is defined by the @POST annotation. This associates the public String setMessage(@PathParam (“msgText”)String msgText) method with HTTP POST operations.

Included in this Resource’s operation is also a new @Path(“{msgText}”) annotation building upon the class’s URL specifying a required input parameter. The URL for this is http(s)://<IP Address or FQDN of the Breezecluster>/services/BreezeRestExample/ws/message/< some message text>

Again thanks to JAX-RS and the use of the @PathParam annotation in the setMessage() declaration, the <some message text> portion of the POST operation’s URL is automatically copied to the method’s local msgText variable.

Once received, the msgText is copied to the class’s msgOfTheDay variable, which as mentioned previously, is persisted between sessions because of the @ApplicationScoped annotation.

Testing our new Message resource, operations with a REST client like Postman produces the following results.

With GET operations prior to setting the Message of the Day string for the first time, the default “No message today” is returned:
http(s)://<IP Address or FQDN of the Breezecluster>/services/BreezeRestExample/ws/message.

200 OK
The Message of the Day is: No message today

POST operations that set the Message of the Day also confirm the input parameter passed in the request:
http(s)://<IP Address or FQDN of the Breezecluster>/services/BreezeRestExample/ws/message/Happy Halloween.

200 OK
Got it! The New Message of the Day is: Happy Halloween

Subsequent GET operations confirm the persistence of the Message of the Day string:
http(s)://<IP Address or FQDN of the Breezecluster>/services/BreezeRestExample/ws/message/
200 OK
The Message of the Day is: Happy Halloween

Finally, the last of the new annotations used in the Message class include @Produces(MediaType.TEXT_PLAIN) and @Consumes(MediaType.TEXT_PLAIN) which specify the MIME media types resources can produce and consume. In this example, we used text plain for simplicity where a litany of others can be used including APPLICATION_XML_TYPE , APPLICATION_JSON_TYPE and TEXT_HTML_TYPE depending on the requirements of your application. JAX-RS will automatically convert values to and from these formats to your class objects, which is a huge bonus.

While there is much more to explore in developing REST web services using JAX-RS, hopefully this example demonstrates how easy it is to create REST-based web services with Avaya Breeze.

Your Avaya Developer Journey Starts Here

STEM. Hackathons. Hour of Code. Oh, my…

I’ve been in the developer and ecosystem space pretty much my entire career, and I can’t recall a time when there was a greater focus on strengthening and expanding skills in software development with new audiences. I’m excited to see Avaya making such efforts across our Team and Customer Engagement portfolios with new and expanded APIs, toolkits, and supporting educational materials for Avaya Breeze, Avaya Oceana, and Avaya Vantage.

Start Your Own Journey—It’s Free!

Many of our customers are aware of the value of the DevConnect “Compliance Tested” designation used by our DevConnect Technology Partners to indicate the proven interoperability of their products. But you may not realize that DevConnect isn’t just a testing and partner program. It’s a full-fledged and open developer program for all types of developers looking to leverage Avaya technology. You can freely browse all our developer content and it takes just a few seconds to register when you want to download a specific SDK. And it doesn’t cost you anything to do this.

For example, we’ve added online developer documentation and code samples like integrating Desk Phone Services into custom applications using Avaya Breeze™ Client SDK, which applies to Android-based mobile devices. And to go alongside that, we’ve expanded our Forum Boards to include discussions on developing custom clients for the Avaya Vantage™ Device, as well as made available a full set of source code for a basic Vantage client using the Breeze Client SDK.

But Wait… There’s More!

With the introduction of the Avaya Breeze™ Platform and the Avaya Oceana™ Solution, Avaya’s made available even more resources for developers to leverage in the form of Avaya Collaboratory and the Avaya Snapp Store.

Avaya Collaboratory provides cloud-based, fully configured developer environments to support jump-starting your projects and evaluating the powerful capabilities of Avaya Breeze and the Avaya Breeze Client SDK. Whether building snap-ins using the Java SDK for Avaya Breeze, or learning to create complex workflows in Avaya Engagement Designer, a Collaboratory environment gives you a full Avaya Aura and Breeze software stack to play around with.

And if you’re looking for additional pre-build snap-ins or workflows, there’s the Avaya Snapp Store. Similar to the DevConnect Marketplace, the Snapp Store highlights a range of Avaya-build and third-party snap-ins for Avaya Breeze or Avaya Oceana environments. Some snap-ins can even be purchased directly from the Snapp Store itself, so you can drop them into your own Collaboratory or Breeze environment in a matter of minutes.

And There’s Even More Coming

We’ve been running some very successful hackathon events around Avaya Breeze, Vantage, and Zang in the past few months, so keep your eyes open for more opportunities to get hands on with new Avaya offers. Note that Avaya Learning has introduced a variety of training courses specifically aimed at Breeze. There are also courses for Avaya Breeze Client SDK developers—on Android and Windows and on iOS and macOS, so Avaya developers can continue to build skills on these new and powerful products.

Keep watching the Avaya Developer blog for deeper insights from key technical leads for many of these products, as well as insight into how our customers and partners are leveraging these new technologies through their own application development efforts.

And even if you aren’t yet ready for the latest and greatest of what Avaya has to offer, visit the DevConnect portal—you may be surprised by what you’ll find for the Avaya products you’re currently using.

Keep Up as our Avaya Equinox Team Member Races for Youth Mental Health

I’m still totally stoked about the energy and enthusiasm at Avaya Engage earlier this year. It was exciting to introduce the Avaya Equinox™ experience and our rich Avaya Breeze™ platform developer tools. We are truly enabling limitless possibilities for workplace automation, and completely transforming how we connect employees to their businesses.

While at Avaya Engage, I was particularly touched by an incredible story from an incredible Avayan, Kirk Jones. Many of you already know Kirk as the Avaya Equinox solution guru. Leading initial implementations, he shares his vast knowledge of deploying the full stack in customer and cloud environments. What I was not aware of is the energy and enthusiasm he is dedicating in his personal life to realize his dreams and benefit youth mental health. Kirk is preparing to participate in September’s 2017 Targa Newfoundland 1700 Km car rally at blistering speeds along closed city streets and municipal highways—while raising money and awareness for youth mental health.

When Kirk’s daughter was recovering from a skiing accident, he developed first-hand knowledge about the challenges faced by children and teens needing help. “The issue is there are not enough resources for parents with children dealing with mental health issues. Unless your situation is critical or life-threatening, it is difficult to get the support you need,” Kirk told me.

Kirk does not like to do things small, and this is no exception. He’s established an official charity for his cause and set the fundraising goal to $100,000! He is building a new race car from the ground up while seeking sponsors—not to pay for the car, but to contribute to his charity. The racing community has already started to come together during the build process, with big name sponsors like Volkswagen stepping up and supporting Kirk’s mission.

I was blown away by Kirk’s extreme dedication to the success of Avaya Equinox, and now he’s applying the same level of commitment and dedication to his racing benefit for youth mental health. For Kirk, even if he helps only one child, it will all be worth it. It seemed to me that for him no goal is too high, no challenge too hard. How could I help? As I told this story to other Avayans, the ideas kept flowing. We have such cool technology at Avaya and have shown we can completely change the fan experience in Sports and Entertainment—so why not make Kirk’s racing journey more accessible and engaging for those who watch and donate?

We will enhance the donor experience by combining the Internet of Things (IoT) and Avaya Breeze workflow automation with Zang™ Cloud, our robust communication platform-as-a-service. We’ll create a workflow to give contributors real-time updates while Kirk races. It will be easy and amazing, and it is all possible using simple Avaya workflows.

In upcoming blogs, as we lead up to the Targa Newfoundland car rally, I will be posting updates on this incredible story and sharing more about how we’re implementing the IoT workflow project. But the real story is about helping children and teens in need—I’ll keep you posted on progress there as well.

This story makes me proud to be an Avayan. We have so many great people, doing great things to make the world a better place. Learn more about Kirk’s journey on his website, and be sure to Like the Facebook page. You can even make a donation to the Race for Mental Health Fund. Until next time, it would be great to hear from you. Follow me @Paul_Relf, and follow this story on social #RealAvayaStories