- Avaya DevConnect

TRIGGERING ENGAGEMENT
DESIGNER WORKFLOWS WITH
CUSTOM HTTP EVENTS
Joel Ezell
© 2015 Avaya Inc. All right reserved
A PERVASIVE BUSINESS PROBLEM: ORCHESTRATING A
HUMAN RESPONSE TO AN EVENT OF INTEREST
 Many systems are able to detect / generate events when a human response is
required. Examples
– A system has detected a malfunction that requires attention
– Inventory is running low
– Internet of Things (IoT) will vastly expand the use cases
 Most of those systems have limited ability to orchestrate a proper human
response
– Many have email capabilities.
– Some have SMS capabilities
– Few if any can match the flexibility of Engagement Designer and Avaya Breeze™ in this
respect
© 2015 Avaya Inc. All right reserved
2
AVAYA BREEZE™ IS THE IDEAL COMPLEMENT TO AN
ENTERPRISE ECOSYSTEM
Analytics
ESB
Big Data
Optional
Event
Responders
Breeze
Context
Store
Call
SMS
Email
Video Conf
IM
Engagement
Designer
Orchestration
Events
Agent
Selection
Optional
© 2015 Avaya Inc. All right reserved
Backend
Systems
Internet of
Things
3
DIFFERENT PERSONAS TO CONSIDER
 Those that can raise events
– Third party ISVs / products (inclusive of IOT) that want to Breeze-enable their products
– IT staff that can extend back end systems to POST events to Breeze / ED
 Those that know what human response is required for events
– Business Analysts working for Avaya’s customers
© 2015 Avaya Inc. All right reserved
4
USE CASE: LOW INVENTORY EVENT
 Inventory has run low on a critical component
– The system doesn’t know what human response is required, and has no inherent
communication capabilities
– The IT expert for the inventory system doesn’t know what human response is required
– Inventory system is configured to send a REST message when inventory has run low.
 A Business Analyst has crafted a workflow to respond to this low inventory
event
– Emails sent to customers notifying them that deliveries may be delayed
– SMS sent to manufacturing leads notifying them of the shortage
– Video conference initiated between sourcing and supplier to understand why the
expected shipment hasn’t arrived
© 2015 Avaya Inc. All right reserved
5
6 STEPS TO DESIGNING A SOLUTION TO THE LOW
INVENTORY EVENT
1. Define the event contents
2. Populate the event in the Engagement Designer event catalog
3. Design a simple workflow to respond to the event
4. Test the workflow using Postman (or similar)
5. Enhance the inventory system to send an HTTP POST message with the
proper format when inventory runs low
6. Design the real workflow to respond to the event. Iterate as needed.
– The real workflow will often be designed by a different person (maybe even a different
company) than the developer that did 1-5.
© 2015 Avaya Inc. All right reserved
6
STEP 1: DEFINE THE EVENT CONTENTS
 Every event has a Family, a Type, and a Version
 Let’s define a Family with 2 Types
– Event Family: “Low Inventory”
– Event Types:
– “Low Inventory Alert”
– “Adequate Inventory Restored”
– Both use the same version 1 of the “Inventory” Schema
 Information included in each event
– Description
– Manufacturer
– Part number
– Inventory count
© 2015 Avaya Inc. All right reserved
7
STEP 2: POPULATE THE EVENT IN THE ENGAGEMENT
DESIGNER EVENT CATALOG
2A: Open Engagement Designer Admin Console
2B: Click on Event Catalog tab, then Create
© 2015 Avaya Inc. All right reserved
8
STEP 2: POPULATE THE EVENT IN THE ENGAGEMENT
DESIGNER EVENT CATALOG (CONT.)
2C: Enter Family, Type, Version and Schema Name, then click “JSON Schema Editor”
Family and Type must not
have spaces. No such
restrictions on Display
Names for Family and Type.
© 2015 Avaya Inc. All right reserved
9
STEP 2: POPULATE THE EVENT IN THE ENGAGEMENT
DESIGNER EVENT CATALOG (CONT.)
2D: Enter object name, click “+”
then “Add XXX” for each element
© 2015 Avaya Inc. All right reserved
2E: After all have been successfully
added, click “OK”
10
STEP 2: POPULATE THE EVENT IN THE ENGAGEMENT
DESIGNER EVENT CATALOG (CONT.)
2F: Select the contents of the Schema box, copy to clipboard, then click OK
© 2015 Avaya Inc. All right reserved
11
STEP 2: POPULATE THE EVENT IN THE ENGAGEMENT
DESIGNER EVENT CATALOG (CONT.)
2G: Repeat the same process for the “Adequate Inventory Reached” event, except that you
can click in the “Schema” box and paste the schema from the Low Inventory Alert event.
© 2015 Avaya Inc. All right reserved
12
STEP 2: POPULATE THE EVENT IN THE ENGAGEMENT
DESIGNER EVENT CATALOG (CONT.)
2H: Gaze with satisfaction upon the events that you’ve successfully entered into the catalog.
© 2015 Avaya Inc. All right reserved
13
STEP 3: DESIGN A SIMPLE WORKFLOW TO RESPOND TO
THE EVENT
3A: Open Engagement Designer “Designer Console URL”
3B: Double Click on your
Start Event. Set Event family
to LowInventory, Event type to
LowInventoryAlert, Event
version to 1.
© 2015 Avaya Inc. All right reserved
14
STEP 3: DESIGN A SIMPLE WORKFLOW TO RESPOND TO
THE EVENT
3C: Click on “Output Mapping”
3D: Note that all of the elements defined
in your event type are available for use in
your workflow. They can be used
individually or composed into a single
string (next slide).
© 2015 Avaya Inc. All right reserved
15
STEP 3: DESIGN A SIMPLE WORKFLOW TO RESPOND TO
THE EVENT
3E: Create a link between the
Inventory Object and an
InventoryMessage variable
(creation of this variable not
shown).
3F: Use the Expression Editor to compose
the various elements in the event into a
single string. Elements can be added to
the expression simply by clicking on them.
NOTE: These steps are optional and are
entirely dependent on the desired response
to the event. Some workflows will just use
the individual elements of the event without
any sort of composition such as this.
© 2015 Avaya Inc. All right reserved
16
STEP 3: DESIGN A SIMPLE WORKFLOW TO RESPOND TO
THE EVENT
3G: Drag a Send Text Message task and End Event onto your canvas.
© 2015 Avaya Inc. All right reserved
17
STEP 3: DESIGN A SIMPLE WORKFLOW TO RESPOND TO
THE EVENT
3H: Double Click on Send Text
Msg task. Populate
Sender/Recipient phone
numbers then click on Input
Mapping.
3I: Create a mapping between the InventoryMessage
and the smsBody. Click OK a few times, then save and
deploy your workflow!
© 2015 Avaya Inc. All right reserved
18
BRIEF INTERLUDE: A BRIEF INTRODUCTION TO
EVENTING FRAMEWORK PUBLISHING VIA HTTPS
 Eventing Framework was defined to support freeform message bodies of any
format
 Eventing Framework also requires each event to include some metadata.
Minimally, event family, type and version must be specified.
 In order to allow for a freeform message body and also support metadata,
multipart MIME was chosen as the format for the HTTP POST messages
when publishing events.
 family, type, version, eventBody are the names of the 4 required parts of an
event POST message
 Additional metadata can be provided with parts that are named “metadataXXXX” (e.g. “metadata-user”)
© 2015 Avaya Inc. All right reserved
19
STEP 4: TEST THE WORKFLOW USING POSTMAN (OR
SIMILAR)
4A: Download Postman from Google Store
4B: Populate the URL with
http://myBreezeServer.example.com/services/EventingConnector/events. Click on “Body”.
© 2015 Avaya Inc. All right reserved
20
STEP 4: TEST THE WORKFLOW USING POSTMAN (OR
SIMILAR)
4C: Using the default “form-data” body type, populate the family, type, version and eventBody
parts. Use something like this for the eventBody: {"Description":"Widgets",
"Manufacturer":"Widgets, Inc.", "PartNumber":"123456789",
"InventoryCount":"5","CountAsString":"5"}
© 2015 Avaya Inc. All right reserved
21
STEP 4: TEST THE WORKFLOW USING POSTMAN (OR
SIMILAR)
4D: Push the Send button and receive the SMS message on your phone!
© 2015 Avaya Inc. All right reserved
22
GET A JUMP ON STEP 5 WITH POSTMAN CODE
GENERATION
Postman can helpfully generate code
in 16 different languages to send your
event!
© 2015 Avaya Inc. All right reserved
23