The document discusses using Alfresco Process Services (APS) to manage processes triggered by Internet of Things (IoT) devices. APS can provide capabilities like device provisioning, decoupling process logic from event handling, and analytics on process activities triggered by IoT events. The document presents an architecture where IoT devices publish messages via MQTT and AWS IoT, which can trigger Lambda functions to start APS processes. APS can then update IoT device shadows stored in AWS IoT to communicate back to devices. This allows processes to manage state changes even if devices disconnect. Tools like Cloud9 and AWS IoT MQTT Client help develop and test IoT/APS integrations.
2. Learn. Connect. Collaborate.
What is the
Internet of
Things?
According to Wikipedia:
“The Internet of things (IoT) is the network of
physical devices, vehicles, home appliances and
other items embedded with electronics, software,
sensors, actuators, and network connectivity
which enables these objects to connect and
exchange data.”
According to Bruce Schneier:
“We're building a world-sized robot, and we don't
even realize it.”
3. Learn. Connect. Collaborate.
It’s big, and
it’s growing
• According to Gartner
– 8.4 billion IoT devices connected in 2017
– 20.4 billion devices by 2020
– $2T in spending in 2017 on hardware and
services
Install base by year, in millions of units
4. Learn. Connect. Collaborate.
Our use case – SmarterBirmingham
• Citizen run citywide IoT project, built on open source hardware and software
• Pilot device - Environmental monitoring and related actions
6. Learn. Connect. Collaborate.
APS for IoT?
Why?
• Device provisioning
– For those cases where a defined process
should be followed to register / deregister a new
“thing”
• Decoupling process management from event
handling
– IoT events start processes, process logic is
neatly isolated from the IoT event handler
– Processes send signals back to IoT devices
where necessary
• Provides analytics of process level activities
triggered by IoT devices.
• Ability to evolve process without affecting in
flight instances
• Puts process logic where it belongs, in a
process!
8. Learn. Connect. Collaborate.
The Amazon Option
AWS IoT
The Open Source Option
Eclipse Mosquitto
AWS IoT: A complete IoT platform covering security and authentication, device
registry, MQTT broker, and simple hooks into other AWS platform services.
Mosquitto: A MQTT broker only, for roll your own applications.
11. Learn. Connect. Collaborate.
Starting an APS process from AWS IoT via Lambda
• IoT rule triggers action on message receive
• Action calls a Lambda function
• Lambda function calls APS REST API to start process
• Two ways to accomplish this in multiple languages
alfresco-js-api
• Works with Node.js Lambda
runtime
• Useful DBP level abstractions
Direct REST call
• Available across all Lambda
runtimes (Node.js, Python, Java,
.NET)
12. Learn. Connect. Collaborate.
Introducing
Thing
Shadows
• IoT applications present unique challenges
– Devices are not always connected
– Devices may come on / offline unpredictably
– Desired state may not match current state
Device (or thing) shadows are the AWS IoT
solution to this problem!
13. Learn. Connect. Collaborate.
AWS IoT device shadows
• Using IoT shadows solves the APS -> IoT message problem
• Shadows can be updated via HTTPS, which means we don’t have to
extend APS to talk MQTT
Current State
Desired State
DeltaSend / receive
state updates
(via MQTT)
Update / poll
device shadow
(via HTTPS)
Device Shadow in AWS
14. Learn. Connect. Collaborate.
Updating IoT device shadows from APS
• Achieved by using the APS REST call task
• URL format:
– <identifier>.iot.<region>.amazonaws.com/things/<thingname>/shadow
• Updates are not guaranteed to be applied immediately
• Shadow deltas show the difference between the desired state and current
state
19. Learn. Connect. Collaborate.
• Complete web based IDE
• Easy integration with AWS
services, including Lambda
• Import Lambda function, run
and test locally, two click
export back to AWS
• Real breakpoints and other
debugging features for AWS
Lambda functions
Cloud9 – The easiest way to build for IoT + APS
The IoT wave is here, it’s only a matter of time before you touch this stuff as a dev
This is the only business related slide in this deck, I promise.
The IoT wave is here, it’s only a matter of time before you touch this stuff as a dev
This is the only business related slide in this deck, I promise.
Direct device -> APS via HTTP
Device -> MQTT Broker -> APS
APS -> MQTT Broker -> Device
Direct device -> APS via HTTP
Device -> MQTT Broker -> APS
APS -> MQTT Broker -> Device
Direct device -> APS via HTTP
Device -> MQTT Broker -> APS
APS -> MQTT Broker -> Device
For our use case, we can’t afford an up front investment in hardware to try to roll our own platform. AWS IoT gets us off the ground for nearly zero cost.
There is currently no direct AWS IoT action to call a REST API. Easiest way to do this is via a Lambda function