Building a Personalized Communication Platform using Open Standards

Created by Nick Van den Bleeken / @nvdbleek / Inventive Designers


  • What is a Personalized Communication Platform?
  • Which standards are used in the platform?
    • What is its purpose in the platform?
    • What extensions were required?
    • What were the challenges?
    • Which implementation is used?
  • Conclusion

What is a Personalized Communication Platform?

Create unique and engaging communications

Document icon iPad icon iMac icon Twitter icon


Printed document









Have full overview of all communications

  • What is sent when?
  • Is it delivered/opened?
  • Did the addressee interact with it and how?
Presentation icon

All types of communications

  • High-volume batch
  • On-demand
  • Interactive
Group icon Presonal icon Form icon

Which standards are used in the platform?


  • XML
  • XQuery and XQuery update facility
  • XSLT
  • XSL-FO
  • XForms


  • All data is XML
  • Easily transformed, merged and enriched
  • Pushed in the platform (folder drop, SOAP/REST endpoint)
  • Pulled by the platform (XQuery, SOAP/REST call)
XML icon


SCXML diagram

SCXML code

<scxml xmlns="" xmlns:my=""
       version="1.0" initial="select-channel">
    <data id="communication.preference" expr="email" />
    <data id="email.address" />

  <state id="select-channel">
      <if cond="${communication.preference eq 'email' && not empty email.address}">
        <transition target="email" />
          <transition target="print" />

  <state id="email" initial="mail">
      <data id="email.retrycount" expr="${-1}" />
    <state id="mail">
        <my:channel type="mail" />
      <transition event="channel.mail.success" target="sent" />
      <transition event="channel.mail.error" target="print" />
    <state id="sent">
        <assign id="email.retrycount" expr="${email.retrycount + 1}" />
        <send id="mailed-timer" event="'schedule.timeout.response-timer'"
          delay="'2d'" />
      <transition event="" target="email-read" />
      <transition event="email.hardbounce" target="print" />
      <transition event="email.softbounce" target="soft-bounce" cond="${email.retrycount lte 3}" />
      <transition event="email.softbounce" target="print" cond="${email.retrycount gt 3}" />
      <transition event="schedule.timeout.response-timer"
        target="print" />
        <cancel sendid="mailed-timer" />
    <state id="soft-bounce">
        <send id="retry-timer" event="'email.retry'" delay="'12h'" />
      <transition event="retry-timer" target="mail" />
        <cancel sendid="retry-timer" />
    <final id="" />

    <transition event="error" target="print" />
    <transition event="" target="exit" />

  <state id="print">
      <my:channel type="print" />
    <transition target="exit" />
  <final id="exit" />

SCXML extensions

  • Custom action: 'Send Communication'
    • Specify channel (print, e-mail, SMS, ...)
    • Delivery intervals
    • Expiration date
    • Sends back status information as events
Jigsaw icon

SCXML challenges

  • State machines stay alive for weeks
  • Implemented highly available event dispatcher:
    • Clustering of multiple servers
    • Automatic load balancing
Gym icon

SCXML implementation

  • Apache commons SCXML
  • Modifications:
    • Custom action: 'Send Communication'
    • Highly available event dispatcher
Feather icon

XQuery and XQuery update facility

  • Retrieve personalization data
  • Retrieve data for management UI
  • Store runtime information about communication
Search icon

XQuery sample queries

declare variable $sub-job-id as xs:string external;
declare variable $client-number as xs:string external;
declare variable $unit-status as xs:string external;
for $unit in /job/subJobs[@id = $sub-job-id]/unit
    [(contains(lower-case(@client-number), lower-case($client-number))
      and ($unit-status = 'all' or @status = $unit-status)]
order by $unit/@creation-date descending
return  element unit {$unit/@* }

XQuery extensions

  • None
Jigsaw icon

XQuery challenges

  • Customers prefer to store data in relational DB
  • Work around database quirks (eg: empty string Oracle)
  • One relational query for performance
  • Ongoing effort to support more of the XQuery spec
  • XQuery knowledge is not common
Gym icon

XQuery implementation

  • Wrote our own with pluggable data store
    • Relational database as back-end
    • Currently a subset of the XQuery spec
Inventive Designers logo


  • Transform, merge and enrich personalization data
  • Conditional structural formatting of content
Shuffle icon


XSL Designers screenshot

XSLT extensions

  • Custom function libraries (abstract complex expressions and business logic)
  • Call other XSLT+XSL-FO stylesheets dynamically
Jigsaw icon

XSLT challenges

  • Memory consumption
    • Streaming mode will make life easier
    • Support streaming mode WYSIWYG XSL editor is challenging
Gym icon

XSLT implementation

  • Saxon PE
Michael Kay


  • Markup language for XML document formatting
    • Citations and Cross-references
    • Headers/footers
    • Keep together, keep with next, keep with previous
    • Orphans and widows
    • Running totals
  • Powerful conditional formatting in combination with XSLT
  • 18 different output formats (PDF, PS, AFP, HTML5,...)
Document icon iPad icon iMac icon

Example document

One document displayd in different delivery channels

XSL-FO extensions

  • Mix-in SVG, XForms and Open Office Charts
  • Meta data (PDF annotations and TLE's in AFP)
  • Finishing features (Duplex printing, input and output trays)
  • Output specific features (AFP overlays)
  • BarcodeML
  • 'Page data'
Jigsaw icon

XSL-FO challenges

  • Performance, memory and quality requirements
    • Small on-demand and large batch
    • Nested tables which span hundreds of pages
  • Repeated markup (XSLT/XSL-FO formatting is separate)
    • Remove superfluous XSL-FO attributes
    • Optionally: Attribute group references
Gym icon

XSL-FO implementation

  • We created our own implementation
Inventive Designers logo


  • Interactive documents and management UI
  • Cross device (desktop and mobile)
  • host language independent (XSL-FO and HTML)
  • Model-view-controller
Form icon

XForms extensions

  • A lot which are standardized in XForms 2.0
  • Custom components based on XBL
Jigsaw icon

XForms challenges

  • A lot of different web browsers with their own quirks
Gym icon

XForms implementation

  • Chiba
  • Orbeon
    • Custom component support
    • Clever performance optimizations
Chiba logo Orbeon logo


  • The open standards and W3C membership ensured
    • Future proof
    • Easy to integrate with/in
    • A lot of good documentation available
    • Re-use of off-the-shelf components
    • Prevent vendor lock-in
  • Platforms is used today by enterprises worldwide
Brightness icon


Question mark icon