impact 2014 - iib - selecting the right transformation option

60
© 2014 IBM Corporation IBM Integration Bus Selecting the Right Transformation Option Andrew Coleman IBM Integration Bus Development Co-Chair, W3C XML Query Working Group

Upload: ajcoleman

Post on 18-Nov-2014

483 views

Category:

Software


4 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Impact 2014 -  IIB - selecting the right transformation option

© 2014 IBM Corporation

IBM Integration Bus

Selecting the Right Transformation Option

Andrew Coleman

IBM Integration Bus Development

Co-Chair, W3C XML Query Working Group

Page 2: Impact 2014 -  IIB - selecting the right transformation option

Please Note

IBM’s statements regarding its plans, directions, and intent are subject to change

or withdrawal without notice at IBM’s sole discretion.

Information regarding potential future products is intended to outline our general

product direction and it should not be relied on in making a purchasing decision.

The information mentioned regarding potential future products is not a

commitment, promise, or legal obligation to deliver any material, code or

functionality. Information about potential future products may not be incorporated

into any contract. The development, release, and timing of any future features or

functionality described for our products remains at our sole discretion.

Performance is based on measurements and projections using standard IBM

benchmarks in a controlled environment. The actual throughput or performance

that any user will experience will vary depending upon many factors, including

considerations such as the amount of multiprogramming in the user’s job stream,

the I/O configuration, the storage configuration, and the workload processed.

Therefore, no assurance can be given that an individual user will achieve results

similar to those stated here.

Page 3: Impact 2014 -  IIB - selecting the right transformation option

Objectives

▪ Discuss the major transformation technologies available in WebSphere Message Broker

▪Mapping

▪ XSLT

▪ ESQL

▪ Java

▪ PHP

▪ .NET

▪ Give an overview of each technology and how to use them in the broker

▪ Discuss the key strengths and weaknesses of each technology

Page 4: Impact 2014 -  IIB - selecting the right transformation option

Flows, Nodes, Parsers and the Message Tree

Input Transform Output

Input node reads

bit-stream

Node accesses logical

message tree

Output node writes

bit-stream

Parser invoked

(on demand)

bit-stream � tree

Parser invoked

(in reverse)

tree � bit-stream

Parser

associated with

bit-stream

Page 5: Impact 2014 -  IIB - selecting the right transformation option

Why So Many Options?

� Because that is what our customers asked for

– Desire to re-use assets

– User skill set and background

� Different tasks require different tools

� “But which should I choose?”

� “To a man with a hammer, everything looks like a nail.”

- Mark Twain

Page 6: Impact 2014 -  IIB - selecting the right transformation option

Considerations and Tradeoffs

Performance

� Often a compromise

� Low vs high level APIs

� Cost of abstraction

� Predictability

Functionality

� Turing complete, butA

� Rich APIs / libraries

� I/O capability (e.g. DB)

� Access to IIB message

trees and headers

� Support all domains

Ease of Use

� Learning curve

� Availability of skills

Portability

� Reuse of assets

– Cross project

– Cross platform

– Cross product

Standards

� Industry standards

� ISO / Web standards

� Corporate standards

Maintenance

� Self explanatory

� Documentation

� Versioning

Page 7: Impact 2014 -  IIB - selecting the right transformation option

Graphical Mapping XSLT

ESQL Java PHP .NET

Transformation Nodes

General purpose programmable (Compute) Nodes

Page 8: Impact 2014 -  IIB - selecting the right transformation option

Mapping Node

Page 9: Impact 2014 -  IIB - selecting the right transformation option

Introduction

� Message flows are a kind of ‘graphical programming’– Wires define message routing

� Maps extend this to message transformation– Lines drawn between structural elements of the message

� Simple to use – drag and drop transformation

� Highly configurable using XPath 2.0– Versatile expression language – W3C standard– Large function library

� Ability to call user-defined functions/methods– ESQL and Java (static methods)

� Can map transport headers and LocalEnvironment– Not Environment or ExceptionList

� Can generate multiple output messages– Split a document into different structures– Shred a large document with repeating elements

� Database support– Select, Insert, Update, Delete, Stored Procedures

Page 10: Impact 2014 -  IIB - selecting the right transformation option

The Mapping Editor

Page 11: Impact 2014 -  IIB - selecting the right transformation option

Creating Mappings

� Drag and drop source to target (can also drag target to source)

� Choose a transform (how to map)

– Defaults to most commonly used transform appropriate to the source and target

� Hierarchical mapping editor

– Create ‘nested’ maps to break a complex transformation into smaller units

– ‘Structural’ transforms – ‘Local’, ‘For each’, ‘Join’, ‘Append’, ‘Submap’, ‘If / Else’

– Drill down to create the mappings between the children of these elements

– ‘Basic’ transforms – ‘Move’, ‘Assign’, ‘Convert’, ‘XPath’

� Configure the transform

– In the ‘Properties’ view

– E.g. condition predicates, array

filtering / ordering, etc.

– Expressed in XPath

– Content assist available

Page 12: Impact 2014 -  IIB - selecting the right transformation option

Function Transforms

� Target value can be computed by applying a function to one or more inputs

– Large function library inherited from XPath 2.0

– String manipulation: concatenation, sub-string, matching, find/replace, regex

– Numeric calculation: counting, summing, rounding, min/max

– Date/time processing: creating time stamps, extracting components of dates and times

Page 13: Impact 2014 -  IIB - selecting the right transformation option

Conditional Mapping

� Individual transforms can be configured to occur only if a condition is met

– User enters an XPath 2.0 predicate

– Mapping is only performed if predicate evaluates to true

� Can also create an if else condition for higher level control

– Each clause contains a nested map

Page 14: Impact 2014 -  IIB - selecting the right transformation option

Custom Logic – XPath, ESQL and Java

� Complex data manipulation logic can be written in XPath

– Use when complexity goes beyond built in transform types and function library– E.g. 1.6 * sum($Item/(Price * Quantity))

� Can also call out to user-defined functions written in Java and ESQL

– Using APIs familiar to existing broker users

– User-defined functions extend the built-in library for use in XPath expressions

Page 15: Impact 2014 -  IIB - selecting the right transformation option

Database mapping

� Database SELECT, INSERT, UPDATE, DELETE & PROCs supported in mapper– WHERE clause built in drag-and-drop editor– Result set appears as extra input tree in map editor– Insert/Update/Delete appears as a target– Invoke DB stored procedures – map the result set(s)

Page 16: Impact 2014 -  IIB - selecting the right transformation option

Mapping Node – at a glance

Performance

� Compiles and runs in

dedicated engine

� Benefits from JIT

technology

Functionality

� Multi domain support

� Integrates with RDBMS

� Rich function library

– Extensible with Java

& ESQL

Ease of Use

� Gentle learning curve

� Graphical drag and drop

� Minimal ‘programming’

skills

Portability

� Graphical Data Mapper

used across many IBM

products

– Including DataPower

MDM Server, RAD

Standards

� W3C XPath 2.0

expression language

� Structures modelled in

XML Schema (XSD)

Maintenance

� Visual representation

assists understanding

Page 17: Impact 2014 -  IIB - selecting the right transformation option

XML Transformation Node

Page 18: Impact 2014 -  IIB - selecting the right transformation option

Introduction

� W3C standard XSLT 1.0 transformation language

� XSLT is a functional programming language

– Functions cannot modify state – variables are not variable!

– Can only transform XML documents

� Uses XPath 1.0 to navigate the incoming XML document

� Functions are expressed as template rules

– Templates are ‘applied’ to elements of the XML document

– Output document is defined within these templates

� Ability to dynamically select style sheet from LocalEnvironment

– Cannot map transport headers or environment trees

� No database support nor external functions

� XSLT debugger available in Message Broker Toolkit

– Not integrated with Flow Debugger

18

Page 19: Impact 2014 -  IIB - selecting the right transformation option

XPath 1.0 Overview

� XPath is a language for addressing parts of a document

� Operates on the logical tree

� Location Paths

– Used to navigate the tree

– Series of location steps separated by ‘/’

– Each step selects a set of nodes relative to the previous step

� Expressions

– Function library

– Numeric and boolean operators

– Variable references

� W3C recommendation http://www.w3.org/TR/xpath

� Used by other Message Broker nodes, not just XSLT

Page 20: Impact 2014 -  IIB - selecting the right transformation option

XPath Example

//book[@price < 10]/title

<bookshop>

<stock>

<book price=‘49.99’>

<title>Learn WebSphere in 24 hours</title>

</book>

<book price=‘9.99’>

<title>Unix in a Nutshell</title>

</book>

<book price=‘4.50’>

<title>XPath quick reference</title>

</book>

</stock>

</bookshop>

Page 21: Impact 2014 -  IIB - selecting the right transformation option

XPath Example

//book[@price < 10]/title

<bookshop>

<stock>

<book price=‘49.99’>

<title>Learn WebSphere in 24 hours</title>

</book>

<book price=‘9.99’>

<title>Unix in a Nutshell</title>

</book>

<book price=‘4.50’>

<title>XPath quick reference</title>

</book>

</stock>

</bookshop>

Page 22: Impact 2014 -  IIB - selecting the right transformation option

XPath Example

//book[@price < 10]/title

<bookshop>

<stock>

<book price=‘49.99’>

<title>Learn WebSphere in 24 hours</title>

</book>

<book price=‘9.99’>

<title>Unix in a Nutshell</title>

</book>

<book price=‘4.50’>

<title>XPath quick reference</title>

</book>

</stock>

</bookshop>

Page 23: Impact 2014 -  IIB - selecting the right transformation option

XPath Example

//book[@price < 10]/title

<bookshop>

<stock>

<book price=‘49.99’>

<title>Learn WebSphere in 24 hours</title>

</book>

<book price=‘9.99’>

<title>Unix in a Nutshell</title>

</book>

<book price=‘4.50’>

<title>XPath quick reference</title>

</book>

</stock>

</bookshop>

Page 24: Impact 2014 -  IIB - selecting the right transformation option

XSLT Template Rules

� Each template rule defines part of the transformation

– ‘Pattern’ matched against the source tree (XPath)

– ‘Template’ instantiated to form part of the result tree

� Each template can instantiate other templates:

<xsl:template match=“/”>

<book-authors>

<xsl:apply-templates select=“/library/books/book”/>

</book-authors>

</xsl:template>

<xsl:template match=“book”>

<book title=“{title}”>

<xsl:copy-of select=“author”/>

</book>

</xsl:template>

Page 25: Impact 2014 -  IIB - selecting the right transformation option

XSLT Node – at a glance

Performance

� Good, butA

� XSLT processor also

parses and serialises

– In a multi-node flow

causes repeated

parsing

Functionality

� Full XSLT 1.0 compliant

� Limited to XML domains

� No I/O support

� No access to headers or

environment trees

Ease of Use

� Functional language

– No side effects

– No threading issues

� Lots of books, tutorials,

forums, etc.

Portability

� This is the most portable

option

� XSLT supported by a

large number of vendors

and products

Standards

� W3C standard

Maintenance

� Not the most readable

language (for humans)

� Nice readable language

(for computers)

Page 26: Impact 2014 -  IIB - selecting the right transformation option

Compute Node

Page 27: Impact 2014 -  IIB - selecting the right transformation option

Introduction

� Excellent for database interaction

� Syntactically similar to SQL

� Invoke static Java methods and database stored procedures

� Supports declarative and procedural programming styles

� Powerful SELECT statement can be applied to messages as well as database tables (or a

mix of the two at the same time – can even be nested!)

� Access to all message domains

� Can address all message headers and environment trees

� Toolkit support with editor for syntax highlighting and context assist

� ESQL debugger integrated with Flow Debugger

Page 28: Impact 2014 -  IIB - selecting the right transformation option

ESQL: SQL + Procedural Extensions

� Typed user defined variables and constantsDECLARE var1 CHARACTER 'Hello World';DECLARE var1 CONSTANT CHAR 'Hello World';

– If not initialized they are initialized to NULL for you

� Data typesCHARACTER DECIMAL FLOAT INT BIT BLOB BOOLEAN

� Data and timeDATE TIME TIMESTAMP INTERVAL GMTTIME GMTTIMESTAMP

� Operators– For manipulation and comparison of variables, etcBETWEEN IN LIKE IS (NOT)

� Conditional constructsIF, ELSEIF, ELSE, CASE, WHEN

� Several looping constructsWHILE, REPEAT, LOOP, FOR

� Functions– Over 80 built-in functionsSUBSTRING LENGTH UPPER CONTAINS STARTSWITH RAND ROUND CEILING FLOOR

Page 29: Impact 2014 -  IIB - selecting the right transformation option

Functions and Procedures

� Main() – the entry point for the Compute node

CREATE FUNCTION Main() RETURNS BOOLEAN

BEGIN

...

SET OutputRoot.XMLNSC.Money.Amount = twice(myInt);

CALL multiplyBy2(myInt);

...

RETURN TRUE; --causes message propagation

END;

� User-defined functions

CREATE FUNCTION twice(IN p INTEGER) RETURNS INTEGER

BEGIN RETURN p * 2; END;

CREATE PROCEDURE multiplyBy2(INOUT p INTEGER)

BEGIN SET p = p * 2; END;

Page 30: Impact 2014 -  IIB - selecting the right transformation option

Working with Messages – Path Extensions

� Field References– Path syntax to address the tree elements– Starts with ‘correlation name’ to identify root of tree

SET OutputRoot = InputRoot; -- copies the whole message

SET OutputRoot.MQMD = NULL; -- removes the MQMD header

SET OutputRoot.XML.doc.title = -- will generate the outputInputBody.session[4].title; -- tree if it doesn’t exist

SET OutputRoot.XML.Library.Publication[] =InputBody.library.books.book[] -- copies all elements

(deep copy)

Page 31: Impact 2014 -  IIB - selecting the right transformation option

Transformation using SELECT

� The SELECT implicitly loops over the repeating ‘book’ element in the input message

– A ‘Publication’ element is created in the output for each one

� The children elements of ‘book’ are mapped

– Element names are changed (‘title’ -> ‘BookTitle’, etc)

– Values are copied (deep copy)

– Arrays and structures are built (author[] -> Authors.Name[])

– Note that nested repeating structures can be transformed with nested SELECTS

SET OutputRoot.XML.Library.Publication[] =

SELECT BOOK.title AS BookTitle,

BOOK.author[] AS Authors.Name[],

BOOK.isbn AS ISBN,

BOOK.price AS Price

FROM InputBody.library.books.book[] AS BOOK;

Page 32: Impact 2014 -  IIB - selecting the right transformation option

Mixing Declarative and Functional styles

SET OutputRoot.XML.Library.Publication[] =

SELECT BOOK.title AS BookTitle,

BOOK.author[] AS Authors.Name[],

ToIsbn13(BOOK.isbn) AS ISBN13,

BOOK.price * 1.6 AS Price

FROM InputBody.library.books.book[] AS BOOK;

CREATE FUNCTION ToIsbn13(IN oldIsbn CHAR) RETURNS CHAR

BEGIN

IF(LENGTH(oldIsbn) = 10) THEN

RETURN '978' || oldIsbn;

ELSE

RETURN oldIsbn;

END IF;

END;

Page 33: Impact 2014 -  IIB - selecting the right transformation option

Database Access

� SELECT statement

– Creates an entire message tree from a database querySET OutputRoot.XMLNSC.Response.Services.Service[] =

(SELECT P.SVCCODE AS Code, P.SVCDESC AS Description

FROM Database.SERVICES as P);

� INSERT statement

– Allows you to add a row to a database tableINSERT INTO Database.Prices(ITEM, ITEMPRICE)

VALUES (Body.Msg.Item, Body.Msg.ItemPrice);

� UPDATE statement

– Changes one or more existing rows in a database tableUPDATE Database.Prices AS P

SET ITEMPRICE = Body.Msg.ItemPrice

WHERE P.ITEM = Body.Msg.Item;

� DELETE statement

– Removes one or more existing rows in a database tableDELETE FROM Database.{DSN}.{Schema}.Prices AS P

WHERE P.ITEM = Body.Msg.Item;

Page 34: Impact 2014 -  IIB - selecting the right transformation option

ESQL Node – at a glance

Performance

� Interpreter closely

coupled to message tree

– Excellent tree

performance

� Easy to write poorly

performing code though

Functionality

� Full domain support

� Integrates with RDBMS

� Rich function library

– Extensible with Java,

.NET

Ease of Use

� Compact DSL (Domain

Specific Language)

� Path navigation build

directly into syntax

Portability

� Runs on all platforms

� Unlikely to run anywhere

else

Standards

� Built on SQL standard

� Proprietary extensions

Maintenance

� Built in source code

debugger

� Supports development

of reusable code

libraries

� Deployed as source

Page 35: Impact 2014 -  IIB - selecting the right transformation option

Java Compute Node

Page 36: Impact 2014 -  IIB - selecting the right transformation option

Introduction

� General purpose programmable node

� Java 7 (IBM Integration Bus v9), Java 6 (Message Broker v8)

� API to work with messages and interact with broker

� JAXB support for creating portable transformation logic

� Full XPath 1.0 support for message navigation

� Two general purpose output terminals for message routing

� Access to external resources

– For example file system, SMS, POJOs

� JDBC (XA) Database support

� Supports all message domains, headers and environment messages

� Full IDE support of Eclipse Java Development Tools (JDT)

– Java debugger integrated with Flow Debugger

Page 37: Impact 2014 -  IIB - selecting the right transformation option

Getting Started

� Wizard driven

– Skeleton Java code is created

� User codes logic in evaluate() method

– Called by the broker once for each message processed

� The incoming message is passed into evaluate() as part of a message assembly

– MbMessageAssembly encapsulates four MbMessage objects

• Message - the incoming message

• Local environment - local scratch pad work area

• Global environment - global scratch pad work area

• Exception list - the current exception list

� Message assembly is propagated to an output terminal

Page 38: Impact 2014 -  IIB - selecting the right transformation option

MbElement API

� Each element in the tree is represented by an MbElement object

� MbMessage.getRootElement() returns the root of the tree

� Methods to access an element – getType(), getValue() and getName()

� MbElement contains methods for traversing the message tree

� Methods for setting name and value of MbElement object

setName(), setValue()

� Methods for creating new MbElement instances in the tree

createElementAsFirstChild()

createElementAsLastChild()

createElementBefore()

createElementAfter()

MbElement

getParent()

getPreviousSibling() getNextSibling()

getFirstChild() getLastChild()

Page 39: Impact 2014 -  IIB - selecting the right transformation option

N: XMLNSC

V:

N: Root

V:

N: Properties

V:

N: MQMD

V:

N: library

V:

N: books

V:

N: book

V:

N: book

V:

� �

N: isbn

V: 0201700735

N: title

V: Imperium

N: author

V: Robert Harris

N: copies

V: 1

<library>

<books>

<book isbn="0201700735">

<title>Imperium</title>

<author>Robert Harris</author>

<copies>3</copies>

</book>

<book ...>

</books>

</library>

<library>

<books>

<book isbn="0201700735">

<title>Imperium</title>

<author>Robert Harris</author>

<copies>3</copies>

</book>

<book ...>

</books>

</library>

N: title

V: Imperium

MbMessage msg = assembly.getMessage();

MbElement root = msg.getRootElement();

MbElement xml = root.getLastChild();

MbElement library = xml.getFirstChild();

MbElement books = library.getFirstChild();

MbElement book = books.getFirstChild();

MbElement isbn = book.getFirstChilld();

MbElement title = isbn.getNextSibling();

msg.evaluateXPath(“/library/books/book[1]/title”);

Navigating the Message Tree

Page 40: Impact 2014 -  IIB - selecting the right transformation option

JAXB

� Java Architecture for XML Binding

� Allows Java developers to write transformation code using a Java object representation of

the data

– JavaBean like representation – getter and setter methods are used to traverse, modify

and build messages

– Transformation logic can be coded without using MbElement API

• Useful for writing code for use across multiple products, or migrating existing code

into WMB

– Full generation wizard and content assist support within WMB toolkit

� JAXB comprises several components

– Schema compiler – generates a set of Java classes from an XSD

– Schema generator – generates an XSD from Java classes

– Binding runtime framework – for converting data between the two representations

• Unmarsalling – converts data in the WMB logical tree into a set of Java objects

• Marshalling – converts the Java objects back into a WMB tree

Page 41: Impact 2014 -  IIB - selecting the right transformation option

JAXB in a Java Compute node

Classes generated by Schema compiler

Transformation code usingJava object manipulation

Page 42: Impact 2014 -  IIB - selecting the right transformation option

Pros and Cons of JAXB versus MbElement API

� Proprietary API– Although XPath 1.0 is standard

� User has to build output tree of correct

shape– Elements must be in correct order

� The whole tree gets unmarshalled up front

� No benefit from WMB parse on demand

capability

� However, JAXB binder allows parts of the

tree to be unmarshalled at a time–

� Best performance

� No input or output schema required

� Standard – built into J2SE JDK (from v6)

� Schema driven– Enables content assist

– Output marshalled tree always correct shape

� Self-contained and portable across JAXB

implementations

� Suitable for migrating code between

products

+

MbElement APIJAXB

Page 43: Impact 2014 -  IIB - selecting the right transformation option

Java Node – at a glance

Performance

� Advanced JIT

technology

� Thin IIB API around

native IIB internals

� Easy to write poorly

performing code though

Functionality

� Full J2SE JVM

� Huge function library

– JDK 7.0

– 3rd party JARs

� Full domain support

� Excellent I/O capabilities

Ease of Use

� Standard Java + IIB API

� Navigation using XPath

� API-less transformation

using standard JAXB

� Full JDT tools

� Beware of multi-threads

Portability

� Runs on all platforms

� JAXB transformation will

run on other products

and vendors

Standards

� Java

– Ubiquitous

– JAXB, JDBC XA, A

� W3C

– XPath 1.0

Maintenance

� Built in source code

debugger

� Productivity tools

– JUnit, JavaDoc, A

Page 44: Impact 2014 -  IIB - selecting the right transformation option

PHP Compute Node

Page 45: Impact 2014 -  IIB - selecting the right transformation option

PHP

� PHP is a dynamic scripting language used to implement web sites

� Easy to use – gentle learning curve

� Efficient syntax and library have evolved in open source

– Community driven to get more done in less time

– Impressive results with little code

– Extensive library support

– Language suited to rapid incremental prototyping

� http://www.php.net

� More than 3 million developers worldwide

� Predicted to grow to 5.5M developers

– 60% corporate by 2013

� 4th most popular language (after Java/C/VB)

� Customer demand for scripting support in the broker

– Allowing rapid development of message processing logic

Page 46: Impact 2014 -  IIB - selecting the right transformation option

Introduction

� General purpose programmable node

� Embeds the IBM Runtime for PHP– Java implementation, fully compliant with PHP version 5.2

� Message tree navigation syntax integrated into PHP language– Inspired by ESQL path navigation and SimpleXML PHP extension

� XPath 1.0 support

� Two PHP script styles are supported– Declare a class with an evaluate() method

• Gets invoked for each message• Annotations control message copying and routing behaviour

– Plain script• No class declaration required• Users have to write more code to support message copying and routing

� No state is retained by the node between messages– Inherently thread-safe

� Multiple dynamic output terminals for message routing

Page 47: Impact 2014 -  IIB - selecting the right transformation option

PHP Example

<?php

class Hello {

/**

* @MessageBrokerSimpleTransform

*/

function evaluate ($output, $input) {

$output->XMLNSC->doc->greeting = 'Hello';

}

}

?> <doc>

<greeting>Hello</greeting>

</doc>

Page 48: Impact 2014 -  IIB - selecting the right transformation option

Navigating the Message Tree

� Each element in the tree is represented by an MbsElement object

� The element tree can be navigated in two ways:– Path syntax

$output->MRM->bin->item = $input->XMLNSC->doc->ref->item;

• Performs deep tree copy from RHS to LHS

• Elements on LHS are created if they don’t already exist

• Navigation is not namespace-aware– API methods

$value = $items->getFirstChild()->getValue();

$catalog->addElement('Item', $value);

Page 49: Impact 2014 -  IIB - selecting the right transformation option

Navigating the Message Tree

N: Root

V:

N: Properties

V:

N: MQMD

V:

N: XMLNSC

V:

N: document

V:

N: chapter

V: Some text.

N: chapter

V: More text.

N: title

V: Introduction

<document>

<chapter title=’Introduction’>

Some text.

</chapter>

<chapter title=’Beginnings’>

More text.

</chapter>

</document> N: title

V: Beginnings

$xml = $input->getLastChild();

$doc = $xml->getFirstChild();

$ch1 = $doc->getFirstChild();

$ch2 = $ch1->getNextSibling()

$attr = $ch2->getFirstChild();

$xml = $input->getChild(‘XMLNSC’);

$doc = $xml->getChild(‘document’);

$ch2 = $doc->getChild(‘chapter’, 1);

$attr = $ch2->getAttribute(‘title’);

$attr = $input->XMLNSC->document->chapter[1][‘title’]

N: title

V: Beginnings

<document>

<chapter title=’Introduction’>

Some text.

</chapter>

<chapter title=’Beginnings’>More text.

</chapter>

</document>

Page 50: Impact 2014 -  IIB - selecting the right transformation option

MbsElement – Repeating Structures

� MbsElement supports the array operator [] to access repeating elements$second = $input->XMLNSC->doc->item[1];

� It also supports the creation of repeating elements$output->XMLNSC->doc->item[] = 'foo';– This creates the XMLNSC and doc folders, if they don’t exist– It creates a new item element regardless of whether one already exists

� Can iterate over a repeating element:foreach($input->XMLNSC->doc->item as $item) {

print $item;}

� An array can be used to create a repeating structure$list = array('ein', 'zwei', 'drei'); $output->XMLNSC->doc->number[] = $list;

<doc><number>ein</number><number>zwei</number><number>drei</number>

</doc>

Page 51: Impact 2014 -  IIB - selecting the right transformation option

PHP Node – at a glance

Performance

� Trades performance for

developer productivity

� Layers on top of the

Java node API

Functionality

� PHP 5.2 runtime

� Access to underlying

JDK

� Supports DB interaction

Ease of Use

� Very easy to use

� Rapid and productive

development

� Path navigation syntax

built into language

Portability

� Runs on all platforms

� Unlikely to run in other

products

Standards

� Hugely popular scripting

language

� Supports XPath 1.0

Maintenance

� PDT tools available

– including debugger

Page 52: Impact 2014 -  IIB - selecting the right transformation option

.NET Compute Node

Page 53: Impact 2014 -  IIB - selecting the right transformation option

Introduction

� General purpose programmable node

� CLR v4 hosted inside the Execution Group

� Supports all CLR languages (e.g. C#, VB.NET, JScript, F#, etc.)

� API to work with messages and interact with broker

� Multiple dynamic output terminals for message routing

� Supports all message domains, headers and environment messages

� Full IDE support of Visual Studio

– Launch Visual Studio from Eclipse

– Plug-ins to provide fast node creation

– Content assist for easy access to the API

– Debug your nodes using Visual Studio

Page 54: Impact 2014 -  IIB - selecting the right transformation option

N: XMLNSC

V:

N: Root

V:

N: Properties

V:

N: MQMD

V:

N: library

V:

N: books

V:

N: book

V:

N: book

V:

� �

N: isbn

V: 0201700735

N: title

V: Imperium

N: author

V: Robert Harris

N: copies

V: 1

<library>

<books>

<book isbn="0201700735">

<title>Imperium</title>

<author>Robert Harris</author>

<copies>3</copies>

</book>

<book ...>

</books>

</library>

<library>

<books>

<book isbn="0201700735">

<title>Imperium</title>

<author>Robert Harris</author>

<copies>3</copies>

</book>

<book ...>

</books>

</library>

N: title

V: Imperium

NBElement title =

root.LastChild.LastChild.FirstChild.FirstChild.FirstChild.NextSibling

NBElement title = root[“library”][“books”][“book”][“title”];

Navigating the Message Tree

Page 55: Impact 2014 -  IIB - selecting the right transformation option

.NET Node – at a glance

Performance

� Comparable with ESQL

and Java

� CLR integrated tightly

with broker internals

Functionality

• Supports full range of .NET languages

• C#, VB.NET, F#, A

� Full domain support

� Excellent I/O capabilities

Ease of Use

• Very widely used set of programming languages

• Microsoft Visual Studio development tools

Portability

� Windows only

Standards

Microsoft CLR

Maintenance

• Excellent tooling available for editing and debugging .NET code

Page 56: Impact 2014 -  IIB - selecting the right transformation option

Questions?

As a reminder, please fill out a session evaluation

Page 57: Impact 2014 -  IIB - selecting the right transformation option

IBM Integration Bus This Week – Selected Sessions

� Monday

– 2.30-3.30 Palazzo H – Integration Featured Session

– 2.30-5.00 Murano 3305 – Healthcare Integration Lab

– 4.00-5.00 Palazzo H – What's New in IIB

– 5.15-6.15 Palazzo H – Introduction to IIB

� Tuesday

– 10.30-11.30 Palazzo H – Cloud Integration Options

– 10.30-11.30 San Polo 3502 – Meet The Experts

– 1.00-2.00 Palazzo H – WESB Conversion

– 1.00-2.00 Marcello 4403 – IIB Retail Integration Pack

– 1.00-3.15 Murano 3303 – IIB V9 Lab

– 2.15-3.15 Palazzo H – Designing for Performance

– 3.45-4.45 Palazzo H – Mobile Integration

– 5.00-6.00 Palazzo H – DFDL Introduction

– 5.00-6.00 Marcello 4402 – Manufacturing in IIB

57

Page 58: Impact 2014 -  IIB - selecting the right transformation option

IBM Integration Bus This Week – Selected Sessions

� Wednesday

– 10.30-11.30 Palazzo H – .NET Integration

– 1.00-2.00 Palazzo H – Effective Application Development

– 1.00-2.00 Marcello 4403 – IIB Healthcare Integration Pack

– 1.00-2.00 San Polo 3503 – Meet The Experts (Repeat)

– 2.15-3.15 Palazzo H – Effective Administration

– 3.45-4.45 Palazzo H – Applications, Libraries, APIs

– 3.45-6.00 Murano 3303 – IIB Open Beta Lab

– 5.00-6.00 Palazzo H – Transformation Options in IIB

� Thursday

– 9.00-10.00 Palazzo H – Predictive Analytics

– 10.30-11.30 Palazzo H – BPM Integration

– 1.00-2.00 Palazzo H – Modelling Industry Formats

– 2.15-3.15 Palazzo H – What's New in IIB (Repeat)

58

Page 59: Impact 2014 -  IIB - selecting the right transformation option

We Value Your Feedback

� Don’t forget to submit your Impact session and speaker feedback! Your feedback is very

important to us – we use it to continually improve the conference.

� Use the Conference Mobile App or the online Agenda Builder to quickly submit your

survey

– Navigate to “Surveys” to see a view of surveys for sessions you’ve attended

59

Page 60: Impact 2014 -  IIB - selecting the right transformation option

Legal Disclaimer

• © IBM Corporation 2014. All Rights Reserved.

• The information contained in this publication is provided for informational purposes only. While efforts were made to verify the completeness and accuracy of the information contained

in this publication, it is provided AS IS without warranty of any kind, express or implied. In addition, this information is based on IBM’s current product plans and strategy, which are

subject to change by IBM without notice. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, this publication or any other materials. Nothing

contained in this publication is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and

conditions of the applicable license agreement governing the use of IBM software.

• References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. Product release dates and/or

capabilities referenced in this presentation may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to

future product or feature availability in any way. Nothing contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by

you will result in any specific sales, revenue growth or other results.

• If the text contains performance statistics or references to benchmarks, insert the following language; otherwise delete:

Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput or performance that any user will

experience will vary depending upon many factors, including considerations such as the amount of multiprogramming in the user's job stream, the I/O configuration, the storage

configuration, and the workload processed. Therefore, no assurance can be given that an individual user will achieve results similar to those stated here.

• If the text includes any customer examples, please confirm we have prior written approval from such customer and insert the following language; otherwise delete:

All customer examples described are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual environmental costs

and performance characteristics may vary by customer.

• Please review text for proper trademark attribution of IBM products. At first use, each product name must be the full name and include appropriate trademark symbols (e.g., IBM

Lotus® Sametime® Unyte™). Subsequent references can drop “IBM” but should include the proper branding (e.g., Lotus Sametime Gateway, or WebSphere Application Server).

Please refer to http://www.ibm.com/legal/copytrade.shtml for guidance on which trademarks require the ® or ™ symbol. Do not use abbreviations for IBM product names in your

presentation. All product names must be used as adjectives rather than nouns. Please list all of the trademarks that you use in your presentation as follows; delete any not included in

your presentation. IBM, the IBM logo, Lotus, Lotus Notes, Notes, Domino, Quickr, Sametime, WebSphere, UC2, PartnerWorld and Lotusphere are trademarks of International

Business Machines Corporation in the United States, other countries, or both. Unyte is a trademark of WebDialogs, Inc., in the United States, other countries, or both.

• If you reference Adobe® in the text, please mark the first use and include the following; otherwise delete:

Adobe, the Adobe logo, PostScript, and the PostScript logo are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States, and/or other countries.

• If you reference Java™ in the text, please mark the first use and include the following; otherwise delete:

Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.

• If you reference Microsoft® and/or Windows® in the text, please mark the first use and include the following, as applicable; otherwise delete:

Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or both.

• If you reference Intel® and/or any of the following Intel products in the text, please mark the first use and include those that you use as follows; otherwise delete:

Intel, Intel Centrino, Celeron, Intel Xeon, Intel SpeedStep, Itanium, and Pentium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and

other countries.

• If you reference UNIX® in the text, please mark the first use and include the following; otherwise delete:

UNIX is a registered trademark of The Open Group in the United States and other countries.

• If you reference Linux® in your presentation, please mark the first use and include the following; otherwise delete:

Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both. Other company, product, or service names may be trademarks or service marks of

others.

• If the text/graphics include screenshots, no actual IBM employee names may be used (even your own), if your screenshots include fictitious company names (e.g., Renovations, Zeta

Bank, Acme) please update and insert the following; otherwise delete: All references to [insert fictitious company name] refer to a fictitious company and are used for illustration

purposes only.