Cast Iron Admin
Cast Iron Admin
Cast Iron Admin
Front cover
SG24-8004-00
Lars Besselmann-Hamandouche Nick Bletzer Simon Dickerson Leonardo Rodriguez Leon Roberto Mascarenhas Giuliano Diniz de Morais Rajath Ramesh Carla Sadtler
ibm.com/redbooks
8004edno.fm
International Technical Support Organization Getting Started with IBM WebSphere Cast Iron Cloud Integration January 2012
SG24-8004-00
8004edno.fm
Note: Before using this information and the product it supports, read the information in Notices on page xi.
First Edition (January 2012) This edition applies to IBM WebSphere Cast Iron Cloud Integration Version 6.1. This document created or updated on December 4, 2011.
Copyright International Business Machines Corporation 2011. All rights reserved. Note to U.S. Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
8004TOC.fm
Contents
Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii The team who wrote this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii Now you can become a published author, too! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv Comments welcome. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv Stay connected to IBM Redbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi Chapter 1. Introduction and technical overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1 Integrating cloud applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 Example use cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.3 The WebSphere Cast Iron approach to integrating applications. . . . . . . . . . . . . . . . . . . 4 1.4 Architecture overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.4.1 On-premise Integration Appliance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.4.2 Cast Iron Live . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.5 Developing integrations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.5.1 Connectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.5.2 Secure communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.5.3 Data variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 1.6 Activities and configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 1.6.1 Transforming and mapping data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 1.6.2 Defining a starter activity for an orchestration job . . . . . . . . . . . . . . . . . . . . . . . . . 16 1.6.3 Error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 1.6.4 Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 1.6.5 Reuse: Template Integration Projects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 1.6.6 Deploying projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 1.6.7 Updating projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 1.7 Management and monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1.8 Availability and scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 1.9 Upgrading to a new release . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 1.10 Cast Iron editions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 1.11 Express edition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.12 Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Chapter 2. Installing and setting up WebSphere Cast Iron integration . . . . . . . . . . . . 2.1 Installing and configuring WebSphere Cast Iron Studio . . . . . . . . . . . . . . . . . . . . . . . . 2.1.1 Installing Studio. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.2 Changing the user interface language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.3 Installing module providers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.4 Installing plug-in connectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Installing and configuring the physical appliance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.1 Installing and starting the appliance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.2 Gathering basic information about the appliance . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.3 Setting up the appliance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 Configuring the physical appliance for high availability . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.1 Prerequisites to set up HA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.2 Configuring the appliances for HA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.3 Managing physical appliances in an HA configuration . . . . . . . . . . . . . . . . . . . . .
Copyright IBM Corp. 2011. All rights reserved.
27 28 28 34 36 37 38 39 40 41 44 45 46 49 iii
8004TOC.fm
2.4 Installing and configuring the virtual appliance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.1 Installing and starting WebSphere Cast Iron Hypervisor Edition . . . . . . . . . . . . . 2.4.2 Gathering basic information about the appliance . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.3 Setting up the appliance using DHCP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.4 Setting up the appliance using static network settings . . . . . . . . . . . . . . . . . . . . . 2.5 Finalizing the installation using the WMC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5.1 Logging in to the WMC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5.2 Installing the required SAP module providers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.6 Installing the WebSphere Cast Iron Live Secure Connector . . . . . . . . . . . . . . . . . . . . . 2.6.1 Creating a Secure Connector in Cast Iron Live. . . . . . . . . . . . . . . . . . . . . . . . . . . 2.6.2 Downloading the Secure Connector configuration and the installer files . . . . . . . 2.6.3 Installing the Secure Connector on a Windows operating system . . . . . . . . . . . . 2.6.4 Starting the Secure Connector and verifying communication . . . . . . . . . . . . . . . . 2.6.5 Installing third-party libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.6.6 Installing the Secure Connector on Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.7 Upgrading from WebSphere Cast Iron Cloud Integration V6.0 to V6.1. . . . . . . . . . . . . 2.7.1 Upgrading WebSphere Cast Iron Studio V6.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.7.2 Upgrading the physical appliance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.7.3 Upgrading the virtual appliance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.7.4 Upgrading the cloud . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
49 50 51 52 53 55 55 59 60 62 63 64 72 73 76 76 77 77 77 78
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio . . . . . . . . . 79 3.1 Overview of Cast Iron development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 3.2 Overview of WebSphere Cast Iron Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 3.3 Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 3.3.1 Project toolbox tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 3.3.2 Configuration properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 3.3.3 Project directory structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 3.3.4 Versioning projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 3.3.5 Project permissions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 3.3.6 Project documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 3.4 Orchestrations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 3.4.1 The orchestration editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 3.4.2 What makes a valid orchestration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 3.4.3 Orchestration properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 3.4.4 Orchestration documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 3.5 Connectors and endpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 3.5.1 Connectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 3.5.2 Endpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 3.5.3 Installing module providers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 3.6 Activities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 3.6.1 Configuring and using an activity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 3.6.2 Starter activities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 3.6.3 Outbound activities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 3.6.4 Transform activities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 3.6.5 Logic and utility activities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 3.6.6 Local web services calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 3.6.7 Database activities, database assets, and the staging database . . . . . . . . . . . . 114 3.6.8 Using HTTP and web service starter activities with Cast Iron Live . . . . . . . . . . . 116 3.7 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 3.7.1 Creating a variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 3.7.2 Shared variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 3.7.3 Deleting a variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
iv
8004TOC.fm
3.7.4 The JobInfo variable and Job Keys. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.8 Functions and Lookup Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.8.1 Custom functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.8.2 Lookup tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.9 Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.9.1 The mapping editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.9.2 Using functions in maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.9.3 The Map Variables activity and standalone maps. . . . . . . . . . . . . . . . . . . . . . . . 3.9.4 XML stylesheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.10 Parsing data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.10.1 Maps and functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.10.2 XML parsing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.10.3 MIME parsing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.10.4 Flat File Schema parsing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.11 Exception handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.11.1 Try activity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.11.2 Global exception handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.11.3 Common Error Handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.12 Unit testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.12.1 Endpoint Test Connection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.12.2 Test Flat File Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.12.3 Test maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.12.4 Test Custom XSLT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.12.5 XPath Evaluator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.12.6 Validate orchestrations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.12.7 Verify orchestrations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.12.8 HTTP Post Utility tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.12.9 Invoke Service tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.13 Exporting and publishing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.13.1 Exporting a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.13.2 Publishing a project directly from Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Chapter 4. Management and monitoring. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1 Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1.1 Command Line Interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1.2 Web Management Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1.3 Management API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 Project configuration life cycle. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.1 Project configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.2 Starting a configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.3 Pausing a configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.4 Stopping a configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.5 Undeploying a configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.6 Changing configuration properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.7 Disabling orchestrations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.8 Cloning configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.9 Deleting configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.10 Versioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.11 Assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.12 Scheduling downtime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.13 Uploading and downloading a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.14 Importing and exporting repository configuration . . . . . . . . . . . . . . . . . . . . . . . 4.3 Monitoring and troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
122 123 124 126 128 129 141 146 149 149 150 150 151 151 155 156 158 158 158 159 159 161 163 163 164 164 168 169 170 170 171 173 174 174 175 179 180 180 181 183 183 184 185 186 188 189 190 190 194 197 198 198
Contents
8004TOC.fm
4.3.1 Logging overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.2 The system log repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.3 Job log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.4 Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4 Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5 The staging database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.6 Resource utilization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.7 Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.8 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.9 Appliance and connector upgrades. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.9.1 Verify the current version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.9.2 Upgrade the Integration Appliance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.9.3 Update connector libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Chapter 5. Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1 WebSphere Cast Iron users and groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.1 Viewing and updating your user profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.2 Creating a new user . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.3 Logging in with a new user ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.4 Changing your password . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.5 Creating a new group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.6 Assigning users to groups. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.7 Deleting a user . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.8 Deleting a group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 Granting project configuration permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3 Permissions to publish projects from Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4 Configuring WebSphere Cast Iron to use LDAP authentication . . . . . . . . . . . . . . . . . 5.5 Working with certificates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5.1 Managing certificates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.6 Securing communication with endpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.6.1 The WebSphere Cast Iron Secure Connector . . . . . . . . . . . . . . . . . . . . . . . . . . 5.6.2 Authentication mechanisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.7 Monitoring security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.8 Additional security considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Chapter 6. Availability and scalability planning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1 High availability techniques for Integration Appliances . . . . . . . . . . . . . . . . . . . . . . . . 6.1.1 Integration Appliance availability features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1.2 Integration Appliance high availability modes . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1.3 Orchestration design for availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2 Scalability techniques for Integration Appliances . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.3 Maintenance and updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.3.1 Rolling out updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.3.2 Scheduling down time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.3.3 Minimizing downtime when updating an orchestration . . . . . . . . . . . . . . . . . . . . 6.4 Backup and restore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.4.1 Using an image or a snapshot and restore for virtual appliances . . . . . . . . . . . . 6.4.2 Exporting or importing the Integration Appliance configuration. . . . . . . . . . . . . . 6.4.3 Recovering a physical or virtual appliance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.4.4 Recovering projects from the WMC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
199 200 206 213 216 217 221 225 227 228 228 229 230 233 234 235 235 239 239 242 243 244 245 245 246 248 252 254 264 264 268 277 277 279 280 280 281 283 284 286 286 287 287 287 287 288 291 292
Chapter 7. Reusability with Template Integration Projects (TIPs) . . . . . . . . . . . . . . . 295 7.1 Overview of Template Integration Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296 7.2 Introduction to the TIP Configuration Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298 vi
Getting Started with IBM WebSphere Cast Iron Cloud Integration
8004TOC.fm
7.2.1 Steps panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2.2 Workspace panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.3 Creating and modifying TIPs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.4 Uploading TIPs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.5 Searching and downloading TIPs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.6 Verifying the TIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.7 Rating and reviewing TIPs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.7.1 Rate and review in the TIP configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.7.2 Rate and review using Publish Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Chapter 8. Building custom plugin connectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.1 Introduction to the CDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.2 The CDK components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.2.1 Schema files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.2.2 XML file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.2.3 WSDL file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.2.4 The .par file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.3 Developing a CDK Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.3.1 Using the CDK Wizard to create a connector . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.3.2 Develop a Google Calendar connector using the CDK Wizard. . . . . . . . . . . . . . 8.4 Publishing the CDK Connector to a local repository . . . . . . . . . . . . . . . . . . . . . . . . . . 8.5 Testing and debugging the CDK Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.6 Sharing the CDK Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.6.1 Export a CDK Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.6.2 Import a CDK Connector. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.6.3 Download a CDK Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Chapter 9. Common error handlers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.1 The principles of a common error handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2 The common error handler Template Integration Project . . . . . . . . . . . . . . . . . . . . . . 9.3 Altering the common error handler TIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.4 Using the common error handler TIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Chapter 10. Scenario: Bidirectional account synchronization . . . . . . . . . . . . . . . . . . 10.1 Cast Iron concepts demonstrated in this scenario . . . . . . . . . . . . . . . . . . . . . . . . . . 10.2 Scenario overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.3 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.4 Overview of the use cases for this scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.5 Use case 1: Synchronizing from SAP to Salesforce.com . . . . . . . . . . . . . . . . . . . . . 10.5.1 Downloading the TIP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.5.2 Using the TIP configuration wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.5.3 Customizing the orchestration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.5.4 Reducing the SAP result set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.5.5 Naming conventions and other definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.5.6 Testing end-to-end . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.5.7 Using the Common Error Handler. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.5.8 Synchronizing dedicated SAP customers to Salesforce.com . . . . . . . . . . . . . . 10.5.9 Deploying and testing the orchestration on the Integration Appliance . . . . . . . 10.5.10 Initial load of thousands of records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.6 Use Case 2: Synchronizing from Salesforce.com to SAP. . . . . . . . . . . . . . . . . . . . . 10.6.1 Building the orchestration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.6.2 Deploying and testing the orchestration on the Integration Appliance . . . . . . . 10.6.3 Enhancing the orchestration to avoid feedback loops. . . . . . . . . . . . . . . . . . . .
299 299 300 307 311 313 320 320 321 323 324 326 326 327 329 331 331 331 335 344 344 346 347 347 348 353 354 354 356 357 361 362 362 363 364 364 364 365 380 389 393 396 401 403 404 409 411 411 433 433
Contents
vii
8004TOC.fm
Chapter 11. Scenario: CRM to cloud calendar services . . . . . . . . . . . . . . . . . . . . . . . 11.1 WebSphere Cast Iron concepts demonstrated in this scenario . . . . . . . . . . . . . . . . 11.2 Scenario overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2.1 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2.2 Scenario description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.3 Signing in to Cast Iron Live . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.4 Creating a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.5 Modifying the orchestration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.5.1 Add the HTTP Receive Request starter activity to the orchestration . . . . . . . . 11.5.2 Perform an initial test on the NetSuite activity. . . . . . . . . . . . . . . . . . . . . . . . . . 11.5.3 Add a response to the HTTP Receive Request . . . . . . . . . . . . . . . . . . . . . . . . 11.5.4 Add a response if no events are to be synchronized . . . . . . . . . . . . . . . . . . . . 11.5.5 Catch errors that occur while searching NetSuite . . . . . . . . . . . . . . . . . . . . . . . 11.5.6 Error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.6 Publishing and deploying the project to the development environment . . . . . . . . . . 11.6.1 Change the job schedule time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.6.2 Publish the project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.6.3 Deploy the project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.6.4 Test the project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.6.5 Connecting to Google . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.6.6 Google Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Chapter 12. Scenario: Data enrichment and aggregation . . . . . . . . . . . . . . . . . . . . . . 12.1 Cast Iron concepts demonstrated in this scenario . . . . . . . . . . . . . . . . . . . . . . . . . . 12.2 Scenario overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.3 The order file structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.4 The item structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.5 The product database structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.6 The Domino document structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.7 The scenario orchestration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.8 Preparing the scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.8.1 Preparing the FTP server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.8.2 Preparing the DB2 database. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.8.3 Preparing the Domino database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.9 Creating entities for the scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.9.1 Create and test an FTP endpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.9.2 Create and test the DB2 endpoint. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.9.3 Create and test the Domino endpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.9.4 Create the Orders flat file schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.9.5 Create the Items flat file Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.9.6 Create a custom function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.9.7 Create a lookup table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.10 Building the orchestration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.10.1 Create job keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.10.2 Poll the FTP directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.10.3 Create and rename orchestration variables . . . . . . . . . . . . . . . . . . . . . . . . . . 12.10.4 Parse the input data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.10.5 Transform the data with an XML stylesheet . . . . . . . . . . . . . . . . . . . . . . . . . . 12.10.6 Add a Lookup activity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.10.7 Map outputs for the Lookup activity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.10.8 Add a Merge activity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.10.9 Add a For Each activity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.10.10 Add the Create Documents activity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
439 440 440 440 441 441 442 449 449 452 455 458 459 464 464 464 464 465 466 467 467 469 470 470 472 473 474 474 474 478 478 478 478 479 480 480 481 482 486 489 491 492 493 494 495 497 499 501 503 506 508 509
viii
8004TOC.fm
12.10.11 Log the job keys using the Create Job Keys activity. . . . . . . . . . . . . . . . . . . 515 12.10.12 Test the orchestration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517 12.10.13 Add error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517 Appendix A. Additional material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521 Locating the Web material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521 Using the Web material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521 Related publications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . IBM Redbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Online resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Help from IBM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523 523 523 524
Contents
ix
8004TOC.fm
8004spec.fm
Notices
This information was developed for products and services offered in the U.S.A. IBM may not offer the products, services, or features discussed in this document in other countries. Consult your local IBM representative for information on the products and services currently available in your area. Any reference to an IBM product, program, or service is not intended to state or imply that only that IBM product, program, or service may be used. Any functionally equivalent product, program, or service that does not infringe any IBM intellectual property right may be used instead. However, it is the user's responsibility to evaluate and verify the operation of any non-IBM product, program, or service. IBM may have patents or pending patent applications covering subject matter described in this document. The furnishing of this document does not give you any license to these patents. You can send license inquiries, in writing, to: IBM Director of Licensing, IBM Corporation, North Castle Drive, Armonk, NY 10504-1785 U.S.A. The following paragraph does not apply to the United Kingdom or any other country where such provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you. This information could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time without notice. Any references in this information to non-IBM websites are provided for convenience only and do not in any manner serve as an endorsement of those websites. The materials at those websites are not part of the materials for this IBM product and use of those websites is at your own risk. IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring any obligation to you. Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products. This information contains examples of data and reports used in daily business operations. To illustrate them as completely as possible, the examples include the names of individuals, companies, brands, and products. All of these names are fictitious and any similarity to the names and addresses used by an actual business enterprise is entirely coincidental. COPYRIGHT LICENSE: This information contains sample application programs in source language, which illustrate programming techniques on various operating platforms. You may copy, modify, and distribute these sample programs in any form without payment to IBM, for the purposes of developing, using, marketing or distributing application programs conforming to the application programming interface for the operating platform for which the sample programs are written. These examples have not been thoroughly tested under all conditions. IBM, therefore, cannot guarantee or imply reliability, serviceability, or function of these programs.
xi
8004spec.fm
Trademarks
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business Machines Corporation in the United States, other countries, or both. These and other IBM trademarked terms are marked on their first occurrence in this information with the appropriate symbol ( or ), indicating US registered or common law trademarks owned by IBM at the time this information was published. Such trademarks may also be registered or common law trademarks in other countries. A current list of IBM trademarks is available on the Web at http://www.ibm.com/legal/copytrade.shtml The following terms are trademarks of the International Business Machines Corporation in the United States, other countries, or both:
Cast Iron DataPower DB2 developerWorks Domino IBM Lotus Notes Lotus Maximo MVS Notes RDN Redbooks Redbooks (logo) Tivoli WebSphere
The following terms are trademarks of other companies: Adobe, the Adobe logo, and the PostScript logo are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States, and/or other countries. Windows, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both. Java, and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and/or its affiliates. Intel, Intel logo, Intel Inside, Intel Inside logo, Intel Centrino, Intel Centrino logo, 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. Linux is a 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.
xii
8004pref.fm
Preface
Cloud computing provides companies with many capabilities to meet their business needs but can also mean that a hybrid architecture is created that includes on-premise systems and the cloud. Integration is needed to bridge the gap between the on-premise existing systems and the new cloud applications, platform, and infrastructure. IBM WebSphere Cast Iron meets the challenge of integrating cloud applications with on-premise systems, cloud applications to cloud applications and on-premise to on-premise applications. It contains a graphical development environment that provides built-in connectivity to many cloud and on-premise applications, as well as reusable solution templates that can be downloaded from a solution repository. The integration solutions that are created can then run on either an on-premise integration appliance or the multi-tenant WebSphere Cast Iron Live cloud service. This IBM Redbooks publication is intended for application integrators, integration designers and administrators evaluating or already using IBM WebSphere Cast Iron. Executives, leaders, and architects who are looking for a way to integrate cloud applications with their on-premise applications will also be shown how WebSphere Cast Iron can help to resolve their integration challenges. The book helps you to get an understanding of Cast Iron and explains how to integrate cloud and on-premise applications quickly and simply. It gives a detailed introduction to the development tool and the administration interfaces and how they are used. It also discusses security, high availability, and re-usability. The book also contains three detailed scenarios covering real-world implementations of a Cast Iron Integration Solution:
xiii
8004pref.fm
consulting and has focussed technical sales for over 10 years. He has worked across a number of application areas including content management and document security, mobile applications and data quality on a variety of platforms and across many industries. Simon holds a degree from the University of Reading in Cybernetics and Control Engineering with Mathematics. Leonardo Rodriguez Leon began at IBM Venezuela in 2002 working as an IT Specialist for Operating Systems such as Linux and Windows on multi platforms, in 2004 he moved to Software Group department working as a WebSphere IT Specialist for Venezuela, in 2006 he was in charge for IBM WebSphere DataPower SOA Appliances for Latin America as IT Specialist. He is currently an Advisory Software Engineer at IBM Mexico for Software Solutions Lab in the Connectivity area covering Latin America region. Roberto Mascarenhas is a Senior IT Specialist at IBM Software Group in Rio de Janeiro, Brazil. He has 15 years of experience in the IT field and has been working with WebSphere Business Integration solutions involving mainly the Connectivity portfolio as WebSphere MQ, WebSphere Message Broker, WebSphere DataPower, WebSphere MQFTE, WebSphere Adapters and also B2B solutions for the last ten years. He also works to accelerate and leverage new IBM solutions acquired from acquisitions. Before joining the WebSphere Pre-Sales team, he worked on several projects for IBM Networking Hardware Division and IBM Storage Systems Group. He studied Electronic Engineering at Federal University of Rio de Janeiro (UFRJ). Giuliano Diniz de Morais is an Advisory Software Engineer at IBM Brazil Software Labs. He joined IBM in 2008 and started at IBM as a developer for IBM Tivoli Maximo. He is currently part of the WorldWide Technical Professionals team for WebSphere working with Business Partner enablement across Latin America focusing on WebSphere integration appliances. He is also a member of the developerWorks Brazil technical board. Giuliano holds certifications on Java, WebSphere Application Server, IBM WebSphere DataPower SOA Appliances and IBM WebSphere Cast Iron Cloud Integration. Giuliano also teaches programming at Fatec (Faculdade de Tecnologia de So Paulo) and is doing a Masters Degree in Computer Graphics at Universidade Federal de Uberlandia. Rajath Ramesh is a Software Engineer at IBM India Software labs. He started his career with IBM in 2010 and started as developer in WebSphere Adapters and incubation projects. He is currently part of WebSphere Cast Iron development team specializing in Connectors, Studio and CDK. Rajath is a recipient of the prestigious Rookie Award at IBM and interests in participating technical events. He holds Bachelor degree of information Science at VTU, India. The leader of this project: Carla Sadtler is a Consulting IT Specialist at the ITSO, Raleigh Center. She writes extensively about WebSphere products and solutions. Before joining the ITSO in 1985, Carla worked in the Raleigh branch office as a Program Support Representative, supporting IBM customers. She has a degree in Mathematics from the University of North Carolina at Greensboro. Thanks to the following people for their contributions to this project: Patrik Hysky Dave Bennin Shari Deanna Debbie Willmschen Margaret Ticknor International Technical Support Organization, Raleigh and Poughkeepsie Centers xiv
Getting Started with IBM WebSphere Cast Iron Cloud Integration
8004pref.fm
Figure 1 From left to right: Nick Bletzer, Leonardo Rodriguez Leon, Lars Besselmann, Simon Dickerson, Roberto Mascarenhas, Giuliano Diniz de Morais
Comments welcome
Your comments are important to us! We want our books to be as helpful as possible. Send us your comments about this book or other IBM Redbooks publications in one of the following ways: Use the online Contact us review Redbooks form found at: ibm.com/redbooks Send your comments in an email to:
Preface
xv
8004pref.fm
redbooks@us.ibm.com Mail your comments to: IBM Corporation, International Technical Support Organization Dept. HYTD Mail Station P099 2455 South Road Poughkeepsie, NY 12601-5400
xvi
8004chIntro.fm
Chapter 1.
8004chIntro.fm
8004chIntro.fm
Packaged Applications
Home-grown Applications
8004chIntro.fm
were routed correctly and that workflow was not interrupted should a user be unavailable. Vendors need to provide data only in one format, with the integration solution making the data available to the systems where it is needed in the proper format. Finally, the integration solution eliminates errors that were introduced due to duplicate data entry. Synchronizing e-commerce systems and linking to SaaS CRM application to provide a single view of customers A commercial enterprise has two e-commerce systems that are populated with customer and order data that is currently not synchronized. The enterprise also has a CRM application where customer data is kept and a fulfilment system with inventory and product data. The enterprise used WebSphere Cast Iron to integrate the data in these systems to provide a more cohesive view of customer data. The initial implementation included the following orchestrations that provided the initial population of data throughout the systems and the synchronization of information between systems: Data providing a single view of the customer (SVC) was populated into the SaaS CRM system from the enterprises existing systems using a web services integration. An orchestration with a short polling interval pushes account, order, inventory, and product information to the SVC from the e-commerce and fulfilment systems, ensuring that the customer service staff has the most current information. A nightly refresh of all stock keeping units (SKUs) in the e-commerce system is made based on information from the fulfillment system. The orchestration uses secure file transfer to perform the refresh. Synchronization of customer records between the two e-commerce systems occurs on a regular basis, ensuring that when customers sign in to a system their data is available to them.
8004chIntro.fm
Figure 1-2 outlines the Cast Iron approach. Within Studio, there is a simulated runtime environment to enable unit testing of the orchestrations with visibility of all data at all points. After you have tested the project, you can then publish the project to the run time, where you can then manage and monitor the project. A browser-based interface, the Web Management Console (WMC), provides the capability to manage all functions on the run time. Cast Iron Live: Cast Iron Live provides the same Studio development environment and runtime functionality as a physical or virtual Integration Appliance but through a cloud-based service. In Cast Iron Live, you publish a project to an environment, for example development, test, and production. The environment contains the functions of an on-premise Integration Appliance.
As with any tool, there are preferred practices to implement designs. When processing large amounts of data, a poor design can mean that the integration takes an extraordinary amount of time or that it simply does not work. Each endpoint is different in its requirements, and any integration flow should use the characteristics of the endpoint to its best advantage, for example processing batches of data to optimize the speed of transactions. Cast Iron also provides Template Integration Projects (TIPs) that encapsulate a specific integration use case between specific endpoints and that include preferred practices. You can download these from the Cast Iron community and modify to fit your precise needs. Cast Iron Express uses a different approach to the design and build of the integration workflows and is introduced in 1.11, Express edition on page 23.
8004chIntro.fm
starter activities.
The Integration Appliance requires connectivity to the endpoints that are required by the orchestration. Data flows through the Integration Appliance and is stored internally as XML variables. The Integration Appliance allows you to control the logging for each orchestration.
Figure 1-3 Cast Iron Live tabs for life cycle environments
You access the runtime environments through the Development, Production, and Test tabs. You can create projects in the Create tab and later modify projects using the Modify tab.
8004chIntro.fm
The Modify tab shows all projects that you are allowed to view (Figure 1-4).
Figure 1-4 Cast Iron Live Modify tab showing a list of projects
Each project has the following actions (as shown in Figure 1-5), which are initiated by clicking an icon: Edit Project ( Publish ( Delete ( ) ) ) )
To edit a project, select the Edit Project icon, and then select Edit Project in Designer. The Studio development environment opens with the same functionality as the on-premise installation. You can then publish the project to one of the runtime environments by selecting the Publish icon. When using Studio in Cast Iron Live, development is the same as for an installation on the local PC. Studio in Cast Iron Live has access to the same endpoints that the PC has access to. When publishing to a runtime environment, the orchestration is run in the Cast Iron Live cloud. Figure 1-6 illustrates the Cast Iron Live process. A developer accesses Cast Iron Live through a web browser, creates projects, and develops these projects with Studio (which runs in a Java runtime environment on the PC). When complete, the developer publishes the project to a test environment. After testing, the projects are published to a production environment. You
8004chIntro.fm
can also manage the environment, the projects and logs and other components through a web browser. If you connect to applications or endpoints behind a firewall, the Secure Connector is required as described in the following section.
Web browser management of project deployment and Cast Iron Live environments Applications (Test) Applications (Production)
Secure Connector
The Cast Iron Live Secure Connector allows orchestrations in Cast Iron Live to connect to endpoints behind a firewall. A separate Secure Connector is configured for each environment and is installed to a computer running the Windows or Linux operating systems behind the firewall. The Secure Connector includes the following security features: The Secure Connector always initiates communication with Cast Iron Live and that communication is validated before the Secure Connector attempts further processing. Communication between the Secure Connector and Cast Iron Live is based on the standard SSL 128-bit encryption over HTTPS through port 443. When the Secure Connector starts, it undergoes the SSL/TLS handshake, authenticates through standard X.509 certificates, and establishes a TLS-encrypted tunnel if all connections are successful. When the TLS connection is established successfully, the Secure Connector sends a request to Cast Iron Live for authentication. Based on information that is provided by the Secure Connector, including a private key, Cast Iron Live ensures that only the correct Secure Connector is granted access to a particular environment of a tenant.
8004chIntro.fm
Data transmission and requests that are inbound to the Secure Connector from Cast Iron Live are limited to the available set of endpoint connectors that are provided by Cast Iron. Users need to explicitly specify address and authentication information from each endpoint to which they are connecting. Local scripts or executables cannot be run directly through the Secure Connector. The Cast Iron Secure Connector can have the network or IPs that it can access internally restricted. Further security information is available in the IBM white paper, WebSphere Cast Iron Live Security, which you can download from: http://www-01.ibm.com/common/ssi/cgi-bin/ssialias?infotype=SA&subtype=WH&htmlfid=W SW14139USEN
8004chIntro.fm
An orchestration is built by dragging activities onto the main workspace. Selecting an activity on the workspace opens the configuration pane for that activity. The configuration consists of a checklist of items that need to be configured. Chapter 3, Developing and unit testing with WebSphere Cast Iron Studio on page 79 provides more information about using Studio.
1.5.1 Connectors
Cast Iron contains built-in connectors to many applications. However, providing a connector for every application in the market is impossible. Companies also often build their own internal applications to which they want to connect. Although you can rely on generic connectivity through web services or can access data directly from the database to connect to applications, you can also use the Connector Development Kit (CDK) to develop a specific connector to an application.
10
8004chIntro.fm
The CDK is a wizard driven tool that enables the development of a connector to abstract specific functionality of the application, for example the insertion of new records or the updating of existing records. The CDK provides all the necessary tools to build the connector and also to perform unit testing, integration testing, and packaging and deployment of the connector. When new connectors are released by IBM Cast Iron, you can download them from Studio. Note: Studio built-in connectors have a discovery mechanism that lists objects, data fields, and parameters for the endpoint activity. For example, with the SAP Invoke RFC activity, you can browse the list of RFCs. When you select an RFC, the Cast Iron connector automatically retrieves the list of input parameters and the data fields that are returned.
11
8004chIntro.fm
12
8004chIntro.fm
You use an activity by dragging it to the workspace. After you place an activity on the workspace, you can move, delete, or reconfigure it at any time.
13
8004chIntro.fm
Figure 1-10 shows an orchestration in the workspace with the following activities: A Receive Request, which is the starter activity that receives a request from an HTTP endpoint A SAP activity, Invoke RFC, which is the orchestration that the chosen RFC uses to retrieve data from SAP A Salesforce.com connector Upsert Objects, which performs the Salesforce.com function to update or insert a record to the selected Salesforce.com object A Send Response, which sends a response back to the HTTP requestor
When you select an activity in the workspace, the configuration pane is presented in the lower section of Studio. Activities for endpoints include a checklist of items and the input and output mapping requirements. Logic and transformation activities list items that are required for the configuration of that activity.
14
8004chIntro.fm
You cannot verify or publish a project if there are incomplete configurations, so Studio provides the ability to validate the orchestrations before publishing them.
15
8004chIntro.fm
Map outputs
Use the Map Outputs option in the checklist to select the data that is required by other activities. For example data that is required to be passed to an endpoint or return codes from an activity that need to be queried. One or more new variables are created for the data. Figure 1-13 shows an example of mapped outputs.
16
8004chIntro.fm
Endpoint specific activities These activities include receiving an IDOC from an SAP system and polling activities, such as for getting updated database records or updated records from Salesforce.com.
1.6.4 Testing
Studio provides the Verify tool to unit test and verify that orchestrations are functioning as expected. An orchestration job can be started, and the orchestration will then wait for the starter activity to initiate. The HTTP Post utility provides an easy way to test and verify the orchestration. Detailed logged information about how the data flows through the various steps in the orchestration is provided to help you easily identify problem areas.
17
8004chIntro.fm
Figure 1-14 shows a test of an orchestration in the Verify tab. Each activity is shown in the top panel, and you can view the data at any point for any activity. The data for the variable SAP Response is shown in the lower panel.
Figure 1-14 Example of Verify tab used for testing the orchestration
Individual activities can also be tested with the verify tool. Rather than running the entire orchestration, you can use a Verify Activity menu item.
18
8004chIntro.fm
You can test the mapping for both Map Inputs and Map Outputs in the configuration pane. This testing is useful for confirming any transformations that might occur in the map. Figure 1-15 shows a test of the map for the Salesforce.com Upsert activity. The ability to generate test data is provided.
Figure 1-15 Testing the mapping for Map Output for an activity
19
8004chIntro.fm
Using the TIPs provides the following key benefits: Save costs because 80% of the developer effort to build an integration is already codified in the template. The vast majority of the remaining effort involves using a wizard to configure the endpoint and to apply any special customizations, such as custom fields or objects mapping and special business logic. Readily referenceable preferred practices, because each certified TIP has been carefully authored and provides a method to reference and learn from other users and Cast Iron experts. Flexible to adapt to changes, because the TIPs and TIP configuration wizard allow a user to modify an integration when business needs change and additional fields or new business rules need to be accommodated. The wizard automatically provides options for a user to select custom fields, change maps, or change business rules.
20
8004chIntro.fm
Logging level settings (Figure 1-17) allow for different levels of error logging from none through to logging all details of each activity.
The dashboard also shows the resource utilization of the Integration Appliance, and you can drill down to more detail. You can configure notifications, and a management API is available that enables you to write scripts for all aspects of the Integration Appliance including monitoring of orchestrations, logging, and security. Chapter 4, Management and monitoring on page 173 provides detail on management and monitoring capability.
21
8004chIntro.fm
22
8004chIntro.fm
23
8004chIntro.fm
The user interface for Cast Iron Express Edition is different from the Cast Iron Live user interface. Figure 1-19 shows an example of the creation of the field mapping between endpoints.
You can sign up for a trial of Cast Iron Express Edition at: http://express.castiron.com/express/ This book does not provide further details about the Cast Iron Express Edition.
1.12 Terminology
When learning about Cast Iron, it might be helpful to have an understanding of the following terminology: Activity An activity performs a specific operation. Activities are organized in categories and are available on the Studio Activities tab. Appliance See Integration Appliance. Checklist A list of tasks that must be configured for the activity. The orchestration cannot be verified or published if one or more checklist tasks are incomplete. Connector The connector is the Cast Iron module that provides the integration to an endpoint. A connector is used by using the activities for the endpoint found on the Studio Activities tab. Connector Developer Kit (CDK) The CDK allows you to use Studio to develop and deploy new connectors. Designer The Designer provides the development environment for creating orchestrations. The term
Designer is used in the Cast Iron Live menu, and is also known as Studio.
24
8004chIntro.fm
Endpoint The endpoint is an external system, for example an application such as SAP or an FTP server. In Studio, an endpoint represents the properties of an external system. Integration Appliance The Integration Appliance is the Cast Iron device that provides the run time for integration projects that are developed with Studio. Job A job is an instance of an orchestration. Orchestration An orchestration is the specific sequence of processing activities (such as data mapping, transformation, and control logic activities), endpoints, and data types that are defined and configured using Studio and that are deployed to a Cast Iron Runtime. Project A project is a Cast Iron container for managing orchestrations and the assets that the orchestrations require. You develop projects using Studio. Run time The run time is the component that runs the project configurations. In Cast Iron Live, run times are environments. Secure Connector The Cast Iron Live Secure Connector facilitates the secure transfer of data between Cast Iron cloud (Cast Iron Live and Express Edition) and an endpoint that is located behind a firewall. Starter activity The starter activity is an activity that can initiate an orchestration. An orchestration must have at least one starter activity and can have more than one by using the Pick activity. Studio Studio is the development environment for creating projects and orchestrations. In Cast Iron Live, Studio is also referred to as Designer. Web Management Console (WMC) The WMC is the browser interface to the Cast Iron Runtime and provides full functionality for the user to manage and control all aspects of the runtime environment.
25
8004chIntro.fm
26
8004chInstall.fm
Chapter 2.
27
8004chInstall.fm
28
8004chInstall.fm
3. Read and accept the license agreement (as indicated in Figure 2-2), and then click Next.
4. At the Destination Directory panel, specify the installation path. The default path is the C:\Program Files\IBM\WebSphere Cast Iron Studio 6.1.0.1 directory. This example uses the reduced path of the C:\IBM\WebSphereCastIronStudio6.1.0.1 directory, as shown in Figure 2-3. Click Next to continue.
29
8004chInstall.fm
5. Accept the default options for the Start Menu Folder (shown in Figure 2-4), and then click Next.
6. Accept the default options for File Associations (shown in Figure 2-5), and then click Next.
30
8004chInstall.fm
7. Accept the default options for Additional Tasks (shown Figure 2-6), and then click Next.
A progress bar shows the status of the installation, as shown in Figure 2-7. The installation takes only a few minutes.
31
8004chInstall.fm
8. When finished, the final panel opens. Leave the Run WebSphere Cast Iron Studio option enabled, and click Finish, as shown in Figure 2-8.
9. Depending on your operating system and the security settings, a Windows Security Alert message might display, as shown in Figure 2-9. Click Unblock to allow Studio to start.
32
8004chInstall.fm
10.The entry window of Studio displays, as shown in Figure 2-10. To set the language for the user interface, Studio determines the regional setting of the operating system. If, for example, the regional setting of the operating system is set to U.S., the Studio menus display in English.
11.Click Help About to determine the version of Studio. Installation directories: Studio creates the following directories during installation and startup: The C:\IBM\WebSphereCastIronStudio6.1.0.1 installation directory contains the binaries and the output.log and error.log log files. The C:\Documents and Settings\username\.castiron configuration directory, where username is the administrator or the name of the user installing Studio, contains configuration properties, installed connectors libraries, and other configuration properties. On Windows 7, the directory is C:\Users\username\.castiron
33
8004chInstall.fm
34
8004chInstall.fm
Studio will now start with a German interface, as shown in Figure 2-12.
35
8004chInstall.fm
3. Click OK to upload the libraries. Studio is stopped after the upload, and you must start Studio again manually.
36
8004chInstall.fm
3. Select the plug-in connectors that you want to download, and click Install. Click Close after the connectors are installed.
37
8004chInstall.fm
After you download a connector, the connector displays in the Activities tab with the built-in connectors, as shown in Figure 2-15.
You can now drag the plug-in connector activities into the Studio workspace to create an orchestration.
38
8004chInstall.fm
The physical appliance has six network interfaces, which are located to the right on the front of the appliance. From these six network interfaces, WebSphere Cast Iron uses the four that are indicated in Figure 2-17.
The network interfaces from left to right are: Repl 1: The first replication interface that is used for high availability scenarios MGMT: The interface for management traffic Data 1: The interface for data integration traffic Data 2: Currently not used in WebSphere Cast Iron Data 3: Currently not used in WebSphere Cast Iron Repl 2: The second replication interface that is used for high availability scenarios The RJ45 serial port: The interface at the far left of the appliances front looks similar to a network interface, but it is the serial port (RJ45). This port is used to connect a terminal that is used primarily for initial configuration.
39
8004chInstall.fm
The scenarios in this book use a management PC that is based on Linux and use Putty as the terminal program. To connect to the physical appliance: 1. Plug the DB9F plug of the RJ45-to-DB9F serial adapter cable into the DB9M plug of the DB9M-to-USB adapter. 2. Plug the RJ45 plug of the serial adapter cable into the RJ45 port of the appliance. 3. Plug the USB plug of the serial adapter cable into one of the USB ports of the management PC. 4. Start the physical appliance. 5. Start the terminal program. 6. Configure the terminal program to connect to the serial cable. The settings that you use depend on the port that is used in the management PC, on the serial or USB port, and on the terminal program. The scenarios in this book, with the USB port and Putty on Linux, use the /dev/ttyUSB0 serial line and a 9600 speed. 7. A login panel displays as shown in Example 2-1.
Example 2-1 Physical appliance login panel
IBM WebSphere DataPower Cast Iron Appliance (6.1.0-0000) Copyright IBM Corp. 2003, 2010. All Rights Reserved. none login:
40
8004chInstall.fm
none/Standalone> system show version Model: Cast Iron XH40, Revision 2 Version: Cast Iron Operating System 6.1.0.0000 (Mon Aug 22 11:38:16 UTC 2011) Serial Number: 6800193 3. Gather additional details about the physical appliance using the system show platform command. Example 2-3 shows the output of this command.
Example 2-3 Physical appliance system show platform
none/Standalone> system show platform ROM Version: I009 Platform: 71988FX Serial Number: 6800193 UUID: 03000200-0400-0500-0006-000700080009 Board Product: Greencity Board Serial Number: serial_number MAC0: 00:0b:ab:51:11:b0 MAC1: 00:0b:ab:51:11:b1 Access Key: DXEY-3L9G-HLB4-4NGO
41
8004chInstall.fm
Table 2-2 lists the values you need to capture before setting up the appliance.
Table 2-2 Physical appliance: Required network parameters Network Management network (emgmt) Network used for administrative traffic Parameter used in command appliance hostname domain-name mgmt ip address mgmt netmask mgmt broadcast dns-ipaddress gateway ip-address ntp-ipaddress Data network (edata) Network used for integration data traffic data ip address data netmask data broadcast Explanation Host name of the appliance Domain name of the appliance IP address for management network Subnet Mask for management network Broadcast for management network Primary DNS address Gateway for management network Network Timeserver address (can be none) Data IP address Data Subnet Mask Broadcast Value
To improve startup time, configure the parameters to either static values or none. For additional details about the network parameters, refer to the Cast Iron CLI reference, which is available at: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/index.jsp?topic=%2Fcom.ibm.web sphere.cast_iron.cli.doc%2FCLI_network_netset.html To set up the appliance network, follow these steps: 1. Complete the information listed in Table 2-2. To configure the appliance based on the values in Table 2-2, use the following commands (the scenarios in this chapter do not use an NTP server or search the domain list): net set hostname static <appliance hostname> net set domain static <domain-name> net set nameserver static <dns-ipaddress> net set gateway static <gateway ip-address> emgmt net set search none net set ntp none (net set ntp static <ntp-ipaddress>) net set interface emgmt address <mgmt ip address> mask <mgmt netmask> bcast <mgmt broadcast> net set interface edata address <data ip address> mask <data netmask> bcast <data broadcast> 42
Getting Started with IBM WebSphere Cast Iron Cloud Integration
8004chInstall.fm
When you issue these commands, the settings are not activated automatically but are kept in memory to become active the next time the network is started. 2. Before activating these settings, make sure that there is no configuration error. Verify the configuration using the net show memory command. Example 2-4 shows the output for this command in the test environment for this book.
Example 2-4 Physical appliance: Net show memory
none/Standalone> net show memory Hostname: castiron1 Domain: localdomain Domain Search: [None] Nameservers: 192.168.100.1 Gateway: 192.168.100.254 on emgmt NTP: [None] Carrier timeout: 30 seconds Emgmt(00:0b:ab:51:11:b1): Static Address: 192.168.100.44, Netmask: 255.255.255.0, Broadcast: 192.168.100.0 Emgmt Link: autonegotiate Edata(00:0b:ab:50:bc:c4): Static Address: 192.168.100.55, Netmask: 255.255.255.0, Broadcast: 192.168.100.0 Edata Link: autonegotiate Routes: [None] 3. After validating the settings, restart the network using the net restart command. Then, verify the new settings using the net show active command. If the network is active and a host name is assigned, the command prompt switches from <none> to <hostname>. Link not ready message: If the network is not set up correctly, a message similar to the following message might display. Review your installation process to ensure the network is set up correctly. ADDRCONF(NETDEV_UP): eth1: link is not ready e1000e: eth1 NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX/TX 0000:0f:00.0: eth1: 10/100 speed: disabling TSO ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready 4. Determine the system status using the system show status command. Example 2-5 shows a sample output from this command. The status for the network and run time might also be Starting or Down.
Example 2-5 Output from the system show status command
Appliance Status ---------------System: Up Network: Up Runtime: Up Command complete If the status of the network is Down or Starting, wait a couple of minutes, and then issue the system show status command again.
43
8004chInstall.fm
Tip: If the net show active command displays the older values and the net show memory command displays the newer values, reboot the appliance using the system reboot command. 5. Use ssh to connect to the management IP address in a more comfortable way. 6. Determine and validate the additional network settings, such as the MAC Address and Link Speed, using the following command: netspect ifconfig interface <emgmt | edata> Additional resources: For additional details about network settings and troubleshooting, refer to the Cast Iron CLI reference, which is available at: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/index.jsp?topic=%2Fcom.ibm. websphere.cast_iron.cli.doc%2FCLI_about_CLI.html To finalize the initial installation, log in to the WMC. For more information, see 2.5, Finalizing the installation using the WMC on page 55.
The two appliances will act as one appliance. To do so, they must stay synchronized and need to know the status of each other. The HA installation and setup consists of the following steps: 1. Install both appliances as separate boxes.
44
8004chInstall.fm
2. Connect the two appliances. 3. Activate high availability. 4. Test HA takeover. When HA is active, both appliances share the host name and IP addresses and stay synchronized.
45
8004chInstall.fm
To set up an HA configuration, you need to provide more information than for a stand-alone configuration. Table 2-4 lists the values that you need to determine before setting up the appliances. For ease of documentation, we refer to appliance1 and appliance2.
Table 2-3 Physical appliances in an HA configuration: Required network parameters Network Management network (emgmt) Network used for administrative traffic Parameter in command appliance1 hostname appliance2 hostname domain-name mgmt ip address for appliance1 mgmt ip address for appliance2 mgmt netmask mgmt broadcast dns-ipaddress gateway ip-address ntp-ipaddress Data network (edata) Network used for integration data traffic data ip address for appliance1 data ip address for appliance2 data netmask data broadcast Explanation Host name of the appliance1 Host name of the appliance2, only used during setup. Domain name of the appliances IP address for management network for appliance1 IP address for management network for appliance1, only used during setup. Subnet Mask for management network Broadcast for management network Primary DNS address Gateway for management network Network Timeserver address (can be none) Data IP address for appliance1 Data IP address for appliance1, only used during setup. Data Subnet Mask Broadcast Value
46
8004chInstall.fm
2. Verify that the two appliances have the same version of WebSphere Cast Iron installed using the system show version command. Upgrade to the latest available version if necessary. Make sure at the end of the installation process that both appliances are up and running in parallel and that each appliance has the run time status Up.
Activate HA
To activate HA: 1. Use the serial cable to connect to the serial port of the primary appliance. 2. The WebSphere Cast Iron Login screen displays in the CLI of the primary appliance. Log in as the administrator. 3. Issue the system haconfig enable active command. The appliance reboots and restarts as the active appliance. 4. When the WebSphere Cast Iron Login panel of the CLI displays, log in again as the administrator. The appliance name/Active> command prompt indicates that the appliance is the active appliance. 5. Disconnect the serial console from the active appliance and connect it to the second appliance. 6. The WebSphere Cast Iron Login screen displays in the CLI of the second appliance. Log in as the administrator. 7. Issue the system haconfig enable standby command to configure the second appliance as the HA standby appliance. The appliance reboots and restarts as the standby appliance.
47
8004chInstall.fm
8. When the WebSphere Cast Iron Login panel of the CLI displays, log in again as the administrator. The none/Standby> command prompt indicates that the appliance is the standby appliance. 9. Switch the serial console back to the active appliance, and check the HA using the ha show pairstatus command. If synchronization has not completed, the status is as shown in Example 2-6.
Example 2-6 Physical appliances: HA Pair Status not complete
Pair Status ---------------NOT Highly Available Local State: ACTIVE_2 Peer State: STANDBY Sync Status: 20% Appliance Services ------------------Network: Up Runtime: Starting Command complete The output indicates that the appliances are not highly available because the synchronization has not yet finished. 10.The synchronization can take up to 15 minutes. So, wait a few minutes, and then issue the ha show pairstatus command again. After synchronization has finished, the pair status looks as shown in Example 2-7.
Example 2-7 Physical appliances: HA Pair Status complete
Pair Status ---------------Highly Available Local State: ACTIVE_2 Peer State: STANDBY Sync Status: Synced Appliance Services ------------------Network: Up Runtime: Up Command complete
Test HA takeover
Log in to the active appliance, and issue the ha switch command to switch the roles of the HA pair. The standby peer takes over and becomes active. It takes over the host name and the IP addresses. The previously active appliance restarts. Issue the ha switch command again to switch back to the original roles. During takeover, by default, no synchronization is required. 48
Getting Started with IBM WebSphere Cast Iron Cloud Integration
8004chInstall.fm
49
8004chInstall.fm
50
8004chInstall.fm
After some time (depending on the hardware), the login panel displays as shown in Figure 2-21.
51
8004chInstall.fm
Password tip: The keyboard layout of the appliance is set to U.S. by default. If you are connecting using a console program, such as vSphere, you might need to use Shift+2 instead of the at symbol (@) in the password. If that does not help, use the resetpass command to change the password. 2. Verify the version using the system show version command, as shown in Example 2-8.
Example 2-8 The show version command for the virtual appliance
none/Standalone> system show version Model: Cast Iron vA3000, Revision A Version: Cast Iron Operating System 6.1.0.1.0000 (Thu Sep 15 14:16:52 UTC 2011) Serial Number: VMW5NKY7RKX54NMA Notice that the prompt varies, depending on the host name. If the host name has not been assigned, the prompt will appear as none/Standalone. Otherwise, the prompt will appear as hostname/Standalone. 3. Gather additional details about the virtual appliance using the system show platform command. The output of this command provides additional information as shown in Example 2-9.
Example 2-9 The system show platform command for the virtual appliance
none/Standalone> system show platform ROM Version: 6.00 Platform: VMware Virtual Platform Serial Number: VMW5NKY7RKX54NMA UUID: 423A3158-B97E-9B70-F2E2-D76EF8018893 Board Product: 440BX Desktop Reference Platform Board Serial Number: None MAC0: 00:50:56:ba:00:e8 MAC1: 00:50:56:ba:00:e9 Access Key: 36G3-ZO77-RWYG-7E36
52
8004chInstall.fm
Command complete If the status of the network is Down or Starting, wait a few minutes, and then issue the system show status command again. If the network is still down, there is a problem getting the network settings using DHCP. 2. Issue the net show active command. If the DHCP address cannot be retrieved, the network shows as inactive. If the network is up, the two network addresses that are assigned for management and data display, as shown in Example 2-11.
Example 2-11 The net show active command output for the virtual appliance
ci-192-168-238-145/Standalone> net show active Hostname (DHCP from emgmt): ci-192-168-238-145 Domain (DHCP from emgmt): localdomain Domain Search (DHCP from emgmt): localdomain Nameservers (DHCP from emgmt): 192.168.238.2 Gateway (DHCP from emgmt): 192.168.238.2 NTP (DHCP from emgmt): [None] Carrier timeout: 30 seconds Emgmt(00:0c:29:22:d1:ea): DHCP Address: 192.168.238.145, Netmask: 255.255.255.0, Broadcast: 192.168.238.255 Link Status is not available Edata(00:0c:29:22:d1:f4): DHCP Address: 192.168.238.146, Netmask: 255.255.255.0, Broadcast: 192.168.238.255 Link Status is not available Routes: [None] ci-192-168-238-145/Standalone>
3. Use ssh to connect to the management IP address, which makes it easier to copy and paste the command and results into the CLI or vice versa. 4. Determine and validate the additional network settings, such as the MAC Address and Link Speed, using the following command: netspect ifconfig interface <emgmt | edata> Additional resource: For additional details about network settings and troubleshooting, refer to the WebSphere Cast Iron CLI reference, which is available at: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/index.jsp?topic=%2Fcom.ibm. websphere.cast_iron.cli.doc%2FCLI_about_CLI.html
53
8004chInstall.fm
Table 2-4 Required network parameters for the virtual appliance Network Management network (emgmt) Network used for administrative traffic Parameter in command appliance hostname domain-name mgmt ip address mgmt netmask mgmt broadcast dns-ipaddress gateway ip-address ntp-ipaddress Data network (edata) Network used for integration data traffic data ip address data netmask data broadcast Explanation Host name of the appliance Domain name of the appliance IP address for management network Subnet Mask for management network Broadcast for management network Primary DNS address Gateway for management network Network Timeserver address (can be none) Data IP address Data Subnet Mask Broadcast Value
To improve startup time, configure all settings to either static values or none. For additional details about the network parameters, refer to the WebSphere Cast Iron CLI reference, which is available at: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/index.jsp?topic=%2Fcom.ibm.web sphere.cast_iron.cli.doc%2FCLI_network_netset.html To set up the appliance network follow these steps: 1. Complete the information listed in Table 2-4. 2. To configure the appliance based on the values in Table 2-4, use the following commands (the scenarios in this book do not use an NTP server or search the domain list): net set hostname static <appliance hostname> net set domain static <domain-name> net set nameserver static <dns-ipaddress> net set gateway static <gateway ip-address> emgmt net set search none net set ntp none (net set ntp static <ntp-ipaddress>) net set interface emgmt address <mgmt ip address> mask <mgmt netmask> bcast <mgmt broadcast> net set interface edata address <data ip address> mask <data netmask> bcast <data broadcast> When you issue these commands, the settings are not activated automatically but are kept in memory to become active the next time the network is started.
54
8004chInstall.fm
3. Before activating these settings, make sure that there is no configuration error. Verify the configuration using the net show memory command. 4. After validating the settings, restart the network using the net restart command. Then, verify the new settings using the net show active command. If the network is active and a host name is assigned, the command prompt switches from <none> to <hostname>. 5. Determine the system status using the system show status command. Example 2-12 shows a sample output from this command. The status for the network and run time might also be Starting or Down.
Example 2-12 The system show status command output for the virtual appliance
Appliance Status ---------------System: Up Network: Up Runtime: Up Command complete If the status of the network is Down or Starting, wait a few minutes, and then issue the system show status command again. Tip: If the net show active command displays the older values and the net show memory command displays the newer values, reboot the appliance using the system reboot command. 6. Use ssh to connect to the management IP to make it easier to copy and paste results into the CLI or vice versa. 7. Determine and validate the additional network settings, such as the MAC Address and Link Speed, using the following command: netspect ifconfig interface <emgmt | edata> Tip: For additional details about network settings and troubleshooting, refer to the Cast Iron command line interface reference at: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/index.jsp?topic=%2Fcom.ibm. websphere.cast_iron.cli.doc%2FCLI_about_CLI.html
55
8004chInstall.fm
http://www-01.ibm.com/software/integration/cast-iron-cloud-integration/reqs/ 2. Insert the following URL: http://<management IP> Replace <management IP> with the management IP address that you retrieved using DHCP or with the IP address that was defined as static IP. 3. A Security Alert window displays explaining that the certificate cannot be trusted and does not match the requested site. Click View Certificate to get details about the certificate, as shown in Figure 2-22.
4. As indicated in Figure 2-23, the Integration Appliance uses a self-signed certificate that was issued by Cast Iron Appliance to Cast Iron Appliance. As indicated by the Valid from date, the certificate is valid for two years from day of installation.
56
8004chInstall.fm
Install the certificate into your browser if you do not want to see the warning again. However, a better approach is to replace the certificate shortly after installation and to keep the certificate uninstalled as a reminder. Click OK to close the Certificate window. The WMC login panel displays. Insert the credentials for the administrative user, as shown in Figure 2-24. (The default user name is admin, and the default password is !n0r1t5@C).
57
8004chInstall.fm
5. The WMC uses Adobe Flash Player to display the content. If the player is not installed, you are prompted to install it. If necessary, install the plugin. If you need to restart the browser after the installation, log in to the WMC again. You can now use the WMC. The console looks similar to that shown in Figure 2-25.
58
8004chInstall.fm
Change the admin password: For security purposes, change the admin default password. For more information, refer to: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/index.jsp?topic=%2Fcom.ibm. websphere.cast_iron.appliance.doc%2FPermissions%2FchangingPasswordOthers.htm
To install the SAP libraries: 1. In the WMC, go to System Upgrade. The current version of the appliance displays. 2. Click Update Connector Libraries, as indicated in Figure 2-27.
59
8004chInstall.fm
3. In the Update connector Libraries panel, click the plus sign (+), as indicated in Figure 2-28.
4. Add the two SAP JCo version 3.x.Java libraries, sapjco3.jar and sapidoc3.jar, and the native SAP library, libsapjco3.so. The panel now looks as shown in Figure 2-29.
5. Click Update to upload the libraries. The appliance restarts after the upload. Now you can use the Integration Appliance with SAP.
60
8004chInstall.fm
The Secure Connector includes the following components: The Secure Connector component in Cast Iron Live You have to configure in Cast Iron Live the Secure Connectors, you want to use. Secure Connectors are defined in the scope of an environment. The Secure Connector component in the enterprise You have to install the Secure Connector program within your on-premise environment that you want to connect to Cast Iron Live through Secure Connector. Figure 2-30 shows the architectural view of the Secure Connector.
Web browser management of project deployment and Cast Iron Live environments
Applications (Test)
Applications (Production)
Tip: The machine running the Secure Connector must have access to the endpoint but does not have to run on the same machine as the endpoint. Cast Iron Live uses the following environments and roles: The IBM WebSphere Cast Iron Cloud (the Cloud) supports multiple organizations (tenants). Each cloud tenant is managed by a tenant administrator. The Cloud supports multiple environments for each tenant. For example, you can have a Development, a Test, a Staging, and a Production environment. Although the Cloud administrator creates these environments for each tenant, it is the tenant administrator or the environment administrator who grants permissions to individual users or groups for each environment and who is allowed to install the Secure Connector.
61
8004chInstall.fm
To enable a Secure Connector, a tenant administrator or an environment administrator must complete the following tasks: 1. Create a Secure Connector in Cast Iron Live. 2. Download the Secure Connector configuration file and the installer. Then, an administrator for the target system must complete these steps: 1. Install the Secure Connector into the target environment behind the firewall. 2. Install third-party libraries. 3. Start the Secure Connector and verify the communication. The sections that follow describe how to set up the Secure Connector. For ease of documentation, we use one user for all steps.
Figure 2-31 Cast Iron Live panel when logging in as the tenant administrator
2. Now, click the environment tab where you want to install the Secure Connector. In this example, WebSphere Cast Iron Secure Connector will be installed into the Test environment. So, click the Test tab. 3. Create a Secure Connector in Cast Iron Live: a. On the Test tab, click System Secure Connectors. Then, click New Secure Connector, as indicated in Figure 2-32.
62
8004chInstall.fm
b. The Create Secure Connector dialog box displays. Specify a Secure Connector name (WinTestEnvironment) as indicated in Figure 2-33, and optionally provide a brief description of the Secure Connector. Then, click Save.
2.6.2 Downloading the Secure Connector configuration and the installer files
Next, you need to download the Secure Connector configuration file and the installer: 1. From the Secure Connectors page, click the Secure Connector name. The Edit Secure Connector dialog box shows the authentication key. 2. Click Download Secure Connector Configuration, as indicated in Figure 2-34.
63
8004chInstall.fm
3. Save the file on your local environment. Note that the name of the file has the environment name and also the connector name (in this example SecureConnector-Test_WinTestEnvironment-Configuration) as indicated in Figure 2-35.
Figure 2-35 WebSphere Cast Iron Live downloading the configuration for Secure Connector
Click OK to continue. 4. Back in the Edit Secure Connector dialog box, click Download Installer. Choose the either the Windows or Linux operating system (in this example, choose the Windows operating system). Save the file on your local environment. For a Windows operating system, this file is called windows-secure-connector-installer.exe, as indicated in Figure 2-36.
64
8004chInstall.fm
Tip: Although you can place the installer file into a temporary directory, you have to put the configuration file into a directory that is stable. During the installation, the configuration file is not copied. Instead, a reference to the file is created and used when the connector starts. 2. Click the installer file executable (windows-secure-connector-installer.exe) to start the installation wizard. 3. Depending on your security settings, a Security Warning panel might display. Click Run to allow the installer to continue. 4. The Welcome panel displays as shown in Figure 2-37. Click Next to continue.
5. Read and accept the Licensing Agreement, and then click Next. 6. Specify the Target Path for the installation. The default path on a Windows operating system is as follows: C:\Program Files\IBM\Secure_Connector_1.6.1.0.0 Change this path to your path of choice. The examples in this book use the following path: C:\IBM\Secure_Connector_1.6.1.0.0
65
8004chInstall.fm
7. You are informed that the target directory will be created, as shown in Figure 2-38. Click OK, and then click Next to continue.
8. Next, you can define the shortcuts. Accept the default settings, and then click Next. Tip: We tested the installer in several environments, and there was no dialog box for step 5 of 14. 9. Now the installer starts the installation as shown in Figure 2-39.
66
8004chInstall.fm
It will take several minutes for the installation to complete. When finished, the progress bar looks as shown in Figure 2-40. Click Next to continue.
10.Specify the location of the downloaded configuration file (SecureConnector-Test_WinTestEnvironment-Configuration) by clicking Browse, as indicated in Figure 2-41. Then, click Next.
Figure 2-41 Cast Iron Secure Connector installation path to configuration file
67
8004chInstall.fm
11.The installation wizard reads the configuration file and displays the user data in step 9 as shown in Figure 2-42. Ensure that the listener port, which defaults to 2500, is not already in use in your system. If required, change the port to a port that is not in use. Then, click Next.
Figure 2-42 Cast Iron Secure Connector installation user data display
68
8004chInstall.fm
12.If your system cannot connect directly to the Internet but is using a proxy, you can specify a proxy, including password, as shown in Figure 2-43. (The environment for this book does not need to specify a proxy.) Click Next to continue.
69
8004chInstall.fm
13.If you want to run the Secure Connector as a Windows service, specify the details as shown in Figure 2-44. This scenario starts the service manually, so do not enable this option. Click Next to continue.
Figure 2-44 Cast Iron Secure Connector installation Windows service configuration
70
8004chInstall.fm
14.The Installation Finished panel displays, indicating that the installation has finished successfully and that an uninstaller was created (Figure 2-45). Click Done to close the installation wizard.
The installer creates the following shortcuts, as shown in Figure 2-46: The Secure Connector Configuration shortcut allows you to change the configuration. A wizard similar to the installation wizard starts, reads the current configuration, and allows to change it. Use this shortcut also if you want to change the location of the configuration file. The Secure Connector Info shortcut displays the readme file with information about how to install the libraries and other components. The Start Secure Connector shortcut starts the Secure Connector. You can also start the Secure Connector using the following command: C:\IBM\Secure_Connector_1.6.1.0.0\runclient_osgi.bat start The Stop Secure Connector shortcut stops the Secure Connector. You can also stop the Secure Connector using the following command: C:\IBM\Secure_Connector_1.6.1.0.0\runclient_osgi.bat stop The Uninstall Secure Connector shortcut uninstalls the Secure Connector. You can also uninstall the Secure Connector using the following command: C:\IBM\Secure_Connector_1.6.1.0.0\Uninstaller\uninstall.bat
71
8004chInstall.fm
C:\>C:\IBM\Secure_Connector_1.6.1.0.0\runclient_osgi.bat start "Agent lib home C:\IBM\Secure_Connector_1.6.1.0.0\\lib" "Picking localconf .\config\localConfig_ws.xml" "Picking the resource rules .\config\resourceRules.xml" "Flags -Dcom.approuter.agent.debugflag="" -Dcom.approuter.agent.localconfigfile= .\config\localConfig_ws.xml -Dcom.approuter.agent.rulefile=.\config\resourceRules.xml -Dcom.approuter.agent.log4jfile=.\config\log4j.properties -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger -Dcom.approuter.agent=true -Dcom.approuter.sysconf.agent=true -Djavax.net.ssl.keyStore=.\etc\security\certs -Djavax.net.ssl.trustStore=.\etc\security\cacerts -Djavax.xml.ws.spi.Provider=com.approuter.module.jws.ProviderImpl -Dorg.osgi.framework.bootdelegation=* -Dc3p0.debugUnreturnedConnectionStackTraces=true -Dc3p0.unreturnedConnectionTimeout=300 -Dc3p0.checkoutTimeout=30000 -Dc3p0.maxIdleTimeExcessConnections=30 -Dc3p0.maxStatementsPerConnection=100 -Dc3p0.testConnectionOnCheckin=true -Dc3p0.testConnectionOnCheckout=true -Dc3p0.numHelperThreads=10 ""JAVA Optional Flags -Xrs -Xmx768m -Xms512m -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:+HeapDumpOnOutOfMemoryError -Xdump:stack -Xdump:java:defaults:file=logs\%Y-%m-%d-%H:%M:%S.jvm.pid%pid.dump" Starting Cast Iron Secure Connector 1.6.1.0.0 (Build 20111011-0038_H3) osgi> 2011-10-14 03:47:33 INFO ******************************************************************************* *** ********** STARTING SECURE CONNECTOR at 2011-10-14 03:47:33 ********** Time zone is Central European Time or Europe/Berlin ******************************************************************************* ***
72
8004chInstall.fm
2011-10-14 03:47:42 INFO Finished loading connector modules 2011-10-14 03:47:42 INFO Secure connector name: WinTestEnvironment, Tenant ID: 8 96FA7C4449370A8E511E6A6E9A03702, Environment ID: 8579AD0FA9D02C755F9DC7DA92D93925 2011-10-14 03:47:45 INFO Secure Connector started successfully 2011-10-14 03:47:49 WARNING could not find the object: com.approuter.assets.AssetPluginFactoryManager@10051005 in any directory! 2011-10-14 03:47:49 WARNING Extension Registry Could not locate the Directory where the extensions may be located! As the output shows, the Secure Connector started successfully but had some warnings. 2. Look at the Cast Iron Live WMC and check the status of the WinTestEnvironment Secure Connector. If there is no communication problem, the status changes from CREATED to RUNNING as shown in Figure 2-47.
Figure 2-47 Cast Iron Live WMC Secure Connector started successfully
3. Use the netstat -an command to verify that the 2500 and 20510 ports are used. 4. Stop the Secure Connector using the shortcut, and a message displays in the command line window, as shown in Example 2-14.
Example 2-14 Message when stopping the Secure Connector
osgi> Cast Iron Secure Connector 1.6.1.0.0 (Build 20111011-0038_H3) has terminated C:\IBM\Secure_Connector_1.6.1.0.0> 5. Use the netstat -an command to verify that the 2500 and 20510 ports are released. 6. Look again at the Cast Iron Live WMC (go to System Secure Connector), and the status of the WinTestEnvironment Secure Connector has changed to STOPPED as shown in Figure 2-48.
Figure 2-48 Cast Iron Live WMC Secure Connector stopped successfully
Tip: You might have to click Refresh before the status change is displayed.
73
8004chInstall.fm
To install the libraries in WebSphere Cast Iron Live using the SAP libraries, log in as the environment administrator, and click the Test tab.
74
8004chInstall.fm
Figure 2-50 Cast Iron Live: Download libraries for the Secure Connector
3. Extract the downloaded libraries.zip file. The libraries.zip file contains libraries for all connectors for which libraries have been uploaded to WebSphere Cast Iron Live. So, in the environment for this example, with only SAP libraries installed, the .zip file contains only SAP libraries. 4. Use the *.jar files (in this example, com.approuter.module.jcaconnectors.sap.tp-1.0.0.jar) to replace the files in the Secure Connector /lib/plugins installation directory. As shown in Figure 2-51, the downloaded file is much larger than the original file.
Figure 2-51 Cast Iron Live: Replace SAP connector libraries for the Secure Connector
Tip: If you want to keep the original files in the lib/plugins directory, move them to a different directory or rename them for example, *.jar_old. Otherwise, they will be picked up and might cause problems. 5. Copy all the remaining files of the .zip file to the Secure Connector /lib/thirdparty installation directory. In case of SAP the remaining files are the sapjco3.dll and libsapjco3.so native libraries, which are located in the in the native directory. These files do not exist in the thirdparty directory. (For Windows operating systems, you need only the DLL and not the .so file.) 6. Start the Secure Connector again. The messages is the same as in Example 2-13 on page 72 and in the Cast Iron Live WMC the status of the Secure Connector WinTestEnvironment changes back to RUNNING. (Take a look at step 6 on page 73 for help).
75
8004chInstall.fm
2.7 Upgrading from WebSphere Cast Iron Cloud Integration V6.0 to V6.1
This section describes how to upgrade from the WebSphere Cast Iron Cloud Integration V6.0 to the WebSphere Cast Iron Cloud Integration V6.1 and later. Upgrades to V6.0 and later are available either as a fix pack or as a full installation. For more information, go to the IBM Support Portal at: http://www-933.ibm.com/support/fixcentral/swg/selectFixes?parent=ibm~WebSphere&pro duct=ibm/WebSphere/WebSphere+Cast+Iron+Cloud+integration&release=All&platform=All& function=all
76
8004chInstall.fm
Figure 2-52 shows a list of the fixes that are available at the writing of this book.
1. fixpack: 6.0.0.4-WS-WCI-20110928-1725_H2.studio.exe 6.0.0.4-WS-WCI-20110928-1725_H2.studio.exe 2. fixpack: 6.0.0.4-WS-WCI-20110928-1717.vcrypt2 6.0.0.4-WS-WCI-20110928-1717.vcrypt2 3. fixpack: 6.0.0.4-WS-WCI-20110928-1717.scrypt2 6.0.0.4-WS-WCI-20110928-1717.scrypt2 4. fixpack: 6.0.0.4-WS-WCI-20110928-1717.ova 6.0.0.4-WS-WCI-20110928-1717.ova 5. fixpack: 6.1.0.1-WS-WCI-20110916-1648_H2.exe 6.1.0.1-WS-WCI-20110916-1648_H2.exe 6. fixpack: 6.1.0.1-WS-WCI-20110915-1504_H2.vcrypt2 6.1.0.1-WS-WCI-20110915-1504_H2.vcrypt2 7. interim fix: 6.1.0.1-WS-WCI-20110915-1504_H2.tar 6.1.0.1-WS-WCI-20110915-1504_H2.tar 8. fixpack: 6.1.0.1-WS-WCI-20110915-1504_H2.scrypt2 6.1.0.1-WS-WCI-20110915-1504_H2.scrypt2 9. fixpack: 6.1.0.1-WS-WCI-20110915-1504_H2.ova 6.1.0.1-WS-WCI-20110915-1504_H2.ova Oct 3, 2011 Oct 3, 2011 Oct 3, 2011 Oct 3, 2011 Sep 19, 2011 Sep 19, 2011 Sep 19, 2011 Sep 19, 2011 Sep 19, 2011
Figure 2-52 Fixes available for WebSphere Cast Iron Cloud Integration
77
8004chInstall.fm
During the upgrade, the appliance checks the integrity of the fix pack before applying it. If the new version supports newer third-party libraries (as is the case for SAP), replace the older libraries with newer ones. For details about the upgrade, refer to 4.9, Appliance and connector upgrades on page 228. Alternatively, you can download the new version of the WebSphere Cast Iron Hypervisor Edition and deploy it to the VMware hypervisor. Then, export the configuration of your existing appliance and import it into the new one. You can decide to import just the projects, just the user settings, or both. User setting information includes network configuration, users and groups, licenses, job log parameters, log levels, notifications, downtime rules, and passwords. For details about the export and import, refer to 4.2.14, Importing and exporting repository configuration on page 198.
78
8004chStudio.fm
Chapter 3.
79
8004chStudio.fm
Activity
Activity
Activity
Activity
Uses Uses
Publish
The remainder of this chapter describes the process of developing Cast Iron Integration Solutions using Studio and describes the components that are involved in this process.
80
8004chStudio.fm
Figure 3-2 Launching Studio from the Web Management Console (WMC) of Cast Iron Live
Tip for Cast Iron Live: If the WMC that launches Studio times out because of inactivity, you cannot save the project that you are developing in Studio back to Cast Iron Live. If this situation occurs, save the project locally, and then close Studio. Log in to the WMC again, and restart Studio. Finally reopen the local project, and save it back to Cast Iron Live. To avoid Cast Iron Live timing out, change the Inactivity Timeout from the WMC Settings pane, which is described in 4.1.2, Web Management Console on page 175. For Cast Iron Integration Appliances, Studio is a local application that must be installed and run on a Windows operating system. The installation process for Studio when using Cast Iron Integration Appliances and the prerequisites for using either version of Studio are described in Chapter 2, Installing and setting up WebSphere Cast Iron integration on page 27. When you launch Studio for the first time, it starts with the introduction pane shown in Figure 3-3 on page 82. The menus and toolbar icons are covered later in this chapter, and projects are covered fully in 3.3, Projects on page 84.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
81
8004chStudio.fm
The moving orange bar at the bottom right of the window indicates the amount of memory that Studio is currently using. To the right of the bar is a trash can icon. Clicking the trash can icon requests that Studio run garbage collection to attempt to reduce the amount of memory currently being used by Studio. You can hide the bar and trash can icon by selecting Edit Preferences Project and clearing the option. You can also set Studio to reopen the last project when Studio starts using the same preference window. Studio preferences include a number of other useful settings, all of which are fully documented in the information center: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/index.jsp?topic=%2Fcom.ibm.web sphere.cast_iron.doc%2Fbasis_projectpreferences.html You can start a web browser through Studio to go to the information center website using the Help menu. From the Help menu, you can also start a web browser to gain access to the WebSphere Cast Iron Community. This community provides support for Cast Iron development. The community also gives access to the Cast Iron Solutions Repository, which is discussed in Chapter 7, Reusability with Template Integration Projects (TIPs) on page 295, or you can access this repository directly in Studio using the Solutions menu. Figure 3-4 shows an open project in Studio. The Studio main window includes the following sections, which are highlighted in Figure 3-4: Workspace Configuration Pane The area for creating and editing orchestrations The area to set properties for the orchestration and its activities as well as to performing mapping
82
8004chStudio.fm
Toolbox
Workspace
Toolbox
Configuration pane
Multiple orchestrations, endpoints, and other project entities can be opened in the workspace at the same time. Each opened entity has an entity tab at the top of the workspace with the name of the entity displayed on it as shown in Figure 3-5. Click an entity tab in the workspace to select that entity. Click the cross on an entity tab to close that entity.
The Toolbox section has the following tabs, as shown in Figure 3-6: Project Selected in Figure 3-4 and discussed in 3.3.1, Project toolbox tab on page 87. This tab provides access to orchestrations, endpoints, flat file schemas, stylesheets, transformations, WSDL files, and XML schemas. Selected in Figure 3-6 on page 84 and discussed in 3.6, Activities on page 107. This tab provides access to the activities you can use to create an orchestration.
Activities
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
83
8004chStudio.fm
Variables Functions
Discussed in 3.7, Variables on page 117. This tab allows you to create and configure the variables that hold data in the orchestration. Discussed in 3.8, Functions and Lookup Tables on page 123. Provides access to built-in and custom functions that can be used to alter data in mapping tables. Discussed in 3.12, Unit testing on page 158. This tab provides a venue for testing orchestrations.
Verify
3.3 Projects
A Cast Iron Integration Solution is created in an integration project. In addition, there are also connector projects, which are discussed in Chapter 8, Building custom plugin connectors on page 323. Projects are a container for the components of an integration solution, such as orchestrations, endpoints, and transformations. You must create a project before you can create an integration solution, and all integration components must be held inside a project. To create a project inside Studio, select File New New Project or click the New Project toolbar icon shown in Figure 3-7. Other toolbar icons are available in Studio. A description of each toolbar icon displays when you move the mouse pointer over the icon.
84
8004chStudio.fm
Enter a name for the project and select a directory in which to store the project files. For a description of valid names, refer to: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/index.jsp?topic=%2Fcom.ibm.web sphere.cast_iron.doc%2Fref_About_Valid_Names.html For Cast Iron Live, you can create a project in the WMC using the Create tab. You can search for a project template in the Cast Iron Solutions Repository or you can select the create one from scratch link as shown in Figure 3-8.
Figure 3-8 Searching for template projects in Cast Iron Live or creating a project from scratch
Tip: Because multiple projects can be published by multiple people to one Cast Iron runtime, it is important to give the project a clear, descriptive, and unique name. A project replaces another project of the same name and version if they are both published to the same Cast Iron runtime. Different versions of the same project can coexist within a Cast Iron runtime To open an existing project inside Studio, select File Open Project, and then select a Cast Iron project properties file from the local file system. The file has an extension of .sp3. To open an existing project from Cast Iron Live, select the Modify tab, click the pencil icon next to the project that you want to open, and then select Edit Project in Designer as shown in Figure 3-2 on page 81. If the Cast Iron Live project was imported using the WMC and was not created in Cast Iron Live, the project does not appear on the Modify tab. To copy the source code for this published project to the Modify tab, select the environment tab where the project was published, and click the Create Source Project icon shown in Figure 3-9 for the project that you want to create.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
85
8004chStudio.fm
You can also delete a project from Cast Iron Live using the Modify tab and the cross icon as shown in Figure 3-10.
Studio opens only one project at a time. If a project is currently open in Studio and a new project is created or an existing project is opened, Studio closes the currently open project. If the currently open project has not been saved, Studio prompts you to save changes before it is closed. You save a project at any time using the File menu. For Cast Iron Live, you can save a project either to the local machine or to Cast Iron Live. The project must be stored to Cast Iron Live before it is published, because you cannot publish to Cast Iron Live environment directly from Studio. You can also rename a project by saving it with a different name, which creates a copy of the project with the new name, allowing you to use it as the starting point for a new integration solution. To promote an integration solution on to a Cast Iron runtime, the project that contains the solution is published to the runtime. All components inside the project are published with the project. The project then becomes a project configuration on the runtime. This project configuration holds the properties associated with the entities in the project. These properties can be changed in the WMC. This is described in 3.3.2, Configuration properties on page 88. When the project configuration is started on the runtime all enabled orchestrations inside it are started. Publishing a project is described in 3.13, Exporting and publishing on page 170 and starting a project configuration is discussed in 4.2.2, Starting a configuration on page 181. Tip: All orchestrations inside a project configuration will be stopped if the project configuration is stopped. Therefore it is good practice to only place orchestrations that are directly related to the same integration solution and would all need to be stopped if any are stopped in to the same project.
86
8004chStudio.fm
A view of the icons at the top of this tab is shown in Figure 3-12 on page 87. The four icons at the top left of the tab allow the creation of new orchestrations (1), endpoints (2), flat file schemas (3), and standalone maps (or transformations) (4) respectively. The fifth icon is Add Document (5) and gives options to import flat file schemas, WSDLs, XML schemas, and stylesheets (XSLTs) into the project. Finally, the right icon (6) revalidates the project. Project validation is discussed in 3.12, Unit testing on page 158.
The bottom of the Project toolbox tab contains a Dependencies pane. When a component is selected in the Project toolbox tab this dependencies pane shows any other components that are dependent on the selected component. The items in the Project toolbox will be discussed in detail later. Orchestrations are discussed in 3.4, Orchestrations on page 95. Endpoints are discussed in 3.5, Connectors and endpoints on page 102. Flat File Schemas and XML Schemas are covered in 3.10, Parsing data on page 149. Stylesheets and Transformations are covered in 3.9, Maps on page 128. Finally, WSDLs are used in 3.6, Activities on page 107.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
87
8004chStudio.fm
Figure 3-13 A cloned project configuration with different values for its configuration properties
Changing configuration properties is described in 4.2.6, Changing configuration properties on page 185. Cloning a project configuration is described in 4.2.8, Cloning configurations on page 188. Tip: It is recommended that configuration properties are used for all endpoint values. Establish a consistent naming convention for configuration properties that avoids abbreviations in the property name to avoid confusion. Configuration properties are listed alphabetically in the WMC so start settings for each endpoint with the same string to group them together, for example, DB2Password, DB2Username, etc.
88
8004chStudio.fm
configuration properties using the Project Configuration Properties menu to open the window shown in Figure 3-14. Each property is given a name, data type, and default value.
The property can then be used in any field in a component that has the T drop down icon next to it. The example in Figure 3-15 shows the User Name and Password fields of a Salesforce.com endpoint. Both of these fields have the T drop down icon next to them and thus can use a configuration property.
A configuration property can also be created directly from a field with the T drop down icon next to it. In Figure 3-15 there is a green dot at the end of the field. This dot indicates that the value in the field can be turned in to a configuration property. If the green dot is clicked a dialog box appears asking for the name of the property as shown in Figure 3-16.
When the configuration property is selected for a field, the name of the property displays in the field and not the value of that property. The name of the field is in italics to indicate that it is a configuration property, as shown in Figure 3-17 on page 90.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
89
8004chStudio.fm
Figure 3-17 The User Name and Password fields are set using configuration properties
Global Configuration Properties are created in Global Property Lists. The default list is created automatically. To create a new list, click New at the bottom left of the Global Configuration Properties window. To create a new property: 1. Select the Global Property List to which you want to add the property. 2. Then, type the name of the property in to the Add field, and click Create. 3. Set the data type and value for the property, and click OK. The window closes. To use a Global Configuration Property in a project, click the Import button on the project Configuration Properties window shown in Figure 3-14 on page 89. The Import Properties window shown in Figure 3-19 on page 91 opens.
90
8004chStudio.fm
Figure 3-19 The Import Properties window to import Global Configuration Properties
Select the Global Property List that contains the property you want to import from the drop-down list on the right pane of the window. Then select the property that you want to import, and click Add. If a property of the same name already exists in the project, a dialog window opens asking whether you want to replace the existing configuration property. You can copy just the value of a Global Configuration Property to an existing project Configuration Property of the same data type by selecting both the Global Configuration Property and the project Configuration Property and clicking Value. Project Configuration Properties can be imported in to a Global Property List by clicking the Import button on the Global Configuration Properties window shown in Figure 3-18 on page 90 and following the same steps as for importing Global Configuration Properties.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
91
8004chStudio.fm
The version number is a string property stored with the project. A copy of the project is not created when the version number is changed. If you need to keep previous versions of a local project then click File Save As to store the old version as a different name. Alternatively the whole of the project directory or an export of the project can be stored in an external version control repository. Two or more versions of a project can be published, deployed and started on the same Cast Iron runtime at the same time. Project configurations for all versions of the project will be created. An example of why two versions of a project might be running at the same time is shown in Figure 3-21 on page 93. A number of departments in a company are using one integration solution to move data from a database to Salesforce.com. New columns have been added to the database to support new requirements for the company. The validation and mapping within the orchestration needs to be changed to reflect the additional fields. However, the new columns are only being introduced to departments one at a time. Therefore it is necessary to keep both versions of the orchestration running for a period of time
92
8004chStudio.fm
WebSphere Cast Iron runtime Orchestration V1 Database Input Original rows New rows Orchestration V2 Database Input New Validation New Mapping Original Validation Original Mapping
Tip: Publishing a new version of a project while the old version is still running can make it quicker to move from one version to another in the WMC. After the new version of the project is published and configured, you can stop the old version and start the new version quickly to take its place. When a project is published to a Cast Iron runtime the name of the project configuration created uses the version number of the project. Thus, if a project is published more than once with different version numbers, multiple separate project configurations are created as shown in Figure 3-22. Note that version 1.0 of a project does not show a version number.
Figure 3-22 Multiple versions of a project published to the same Cast Iron runtime
For projects created in Cast Iron Live it is possible to create a new version of the project from the Modify tab by pressing the Create New Version icon as shown in Figure 3-23 on page 93.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
93
8004chStudio.fm
A project that is protected cannot be opened in Studio without entering the password. You can change the password and the project can be unprotected using the Project menu. The password is held only inside the project. When the project is published to a Cast Iron runtime, the password is not included in the project configuration and has no effect on the integration solution.
94
8004chStudio.fm
Figure 3-25 The orchestration summary contained inside a project documentation file
Orchestration and activity comments, as well as saving an image of an orchestration, are described in 3.4.4, Orchestration documentation on page 100. An XML file is also created that contains the settings for all components of the project, including configuration properties.
3.4 Orchestrations
Orchestrations are the main component of a Cast Iron Integration Solution. All functionality in
an integration solution is controlled by orchestrations. All projects must have at least one orchestration but projects can contain more than one orchestration. Take care when designing orchestrations. Poorly designed orchestrations can be difficult to maintain and if an orchestration is designed badly, it can take a long time to complete execution or not complete at all. Additionally, the Cast Iron runtime executes multiple orchestrations at the same time. Thus, a badly designed orchestration can slow down other orchestrations running on the same Cast Iron runtime. You can create orchestrations from either the Project menu or the Project toolbox tab by clicking the New Orchestration icon. The new orchestration is given a default name that you should change to a name that is unique within the project and that describes the functionality of the orchestration. For a description of valid orchestration names, refer to:
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
95
8004chStudio.fm
http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/index.jsp?topic=%2Fcom.ibm.web sphere.cast_iron.doc%2Fref_About_Valid_Names.html Orchestrations contain a set of activities that are performed in an order that is defined within the orchestration editor or workspace. Activities are discussed in 3.6, Activities on page 107.
Below the workspace is the configuration pane. Property values are set in this pane to control the behavior of an orchestration and its components. When a new orchestration is opened in the workspace the orchestration properties are shown in the configuration pane. Orchestration properties are described in 3.4.3, Orchestration properties on page 99. The workspace has three sections. The middle section shows the set of activities in the orchestration and the order in which they will be performed. The orchestration starts from the green play icon and ends at the red stop icon. These icons indicate only the start and end of the orchestration and do not contain any functionality. The top and bottom sections of the workspace show any endpoints that are used by activities in the orchestration. Inbound activities are linked to endpoints in the top section and outbound activities are linked to endpoints in the bottom section.
96
8004chStudio.fm
Inbound Endpoint
Activities
Outbound Endpoints
Figure 3-27 The workspace for an orchestration with activities and endpoints
Tip: If an endpoint is used as both inbound and outbound, it can be displayed in both the top section and the bottom section of the workspace. In Figure 3-27, the FTP endpoint is used to both get files and to put files using FTP. You drag activities from the Activities toolbox tab and place them on the orchestration at the point where they will be performed, as shown in Figure 3-28.
You can reorder activities at any time by dragging the existing activity in the orchestration to its new position in the orchestration. You can delete activities by right-clicking the activity and then selecting delete.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
97
8004chStudio.fm
You control the appearance of the workspace using the orchestration view icons at the top left of the workspace, as shown in Figure 3-29.
The top right icon highlighted in Figure 3-29 provides orchestration layout preferences. Clicking the icon opens the window shown in Figure 3-30, which you can use to set preferences on the layout of the orchestration.
Each icon provides a description when you move the mouse pointer over it. You can find full descriptions of each icon in the information center at: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/index.jsp?topic=%2Fcom.ibm.web sphere.cast_iron.doc%2Forch_Viewing_an_Orchestration.html
8004chStudio.fm
Initializing variables is discussed in 3.6.8, Using HTTP and web service starter activities with Cast Iron Live on page 116. All mandatory properties of all activities in the orchestration must be populated with valid values. If an orchestration is not valid, a yellow hazard symbol (which includes an exclamation mark) displays next to the orchestration in the Project toolbox tab, as highlighted in Figure 3-31.
Tip: If the Orchestration > Properties option is grayed out, there are a couple of reasons this could happen: The Orchestration Properties are already visible at the bottom of the screen. The Orchestration doesn't have focus. This can happen if you are using the Variables Toolbox Tab to edit a variable, for example. With the orchestration open, click in the workspace, then try again.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
99
8004chStudio.fm
You can set the following properties for the orchestration: Job Keys are created in the Job Identification section of the orchestration properties. The benefit of Job Keys and how they are used is discussed in 3.7.4, The JobInfo variable and Job Keys on page 122. By default multiple jobs run through each orchestration in parallel on a Cast Iron runtime to improve performance. In some cases it is important that only one job runs at any one time. For example, two jobs can conflict with each other when trying to access one resource, such as a database table where one job can delete a table row that the other job is trying to use. To force the orchestration to run with only one job at a time, select the Process Orchestration Jobs Sequentially option shown in Figure 3-32. Tip: If any orchestration variables are defined as shared, the orchestration runs all jobs sequentially automatically. Shared variables are described in 3.7.2, Shared variables on page 121. In this case, the orchestration properties view displays as shown in Figure 3-33. The option is selected and disabled so that it cannot be changed.
By default the Cast Iron runtime persists the current state of a job running through an orchestration along with its current data. Thus if a Cast Iron runtime failure occurs that causes the runtime to stop before the job has run to completion, the Cast Iron runtime remembers the state of the job and when the runtime restarts the job restarts from the last persisted point. However, persisting the state of each job impacts performance. Persistence is disabled for an orchestration by clearing the Enable Persistence option as shown in Figure 3-32. You can find further details about Cast Iron recovery in Chapter 6, Availability and scalability planning on page 279.
100
8004chStudio.fm
A window opens to allow you to add comments. After you add comments for an activity, the yellow box for the activity is filled in with lines as shown in Figure 3-35.
You can also enter comments for the green start icon by clicking the icon in the same manner. Finally, you can enter comments for the whole orchestration by right-clicking the orchestration in the Project toolbox tab and then clicking Comment. After you add comments for the orchestration, a yellow box displays at the top left of the orchestration icon for that orchestration in the Project toolbox tab as shown in Figure 3-36.
Comments entered for the orchestration and its activities display in the project documentation files as described in 3.3.6, Project documentation on page 94. However, comments that are entered for the green start icon do not display in the project documentation files. Tip: You can also add comments to the other components of a project, such as an endpoint or an XML schema, by right-clicking on the component in the Project toolbox tab and selecting Comment. Comments for the project are set by selecting Project Project Settings. Comments for the project and all of its components display in the project documentation files.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
101
8004chStudio.fm
You can save orchestrations as an image to provide further documentation alongside the project documentation. To save an image of an orchestration, open the orchestration in the workspace, and then select File Save as Image. An image is created with the same name as the orchestration, and the image shows all the activities and endpoints in an orchestration. You can also select File Print to print an image of the orchestration. Figure 3-37 is an example of an image file that was produced by selecting File Save as Image. Notice that no comments or properties display in the image. Comments and properties display in the project documentation files.
3.5.1 Connectors
A Cast Iron Integration Solution uses connectors to access external systems. A connector is a component installed on the Cast Iron runtime that provides the functionality to connect to a specific external system. Cast Iron contains a number of built in connectors which fall in to two categories:
Application connectors connect to specific applications, such as Salesforce.com. SAP, PeopleSoft, and so forth. Technology connectors connect to systems without a specific application endpoint, such
as FTP, databases, web services, and so forth. You can create new connectors using the Connector Development Kit described in Chapter 8, Building custom plugin connectors on page 323. You can add a connector to Studio by selecting either File Import Connector to import a local connector or Solutions Plugin Connectors to import a connector that has been shared with the Cast Iron community.
102
8004chStudio.fm
3.5.2 Endpoints
An endpoint is defined within a project to hold the connection properties used by a connector. Each endpoint is associated with a specific fixed type of connector and contains properties for that specific type of connector. For example, an endpoint created for a database connector contains database connection properties such as the database name while an endpoint created for an SAP connector contains properties such as the SAP system number. By holding these connection properties in an endpoint component rather than in each activity that accesses the external system, the connection properties are defined only once for each external system that is used in a project, as shown in Figure 3-38. In addition, if the connection properties for the external system change, the endpoint can be updated, and the new property values will be used by all activities that are associated with this endpoint.
Orchestration1
Endpoint1
Sys1
Orchestration2
Endpoint2 Orchestration3
Sys2
Endpoints should use configuration properties to hold the values of the connection properties. Configuration properties allow the values of these properties to be changed in the WMC at run time. Configuration properties are described in 3.3.2, Configuration properties on page 88. You can create endpoints from the Project toolbox tab by clicking the New Endpoint icon or right-clicking on Endpoints and selecting Create Endpoint. A dialog box opens that shows all connectors in this copy of Studio, as shown in Figure 3-39. Select the type of endpoint that you want to create. You cannot change the type of an endpoint after it is created. However, you can create a new endpoint with different properties and change activities to use this new endpoint. You can then delete any endpoint that is not used by the activities in an orchestration.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
103
8004chStudio.fm
The new endpoint is given a default name. Change the default name to a name that is unique within the project and that describes the functionality of the endpoint. For a description of valid names, refer to: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/index.jsp?topic=%2Fcom.ibm.web sphere.cast_iron.doc%2Fref_About_Valid_Names.html To set the properties of an endpoint, double-click the endpoint in the endpoints section of the Project toolbox tab. An entity tab opens that shows the specific settings for the connector that is associated with this endpoint. Figure 3-40 shows an endpoint for an SAP connector with no values entered. The yellow hazard symbol indicates a required property that has not yet had a valid value entered.
104
8004chStudio.fm
Notice the Test Connection button at the bottom of the SAP endpoint in Figure 3-40. Some endpoint types can issue a connection to the external system from Studio to test that the connection properties are entered correctly. Test connection is described in 3.12.1, Endpoint Test Connection on page 159. The SAP endpoint in Figure 3-40 can be used by activities to run SAP functions that read in data from the SAP system and write out data to the SAP system. However, some endpoints are one way which means that the endpoint can only be used to read in or to write out. An HTTP endpoint is an example of a one way endpoint. Figure 3-41 shows a section of an HTTP endpoint that has been configured to receive HTTP requests. To change the HTTP endpoint to send out HTTP requests, select the Remote Server option and enter an HTTP host name and port.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
105
8004chStudio.fm
Notice that the HTTP host name in Figure 3-41 cannot be set for an HTTP endpoint that is configured to receive requests because the integration solution that is using the HTTP endpoint will be published to a specific Cast Iron runtime and the HTTP host name of this runtime will be used. Every endpoint type contains detailed properties that are specific to the connector with which it is associated. More information about each of the endpoint types and the properties that can be set can be found in the WebSphere Cast Iron information center. Tip: Endpoints are used at development time to interrogate external systems to discover the structure of the systems. This is used to generate the queries run by activities as well as to pre-populate the list of input and output parameters required by activities.
106
8004chStudio.fm
To install a module provider in Studio: 1. Click Tools Install Module Providers. The window shown in Figure 3-42 opens.
2. Click the plus icon for the type of provider that you want to add, and then click Browse. 3. Navigate to the file that contains the module provider for the external system that you want to access and select it. 4. Click OK. 5. To install the module provider, Studio must close and reopen. Thus, a confirmation box opens telling you that Studio will close. Click Yes to close Studio. Then, restart Studio manually. You must also install module providers on the Cast Iron runtime where the orchestration that is using the connector will run. For more information about this topic, refer to 4.9.3, Update connector libraries on page 230.
3.6 Activities
Activities are pre-written functional components that are placed in an orchestration and
configured to create an integration solution. There are many different activities built into Studio. These activities provide a full range of functionality, but the development process to use them within Studio is the same.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
107
8004chStudio.fm
Figure 3-43 The configuration pane for an HTTP Post Request activity
The configuration pane provides a checklist of tasks for the activity that must be completed. When a task is completed with valid values, it shows a green check mark next to this task. A yellow hazard symbol (which includes an exclamation point) displays next to any task that is not completed. Figure 3-44 shows a checklist with both complete and incomplete tasks.
108
8004chStudio.fm
You can change properties for the activity in Studio by selecting the activity and clicking the checklist task that contains the property. Some properties fields are check boxes or drop-down menus. Other fields allow text entry. Some fields are set by selecting specific values that are generated by Studio. You set fields with a Browse button or an ellipsis button (...) next to them, as highlighted in Figure 3-45, by clicking the button and then selecting the appropriate value. Use the Browse or ellipsis buttons where they are available, even if the field allows text entry, to ensure the syntax is correct.
Activities can contain the following tasks in their checklist: Summary Pick Endpoint Configure tasks Map Inputs Map Outputs A description of the functionality of the activity. For activities that use external systems this task sets the endpoint that holds connection properties to the external system. A set of tasks to change how the activity behaves. A mapping editor that defines how the input parameters for the activity are set. A mapping editor that defines where the output parameters from the activity are written.
The mapping editor is discussed in 3.9, Maps on page 128. The checklist for each activity depends heavily on the functionality that the activity provides. Some activities require little configuration. Other activities have a lot of checklist tasks. Activities such as the Apply XSLT and the Web Services Invoke Service activities require additional files, such as stylesheets, WSDL files, or XML schemas, to be imported in to Studio
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
109
8004chStudio.fm
in order to configure the activity. These files are imported as one of the tasks in the checklist for each activity. Tip: If a new version of an XML schema or a WSDL file needs to be imported in to Studio, right-click the name of the file in the Project toolbox tab and then select Update. A window opens to select the new version of the file. Studio then imports the file and updates all references to the file to reflect the new structure of the XML schema or WSDL. Some activities that run using external systems need to access these external systems directly at development time in Studio. This access allows Studio to interrogate the external system to discover how the system was set up. For example, the database Insert Rows activity shown in Figure 3-46 on page 110 is configured by connecting to the database and discovering the tables and the list of columns in a selected table. The input for the activity will be set to the selected columns. This task is a required task. Therefore, access to the database from Studio is required at development time.
Database Schema
Figure 3-46 The database Insert Rows activity needs access to the database at development time
It is important, therefore, to provide a direct connection from Studio at development time to any external systems that are used by activities that interrogate these external systems. Without access to these systems from Studio at development time, some activities cannot be configured. Tip: Studio cannot access the Cast Iron Secure Connector that is used by Cast Iron Live to access an external system running in a private network behind a firewall. Therefore, to configure access to an external system that is running in a private network, Studio must be provided with a direct connection in to this private network so that it can access the external system at development time.
110
8004chStudio.fm
You can find full documentation of the large number of activities that are available in a Cast Iron Integration Solution, the functionality of these activities, and the properties that need to be set for each activity at: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/index.jsp The remainder of this section introduces a few groups of activities.
Tip: An HTTP Receive Request activity can be used to manually start an orchestration. This orchestration can then integrate systems that use other endpoints, for example SAP and Salesforce.com. An example of using an HTTP Receive Request activity in this manner is described in Chapter 10, Scenario: Bidirectional account synchronization on page 361.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
111
8004chStudio.fm
A Data Quality Lookup activity that pulls data from a database and uses that data to update values of defined fields in a data structure passed to the activity. The outbound activities that are available for each external system and the properties for these activities depend on the external system being called.
112
8004chStudio.fm
Exception handling is provided in an orchestration using the Try activity, which is discussed in 3.11, Exception handling on page 155. There are a number of utility activities. The Log Message activity writes a message to the system log with the log level that is specified in the activity. The Schedule Job activity is discussed in 3.6.2, Starter activities on page 111. The Create Job Keys activity is described in 3.7.4, The JobInfo variable and Job Keys on page 122.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
113
8004chStudio.fm
Tip: When the endpoint for the Provide Service activity is updated to have a Transport of Remote, a WSDL file is generated for the web service that is defined by that Provide Service activity. This WSDL is then given to the application that is invoking the web service. The generated WSDL is created as an asset for the project and is published automatically to a Cast Iron runtime along with the project. You can download the WSDL using the WMC. This is described in 4.2.11, Assets on page 190. You can view and store the generated WSDL inside Studio by right-clicking the Provide Service activity and then selecting either View Generated WSDL or Add Generated WSDL To Studio Project.
Database assets
To detect when a database table has been updated you must use a trigger on the database. You can also use a buffer table that holds the updated data until it has been processed. If each update to a database table needs to be made exactly once you must use a control table that temporarily remembers the changes that you have already made to the table that you are updating. This is controlled by the Deliver Messages field in database activities. This option is explained in the following page in the information center: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/topic/com.ibm.websphere.cast_i ron.doc/db_specifying_delivery_rules_for_database_activities.html Both of these situations involve changing the design of the database that is being used. Each table, trigger or other database artifact that must be created or changed is referred to as a database asset. Cast Iron helps with this by generating database scripts for each database 114
Getting Started with IBM WebSphere Cast Iron Cloud Integration
8004chStudio.fm
asset that needs to be created or changed. These database scripts are generated when a project is published and can be accessed using the WMC. The following database activities require changes to the design of the database that the activity is accessing: Starter database activities Activities with the exactly once delivery option set Database assets that might be needed by Cast Iron activities are control tables, buffer tables, sequence tables (for Oracle only), indexes (for the local Staging Database only), or triggers. The database asset scripts are accessed through the Configuration Details page of the WMC.These scripts can be run from within the WMC or downloaded and run manually. Accessing assets is described in 4.2.11, Assets on page 190. The scripts are also provided in Studio when an orchestration that requires a database asset is tested using the Verify toolbox tab. When the orchestration is started, the window in Figure 3-49 opens. The script can be run directly against the external database from this window. Testing with the Verify toolbox tab is discussed in 3.12.7, Verify orchestrations on page 164.
You can find more information about database assets at the following pages in the information center: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/topic/com.ibm.websphere.cast_ iron.doc/db_poll_table_activity.html http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/topic/com.ibm.websphere.cast_ iron.appliance.doc/Managing_Projects/generatingDBAssets.htm http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/topic/com.ibm.websphere.cast_ iron.doc/conn_ref_Connector_Prerequisites_for_Database_Operations.html http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/topic/com.ibm.websphere.cast_ iron.appliance.doc/Managing_Projects/recreatingDBAssets.htm
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
115
8004chStudio.fm
3.6.8 Using HTTP and web service starter activities with Cast Iron Live
An orchestration containing either an HTTP Receive Request starter activity or a Web Services Provide Service starter activity is executed by receiving an HTTP request. If this orchestration is running on Cast Iron Live, the HTTP Request determines which tenant and environment contains the orchestration that is executed by the request. To send an HTTP request to an orchestration running on Cast Iron Live, use the URL: https://<Hostname>:443/env/<Environment>/<RequestURI> The details of this URL are as follows: https Hostname The request must always use the HTTPS protocol for Cast Iron Live. Send the request to the hostname provide.castiron.com. If you are using the evaluation cloud then the hostname is eval-provide.castiron.com. The port that Cast Iron Live uses for HTTPS. This is always 443. This is a mandatory value and must always be present. If a user name and password are included in the URL this will be envq instead, as discussed later in this section.
443 env
116
8004chStudio.fm
Environment RequestURI
The name of the environment for the Tenant where the orchestration is running. For example Development or Production. For an HTTP Receive Request this is the URL (Path After Hostname) property in the Configure task of the activity. For a Web Services Provide Service this is the Path property in the Web Services endpoint.
An example of a completed URL is: https://provide.castiron.com:443/env/Development/syncNetSuiteGoogleCalendartest The HTTP request must also provide a user name and password in the request. This user name is a Cast Iron user name created using the WMC. The user must have access to the environment where the orchestration is running. The user name and password can be provided using the HTTP Basic Authentication header. Alternatively, they can be included as part of the URL, for example: https://eval-provide.castiron.com:443/envq/Production/loadSAP?ciUser=<user>&ciPass word=<password> Notice that this url contains /envq/ instead of /env/. This is required if a user name and password are included in the URL. An example of sending HTTP requests to an orchestration running on Cast Iron Live is described in Chapter 11, Scenario: CRM to cloud calendar services on page 439.
3.7 Variables
Data is held within an integration solution in variables. Each orchestration has its own set of variables. Thus no data can be passed between orchestrations without making an external call. Each execution of an orchestration is given its own set of variables unless that variable is defined as shared which is discussed later in this section. All non-shared variables for an orchestration are deleted at the end of the execution of the orchestration. All output data from activities in an orchestration is written to variables. There are no automatic variables created to hold output from an activity. Thus, if data from one activity is to be passed to the next activity in an orchestration, the data must first be written to a variable as the output of the first activity before being read from the variable as the input to the next activity as shown in Figure 3-50.
Data Activity
Input Data
Input Data
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
117
8004chStudio.fm
Data is passed in to an activity using the Map Inputs task of the activity. Data is written out of an activity using the Map Outputs task of the activity. Map Inputs and Map Outputs tasks are described in 3.9, Maps on page 128. All variables have a data type, meaning that they can only hold data of the specified type. Variables can have primitive data types or complex data types. Primitive data types are where the data is of only one type such as a string, an integer or a boolean. Complex data types are comprised of a set of primitive types or other complex types as shown in Figure 3-51. You can define elements inside a complex data type to be repeating fields. You define complex data types in Studio using XML schemas.
ComplexVar3 ComplexVar1 Var1 Var2 Primitive Primitive
Var6
Primitive
Studio contains a Variables toolbox tab. The orchestration that contains the variables must be open in Studio before the variables for the orchestration will show in the Variables toolbox tab. The Variables toolbox tab has the following sections: Variables Schema of <var> Properties of <var> A list of the variables currently available. The XML schema structure of the data type of the selected variable. The editable properties of the selected variable.
Activities using <var> A list of all of the activities that use the selected variable.
118
8004chStudio.fm
Figure 3-52 shows an example of the sections of the Variables toolbox tab.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
119
8004chStudio.fm
3. Click Next to enter the name of the variable. Use a consistent naming convention for all variables in a project. 4. Click Finish. The new variable displays in the Variables toolbox tab. You can rename the variable from the Properties section of the Variables toolbox tab. You can also change the variable data type from this section and set a default value for the variable. Some variables are created by activities and given default names. For example, the Try activity creates variables to hold information about the exception that is being handled. You should rename these variables to follow the naming convention that you established for the project. Tip: It is possible to rename a variable in the mapping editor, but this change does not change the original variable name. Instead, it creates a new variable of the same data type with the new name. If you accidentally create a new variable, click on the down arrow next to the variable name in the mapping editor, select Choose Another Variable and then select the original variable. Then select Remove Unused Variable(s) in the Variables toolbox tab to remove the new variable, as described in 3.7.3, Deleting a variable on page 122. You need to initialize variables in an integration solution before you can use them. Thus, the first use of a variable must be to set a value to that variable and not to read from that variable. Variables are visible only within the scope in which they are first initialized. For example, a variable initialized inside a while loop will not be visible outside of that loop, as shown in Figure 3-54.
120
8004chStudio.fm
Initialize Var1
Enter If... Then Initialize Var3 Var1 Var2 Var3 Var1 Var2 Var3 Leave Loop Var1 Var2 Var3
Leave If...Then
Tip: When a variable is given a default value in the properties section of the Variables toolbox tab, that variable is initialized at the start of an orchestration. Thus, even if the variable is first used explicitly inside a scope, such as a while loop, it will still be visible outside of the scope because it was initialized before the orchestration entered the scope. To use a variable inside a loop and then after the loop, give that variable a default value.
121
8004chStudio.fm
where a poll activity does not exist for an endpoint, for example when the connector does not contain the functionality to poll the endpoint, then a shared variable can be used. An example of using shared variables in this manner is described in Chapter 11, Scenario: CRM to cloud calendar services on page 439.
orchestrationName routerHostName
The information in the JobInfo variable can be read by activities in an orchestration. The information is also visible in the WMC on the Job Log pane as discussed in 4.3.3, Job log on page 206. An orchestration can additionally set Job Keys. Job Keys are extra key/value pairs that are shown in the Job Log pane of the WMC. Job Keys are useful to allow an administrator to use the WMC to check on the results from a particular job. Job Keys can contain any key/value pairs of data that are available to the orchestration running the job. Examples of the Job Key data that can be shown on the WMC include: The number of rows of input data that were successfully processed by each job and the number of rows that failed. The user name of the original sender of an MQ message held inside the MQ message descriptor that was used to access an external system. The name of a file written out by an FTP Put File activity. Before a Job Key can be used, you must register it in the orchestration properties. To set the orchestration properties, select Orchestration Properties. Click Add in the orchestration properties, and set the name and type of the Job Key variable as shown in Figure 3-55.
122
8004chStudio.fm
If the Primary option is selected for a Job Key, the value of this Job Key is used as the jobId property in the JobInfo variable. Only one Job Key can be set as primary. To change the primary Job Key, you must first clear the existing primary Job Key option and then select the new primary Job Key. To set the value of a Job Key, use the Create Job Keys activity. The input variables for the Create Job Keys activity are automatically populated from the settings in the orchestration properties. Use the Map Inputs checklist task of the Create Job Keys activity to populate the Job Key variables. Tip: The Create Job Keys activity runs only once in any orchestration. If two Create Job Key activities are executed in any orchestration, the second activity will have no effect.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
123
8004chStudio.fm
124
8004chStudio.fm
2. Click Add to add each input parameter. A new parameter line displays with no parameter name and a type of string. Double-click the empty parameter name field, and enter the parameter name. Then, select the parameter type as shown in Figure 3-58.
3. Click Next. The wizard shows a window with a text entry field. Enter the contents of the JavaScript function in to the text field. The function declaration and the opening and
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
125
8004chStudio.fm
closing braces are provided automatically. Figure 3-59 shows the contents of a custom function entered in to this window.
4. Click Compile to confirm that the JavaScript function can be compiled successfully. 5. Click Finish to save the custom function in the project. You can edit a custom function by right-clicking the name of the custom function in the Functions toolbox tab and selecting Edit to relaunch the custom function wizard. Example: You can find an example of using a custom function in Chapter 12, Scenario: Data enrichment and aggregation on page 469.
126
8004chStudio.fm
To create a new lookup table, use the following steps. 1. Go to the Functions toolbox tab, right-click the Lookup Tables folder, and click Add New Lookup Table. The lookup table window opens. 2. Enter a name and description for the lookup table as shown in Figure 3-60.
3. Click Add to add a new key/value pair to the lookup table. 4. Double-click the empty key field, and enter the new key. 5. Double-click the empty value field, and enter the new value. 6. Click Add to enter more key/value pairs, and click Delete to remove key/value pairs as needed. 7. Enter a default value in the Default Value field. This value is used if the key passed to the lookup table cannot be found. 8. Enter a value to be returned if the key passed to the lookup table is nil in the Value if nil field. 9. When the lookup table is complete, click OK to save the table to the project.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
127
8004chStudio.fm
You can edit a lookup table by right-clicking the name of the lookup table in the Functions toolbox tab and then selecting Edit. Example: You can find an example of using a lookup table in Chapter 12, Scenario: Data enrichment and aggregation on page 469.
3.9 Maps
Activities in an integration solution can require that input parameters are set for the activity. An activity that requires input parameters has a Map Inputs task in the checklist for the activity to define data that is sent to the activity. This task uses a tool called the mapping editor to define how the input parameters are set. The same mapping editor is used on the Map Outputs task for activities that return results to define the data that can be used by other activities in the orchestration. In this case, the mapping editor is used to define where the results of the activity are stored. Not all activities require input parameters and not all activities return results. Some activities have both input and output parameters. Figure 3-62 on page 129 shows a representation of an activity that requires input parameters and returns results.
128
8004chStudio.fm
Inpu t D at a
Map Inputs
Ac tivi ty
M ap Out puts
Figure 3-62 An activity that requires input parameters and returns results
You can map data in variables directly to and from activity parameters using the mapping editor. You can give parameters and variables default values or use functions to set the values. You can use default values with mappings and functions together as well. In this case the default value is only used if the mapped value or function output is empty. Functions are described in 3.8, Functions and Lookup Tables on page 123. Figure 3-63 shows a representation of an input map for an activity that uses direct mapping, default values and functions.
Variable 1
Input Parameter 1
Input Parameter 2
Input Parameter 3
Figure 3-63 An input map that uses direct mapping, default values and functions
You can transform data into the form that is needed for each activity by using direct mapping, default values, and functions in the mapping editor. As the data passes from one activity to another in an orchestration, it is transformed in each activity until it is in the correct form that is needed by the external systems that are used by the orchestration.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
129
8004chStudio.fm
Figure 3-64 The mapping editor for the Map Inputs task of a Send Email activity
Notice that the left pane of the mapping editor for the Map Inputs task is labelled From Orchestration and is empty. The right pane for the Map Inputs task is labelled To Activity and is prepopulated with an input parameter called body. Figure 3-65 shows the mapping editor for the Map Outputs task of the FTP Poll Directory activity. This mapping editor has a left pane labelled From Activity that is prepopulated with output parameters. The right pane in the mapping editor for the Map Outputs task is labelled To Orchestration and is empty.
Figure 3-65 The mapping editor for the Map Outputs task of an FTP Poll Directory activity
The Map Inputs and Map Outputs tasks are used in similar ways. The Map Inputs task displays input parameters in the To Activity pane on the right and variables in the From Orchestration pane on the left. The Map Outputs task displays output parameters in the From Activity pane on the left and variables in the To Orchestration pane on the right. Other than this difference, they are the same. Mappings are always performed from the left pane in both the Map Inputs and Map Outputs tasks to the right pane.
Parameters
Each activity automatically populates the list of input and output parameters in the Map Inputs and Map Outputs tasks of that activity. Activities that use external systems interrogate the
130
8004chStudio.fm
external systems at development time to discover the input and output parameters that are required for the activity. Activities can have optional parameters that are not shown by default. Right-click in the From Activity or To Activity panes, and select Show Optional Parameters to show these optional parameters. If the Show Optional Parameters option is not available when you right-click in the pane, then no optional parameters are available for the activity you are configuring. Figure 3-66 shows the To Activity pane of an HTTP Send Response activity after the optional parameters are enabled. The optional parameters are marked as optional.
Figure 3-66 The optional and mandatory input parameters of an HTTP Send Response activity
Optional parameters can include routing, proxying and security information for an HTTP request, web services security headers for a web service invoke, connection and session information for Salesforce.com, and so forth.
Adding variables
You must select the variables that will be used in the From Orchestration and To Orchestration panes. To select an existing variable: 1. Click Select Inputs for the Map Inputs task and Select Outputs for the Map Outputs task. The Select Inputs or Select Outputs window opens. The Select Inputs window is shown in Figure 3-67. Both windows are used in the same way.
2. Click the variable that you want to add, and then click OK. Variables that are already added are highlighted in bold. The variable aVariable in Figure 3-67 has been added. The icon to the left of each variable indicates whether the
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
131
8004chStudio.fm
type for the variable is a primitive type or a complex type. The blue square indicates that the variable has a primitive type. The larger blue rectangle with xml on it indicates that the variable has a complex type. Tip: The JobInfo variable is set automatically by the orchestration and cannot be written to. The padlock symbol on its type icon indicates this. The JobInfo variable is described in 3.7.4, The JobInfo variable and Job Keys on page 122. Figure 3-68 shows the From Orchestration of an activity with the variables aVariable and aComplexVariable added to it. Notice that more than one variable can be added to the From Orchestration pane which means that values from fields in more than one variable can be combined to populate fields in an input parameter.
Figure 3-68 The From Orchestration pane of an activity with aVariable and aComplexVariable added
The name of the variable displays in a blue area. The data contained inside that variable shows as a set of nodes in the white area underneath the variable name. The data for a primitive variable shows as a single field node underneath the variable name in the white area, with the same name as the variable. The data type of the primitive variable is indicated by an icon to the left of the field node. In Figure 3-68 the variable aVariable is a primitive variable. The field node for the variable is also called aVariable. The data type icon for this variable displays a number sign (#), which indicates that this variable is a number. In Figure 3-68, the variable aComplexVariable is a complex variable. The variable contains nodes representing the different fields in the complex variable. Each of the fields can have different data types. For example, the field projectName is of type string and the field activityId is of type number. The data type of a complex variable displays as a record node immediately under the variable name. In Figure 3-68 the data type of the variable aComplexVariable is ExampleComplexType.
132
8004chStudio.fm
A From Orchestration pane displaying a complex variable with a more complicated structure is shown in Figure 3-69. The variable name is ordersParsedData and the data type is Orders.
Figure 3-69 A variable with a complex data type in the From Orchestration pane
The Orders data type contains a set of orders, indicated by the repeating node icon highlighted in Figure 3-69. The Orders data type also contains a record node called Items, which has a complex type. A variable can contain a large number of nested nodes. However, it is important to note that the variable is still displayed in the blue area. Everything in the white area is contained within this variable. This concept is important because mappings are performed on the nodes for the variable that are displayed in the white area. The variable in the mapping editor is used only if you need to remove the variable from the mapping editor. Right-click the blue area that contains the variable name, and select Remove Variable to remove the variable as shown in Figure 3-70.
Right-clicking the variable name and selecting Choose Another Variable as shown in Figure 3-70 allows you to choose another variable of the same data type to use instead of the variable that you right-clicked.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
133
8004chStudio.fm
Tip: Pressing CTRL+ALT+K while in the mapping editor enables and disables some advanced XML schema options for the menus that appear when you right-click variables and nodes. The following options are enabled when you right-click a variable: View Resolved DOM Tree View XML Schema Source The following options are enabled when you right-click a node: View XML Schema Type Definition View XML Schema Fragment View MetaData for Selected Node
Simple mapping
To define a simple mapping, drag a field node from the left pane on to a field node of the same data type on the right pane as shown in Figure 3-71. The field node for the primitive variable anotherVariable is dragged to the field node for the primitive variable body.
When a mapping is defined, a line displays that connects the two nodes as shown in Figure 3-72.
You can map a node on the left pane to multiple nodes on the right pane, which maps the value of the node in the left pane to all of the nodes in the right pane. However, a node on the right pane can be mapped only to one node on the left pane.
Guaranteed mapping
The data types of the two nodes that are mapped must be the same to guarantee the mapping. The mapping editor allows some mappings to be defined between different data types, but this can cause an error when the orchestration is executed. Error handling is discussed in 3.11, Exception handling on page 155. When a mapping is defined that is not guaranteed, a dialog window will open warning that the mapping is not guaranteed and asking you if you want to define the mapping. Figure 3-73 shows a mapping that is being defined between a string and a number. 134
Getting Started with IBM WebSphere Cast Iron Cloud Integration
8004chStudio.fm
The color of the line representing the mapping in Figure 3-73 is orange. In guaranteed mappings the line is green. The mapping lines are also different colors if a function is used. Using functions for mapping is discussed in 3.9.2, Using functions in maps on page 141. The mapping editor line colors are as follows: Green Blue Orange Magenta A straight guaranteed map A guaranteed map using functions A straight map that is not guaranteed A map using functions that is not guaranteed
Copy button
The Map Outputs task contains an extra button labelled Copy, as shown in Figure 3-74. This button creates a new variable of the same name and the same data type as one of the output parameters of the activity. It also defines a simple mapping for all nodes of the output parameter to all nodes of the new variable. Output parameters are the pieces of data returned from the Activity. They are not automatically saved, even though they are given names. They are like variables that are local to the Activity alone. On the screen in Figure 3-74 we are copying the contents of these output parameters to variables that are available outside of the Activity. The Copy button: 1. Creates a variable that is available outside the activity. 2. Gives the new variable the same name as the local parameter. 3. Copies the value of the local parameter into the new variable.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
135
8004chStudio.fm
Click Copy to open the Copy Parameters window shown in Figure 3-75. Then, select the output parameter that you want to copy, and click Create.
A variable is created and a simple mapping to this variable is defined as shown in Figure 3-76. In this example the variable, httpheaders was selected.
Figure 3-76 The Copy button created the variable httpheaders and defined simple mappings
Notice that all of the nodes of the output parameter httpheaders are mapped, including the repeating fields. The new variable called httpheaders displays in the To Orchestration pane on the right. Rename this new variable using the Variables toolbox tab. Important: Do not rename a variable by left-clicking the variable name in the blue area and over-typing a new variable name. This action creates a second variable of the same type with the new name. This action does not rename the original variable, which will still exist. See the Tip box on 120.
136
8004chStudio.fm
nodes for the httpheaders output parameter in the From Activity pane have complex data types and therefore have child nodes: httpheaders otherHeaders headerItem A bulk mapping is defined if the httpheaders node in the From Activity pane in Figure 3-76 on page 136 is dragged to the httpheaders in the To Orchestration pane that has the same structure. As shown in the figure, all of the children of the httpheaders source node are mapped to the corresponding children of the httpheaders destination node. If the headerItem node in the From Activity pane is dragged to the headerItem node in the To Orchestration pane, only the children of headerItem are mapped as shown in Figure 3-77. These mappings could have been created by dragging each source child node to the corresponding destination child node individually, but using bulk mapping can be much quicker for nodes with large numbers of children.
Figure 3-77 The children of headerItem are mapped using bulk mapping
The mapping editor can also perform automapping. Automapping scans the field nodes in the left pane and creates a map to one field node in the right pane with the same name. Case and punctuation are ignored. If there are two or more field nodes of the same name in either pane, automapping cannot be performed. To use automapping, click Map Automap. Automapping would define the mappings in Figure 3-76 on page 136 and not those in Figure 3-77, where the uri and method fields have been left unmapped.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
137
8004chStudio.fm
3. Then, drag the children of the repeating node to a non-repeating destination field node, as shown in Figure 3-79, to define simple mappings for those field nodes.
Figure 3-79 Defining a simple mapping for one occurrence of a repeating field
You can use a variable to define the number of the occurrence that is mapped as follows: 1. Right-click the repeating node and then click Select Occurrence When. The Select Occurrence window shown in Figure 3-80 opens. 2. Enter a variable to define the occurrence that is selected.
You can also map individual occurrences of a repeating destination node: 1. Right-click the destination node in the right pane, and select Expand Occurrences. 2. Enter the number of repeating occurrences to expand, and then click OK. In Figure 3-81 on page 139, four occurrences of the headerItem repeating node in the To Orchestration pane are expanded, allowing each of these occurrences to be mapped 138
Getting Started with IBM WebSphere Cast Iron Cloud Integration
8004chStudio.fm
individually. The fifth occurrence of headerItem, highlighted in Figure 3-81 on page 139, represents the remaining occurrences of the repeating node, which you can still map as well.
Figure 3-81 Four occurrences of the headerItem repeating field are expanded
Remove repeating occurrences by right-clicking the occurrence to be removed and then clicking Remove Selected Occurrence. You can also filter the data being passed to a recurring destination node. For example, if a recurring source node contains a list of orders, this list can be filtered by the size of each order so that large orders only are mapped to the recurring destination node. The list of data in the destination node contains only the orders that meet the filter condition. The filter condition is defined using an XPath predicate, which is the XPath form of an if statement. To filter the mapping for a recurring destination node: 1. Map a recurring source node to the recurring destination node. 2. Right-click the recurring destination node and then click Filter Recurring Nodes. The Filter Recurring Nodes window shown in Figure 3-82 opens. 3. Enter an XPath predicate, and then click OK.
4. The XPath predicate is checked. If it is valid, a filter icon is displayed next to the recurring destination node.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
139
8004chStudio.fm
An example of filtering a destination recurring node is described in Chapter 10, Scenario: Bidirectional account synchronization on page 361. The information center contains a table that shows how to create mappings between different combinations of recurring and non-recurring nodes: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/topic/com.ibm.websphere.cast_i ron.doc/map_Mapping_Recurring_Nodes.html
Default values
A destination field node can be given a default value. If no value is set for the destination node using a mapping then the node will be set to the default value. If a value is set by a mapping, this value will be used. You can set a default value for a destination field node: 1. Right-click the field node and then select Define Default Value. The Define Default Value window opens. 2. Enter a default value, and click OK. The default value icon displays against the field node name to indicate that a default value is set for that field node, as highlighted in Figure 3-84.
140
8004chStudio.fm
Tip: You can set the default value of a destination node using a configuration property. The value of this configuration property can then be changed by an administrator using the WMC. Configuration properties are described in 3.3.2, Configuration properties on page 88.
Deleting a mapping
To delete an existing mapping, right-click the mapping line, and select Delete Mapping as shown in Figure 3-85. Deleting an existing map removes any default values that are set for the destination field nodes.
You can delete default values for a destination field node without deleting mappings to the field node by right-clicking the field node and then selecting Define Default Value. Remove the existing default value so that the Default Value property is blank, and click OK.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
141
8004chStudio.fm
The Number function in Figure 3-86 takes a string input parameter and converts it in to a number. As an example, this allows you to convert the uri field node to a number to store the value of that field node in the aVariable field node. 2. The Number function requires an input parameter. To set the input parameter using a field node, drag the field node to the icon representing the function in the middle pane as shown in Figure 3-87.
Figure 3-87 Setting the input parameter of a function to a field node value
A line is drawn from the field node to the function as shown in Figure 3-88.
142
8004chStudio.fm
Figure 3-88 A completed input parameter mapping from a field value node
3. Define the mapping of the result of the function by dragging the function to a destination field. You can chain functions together by setting the result of one function to be an input parameter of the next function, as shown in Figure 3-89, where an Add function is dragged to the middle pane and then the Number function is dragged to the Add function. A line is drawn between the functions to show that they are chained.
4. After you create all of the parameters and mappings for a function or chain of functions, right-click anywhere in the middle pane, and then click Apply Function Graph as shown in Figure 3-90.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
143
8004chStudio.fm
Tip: You can create only one chain of functions at any one time and map only one destination field node from any one chain of functions. To create another chain of functions to map to another destination field node, first Apply Function Graph for the current chain. 5. A mapping line displays between the source nodes and the destination node. The line is colored blue for a guaranteed mapping and is colored magenta for a mapping that is not guaranteed. A function icon also displays next to the destination field node as shown in Figure 3-91. The function icon looks like a scroll and is highlighted in the figure.
Important: The mapping line that displays for the function mapping in this example is blue, meaning that the mapping is guaranteed. However, the mapping that is defined takes a uri from an HTTP request and uses the Number function to attempt to convert it to a number. This action will fail because the input parameter cannot be converted to a number. Guaranteed mapping means that the data types of all input and output connections in a mapping chain are the same. It does not mean that the mapping will not fail. Thus, include error handling for maps, even if all the mappings are guaranteed. To edit the function mapping to the destination field node, right-click the field node, and then select Edit Function Graph.
Functions that do not need input (Get Current Date and Time function)
The Get Current Date and Time function is an example of a function that does not need input parameters. In Figure 3-92, the output result of the function is connected to the anotherVariable field node.
When Apply Function Graph is selected for the Get Current Date and Time function, no mapping line is displayed for the mapping. Only the scroll function icon displays next to the name of the field node, as shown in Figure 3-93.
144
8004chStudio.fm
Figure 3-93 No mapping line is displayed for a function that does not have input parameters
Tip: You can drag a function on to an existing simple mapping without needing to delete the mapping first. A mapping is defined where the function takes the source node as an input parameter and a destination node as the output parameter.
Concatenate function
Concatenate is another example of a common function (Figure 3-94). This function concatenates string input parameters together.
Figure 3-94 The Function Parameters window for the Concatenate function
Double-click the fields in the value column, and add hard-coded values for the input parameters. Some functions, including the Concatenate function, allow additional input parameters to be added. To add an input parameter, click Add and enter the input parameter value. After you enter all input parameter values, click OK.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
145
8004chStudio.fm
Figure 3-95 The Map Variables activity does not have a checklist
The activity is used in an orchestration in the normal way. When the activity executes, the mappings that are defined in the activity are performed using the input and output variables that are added to the activity. The mapping editor for a Map Variables activity is the same as the mapping editor for all other activities. Simple mapping, default values and functions can be used in a Map Variables activity. Multiple input and output variables can be added to a Map Variables activity. An example of some mappings in the mapping editor for a Map Variables activity is shown in Figure 3-96.
You might need to perform a mapping from one complex data type structure to another complex data type structure in several places in one orchestration, or in several orchestrations in one project. For example, the structure of an address record held in one
146
8004chStudio.fm
system needs to be mapped to the structure of an address record held in another system after several different data extracts at different stages throughout an orchestration. You could redefine the mapping between the address structures every time the mapping needs to be performed. Alternatively you can define a standalone map which is used to create multiple Map Variables activities that perform the same mapping. This saves time during development and makes sure that every Map Variables activity created from the standalone map uses the same mapping. Mappings for a standalone map do not use variables for the input and output nodes. Instead, they use complex data types. You must define these complex data types in Studio before you create the standalone map. You can define complex data types using XML schema files and WSDL files. You add these files to Studio on the Project toolbox tab by right-clicking XML Schemas or WSDLs and then selecting Add Document. You can also define complex data types using Flat File Schemas, which are described in 3.10, Parsing data on page 149. To create and use a standalone map, follow these steps: 1. Right-click Transformations in the Project toolbox tab, and then select New Standalone Map. A standalone map is created with a default name. 2. Right-click the newly created standalone map, and select Rename. Give the map a suitable name. 3. Double-click the new standalone map to open the mapping editor. 4. Add input and output complex data types to the mapping editor by clicking either Select Inputs or Select Outputs. The Browse For Schema Type Element window shown in Figure 3-97 opens. Select a record node, and then click OK. An example of a record node is highlighted in the figure.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
147
8004chStudio.fm
5. Define mappings using the mapping editor. You can use simple mapping, default values, and functions in a standalone map. Figure 3-98 shows an example of a standalone map with some mappings.
6. Open the orchestration where you want to use the standalone map. Drag the standalone map from the Project toolbox tab to the place in the orchestration where it will be executed. A Map Variables activity is created using the mapping that is defined in the standalone map. 7. The Link Schema Types To Variables window shown in Figure 3-99 opens. Use the drop-down boxes in the Orchestration Variables column to select existing variables of the correct data types that are used by the Map Variables activity that is created, and then click OK.
148
8004chStudio.fm
You can alter the mappings in the Map Variables activity that you create if needed for the particular use of the standalone activity. The original standalone activity is not changed.
Figure 3-100 The Map Outputs task of a Database Poll Table activity
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
149
8004chStudio.fm
The data that is extracted from the table has been parsed, meaning that the data has been interpreted intelligently to make sense of the data. This parsing allows the remainder of the orchestration to use the individual field nodes for the data rather than having to use all of the data as a whole as shown in Figure 3-101.
Data 7232011101532412 Activity
Some data that is received from external systems is not parsed automatically. For example, the MQ Poll Message activity returns an output parameter called payload of data type string that contains the whole body of the MQ message. To make sense of this data, it must be parsed. Cast Iron Integration Solutions can use the following techniques to parse data manually: Maps and functions XML parsing MIME parsing Flat File Schema parsing
8004chStudio.fm
There is also a Write XML activity that takes a complex variable and outputs a string in the XML format containing the data held in the complex variable.
151
8004chStudio.fm
Figure 3-102 The Flat File Schema editor for schema ExampleFlatFileSchema
The Flat File Schema editor also contains a testing tool that is displayed in Studio below the panes shown in Figure 3-102. This tool is described in 3.12.2, Test Flat File Schema on page 159. The name of the Flat File Schema in Figure 3-102 is ExampleFlatFileSchema. The white pane on the left of the Flat File Schema editor is the Schema Layout pane. A new schema contains only one node in its Schema Layout which is the Root Node. Every Flat File Schema has exactly one Root Node. In Figure 3-102, the Root Node is called ExampleFlatFileSchema. The Root Node is given the same name as the Flat File schema by default, but you can change this name using the node properties. The properties for each node that is selected in the Schema Layout pane displays on the right of the Flat File Schema editor. In Figure 3-102, the Root Node is selected. So, the properties that display are for the Root Node. The Root Node contains parsing settings for the entire stream of data or document that is being parsed. For example, the Root Node properties can require that the document ends with an end of stream character. The Root Node properties also describe how the child nodes of the Root Node are parsed. For example, are the children of this node delimited or are they of fixed length (positional)? These parsing properties of the Root Node are the same as those on the Record node. The Root Node can have the following child nodes: Field Record Group A single field containing a value of a primitive data type A node containing other child nodes which can be Fields or Records A more flexible type of record
Tip: Groups are required only when parsing a document that contains repeating records, where the document does not clearly define the start and end of each record. You can find more information about groups at: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/topic/com.ibm.websphere.cas t_iron.doc/mde_Adding_Groups_or_Group_Types.html To add a child of a node: 1. Right-click the node. 152
Getting Started with IBM WebSphere Cast Iron Cloud Integration
8004chStudio.fm
2. Select New Child and then Field, Record, or Group as shown in Figure 3-103. 3. Enter the name of the new child, and click OK.
Figure 3-103 Adding a child to a node in the Flat File Schema editor
The properties also define how many occurrences of the node are valid. You can define explicit minimum and maximum occurrences of the node. You can also make the occurrences of the node unbounded, meaning that there is no maximum number of occurrences of the node. You can set a node as unbounded only if its parent node has a structure of Delimited and if you have set a valid delimiter in the parent node.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
153
8004chStudio.fm
Figure 3-105 shows the properties of a Field node. You can set the field node to repeat a minimum and maximum number of times, or it can be unbounded. Again, you can set a node as unbounded only if its parent node has a structure of Delimited and if you have set a valid delimiter in the parent node.
The field node has a data type property, which means that data in the field node will be treated as that primitive type. If data for the field node is not of the correct type, parsing will fail. The Positional Properties control how the data for the field node is parsed if the parent Record node has been set to Positional structure. The Delimiters section controls how the field node can handle characters that are part of the data but have also been used as separators. For example, if a record contains a product ID, a product name and a quantity separated by a slash character (/), the parser will have difficulty parsing a product name of OS/2. There are two ways to solve this problem. You can define an escape character, such as a caret symbol (^), so that any character immediately after the escape character is not treated as a delimiter, for example: 123/OS^/2/14 Alternatively, you can surround or encapsulate the data with a pair of characters, such as quotation marks (" "), and any delimiter character found between those characters will be ignored, for example: 123/"OS/2"/14 The Delimiter Escape and Encapsulation sections contain these properties. You can find a full description of the properties for Root nodes, Group nodes, Record nodes, and Field nodes in the information center: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/topic/com.ibm.websphere.cast_i ron.doc/toc_flatfileschemas.html
154
8004chStudio.fm
A complex data type is created when you create a Flat File Schema. You can use this complex data type as the data type for a variable. The name of the complex data type that you create is the same as the name of the Root node of the Flat File Schema. The names and positions of the nodes in the Flat File Schema are the same as the names and positions of the nodes in the complex data type. You can change the names of all nodes in the Flat File Schema and the positions of the nodes using the Flat File Schema editor. Rename a node by right-clicking the node in the Schema Layout pane and then selecting Rename. Change the position by dragging the node to its new position in the Schema Layout pane. The complex data type that you created from the Flat File Schema is updated dynamically. Tip: If the complex data type for any variable is changed or updated, any mappings to and from that variable might be invalid. Check all mappings using a variable after changing its data type. You can edit a Flat File Schema after you create it by double-clicking the Flat File Schema in the Project toolbox tab. You can also edit a Flat File Schema that is created using the Flat File wizard in the same manner. Tip: SAP uses a data structure called IDOC. Studio includes a tool for generating a Flat File Schema from an SAP IDOC as described in the information center: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/topic/com.ibm.websphere.cas t_iron.doc/Generating_a_Flat_File_Schema_from_an_IDOC.html
155
8004chStudio.fm
When designing an orchestration, be aware of the type of exception that an activity will throw and any status codes that are returned in the response. Create logic in an orchestration to validate the response message to discover if an unexpected situation occurs. Tip: An activity that uses an endpoint will have retry settings to allow the activity to automatically retry connecting to the external system without the need for explicit logic. These retry settings are configured in the checklist for the activity and should be altered to meet the specific needs of the integration solution. Another example where you should check the status of results is a Database Update Rows activity. The activity fails if the activity cannot connect to the database but can also fail if the number of rows updated is zero. In this case an exception is not thrown. Check the Get Row Counts check box in the activitys checklist to return the number of rows updated and then add an If..Then activity to the orchestration to check whether zero rows were updated. The remainder of this section looks at Cast Iron Integration Solution exception handling activities.
The activities inside the Try activity are attempted. If any of the activities fails with an exception, an exception message is written to the system log, and the execution flow moves to the CatchAll path. All other activities in the Try path are skipped. Activities that you drag to the CatchAll path are executed when there is an exception. You can use these activities to handle the exception. Some examples are shown in Figure 3-107.
Variables that contain exception information are initialized in the CatchAll path. Because these variables are initialized inside the CatchAll path, they are not visible outside of that scope. The following variables are initialized: FaultName 156 The name of the exception
8004chStudio.fm
FaultData FaultInfo
For Web Service activity exceptions only, the error message for the exception A set of fields containing exception information, including the exception name
You can give these variables specific names by clicking the CatchAll activity. The faultInfo variable contains the faultName and extra information. Thus, the faultInfo variable is almost always used. The faultInfo variable contains the following fields: name message activityId activityName faultTime The activityId is a system generated number that uniquely identifies the activity where the exception occurred. You can include an If..Then activity in the CatchAll path to check the faultName and provide specific functionality based on the exception that has occurred, as shown in Figure 3-108.
You can create a specific Catch path by right-clicking the Try activity and then selecting Add Catch Branch. Figure 3-109 shows an example of a Try activity with a specific Catch path.
Specific Catch paths catch only web service faults. Thus, use them only when you include a Web Services Invoke Service activity in the Try path as shown in Figure 3-109. The WSDL for the web service that is being invoked must declare a fault. You then select this fault by clicking the Catch activity and selecting the fault from the FaultName drop-down property.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
157
8004chStudio.fm
This global exception handler catches any exceptions in the orchestration that are not caught by specific Try activities. Figure 3-111 shows an orchestration with a global exception handler. You can also attach a global exception handler to a Group activity by right-clicking the Group activity and then selecting Add CatchAll Branch. All uncaught exceptions in the Group activity are caught by the CatchAll branch.
158
8004chStudio.fm
Tip: Studio cannot access the Cast Iron Secure Connector that is used by Cast Iron Live to access an external system running in a private network behind a firewall. Therefore, to test an orchestration that uses an external system running in a private network, you must provide Studio with a direct connection in to this private network so that it can access the external system at testing time. When you test a project in Studio, you can publish it to a Cast Iron runtime with the expectation that there will be no issues with the project. The system log level for an orchestration executing on a Cast Iron runtime is changed using the WMC as discussed in 4.3.2, The system log repository on page 200. The following sections describe the testing tools that are provided by Studio.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
159
8004chStudio.fm
The left pane in Figure 3-112 holds the test data, and the right pane displays the results after that data is parsed. Enter data in the left pane by either cutting and pasting the data or using the Browse button to select data from a file. Click the Test icon, marked (1) in Figure 3-112, to run the test. A window might open displaying an error or a warning if the test failed. Click the Display in Hexadecimal icon, marked (2), to display the input test data in hexadecimal and the Font icons, marked (4), to change the font used to display the test data and the results. The results are saved using the Save icon (3) and visually formatted in the test tool using the Format icons (5). After the test data is parsed, click a node in the Schema Layout pane, and the corresponding sections of the test data are highlighted, as shown in Figure 3-113.
Figure 3-113 The test data elements corresponding to the selected node are highlighted
Tip: The Flat File Schema testing tool can also be used in reverse, by selecting a file containing XML of the format that would be produced by the Flat File Schema as the test file. When the test is run, data is displayed in the right pane with the correct format needed as input to the Flat File Schema. This data can be cut and pasted into a file and used for further testing.
160
8004chStudio.fm
You cannot paste sample data into the Input Test Data pane. You can either import data from sample files or it can be provided by Studio. Sample data that is exported from an orchestration running on a Cast Iron runtime and saved in a file is recommended. To load a sample file, click the ellipsis in the Location column for the input data that you are loading, and then select the file from the window that opens. Click Run Test to run the test. If you tested the current orchestration using the Verify toolbox tab, you can import the real execution data for the activity that is associated with the map that you are testing using the Assign Executions Results icon in the Verify toolbox tab. Verifying orchestrations is described in 3.12.7, Verify orchestrations on page 164.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
161
8004chStudio.fm
To generate example test data in Studio, select Map Generate Test Data. Click Run Test to run the test. Figure 3-115 shows an example of a map test that has been performed using generated test data.
Figure 3-115 An example of a map test that has been performed using generated test data
Tip: Cast Iron maps use generated XML stylesheets to perform the transformations. To toggle displaying the XML stylesheet for a particular map, open the map in the Test mode of the mapping editor and press CTRL-ALT-SHIFT-8.
162
8004chStudio.fm
Click Browse to load a sample test document, and then click Run to perform the test.
You can also use the XPath Evaluator to generate an XPath expression. To generate an expression, click an XML element in the sample data window. The expression that returns the element displays in the Generated XPath Expression field.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
163
8004chStudio.fm
Tip: If the orchestration starts with a Pick activity, right-click one of the starter activities in the Pick activity, and select Verify Orchestration From Here to start the job instance from the starter activity and not from the Pick activity. The orchestration job runs. While it is running, the Verify toolbox tab displays a trace of the activity that is currently executing and the activities that have already been executed, as shown in Figure 3-120. To stop the job before it has completed, click the red Stop Orchestration icon. The job stops automatically when it has run to completion.
Figure 3-120 The trace data for a job running in the Verify toolbox tab
164
8004chStudio.fm
Only one job instance can execute for each orchestration in the Verify toolbox tab at a time. However, after one job instance completes, another job instance for the same orchestration can be started. Trace data for each job instance for the orchestration displays in the Verify toolbox tab, as shown in Figure 3-121. Job instance data is removed by selecting the job instance data and clicking the Delete Verify toolbox tab icon.
Figure 3-121 The trace data for multiple job instances is displayed
You can test multiple orchestrations in the Verify toolbox tab at the same time. To select the orchestration being tested, open and select the orchestration in the workspace. An orchestration must be open and selected in the workspace to be tested and to display the trace data for previous job instances of the orchestration. To test multiple orchestrations, select each orchestration in turn and click the Start Orchestration Verify toolbox tab icon for that orchestration. To start all orchestrations in a project, select any orchestration, and then click the Start all orchestrations Verify toolbox tab icon. To stop all orchestrations, click the Stop all orchestrations Verify toolbox tab icon.
Figure 3-122 The trace data for a completed job in the Verify toolbox tab
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
165
8004chStudio.fm
Clicking each line of the trace data highlights the activity in the orchestration in the workspace that produced that line of trace data. Using this technique, you can discover the execution path that the job took through the orchestration. You can also click the Show Execution Path Verify toolbox tab icon, which highlights in green the entire execution path taken by the job through the orchestration, as shown in Figure 3-123.
Figure 3-123 An orchestration highlighting the execution path of a job run using the Verify toolbox tab
If an orchestration fails, the trace displays a status of ERRORED and ends with the activity that failed as shown in Figure 3-124. The trace data contains the error message for the exception.
The trace Execution Path also highlights the activity that failed in red, as shown in Figure 3-125
Studio records the values of all variables and parameters used by each activity in the orchestration as the job executes. The bottom of the Verify toolbox tab contains a pane displaying message data. Clicking a line of trace data for a variable or parameter displays the value of that variable or parameter at that point of the job in the Message Data pane, as shown in Figure 3-126.
166
8004chStudio.fm
Figure 3-126 The message data for the parameter level is displayed
You can copy this message data into the Test mode of the mapping editor to test each map in the orchestration using real data from a job execution. To copy the data, click the Assign Executions Results Verify toolbox tab icon. Note, the job execution data is not saved when Studio is closed.
You must set the minimum log level and log message type of the log messages before an orchestration is tested. These fields set the level and type for log messages that are recorded in the Log Viewer. If a message that is created by an orchestration does not match the log level and type set in the Log Viewer, it will not be recorded.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
167
8004chStudio.fm
Tip: Log files for Studio are stored in the C:\Documents and Settings\User\.castiron directory. In Windows 7 systems, the path is C:\Users\User\.castiron.
Verify activity
To test an individual activity in an orchestration using the Verify toolbox tab, right-click the activity in the orchestration, and then select Verify Activity. The activity is tested in isolation. No other activities in the orchestration are executed. If the activity requires input parameters, set these parameters by clicking the Map Inputs task in the checklist for the activity. You can also set a default value for the variable temporarily in the Variables toolbox tab. Click Test to enter the Test mode for the mapping editor and import test data in to the Input Test Data pane. Importing test data in to the Input Test Data pane is described in 3.12.3, Test maps on page 161.
The URL of the inbound connector defaults to the host name of the local machine. Append to this URL the port defined in the HTTP endpoint and the URI for the HTTP Receive Request you are testing. Enter message data in the Message to post field if the HTTP request requires data to be posted. Then click Submit. If an HTTP response is expected, click the Show Response link which will display the HTTP response. A simple HTML version of the HTTP Post Utility which can be used when Studio is not running is supplied with Studio when it is installed locally. This utility is typically used to test orchestrations with HTTP Receive Request starter activities after they have been started in a Cast Iron run time. To open the web page, use the Windows Start menu to select Programs IBM WebSphere Cast Iron Studio HTTP Post Utility.
168
8004chStudio.fm
The window is prepopulated with a request message that is generated from the WSDL for the web service that you are testing. You can edit the generated request message. To select a different test request message, click Open. To save the current request message, click Save. To invoke the web service, click Execute. To view the web service response, click the Show Response link. The orchestration that provided the web service ran in the Verify toolbox tab. Thus, trace data for the job instance of the orchestration shows in the Verify toolbox tab. This trace data is described in 3.12.7, Verify orchestrations on page 164. To retest the web service, you must restart the orchestration in the Verify toolbox tab. To do this, you must close the Invoke Service window. You can then either start the orchestration manually in the Verify toolbox tab or just reopen the Invoke Service window as before. If you close the Invoke Service window before executing the test, the Invoke Service option might not be available because the orchestration was not stopped in the Verify toolbox tab. To reopen the Invoke Service window, first click the Stop Orchestration icon on the Verify toolbox tab and then open the window as before.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
169
8004chStudio.fm
Figure 3-130 Downloading the .zip file for a project from the WMC
170
8004chStudio.fm
Tip: The .par file is also a .zip file and contains the source code. To extract the source code, rename the .par file to an extension of .zip, and then open the .zip file. The source directory in the .zip file contains the source code in the same format that it is downloaded from the WMC.
4. The connection to the Cast Iron Integration Appliance uses SSL by default. If this has been turned off by the administrator of this Integration Appliance, then clear the Secure option. 5. Click OK to publish. Tip: The values on the Publish Project window are remembered until Studio is closed. To publish any project from Studio that has already published one project and has not been closed since it was published, you need only to click OK. Publishing to Cast Iron Live is performed using the WMC. The project is first saved to Cast Iron Live. In Studio, click File Save Project [To Cloud] as shown in Figure 3-132. Notice that the File menu for the Cast Iron Live Studio does not have an option to Publish Project.
Chapter 3. Developing and unit testing with WebSphere Cast Iron Studio
171
8004chStudio.fm
After you save the project to Cast Iron Live, select the Modify tab in the WMC., Click the Publish Project icon shown in Figure 3-133 for the project that you want to publish and select the environment where the project is being published to.
A project fails to publish if a project of the same name and version is currently started or deployed on the Cast Iron runtime. To fix this issue, use the WMC to stop and undeploy the project. The new project will replace the existing one, so if the existing version needs to be saved it should be downloaded from the WMC first. Notice that the project on the Integration Appliance does not have to be deleted. Deleting a project removes its Job Log data. Thus, do not delete a project just to republish the project.
172
8004chMgmt.fm
Chapter 4.
173
8004chMgmt.fm
4.1 Management
The management of the WebSphere Cast Iron runtime involves administration tasks such as orchestration management, appliance upgrades, and problem identification. You can manage the WebSphere Cast Iron runtime using the three different interfaces shown in Figure 4-1. Management API (web services) Command Line Interface (CLI) Web management console (WMC) Although some tasks are available in all three options, each interface generally has a different applicability.
Management API
<soapenv:Envelope xmlns:d xmlns:dep="http://www.ap <soapenv:Header> <dep:sessionId>8FDM </soapenf:Header> <soapenv:Body> <dep:createRule> HTTPS SOAP
SSH
IBM WebSphere Cast Iron
login as: admin Using keyboard-interacti Password: ci-192-168-116-131/Stand Applicance Status ----------------System: Up Network: Up Runtime: Up
174
8004chMgmt.fm
System: Up Network: Up Runtime: Up Command complete Note: The CLI is not available for IBM WebSphere Cast Iron Live. For more details about the CLI, refer to: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/topic/com.ibm.websphere.cast_i ron.cli.doc/CLI_about_CLI.html
In Cast Iron Live, multiple runtime environments are provided as highlighted in Figure 4-3. These environments are available on tabs within the WMC. Each environment provides the same functions of the WMC as described in this chapter. Differences in using Cast Iron Live are highlighted.
175
8004chMgmt.fm
Important: Although this chapter focuses on the WMC, several functions described in this chapter are also available in the CLI and the Management API. Refer to the online documentation for more information.
Logging in
You log in to the WMC through a web browser using the following URL: https://<emgmt> where <emgmt> is the IP address of the management interface. You provide a user name and password, as shown in Figure 4-4.
Cast Iron Live: The WMC in Cast Iron Live has a different URL that is provided with your Cast Iron Live subscription.
176
8004chMgmt.fm
The initial WMC page will look like Figure 4-5 on page 177. Most of the functions discussed in this chapter are available through the left-side menu, as shown in Figure 4-5.
The settings that you can change include user profile, session, and display settings. The User Profile section allows you to change personal fields, such as the password, the display name, and email. With WebSphere Cloud Live especially, the email field is important because it is the primary method of communication between the system administrator and the user. Users can also modify the session time-out value and dashboard refresh interval though the Settings page.
177
8004chMgmt.fm
Hint: When using Cast Iron Live, be aware of your session timing out. If your session times out when you are editing a project in Studio, you will not be able to save your project to Cast Iron live. You will be able to save to your local disk. See the Tip on page 81 for more information. Users can also change settings that are related to display, such as page size for logs and other display settings. Figure 4-7 shows all the fields that are available in the Settings page.
The Settings page for WebSphere Cast Iron Live is slightly different because it includes complementary fields. For example, the Libraries Environment field allows you to select from which environment Studio loads the connector libraries, as indicated in Figure 4-8.
178
8004chMgmt.fm
Figure 4-8 Libraries Environment field for the Cast Iron Live Settings page
For more information about profile the Settings page, visit: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/topic/com.ibm.websphere.cast_i ron.appliance.doc/About_the_WMC/consoleSettings.htm
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sec="http://www.approuter.com/schemas/2008/1/security"> <soapenv:Header> <sec:sessionId>8EB8F17160F7D1E561EC45EFEBF344CF</sec:sessionId> </soapenv:Header> <soapenv:Body> <sec:getUsers/> </soapenv:Body> </soapenv:Envelope> Note that when using the Management API with Cast Iron Live vs. an integration appliance, you must use the setCurrentScope operation to set the scope to the environment where you
179
8004chMgmt.fm
want to run SOAP operations before you send any other requests. More information is available at: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/topic/com.ibm.websphere.cast_i ron.api.doc/ci00001.html For more information about the Management API, refer to: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/topic/com.ibm.websphere.cast_i ron.api.doc/ci00000.html
180
8004chMgmt.fm
Every project configuration has at least one orchestration. To view the orchestration or orchestrations that are part of the project configuration, click in the arrow on the side of the configuration name to expand it. Figure 4-10 shows the two orchestrations that are part of the ITSO_Management_Chapter project configuration.
The configuration status transitions to Deploying, as shown in Figure 4-12. While the configuration is being deployed, you cannot perform any actions, and the Actions icons are unavailable.
181
8004chMgmt.fm
Important: You can deploy a configuration only if there is at least one enabled orchestration. You can learn more about disabling orchestrations in 4.2.7, Disabling orchestrations on page 186. If no errors occur, the configuration is ready to run the enabled orchestrations. The WMC will show the status as Running and additional life cycle actions are available for the configuration, as indicated in Figure 4-13.
When a project configuration is running, all the enabled orchestrations that belong to that project also show the same Running status. Enabling and disabling orchestrations: You can enable or disable individual orchestrations as described in 4.2.7, Disabling orchestrations on page 186. If for some reason one of the orchestrations cannot start, the entire configuration goes to the stopped state. Avoid trouble: For critical integrations, avoid a situation where one failed orchestration stops other orchestrations in the same project configuration by having only one orchestration per configuration. For information about troubleshooting, refer to 4.3, Monitoring and troubleshooting on page 198.
Cast Iron Live: When using Cast Iron Live an orchestration will not start if it requires a secure connector that is not currently running. The dashboard includes the following execution counters that provide information about each orchestration, as shown in Figure 4-14:
182
8004chMgmt.fm
Jobs running Successfully completed job instances Jobs that have errored
This action pauses any jobs that are currently running and prevents new jobs instances from starting. When the configuration is resumed, the suspended job will continue from the point where you paused it. Scheduling downtime: You can schedule down time for configurations, which changes the status to a suspended state. For more information, refer to 4.2.12, Scheduling downtime on page 194.
183
8004chMgmt.fm
When stopping a service, a Stop Configuration window, shown in Figure 4-16, allows you to decide how to handle jobs that are currently running:
Allow jobs to finish prevents any new orchestration jobs from starting and allows current jobs to finish processing. This action allows the job instances to run to completion before the project configuration stops. Cancel running jobs prevents any new orchestration jobs from starting and stops all
currently running jobs. This action stops all jobs immediately.
You cannot stop orchestrations individually. When a project configuration is stopped, all orchestrations that belong to it are stopped also. Other methods to stop a configuration: The Stop action is also available in the Management API as the stopAndCancel and stopAndWait operations. The Schedule Downtime function also allows you to stop configurations.
Important: A stopped configuration will be started by the Schedule Downtime process (see 4.2.12, Scheduling downtime on page 194) even if it was stopped manually.
Notice in Figure 4-18 that the configuration state has changed from Stopped to Undeployed.
184
8004chMgmt.fm
The Properties view (Figure 4-20), shows the properties from all orchestrations that are part of the selected project configuration.
185
8004chMgmt.fm
The example in this section changes the ftp_host and salesforce_username properties to point to a production FTP host and to use a different user name for salesforce credentials. To modify the properties for this configuration, click Edit, which is located on the bottom of the properties view. In the Edit Configuration Properties window, change the property value for each field. Figure 4-21 shows the ftp_host and salesforce_username new property values.
When you finish the modifications, use the Save link on the bottom of the page to make the configuration persistent and available. With these changes, an orchestration that references these configuration properties will use the new values after the project is deployed and started.
186
8004chMgmt.fm
Disabling an orchestration is a simple task in the WMC. When you open the Configuration Details view for a project, the orchestrations are listed in the Orchestrations section along with the current status for each, as shown in Figure 4-22.
Click Edit at the bottom of the list to open the Edit Orchestration Settings window. The enabled orchestrations are checked in the Enabled column as shown in Figure 4-23. Clear the setting for the orchestration or orchestrations that you want to disable.
To enable or disable all orchestration in a single step, check or clear the unnamed header as indicated in Figure 4-24.
If you disable all orchestrations, the project configuration will not start, and a warning message is issued, as shown in Figure 4-25.
Save the orchestration settings to return to the Configuration Details view, where you can see that the CurrentTime orchestration is disabled (Figure 4-26).
187
8004chMgmt.fm
When you start the project configuration and monitor the status through the dashboard, it is easy to see that the CurrentTime orchestration is disabled, as shown in Figure 4-27.
In this example, the ITSO_Management_Chapter configuration is the configuration to be cloned. To clone this project configuration, click the Clone Configuration icon, and then enter a name for the new cloned project in the Clone Project Configuration window, as shown in Figure 4-29.
188
8004chMgmt.fm
The name for the cloned project should follow the same name conventions you use for all projects. The new name will be the original name with the new name after it in square brackets as shown in Figure 4-30. The clone will be in the undeployed state so you can change any property values that you want before starting it.
Tip: Make sure that the cloned project configuration property values that you provide do not conflict with any other configuration that are already deployed, including the configuration from which it was cloned. It is common to have conflicts that are related to the HTTP port and URL configuration settings. If there are conflicts in settings, the project configuration will not start.
189
8004chMgmt.fm
Important: When a Project Configuration is deleted, all monitoring log history that is associated with it is also deleted.
4.2.10 Versioning
WebSphere Cast Iron runtime provides version control functionality which allows you to have different Project Configuration versions in the runtime in parallel. Important: If a configuration project with the same name and version is published, it overwrites the configuration project that is deployed in the run time. Figure 4-33 shows a project configuration published with a different version, in this case version 2.0. Notice that version 1.0 does not display, which is the expected behavior.
Hint: A version number is required for some Management API operations, even if the project configuration that you are targeting is version 1.0. When uploading a project, you can change the version number to a different number other than the version originally exported from the Studio project. For more information, see Refer to 4.2.13, Uploading and downloading a project on page 197 and 3.3.4, Versioning projects on page 92.
4.2.11 Assets
This section explains how to manage database and web services assets from the Web Management Console. The following assets are managed from the WMC: Database scripts Web Services Description Language (WSDL) files
190
8004chMgmt.fm
Database scripts
For those orchestrations that contain database activities that specify the Exactly Once delivery option, database scripts are created automatically when you publish a project. A typical scenario is when a starter activity monitors a database table for updated rows (Get Updated Rows activity). In this example, a trigger and a buffer table are created by WebSphere Cast Iron. The trigger monitors the source table and copies updated data to the buffer table. Then, the orchestration starts with the activity reading data from the buffer table. Scripts to create the trigger and database table are created for you. You also get database scripts if you are using the Get Inserted Rows, Get Updated Rows, or Get Deleted Rows activities, but not the Poll Table database starter activity. You can manage the assets from the WMC by opening the project configurations Configuration Details page. The database endpoints with assets are listed in the Assets section. Figure 4-34 lists two entries: ProductsDatabase BankWS
Clicking on the ProductsDatabase database endpoint entry opens a window showing the list of assets you can generate scripts for. The ProductsDatabase in this example contains an update trigger and a buffer table as shown in Figure 4-35
191
8004chMgmt.fm
When you select one of the database script links at the bottom of the asset list, the script is generated if you click Create, Drop or Recreate, as shown in Figure 4-36. You can execute the script through the WMC, or you can download it. If you download the script, you can change it and run it outside the WMC.
These operations can run only when the project configuration is undeployed. Note: The proposed names of the database objects can be modified in WMC before executing the script. The default names begin with CI_. The next two characters indicate the type of object: buffer table (BT) control table (CT) Oracle sequence (SEQ) insert trigger (IT) update trigger (UT) delete trigger (DT).
192
8004chMgmt.fm
For more information about working with these assets, refer to 3.6.7, Database activities, database assets, and the staging database on page 114.
WSDL files
An orchestration exposed as a web service through the Provide Service activity has a WSDL file that describes the service. Clients of this service need a copy of this file. The WSDL file is made available automatically in the WMC when the project is published. You can download it to use it to build the web service client. The asset is available in the project configurations Configuration Details page in the Assets section, as shown in Figure 4-37. When you select the asset that is related to a Provider Service activity, in this case BankWS, you have access to the WSDL file that is related to it.
You can view the WSDL file or download it, as shown in Figure 4-38.
193
8004chMgmt.fm
For more information, see: Chapter 9, Common error handlers on page 353. The common error handler is called as a web service. http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/topic/com.ibm.websphere.cast_ iron.appliance.doc/Managing_Projects/toc_managing_projects.htm
194
8004chMgmt.fm
To create or edit downtime rules, you do not have to undeploy the project configuration. Only users with administrator or publisher access rights can manage scheduled downtime rules. To schedule downtime for a project: 1. Open the Configuration Details page for the project configuration. The Configuration Details page includes a Scheduled Downtimes section, as shown in Figure 4-39.
2. Click the New Rule link highlighted in Figure 4-39. 3. In the New Downtime Rule window, shown in Figure 4-40, select the start and end time for the downtime. You can also specify the actions to be taken when the time comes.
195
8004chMgmt.fm
Table 4-1 on page 196 lists the actions for the downtime rules. One of the three actions listed must be selected for the Action field for a downtime rule.
Table 4-1 Schedule downtime actions Action Stop (allows jobs to finish) Result Prevents any new orchestration jobs from starting and allows current jobs to finish processing. This action facilitates a graceful stop. Prevents any new orchestration jobs from starting and stops all currently running jobs. This action immediately stops all jobs. Prevents any new orchestrations from starting and pauses any jobs that are currently running. At the end of the scheduled downtime, the run time processes the suspended job from the point where it paused.
The fields in the Repeat section in the New Downtime Rule window are optional. In Figure 4-41, the downtime rule is set to run repeatedly every 2 weeks.
4. Click Save to create and activate the rule. It is now listed in the Scheduled Downtimes pane. To edit a rule, click the link in the Action field. To delete a rule, select it, and click the Delete link. Refer to Figure 4-42.
Hint: You can delete a group of multiple rules for the same project configuration at the same time by selecting multiple configurations and then clicking the Delete link.
Hint: By default, downtime rules are stored in GMT time zone. If the WebSphere Cast Iron system clock is changed from GMT to another time zone, downtime rules start and end fields will be adjusted for the new time zone. To keep the same start and end time with a new time zone, you will need to edit all rules and change the times appropriately.
196
8004chMgmt.fm
Click Upload Project to open the Upload Project Configuration window. This window allows you to browse for the project file in the file system. You can set the Project name and version for the project, as shown in Figure 4-44.
Click Upload to upload the project into the WebSphere Cast Iron runtime. Important: Some browsers can have problems when using Cast Iron with self-signed certificates. If you encounter such a problem use another supported browser. For a list of supported browsers, see the system requirements for your Integration Appliance at: http://www-01.ibm.com/software/integration/cast-iron-cloud-integration/reqs/
197
8004chMgmt.fm
Projects can also be downloaded. You might do this to then upload the same project to another WebSphere Cast Iron environment or to retrieve the source code for the project (stored with the project in the runtime). To download a project, select the project configuration, and click the Download link in the Configuration Details page, as highlighted in Figure 4-46.
The download creates a compressed file that contains project source code from the configuration that you selected.
198
8004chMgmt.fm
WebSphere Cast Iron contains useful tools to generate, visualize, and export logs. This section discusses logging, resource utilization, and notifications.
As illustrated in Figure 4-48, WebSphere Cast Iron pushes log events to the system and job logs. Log events generated by orchestrations (job instances) go through job filters (illustrated as the smaller filters in the diagram) that can block events from being logged. The system log determines the level of logs it will accept through an additional filter( the larger filter in the diagram). Although a log event may pass the job filter and be sent to the system log, the event can still be blocked. In addition to job instance log events, WebSphere Cast Iron also produces log events that are not related to orchestrations, such as security, hardware, and network events. These log events are pushed to the system log.
199
8004chMgmt.fm
System Log
Job Logs
In addition to logging system messages, the system log also records events that are related to activities from running (or tried to run and failed) orchestrations, including logs from the Log Message activity.
Entry types
WebSphere Cast Iron records log entries in one of the following categories: Hardware Resources Network Security Orchestration Deployment 200
Getting Started with IBM WebSphere Cast Iron Cloud Integration
8004chMgmt.fm
Logging levels
There are four logging levels that can be bound to events generated inside WebSphere Cast Iron, as listed in Table 4-2. As mentioned previously, these log levels (also known as severity levels) are produced by the run time and also by the job instances.
Table 4-2 Severities levels Severity Critical Error Warning Info Description Used for error condition that causes a shutdown. Used for non-critical issues that must be handled immediately they occur. Used when potential error conditions occur. Used for informational usage.
The System Log page has a configuration window that allows you to define the minimum logging level that an event has to have to be recorded in the system log repository. At the bottom of the System Log page is the Settings link, as indicated in Figure 4-50. Use this link to change the settings.
From the system log Settings window, you choose the minimum log level that the system log records based on the event source, as shown in Figure 4-51.
Cast Iron Live: Cast Iron Live system log settings contain only the Security, Orchestration, and Deployment settings.
201
8004chMgmt.fm
Figure 4-53 shows log entries from an orchestration that tried to poll an FTP server using the wrong password. Is this case, the system log contains five warnings messages and one error, all related to the event of not having access to the FTP server.
For FTP, both the number of retries and the time between each retry are defined in the Poll Directory activity during the development phase. For more information, refer to: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/topic/com.ibm.websphere.cast_i ron.doc/toc_FTPactivities.html Notice that these logs belong to the Orchestration category because the error is related to a job instance that ran and is not related to the Integration Appliance. The log entry in Figure 4-54 shows a failed attempt to parse the input data. The data can be corrupted or can contain the wrong format. Some system log entries can also contain links to job instances logs.
Click the link highlighted in Figure 4-54 to show more details in the Job Details section, shown in Figure 4-55. This level of detail with activities and its variable values is provided when the job log level is set to All. 202
Getting Started with IBM WebSphere Cast Iron Cloud Integration
8004chMgmt.fm
If the log level is set to Error Values, the Job Detail panel is still present but shows only the activity where the error happened, as shown in Figure 4-56. You can read more about job detailed logs in 4.3.3, Job log on page 206.
Figure 4-56 Job details for an error message with log level set to Error Values
The System log page now contains the message created by the Log Message activity, as shown in Figure 4-58.
203
8004chMgmt.fm
Important: Although an error is caught in a try/catch or catch all block, one or more log entries will still be recorded in the system log.
For example, you can select the type of log entries to view by selecting one of these categories in the System drop-down, as shown in Figure 4-60. Additional filters allow you to filter the view by logging level, date, and resolved or unresolved entries.
You can also sort columns by clicking the column header, as shown in Figure 4-61
Figure 4-61 The arrow on the right side indicates the sorted column
For each entry in the system log, you can keep track of whether or not an error or warning was resolved. You can mark one or more entries as resolved, which automatically completes the other two fields, Resolved On and Resolved By, as indicated in Figure 4-62. Flagging a log entry as resolved helps you to identify records that have not been resolved so far. There is a "Unresolved" filter to find them.
Hint: On the bottom of the System Log page, the Resolve All link changes all entries to the resolved state.
204
8004chMgmt.fm
You can also access the System Log page through the dashboard. There is Critical Alert panel on the right of the dashboard that shows Error and Critical alerts. You can use this panel to link to the System Log page by clicking the plus sign (+) on the upper right corner, as shown in Figure 4-63.
Exactly the same number of entries that are filtered for display in the System Log page are exported to the file. You can narrow the entries that are exported to the file by changing the filter values on the filter header row.
205
8004chMgmt.fm
Example 4-3 shows one log entry that was extracted from an exported system log XML file.
Example 4-3 A log entry in the exported file
<log xmlns:ns2="http://www.approuter.com/schemas/2008/1/lognotif/types"> <ns2:system>security</ns2:system> <ns2:message>Authentication failure for user: admin, from host:</ns2:message> <ns2:id>3</ns2:id> <ns2:level>error</ns2:level> <ns2:timestamp>2011-10-05T15:22:11.179Z</ns2:timestamp> </log> Important: When upgrading WebSphere Cast Iron, the logs are deleted. To retain system log information, export system logs before you begin the upgrade.
Cast Iron live: The functionality for exporting system logs is currently not available with Cast Iron Live
Log levels
Each orchestration in a project can have the log level set individually or all orchestrations can have the same log level. Table 4-3 lists the available log levels.
Table 4-3 Log levels for orchestrations Log Level None Initial Values Initial and Error Values Error Values Inline All Description Orchestration status and activity are not logged. Only the initial values of orchestration variables are logged. Both the initial values of orchestration variables and orchestration errors are logged. Only orchestration errors are logged. Orchestration job details are logged for sub-orchestrations inline with the job details of the calling orchestration. The highest level of logging. All orchestration activity is logged.
To view or change a log level for an orchestration or orchestrations, select Repository Configurations, and then select the target project configuration. As shown in Figure 4-66, the Configuration Details page shows the current logging level set for each orchestration. You can use the Edit link highlighted in this figure to open the Edit Orchestration Settings page, where you can change the logging level setting and other parameters.The Edit link is enabled only if the configuration is undeployed.
206
8004chMgmt.fm
Figure 4-67 shows the Edit Orchestration Settings page and the parameters that you can change for each orchestration. The logging level defaults to Error Values for a newly published project. You can change the logging level for each orchestration, or you can apply a change for all orchestrations using the unlabeled header row.
Even if the logging level is set to Error, the Job Log still records a successfully completed execution entry. The Log Synchronously field allows the run time to synchronize the writing of job instance events to the monitoring logs as the orchestration is running. By default, this setting is disabled, and orchestration jobs are not logged synchronously. When you enable Log Synchronously, the time it takes to process an orchestration job increases. In summary, the logging level field determines how much log information is produced for a job instance execution. You can then read the generated log information in the Job Log page. The details recorded in the log can change according to the corresponding level that is selected.
207
8004chMgmt.fm
Figure 4-68 Job Log page showing details for an errored job instance
One of the log levels listed in Table 4-3 on page 206 is the Inline level. When one orchestration calls another (called a suborchestration), using the Inline setting will cause the job details for suborchestration to be logged inline with the job details of the calling orchestration.
208
8004chMgmt.fm
Figure 4-69 shows detailed log information that includes data from both orchestrations. The highlighted area shows activities from the suborchestration.
Click Job Keys in the Job Details section to show the job keys and their values, as shown in (Figure 4-70).
Finally, click Summary in the Job Details section to display general job instance information, including completion time, as shown in Figure 4-71.
209
8004chMgmt.fm
Hint: You can search for a job log entry using the job ID in the Key Search field.
<job ... status="1" startTime="2011-10-06T16:01:35.481Z" path="LogSampleProject/1.0/Default/Orchestrations/CreateServicesPeopleCatalog" id="9C21C2B28C105251C072E323515A3C69" endTime="2011-10-06T16:01:35.555Z"> <ns3:event seqNum="0"> <ns3:eventType> <taskStartLoggedEvent> <taskId>9C21C2B28C105251C072E323515A3C69</taskId> <sequenceNumber>0</sequenceNumber> <time>2011-10-06T16:01:35.481Z</time> </taskStartLoggedEvent> </ns3:eventType> </ns3:event> ... </job> The job logs can contain detailed information, depending on the log level set. Example 4-5 shows an example of a detailed job log entry with internal activity data exported to an XML file.
Example 4-5 Detailed job log entry
<ns3:eventType> <saveVarsLoggedEvent> <taskId>943F1E28D4D94C6EE670902110A73494</taskId> <sequenceNumber>4</sequenceNumber> <activityId>4</activityId> <variableName>dataRow</variableName> <variableName>Total</variableName> <variableName>Filtered</variableName> <variableName>JobInfo</variableName> </saveVarsLoggedEvent> </ns3:eventType> <ns3:variable name="dataRow"> <ns3:value>122234 Giuliano,Builder,Sao Paulo,567 Leonardo,Engineer,Mexico City,55</ns3:value> </ns3:variable> <ns3:variable name="Total"> <ns3:value>0</ns3:value> ... ... To create a job log export file, use the Export link on the bottom of the Job Log page, as indicated in Figure 4-72, to open the Export Jobs window.
210
8004chMgmt.fm
The Export Jobs window gives you the option of exporting, or exporting and deleting the job logs indicated in Figure 4-73. The Export and Delete option generates the export file and deletes the data from the job logs repository. Only administrators can export logs.
The Purge action deletes job log entries based on criteria as defined in Figure 4-75.
211
8004chMgmt.fm
The purge settings are divided into the following sections: Trigger Conditions: Settings that determine the conditions that trigger the action to start purging data. These conditions include disk usage space or a scheduled date or number (variable or fixed) of job instance occurrences. Frequency: Determines how often the trigger conditions are checked for. Job Scope: Sets a filter that allows you to select the job log entries that are suitable to be purged. Job log entries can be archived before the job log is purged using the Archive feature (as described in the next section). If you do not enable the archiving settings, all the purged data is deleted.
212
8004chMgmt.fm
You can download the local stored files by selecting the file in the Select archive to download section and clicking the Download link, as shown in Figure 4-77.
Hint: Enable the Replace exported file option to avoid excessive disk consumption. Running out of disk space also triggers the purge action more often. For more information about Job Logs purge and archive, visit: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/topic/com.ibm.websphere.cast_i ron.appliance.doc/Working_with_Logs/purgingJobLogs.htm Tip: For troubleshooting purposes there is a postmortem log. You can generate and download the postmortem log from the Commands page. For more information, refer to 4.7, Commands on page 225. Some internal logs are also available by selecting Logs Archived Logs.
4.3.4 Notifications
WebSphere Cast Iron can generate alert notifications, allowing you to monitor the system for certain events. Email and SNMP are the target destinations for notifications. You can access the notifications page by selecting Logs Notifications, as shown in Figure 4-78.
213
8004chMgmt.fm
Before configuring the policies for notification generation, you have to configure the target destinations. You can configure Email or SNMP. If the target destinations are not configured and enabled, notifications will not be created. To configure the email, click the Email link. Figure 4-79 shows the email settings. Click the SNMP link to set up the SNMP target destination.
You can download the WebSphere Cast Iron Management Information Base (MIB) file to import it into a SNMP server or a monitor tool as shown in Figure 4-80.
214
8004chMgmt.fm
After you have configured the notification destinations, either Email or SNMP, notice that their status changes to active, as indicated in Figure 4-81. You next need to create policies. Policies are the actual alert configuration. When creating a policy, you can determine the run time systems and severity level for which you want the system to generate notifications. Click Logs Notifications, and then click the New Policy link at the bottom of the page to create a policy, as indicated in Figure 4-81.
In the configuration for the New Policy, you must select the minimum notification level and the system level the notification engine will be monitoring to generate notification alerts. Figure 4-82 shows an example of how to set the name, log level, and system. In the Email pane, you can enter email addresses to receive this notification. Although the target destinations can be active, for each policy you determine whether or not this destination is going to be used. Figure 4-82 shows that both Email and SNMP are being used as destinations for this policy.
After saving the policy, you can view the list of all policies in the notifications page. You can delete a policy by selecting the policy and then clicking the Delete link, as indicated in Figure 4-83.
215
8004chMgmt.fm
Hint: Refer to the CLI documentation to learn more about getting SNMP traps that are not related to notification alerts. Refer to information about the mgmt snmp command at: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/topic/com.ibm.websphere.cas t_iron.cli.doc/CLI_about_CLI.html
Cast Iron Live: For Cast Iron Live, you cannot generate SNMP notifications.
4.4 Network
Chapter 2, Installing and setting up WebSphere Cast Iron integration on page 27 discusses how to configure network settings through the Command Line Interface. The WMC also provides administrators a page to change network settings. Select the Network link in the menu to access the network page settings, as indicated in Figure 4-84.
The Network Settings page displays the current network settings and allows you to change several network parameters, including the management and data interface configuration, routes, host name, DNS, and time server among others. Click the Edit link, indicated in Figure 4-85, to change these configurations. Cast Iron Live: This functionality is not available with Cast Iron Live.
216
8004chMgmt.fm
You can change the configuration using a four-step wizard, as shown in Figure 4-86. The last step is to restart the appliance to apply your changes. At the bottom of the screen you will find Previous and Next links that allow you to move between the wizard steps.
You can find more information at: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/topic/com.ibm.websphere.cast_i ron.appliance.doc/Managing_Integration_Appliances/specifyingNetworkSettings.htm Hint: If a TimeServer is set, you cannot change the time or time zone using the CLI.
217
8004chMgmt.fm
Staging DB. The Staging DB can be used by any database related activity from Studio. It is
frequently used by Data Quality activities such as Lookup, Sort, and Merge. When you need to merge data flowing inside the orchestration with data from a database table that does not change often, use the Staging DB. To configure activities in Studio to use the Staging DB, create a database endpoint that is configured to Local and specify the appliance data IP address and a valid user name and password as shown in Figure 4-87. The user name and password must be for a user with Publisher privileges on the Integration Appliance. The staging database must be started using the WMC before it can be accessed.
Cast Iron Live: This functionality is not available with Cast Iron Live. In the WMC, you can manage the Staging DB through the System Staging DB menu, indicated in Figure 4-88.
On the Staging DB page, you can start and stop the database and access the Database Viewer. By default the Staging DB is not started. The Start Database and Stop Database link at the bottom of the page is a toggle switch. When the database is started, you have the Stop Database link. Only administrators are allowed to start or stop the Staging DB.
218
8004chMgmt.fm
After the Staging DB is started, click the Database Viewer link to manage the database content. The Database Viewer allows you to create database tables and data and to validate queries. Only administrators or publishers are allowed to manage database table structures. Click the APP folder inside the Schema pane to create a new database table, as shown in Figure 4-89.
219
8004chMgmt.fm
The Create Table page, shown in Figure 4-90, provides an intuitive interface to create the new database table structure.
220
8004chMgmt.fm
After the database table is created, its structure is displayed in the left pane. There are two other panes in this pagethe console and the results pane. Using these two panes, you can issue and validate SQL statements to the database and check the results, as shown in Figure 4-91.
Database scripts: In Database scripts on page 191, you read that database scripts are created for you. If you are using a local database (the Staging DB), the database assets are created in the Staging DB.
221
8004chMgmt.fm
Clicking the plus sign (+) highlighted in Figure 4-92 opens an expanded Resource Utilization page. You can also access this page by clicking Home Utilization. Figure 4-93 displays the expanded Resource Utilization window.
The % of Disk Used data allows you to identify whether WebSphere Cast Iron is running of out disk space. If WebSphere Cast Iron runs out of disk space, you can take actions, such as turning off the persistence option (as described in 3.4.3, Orchestration properties on page 99) for orchestrations that no longer save job instance variables data into the disk. You can also change logging level to record less data or purge logs. The % of Memory Used data allows you to monitor memory utilization inside WebSphere Cast Iron. A high level of memory utilization might imply an out of memory error. To avoid this type of error, you can change the Max Simultaneous Jobs field for an orchestration to limit the number of parallel job instances that can run at the same time. You can also turn on the persistence for an orchestration to save job instance data in the disk using less memory. In addition, you can schedule downtime to allow an orchestration that uses more hardware resources (a batch job for example) to run when more hardware resources are available. In this case, the scheduled downtime can bring down other orchestrations for a certain amount of time, freeing resources to the orchestration in need of more memory. The GC Activity data displays the garbage collector activity. The garbage collector is a process within the run time Java virtual machine (JVM) that returns memory that is held by completed jobs and variable data back to the pool of memory used by orchestrations, as shown in Figure 4-94.. This garbage collection gives the orchestration engine a constant
222
8004chMgmt.fm
supply of free memory to be used by new orchestrations. When the memory utilization is over the 80% threshold, the garbage collection is more intensive and can affect the orchestrations response times
223
8004chMgmt.fm
Finally the # Running Jobs data displays graphically the number of jobs instances at a point in time indicated by the horizontal axis (time line). You can click in the # Running Jobs line to obtain details about the orchestration that ran at that certain point in time, as shown in Figure 4-95.
You can view the hardware status by clicking the Hardware Status link located on the bottom of the Resource Utilization windows, indicated in Figure 4-96. You can also view this page by selecting the System Hardware Status menu.
224
8004chMgmt.fm
The Hardware Status shows the resource utilization in a bar graph. This page displays CPU, RAM, and disk consumption as a percentage, as shown in Figure 4-97.
For further analysis, you can also download the results from the graph as a comma-separated value (CSV) file. Click the Export Utilization Data link to download the file, as shown in Figure 4-98.
Time,% Disk Used,Memory Tue Oct 18 01:44:43 GMT Tue Oct 18 01:44:53 GMT Tue Oct 18 01:45:03 GMT Tue Oct 18 01:45:13 GMT Tue Oct 18 01:47:13 GMT Tue Oct 18 01:47:23 GMT Tue Oct 18 01:47:33 GMT Tue Oct 18 01:47:43 GMT Tue Oct 18 01:48:53 GMT
Used,% Memory Used,GC Count,Total Running Jobs 2011,6,37666120,2,122,0 2011,6,37666120,2,122,0 2011,6,39876848,3,122,22 2011,6,43099880,3,122,8 2011,6,43099880,3,122,0 2011,6,44162904,3,122,28 2011,6,46233864,3,122,6 2011,6,46233864,3,122,0 2011,6,46233864,3,122,0
4.7 Commands
Through the System Commands menu, an administrator can issue several system commands to WebSphere Cast Iron (Figure 4-99 on page 226). The list of commands can vary, depending on the Integration Appliance configuration (stand-alone versus high availability pairs) and the Integration Appliance state (active or standby).
225
8004chMgmt.fm
Cast Iron Live: This functionality is not available with Cast Iron Live. Table 4-4 lists a description of these commands.
Table 4-4 System commands Command Remove job history Remove project and configurations Remove all jobs in progress Download postmortem Description Removes orchestration monitoring data. Removes currently deployed project or projects data. Stops and removes all currently running project data. Generates an archive of information that is gathered from Integration Appliance logs, orchestration logs, and transaction stores. This information can be used to debug Integration Appliance issues. Restarts the Integration Appliance routing subsystem (the runtime engine). Shuts down all routing services and then reboots the Integration Appliance.
Restart Reboot
226
8004chMgmt.fm
To run a command, select the command and then click Go. Figure 4-100 shows a reboot command in progress.
4.8 Security
The WMC contains a Security menu as shown in Figure 4-101. This menu offers several tasks to manage the appliance from the security perspective. You can use this menu to manage users and groups, authentication servers (LDAP and Kerberos), and also certificates.
Notice that WebSphere Cast Live security menu contains only Users and Groups and certificates. There is a dedicated menu to manage Secure Connectors as shown in Figure 4-102.
You can find more details about Security in Chapter 5, Security on page 233.
227
8004chMgmt.fm
With WebSphere Cast Iron Cloud, this information is accessible through the Settings menu, as shown in Figure 4-104.
228
8004chMgmt.fm
2. Log in as an administrator to your Integration Appliance. 3. Click System, and then click Upgrade if it is not already selected. 4. Click Upgrade Operating System, as highlighted in Figure 4-106.
Click Browse, and select the .vcrypt2 file that you downloaded. Then, click Upgrade, as indicated in Figure 4-107.
229
8004chMgmt.fm
5. The Integration Appliance completes the following tasks: a. Upload File b. Upgrade Operating System c. Reboot When these tasks complete, which can take several minutes, the WMC login window opens, as shown in Figure 4-108.
Tip: Some browsers are restrictive in supporting self-signed certificates and might block browser functions, such as file upload, which is required for the installation of module providers (as well as for uploading projects). If you have this problem, either install a trusted certificate before starting the upload or use a different browser.
After the upgrade, it is recommended that you check the version number in the System Summary. Cast Iron Live: Maintenance for Cast Iron Live is performed by IBM.
230
8004chMgmt.fm
complete list of connectors that require third-party libraries, open the System > Upgrade > Update Connector Libraries page, as indicated in Figure 4-109.
Cast Iron Live: In Cast Iron Live, you can open this window by clicking the System Connector Libraries menu. The detailed steps to update an SAP library in your system are described in 2.6.5, Installing third-party libraries on page 73. For each connector, a different file set is provided, but the process to update connector libraries does not change. For more details about connector libraries, go to: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/topic/com.ibm.websphere.cast_i ron.appliance.doc/Managing_Integration_Appliances/installing3rdPartyLibraries.htm
231
8004chMgmt.fm
232
8004chSecurity.fm
Chapter 5.
Security
This chapter provides an overview of the security features that are included in IBM WebSphere Cast Iron. It shows how to address the main security aspects at various levels for all form factors and discusses the security configuration steps that are required when a project is assembled. This chapter is not intended to be a guide to securing appliances, applications, or networks. That information is beyond the scope of this book. This chapter is intended to provide security specialists with information about the capabilities of IBM WebSphere Cast Iron Cloud Integration. This information can be factored into the larger scope of corporate security procedures. This chapter contains the following sections: WebSphere Cast Iron users and groups Granting project configuration permissions Permissions to publish projects from Studio Configuring WebSphere Cast Iron to use LDAP authentication Working with certificates Securing communication with endpoints Monitoring security Additional security considerations
233
8004chSecurity.fm
Allowed
Allowed
Not allowed
Allowed
Allowed
Allowed
234
8004chSecurity.fm
The resulting list displays your user name, display name, email, and group memberships. You can also change your display name, password, or email. For example, Figure 5-2 shows the details for user2.
Chapter 5. Security
235
8004chSecurity.fm
236
8004chSecurity.fm
The New User window opens (as shown in Figure 5-5). Complete the following fields: Name Display Name Email Password Confirm Password The user name that will be used for log in A name to associate with the user An email address for the user A password that conforms to the specified rules Configuration of the password
Password rules: The password must contain characters from three of the following four categories: Uppercase letters Lowercase letters Numeric characters Punctuation (for example !, $, #, or %) Add the tenant name to the user name and display name. For example, if the tenant name is ibm.com, the new user name is newuser@ibm.com. This naming convention can help you to identify common user names across multiple tenants in the cloud. Clearing the Hide password text field shows the password in clear text. Clearing the Active option prevents the user from being able to log in to the WMC. You can select a group for the user in the right column. Group selection: A new user is placed in one of the built-in groups regardless of whether you select a group as follows: If you select no groups, the user is added to the user group. If you select a group other than the user group, the user is added to that group and to the user group. If you select a built-in group higher in the hierarchy than theuser group, for example the publisher group, the new user is added only to that group. If you do no select a group, the user is placed in the user group by default.
Chapter 5. Security
237
8004chSecurity.fm
WebSphere Cast Iron Live: The WebSphere Cast Iron Live environment includes a field called Libraries Environment. This field allows you to select the environment from which the users projects can retrieve additional libraries and files for endpoints. The environment that you select should match the environment of the primary group of which the user is a member. 3. Click Save. The new user is added to the list of users (as shown in Figure 5-6). This user is placed in the user group by default because you did not specify a group.
238
8004chSecurity.fm
Chapter 5. Security
239
8004chSecurity.fm
3. In the Settings pane, click the Edit link to the right of Password, as indicated in Figure 5-8, to change your password.
4. Enter your old password. Then, enter and confirm your new password, as shown in Figure 5-9. Click Save.
Password rules
When you create or change a password, the password must meet the following requirements: A new password cannot contain parts of an old password. The password must contain characters from three of the following four categories: Uppercase letters Lowercase letters Numeric characters Punctuation (for example !, $, #, or %)
240
8004chSecurity.fm
3. In the Users section, click the user to edit it as shown in Figure 5-10.
4. The Edit User window opens with the user profile information. Enter and confirm the password, as shown in Figure 5-11.
5. Click Save. A message displays that the save was successful. Using the Command Line Interface to change a password: You can use the Command Line Interface (CLI) to change the password of a user. You do not need to know the current password for user2, but you need the admin password. The passwords that you type do not display on the console. For example, to change the password for user2, use the following command from the CLI: ci-9-42-171-225/Standalone> auth set user user2 Enter user2s old password or admins password: Enter new password: Re-enter new password: Successfully changed password When Lightweight Directory Access Protocol (LDAP) is used for authorization and authentication for users and groups, this command can be used only for the administration account.
Chapter 5. Security
241
8004chSecurity.fm
3. In the New Group window, enter the name for the group and a display name as shown in Figure 5-13. You can also select the users to add to the group now by selecting each user from the list on the right.
242
8004chSecurity.fm
4. Click Save. The new group is listed in the Security Groups section, as indicated in Figure 5-14.
Figure 5-15 Updating the itso1 group with the user1 and user2 users
Chapter 5. Security
243
8004chSecurity.fm
3. A message displays that the group saved successfully. Now the Groups section shows the group updated with the users added, as indicated in Figure 5-16.
Figure 5-16 The itso1 group updated with the user1 and user2 users
3. Confirm that you want to delete the user. by clicking Yes as shown in Figure 5-18.
244
8004chSecurity.fm
Deleting a user notes: Notice that deleting a user does not affect any groups. Deleting the user removes the user from any group membership. You cannot delete the admin user.
3. Confirm that you want to delete the group by clicking Yes (Figure 5-20).
A message displays indicating that the group deleted successfully. Users in deleted groups: Deleting a custom group does not delete the users in the group. Users can belong to multiple groups and always belong to one built-in group. If you delete a custom group, the users still have membership in the built-in group.
Chapter 5. Security
245
8004chSecurity.fm
Granting a group permission to a project configuration in the WebSphere Cast Iron runtime gives the users in that group full access to the project configuration. They can edit the project configuration, delete it, or create new project configurations. You must have administrator privileges or be the publisher of a project to grant permissions to a project configuration. To assign permissions for a project: 1. Click a project configuration. The Configuration Details page displays. In the Permissions section, click Edit as indicated in Figure 5-21.
2. Select the users or groups to which you want to grant permissions, as shown in Figure 5-22.
3. Click Save.
8004chSecurity.fm
For example, user1 attempts to publish the SFDC_to_DB2_upsert_Products project using his credentials, as shown in Figure 5-23.
As soon user1 clicks OK, an authentication failure message displays, as shown in Figure 5-24.
However, if publisher1 credentials are used, as shown in Figure 5-25, the project will publish successfully.
Chapter 5. Security
247
8004chSecurity.fm
If the project publishes successfully, a message displays, as shown in Figure 5-27. Click OK to continue.
8004chSecurity.fm
Configuring WebSphere Cast Iron to use LDAP requires an understanding of LDAP and of the structure of your LDAP repository. These steps show only the options that are available. To configure an LDAP repository to the Integration Appliance: 1. Log in to the WMC console as admin. 2. In the navigation pane, select Security LDAP as shown in Figure 5-28.
3. Select the Enable LDAP option. 4. In the Host Information section, complete the following information: a. Enter the host and port information for the LDAP server. b. Click the Fetch DNs button to select the base Distinguished Name (Base DN) of your company. 5. In the Credentials section, enter the user ID of an LDAP admin user or a user who is capable of running directory searches (if the LDAP server requires it), as shown in Figure 5-29.
6. In the Security Options section, choose one of the following options: Use Secure Connection (SASL)
Chapter 5. Security
249
8004chSecurity.fm
Enables Simple Authentication and Security (SASL) mechanisms that are supported by the LDAP directory server. This option is the most secure option. Use Simple Authentication Enables simple authentication, but does not encrypt credentials. Anonymous Bind Enables anonymous binding to the LDAP directory server. This option is the least secure option. If you select SASL, configure the Authentication section. 7. In the Authentication Mode section select the mode: Composed DN Mode Search DN Mode 8. In the User Information section, complete the following fields: User Container RDN Configure this field when the composed DN mode is selected, which means you can specify the immediate ancestor of the users. For example, if User DN = uid=itsouser,ou=itso,dc=xyz,dc=com, the User Container RDN would be ou=itso due to dc=xyz,dc=com is the Base DN. This is typically left blank when the search DN mode is selected. User Search Filter This field is required only if the search DN mode is selected. This entry accepts an LDAP search filter specification and also accepts a user name in the form of $USERNAME. Figure 5-30 illustrates this configuration.
User Principal DN This field specifies the DN of the user that the LDAP directory server binds after the search. You can specify $USERNAME or $DN to represent the user name and Distinguished Name. Where $DN represents (RDN+BaseDN) for the Compose DN Mode and searched DN for Search DN Mode.
250
8004chSecurity.fm
9. Specify in the Group Mapping section the filters for the three roles (administrators, publishers, and users). These are standard LDAP filters. For example, many LDAP servers use the isMemberOf field to indicate to which group the user belongs as shown in Figure 5-31.
Figure 5-32 shows a configuration of WebSphere Cast Iron that is connected to an LDAP server that requires directory search authentication. The searching of users is done with search DN mode, which means that the LDAP search starts from the root of the directory information trees (DITs).
The user group filter is the first filter that is evaluated. Then, the user is checked for publisher or administrator privileges. The user group filter determines who gets to log in to the WMC. This filter is the first of the three group filters that are evaluated for WMC login. With the user group filter, the following cases occur: Case 1: If the group filter is blank, any user who inputs valid credentials is allowed to log in. In other words, this filter is satisfied for all users.
Chapter 5. Security
251
8004chSecurity.fm
Case 2: If it is non-blank, only the users satisfying this filter are allowed to log in. If this filter fails, the user is denied WMC access even if valid login credentials are provided. The other two filters are used for granting privileges and are consulted only if the user group filter is satisfied; otherwise, they are ignored: The publisher group filter determines whether the user is granted publisher privileges as follows: Case 1: If blank, publisher privileges are never granted. Case 2: If non-blank, users satisfying this filter are granted publisher privileges. The admin group filter determines whether the user is granted admin privileges. Case 1: If blank, admin privileges are never granted. Case 2: If non-blank, users satisfying this filter are granted admin privileges. For further information, visit: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/topic/com.ibm.websphere.cast_i ron.appliance.doc/Security/enablingLDAP.htm LDAP configuration can also be performed using the Management API interface, as described at: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/topic/com.ibm.websphere.cast_i ron.api.doc/ci00060.html
252
8004chSecurity.fm
In the context of WebSphere Cast Iron, certificates are used to secure an inbound or outbound connection. In the WMC, go to Security Certificates to view the certificates that are used by WebSphere Cast Iron. Figure 5-33 shows several certificates.
The certificates are stored in a secure store. WebSphere Cast Iron includes the following stores: The Key Store contains the certificates that WebSphere Cast Iron uses to authenticate itself.
Supplied Identity. This certificate is created during the first start of the Integration
The Trust Store contains the certificates that are used to verify trust.
There is currently only one certificate in the Key Store, a certificate with the name Factory Appliance and valid for two years. You can have more than one certificate in the Key Store. The certificates are created mainly by Trusted CA and used to verify that a retrieved certificate is valid. The certificates are often called signer certificates as these certificates are signed by a CA. You can add your own certificates to the Trust Store.
You can specify the certificate to use in the following situations: For inbound SSL communication on the management network, for example when you access the WMC For inbound SSL communication on the data network, for example, when you call an orchestration with an HTTP Receive Request using HTTPS For outbound SSL communication on the data networkwhen the run time calls an external service on the data network and provides a client certificate This scenario is also called mutual SSL because the server and the client have to authenticate each other. Use cases where certificates are used are discussed in more detail in 5.6, Securing communication with endpoints on page 264.
Chapter 5. Security
253
8004chSecurity.fm
2. Specify the certificate alias and the file to import as shown in Figure 5-35. Because the signer certificate does not contain a private key, it is not secured using a password. If the certificate has not been signed by a trusted CA, select the Bypass Chain-of-Trust checks option. Then click Import. See Figure 5-35 for details.
254
8004chSecurity.fm
The imported certificate displays in the Trust Store list as shown in Figure 5-36.
3. Verify the content of the certificate by clicking the Alias name. Information about the certificate displays as shown in Figure 5-37.
Chapter 5. Security
255
8004chSecurity.fm
2. Specify the certificate alias, the password, and the file to import as shown in Figure 5-39. If the certificate has not been signed by a trusted CA, select the Bypass Chain-of-Trust checks option. Then click Import.
Figure 5-39 Import options for a certificate to be placed into Key Store
If you receive the message shown in Figure 5-40, the certificate might be corrupted. You will need to create the certificate again.
If certificate corruption is not the problem, select the Bypass Chain-of-Trust checks option, and then try the import again. After the certificate is imported, it is listed in the Key Store list as shown in Figure 5-41.
256
8004chSecurity.fm
3. Verify the content of the certificate by clicking the Alias name. A window displays information about the certificate, as shown in Figure 5-42.
Chapter 5. Security
257
8004chSecurity.fm
2. Enter the values for your company. Figure 5-44 shows sample data. Click Generate.
3. The content of the certificate displays and is available for download or copy as shown in Figure 5-45. Because you do not need the certificate outside of WebSphere Cast Iron, click Close.
258
8004chSecurity.fm
4. As shown in Figure 5-46, the self-signed certificate is placed into the Key Store.
Chapter 5. Security
259
8004chSecurity.fm
2. Verify that the certificate contains the correct information for the request, and then click Generate CSR to generate a certificate signer request, as shown in Figure 5-48.
3. The certificate signer request displays similar to that shown in Figure 5-49.
You can download the request as a .pem file (for example, company2-csr.pem) using the Download function, or you can copy the text to initiate the request. Depending on the CA, you are requested either to send the text through email or a portal or to send the .pem file. After you save the request, click Close. 4. Send the certificate request to the CA. When the signed certificate is returned, you need to import it using the WMC:
260
8004chSecurity.fm
1. In the WMC, go to Security Certificates and in the Key Store section click the company2 certificate alias as shown in Figure 5-47 on page 259. 2. Verify that the certificate contains the correct information for the request and click Upload to upload the certificate received by the CA to the run time, as shown in Figure 5-50.
3. In the Update Certificate window, specify the name of the certificate file and then click Import. If the signer certificate of the CA that signed your certificate is not in the Trust Store you might have to select the Bypass Chain-of-Trust checks option as shown in Figure 5-51.
4. You are routed back to Figure 5-50 (still with the old values). Click Close.
Chapter 5. Security
261
8004chSecurity.fm
5. Back on the main window, the certificate is updated. As indicated in Figure 5-52, the Issued By column now shows that CA and the To Date has changed to 10/23/2012. Compare the values shown here to those shown in Figure 5-46 on page 259.
262
8004chSecurity.fm
2. Click the drop-down menu to the right of the Server SSL over mgmt NIC option to display a list of all certificates that are available for assignment. Select the company2 certificate as indicated in Figure 5-54.
3. Click Save. The company2 certificate is now listed for usage type Server SSL over mgmt NIC, as indicated in Figure 5-55.
Figure 5-55 New server SSL over mgmt NIC certificate has been assigned
4. Log out of the WMC. 5. Restart the network using the net restart CLI command. 6. Log in again and the new certificate is listed, as shown in Figure 5-56.
Chapter 5. Security
263
8004chSecurity.fm
Tip: Cast Iron Live includes an option to use the WebSphere Cast Iron Secure Connector to provide a secure connection to endpoints behind a firewall. For more details, refer to the next section.
264
8004chSecurity.fm
Figure 5-57 shows the architectural view. There are separate Secure Connectors for the Test and the Production cloud environments.
Web browser management of project deployment and Cast Iron Live environments
Applications (Test)
Applications (Production)
Tip: WebSphere Cast Iron Studio cannot access the Cast Iron Secure Connector that is used by Cast Iron Live to access an external system running in a private network behind a firewall. Therefore, to configure access to an external system that is running in a private network, Studio must be provided with a direct connection in to this private network so that it can access the external system at development time.
Chapter 5. Security
265
8004chSecurity.fm
No route to an endpoint has to be defined in the intranet. The communication over a channel is secured with mutual SSL. The Secure Connector and Cast Iron Live must validate each other at start using a certificate that was exchanged during configuration and installation. The communication from the Secure Connector in the intranet to the endpoint in the intranet is done through a native protocol (for example BAPI call, JDBC, MQ, JMS, and so on). Each runtime environment has its own secure connector to ensure that there is no way to bridge different environments when not intended. The creation and modification of Secure Connector configurations needs administrative rights in the cloud environment.
266
8004chSecurity.fm
Alternatively, you can install a proxy in the intranet that receives the HTTP request, does the authentication to the cloud and sends the request to the HTTP endpoint in the cloud. In both cases, you have to secure the communication even though the original HTTP call might not use HTTPS. The requirement to open the firewall for inbound requests is challenging. Security is even more challenging if these requests then have to use ports other than the HTTP ports.
The installation and initial configuration of the WebSphere Cast Iron Secure Connector is discussed in 2.6, Installing the WebSphere Cast Iron Live Secure Connector on page 60.
Chapter 5. Security
267
8004chSecurity.fm
<installation directory>\runclient_osgi.bat stop You can configure the Secure Connector with regard to ports and so forth with the following command: <installation directory>\jre\jre\bin\java.exe -Dconfigure.agent=true -jar agent_configurator.jar You can find the logs for troubleshooting in the <installation directory>/logs directory.
268
8004chSecurity.fm
b. Enter the name or IP address of the Kerberos Key Distribution Center (KDC) server and the Kerberos realm. c. Click Save. Tip: If you want to test Kerberos within Studio, specify the server and realm in Studio using Edit Preferences SSL/Kerberos. 2. Configure the endpoint to use Kerberos (see Using authentication mechanisms for outbound endpoints on page 273).
Chapter 5. Security
269
8004chSecurity.fm
Figure 5-60 shows the HTTP endpoint for inbound configuration panel. Open the endpoint by double-clicking the entry in the Projects tab under Endpoints or by double-clicking the endpoint in the orchestration graph.
The Login options are disabled because they are not available for HTTP inbound. In the Security section, you can specify the use of SSL, and if so, the certificate to use. None The endpoint is provided only through HTTP without any security. No encryption or authentication takes place. HTTPS The endpoint is provided through HTTPS.
270
8004chSecurity.fm
Tip: If you switch from HTTP to HTTPS, the endpoint settings for the port stay the same and are not switched to port 443. If you use HTTPS for an HTTP inbound endpoint, select the Server Certificate Alias Name option, as shown in Figure 5-61. This option specifies whether the Integration Appliance provides a specific certificate to the client. If you enable this option, you must insert a name for a valid certificate. The Integration Appliance that has a default certificate for the data interface.
You can define the server certificate for the data network as follows: If you do not enable the Server Certificate Alias Name option, the certificate that is specified in the WMC (or through the CLI) is taken. If you enable the Server Certificate Alias Name option, the certificate that is specified at the endpoint level takes precedence over certificates that are specified at the Integration Appliance level. If you enable the Server Certificate Alias Name option and the name that is specified for the certificate is not valid, the orchestration will not start. Tip: Configure the Server Certificate Alias Name option as a configuration property to simplify adding or replacing certificates.
Chapter 5. Security
271
8004chSecurity.fm
If you want to run the endpoint in WebSphere Cast Iron Live, other rules apply. Select the Configure for WebSphere Cast Iron Live option as indicated in Figure 5-62.
Figure 5-62 Security settings for HTTP inbound for WebSphere Cast Iron Live
When you select this option, HTTPS is selected automatically and the port changes to 443. You cannot change either the port or the certificate. For additional information, visit: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/index.jsp?topic=%2Fcom.ibm.web sphere.cast_iron.doc%2Fhttp_create_edit_endpoint.html
272
8004chSecurity.fm
In the Location section, select Remote Server, and specify the Host Name and Port of the remote server hosting the service you want to call. Specify the URI in the HTTP Post activity. You can access the service from a browser to determine whether it needs a user ID and password.
Chapter 5. Security
273
8004chSecurity.fm
Outbound settings include the following options for login: Log into the Server as an Anonymous user This setting is the default setting and needs no further configuration. It works only if the service does not need a user ID and password. Log into the Server with User Name and PasswordBasic Authentication If the remote service requires a user name and password, you can use basic authentication to provide this information. Select Basic for authentication, and provide the user ID and password. Depending on the endpoint, you might also need to specify a realm as shown in Figure 5-64.
Log into the Server with User Name and PasswordDigest Authentication This option is similar to basic authentication as shown in Figure 5-65.
Log into the Server with User Name and PasswordNTLM Authentication With NTLM, you do not provide the credentials to the remote server but to a third instance, the NTLM server. You must specify the NTLM user credentials and the NTLM domain, as shown in Figure 5-66.
274
8004chSecurity.fm
Log into the Server with User Name and PasswordKerberos Authentication The configuration of Kerberos requires the following parameters: The Kerberos Key Distribution Center (KDC) server and the Kerberos realm are defined for the appliance as described in Using Kerberos for authentication on page 269. The Kerberos user name and password are defined per the endpoint in the Login section as shown in Figure 5-67.
In the Security section, you can select HTTPS to use SSL, as shown in Figure 5-68.
Tip: If you switch from HTTP to HTTPS, the endpoint settings for the port stay the same and are not switched to port 443. If you use HTTPS for the HTTP inbound endpoint, select the Client Certificate Alias Name option. This option specifies wether the Integration Appliance provides a client certificate to the server. If you select this option, you must insert a name for a valid certificate. The Integration Appliance has a default client certificate. You can define the client certificate for the data network as follows: If you do not enable the Client Certificate Alias Name option, the certificate that is specified in the WMC (or through the CLI) is taken. If you enable the Client Certificate Alias Name option, the certificate that is specified at the endpoint level takes precedence over certificates that are specified at the Integration Appliance level. If you enable the Client Certificate Alias Name option and the name that is specified for the certificate is not valid, the orchestration will not start. Tip: Configure the Client Certificate Alias Name option as a configuration property to make it simple to add or replace certificates.
Chapter 5. Security
275
8004chSecurity.fm
WebSphere Cast Iron Live. For flexibility, use a configuration property instead of a fixed name, as shown in Figure 5-69.
If you want to access a server running in WebSphere Cast Iron Live, other rules apply. Select the Invoke service in WebSphere Cast Iron Live option as shown in Figure 5-70.
Figure 5-70 Invoke HTTP outbound service in WebSphere Cast Iron Live
The following changes apply: The host name is set to provide.castiron.com. Only HTTPS is allowed and the port is set to 443. Only Basic authentication is allowed. For additional information, visit: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/index.jsp?topic=%2Fcom.ibm.web sphere.cast_iron.doc%2Fhttp_create_edit_endpoint.html
276
8004chSecurity.fm
For security reason, alerts and errors cannot be removed from the System Logs. However, you can mark them as Resolved and filter them so that an administrator can manage the number of alerts that they must view. The person that marks a record as Resolved is documented for the record with date and time. To resolve an alert, User rights are sufficient. You can create a policy (Logs Notifications) that indicates that a notification should be sent automatically when a critical security alert occurs. You can specify that security alerts only of a specific level trigger a notification and specify who receives the notification, as shown in Figure 5-72.
Figure 5-72 Security notification for security level Error and above
You can define more than one notification for a topic, for example to send security errors and above to the security officer but security warnings to the administrator. Although all roles can see notification rules, only an administrator has the right to change them.
277
8004chSecurity.fm
Even if your Integration Appliance is running behind the firewall, take steps to restrict the access to the appliance. Take steps to protect your appliance from receiving malformed requests that might influence your environment. Take steps to ensure that a single client cannot cause an Integration Appliance to be busy all the time. Security appliances, such as the WebSphere DataPower XG45, can help to address these topics. For more information, refer to: http://www-01.ibm.com/software/integration/datapower/XG45/
278
8004chAvail.fm
Chapter 6.
279
8004chAvail.fm
280
8004chAvail.fm
Some hypervisors allow the movement of virtual machines during run time. For example, if the hypervisor detects that the hardware that is running a virtual appliance has a network problem, the hypervisor can move the virtual appliance to another hardware without stopping the appliance. Whether this type of feature is available depends on the hypervisor. So, with Cast Iron Hypervisor Edition, it is up to the hypervisor to make the underlying hardware and resources highly available. Cast Iron Live: High availability features are built into WebSphere Cast Iron Live.
Active/active
In an active/active configuration, two Integration Appliances are actively running project configurations. If a failure is detected in one appliance, the second appliance receives all new work and processes it. An active/active configuration can be achieved, for example, by using a load balancer or a shared input source such as an FTP server. You can have multiple Integration Appliances running in parallel. Active/active on a Cast Iron Integration Appliance does not support the take over of work in progress.
Active/standby
In an active/standby configuration, only the primary Integration Appliance is doing work. The standby appliance or a central instance verifies that the primary appliance is still alive using a heartbeat or similar technique so that the standby appliance can take over if the primary is not responsive. Active/standby on a Cast Iron Integration Appliance can be set up to support the take over of work in progress. Configurations that support take over are described below. Cast Iron supports active/standby using the following configurations: Cold standby In a cold standby scenario, only one appliance is fully working. The other appliance is not started or is only partly started. If the primary appliance fails, the standby appliance is activated and can take over new work. Take over for work in progress might be achieved. All Integration Appliances support a cold standby configuration. You can implement this configuration using the following methods: Both Integration Appliances are started Both Integration Appliances are started, but the orchestrations are started only on the primary appliance. An external monitoring tool such as an SNMP monitor is used to monitor the state of the primary appliance. When an outage of the primary appliance is detected, the monitoring tool calls the management APIs to stop the orchestrations on the primary appliance and to start them on the standby appliance. The monitoring tool is not provided with Cast Iron and must be configured separately. Only the primary Integration Appliance is started Virtual appliance only: This scenario is valid only for virtual appliances as it relies upon the functionality of the Hypervisor on which the virtual appliance is running.
281
8004chAvail.fm
The hypervisor can be configured to automatically start a new Cast Iron Hypervisor instance if the primary appliance fails. This new virtual machine can be on the same physical environment or on a different physical environment if the original environment is unavailable. The hypervisor then attempts to restart the image of the primary appliance. There are two possible situations: The image of the primary appliance can be restarted. In this case, the appliance can take over the new work and continue with the work in progress if the orchestrations use persistence. The image of the primary appliance cannot be restarted. In this case, a new image of the appliance is started and can take over the new work but cannot continue with the work in progress.
Warm standby You can implement a warm standby for all Integration Appliances. In a warm standby scenario, both appliances are configured for active/active mode, but only the primary appliance receives work. This is not achieved by the Integration Appliances themselves, but instead requires external configuration. For example, if data is being sent to the Integration Appliances using HTTP then an intelligent Load Balancer is needed. This Load Balancer directs messages only to the primary appliance and monitors this appliance to detect its state. If the Load Balancer detects that the primary appliance has failed, the Load Balancer will direct traffic to the secondary appliance. This requires no additional configuration on the Integration Appliances. A similar technique can be used for most protocols, for example: for FTP by using two FTP directories, one for each Integration Appliance for WebSphere MQ by using an MQ Cluster with one Queue Manager per Integration Appliance The secondary appliance takes over new work as quickly as the protocol allows. However, there is no take over for work in progress. Hot standby Physical appliance only: You cannot achieve hot standby with a virtual appliance. This configuration consists of two physically identical Integration Appliances working together to handle transactions from and to different endpoints. This configuration is called HA pairs. In this case, one Integration Appliance acts in the active role and the other appliance acts in the standby role. These two Integration Appliances are synchronized automatically. The standby appliance is in charge of synchronization and pulls data from the active appliance. When the two appliances connect to each other for first time, they synchronize immediately and determine which appliance will assume the active and standby roles. In this initial process the active appliance can handle transactions, but failover cannot occur until the HA pair is synchronized completely. After synchronization is complete, data is replicated in both appliances, and failover can be established. When the active appliance becomes unavailable, a failover process is triggered. The standby appliance takes the active role and resumes the processing exactly where it was at the failure time.
282
8004chAvail.fm
During the takeover, the appliance that was originally the standby appliance attempts to reboot the appliance that has failed. If the failed appliance can be rebooted, it takes over the role of standby appliance and starts synchronizing with the other appliance. Details of the HA Pairs states can be found at: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/index.jsp?topic=/com.ibm.we bsphere.cast_iron.HAOverview.doc/HA_about_IAStates.html For information about how to configure an HA environment using physical Integration Appliances, refer to 2.3, Configuring the physical appliance for high availability on page 44.
283
8004chAvail.fm
If persistence for the orchestration is enabled or disabled, the following actions occur If the Integration Appliance crashes just after reading the IDoc but before going into the loop: If persistence is disabled, the IDoc request is gone. If persistence is enabled, the orchestration restarts just after receiving the IDoc. In this case, all data is available. If the appliance crashes just after processing record 304 between Write XML and Update Customer: If persistence is disabled, the records 1 to 303 have been processed, and all further data is lost. Resending the IDoc means that 303 records are processed again, which can cause duplication in the database. If persistence is enabled, the orchestration restarts at the last point of persistence, which is after the update just after record 303. All data is available, and the remaining customer records can be processed without any duplication. The protocol used to start the Job Instance can also have an effect. For example, if a Job Instance was started using an HTTP Receive Request activity and the Integration Appliance fails, an HTTP error will be sent back to the requester. This will happen even if the orchestration is persistent. Thus, if the orchestration is persistent and the Job Instance restarts, the Job Instance can run to completion even though an error was sent back to the requester. Care should be taken to design the orchestration to handle these sort or unexpected situations
284
8004chAvail.fm
Scalability refers to the ability to increase processing capacity as the requirement for it grows. Planning for scalability includes selecting a platform that can grow dynamically, and investing in the additional resources (usually hardware) required for that growth. There are two approaches to scale a system. Vertical scalability refers to increasing the processing capability of the current system by adding CPUs, memory, hard disks, and so forth. Horizontal scalability refers to adding systems and spreading the application load across them. Vertical scaling can be achieved on the Cast Iron Hypervisor Edition by scaling up the hardware running the hypervisor or by assigning more resources to the virtual appliance. Virtual appliances can also scale horizontally by starting multiple virtual appliances in parallel. The physical Integration Appliance can be scaled horizontally, which means allowing one orchestration to run on multiple appliances at the same time. However, because there is no replication between the machines, some considerations have to be made with horizontal scaling. Implementing horizontal scalability depends on the use of a load balancing mechanism to ensure the distribution of load across the appliances. Figure 6-2 illustrates this concept.
Horizontal Scalability
XH40
Load Balancer
Business Apps
XH40
Business Apps
XH40
The type of load balancing that can be implemented depends on the type of starter activity for the project configuration. If data is pushed to Cast Iron (for example via an HTTP request), load balancing can be done by a load balancer. If data is polled by Cast Iron and reading data is fast, you might consider to have more than one orchestration listening to the same resource (file system, queue, server, and so forth). But however the retrieval of data takes a bit longer, this approach can cause conflicts. For example, if there is an FTP server with large files so that the retrieval of a file can take a minute or more, there is a risk that the same file will be read and processed by more than one orchestration. In this case you need additional logic to do load balancing. The following concepts apply to load balancing for orchestrations that are actively polling:
285
8004chAvail.fm
Provide different sources for the orchestrations, for example JMS queues or FTP directories, so that different orchestrations listen to different events. Provide different filter criteria for the poll activity, for example a file name pattern for an FTP poll, subject patterns for email polling, and so on. Alternatively, if different appliances process load for different department or customers, consider replacing poll activities with scheduled jobs and separating the load by intelligent queries. If these configurations for load balancing do not work, consider creating a dispatcher orchestration that acts as a load balancer. A dispatcher orchestration can take the requests and spray them in an intelligent way to the orchestrations in different appliances using round-robin or even more intelligent mechanisms, for example using the management API to query the number of current jobs. Consider the following example. If you have an orchestration that polls an FTP server, you can create a dispatcher orchestration with a scheduler that retrieves a list of all files and then calls the orchestrations on different appliances with different file names. You can do the same configuration, for example, with JMS or MQ, based on the message ID, with emails, and so forth. In addition, you can use a staging DB to store the status of assignments.
286
8004chAvail.fm
3. Update the Integration Appliance. 4. Start the orchestrations and wait until all orchestrations are running. 5. Take the Integration Appliance back into the load balancing mechanism. 6. Continue with step 1 for the next appliance.
287
8004chAvail.fm
can be a challenge if the image or snapshot contains in-flight data (also known as work in progress data) that might no longer be valid and that can cause duplication or other issues. Creating an image creates a large file because the entire virtual machine is saved. Creating a snapshot produces a smaller file but does not provide a real backup, as the snapshot is not saved on an external device. If the runtime image becomes corrupted at the file level, the snapshot may not be of use either. The image is not portable, meaning that you cannot use it to clone the environment. There are additional backup tools for virtual machines available to address disaster recovery.
288
8004chAvail.fm
3. Click Export, and a message displays as shown in Figure 6-4. In this message, click Download Now.
A .tar.gz file is generated to be stored in a file system. This file contains two XML files: One file for user data (user-data.xml) One file for project data (proj-data.xml) These files include data that refers to network configurations, users and groups, licenses, job log parameters, log levels, notifications, downtime rules, and passwords (system logs are not exported). These XML files are encrypted to protect the information. If you change the configuration of your Integration Appliance we recommend to export the current configuration before and after. Virtual appliance considerations: Encryption of virtual appliance disks uses the VMware-assigned UUID of the virtual appliance. As a result, attempting to clone or copy a virtual appliance creates a non-functioning clone or copy because such operations create a new UUID. To create a backup appliance, create a new a virtual appliance with the same configuration (for example standard or enhanced). Use the config save/load CLI command to export or import virtual appliance settings and WMC repository functions. Be aware, however, that these operations do not export or import any work in progress. Also note that VMware VMotion provides a valid operation for migrating a virtual appliance to a new host. For information see: http://www.vmware.com/products/vmotion/overview.html For more information on exporting a virtual appliance repository, see: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/index.jsp?topic=/com.ibm.we bsphere.cast_iron.VAuserguide.doc/VA_exportingVA.html The exported system does not contain any installed third-party libraries. So, a package of assets that are required to recover an appliance must contain the following components: For a virtual appliance, a Cast Iron 6.1.x Hypervisor Edition image (A Cast Iron 6.1 version is already installed on a physical appliance)
289
8004chAvail.fm
The fix pack of choice if not already installed. Any installed third-party libraries The export file
Importing a configuration
To restore an exported repository into the Integration Appliance, import it using the following instructions: 1. Go to the Navigation page in the WMC. 2. Click Repository Import/Export. 3. Click Browse, and select the .tar.gz file with the exported repository and then select the settings to be imported, as shown in Figure 6-5.
You have the following options to import a project repository: Project and User settings: Imports all the contents from the repository file. Project settings only: Imports only project information from the repository file. User settings only: Imports only user information from the repository file, such as network configurations, users and groups, licenses, job log parameters, log levels, notifications, downtime rules, and passwords. Important: All of the projects in the Integration Appliance must be undeployed before you can import a project repository. Otherwise, an error message displays.
Warning: When you import projects from a repository, the WMC deletes all existing projects, project configurations, and job history in the Integration Appliance. The system logs remain unaffected. To have the option to roll back to the older configuration you have to create an export of the older configuration before importing the new one. Import is supported from Cast Iron versions 3.7.1 to 6.x.
290
8004chAvail.fm
4. Click Import. The runtime imports the content of choice. After successful import the appliance either restarts the runtime or reboots it. A message displays indicating that the Integration Appliance will be restarted or rebooted. Depending on your browser, the file upload may initially fail due to certificate issues. If this happens you will see a warning message similar to Figure 6-6 about the self-signed certificate that is used by default in the Integration Appliance. You can follow any of the options listed in the message, as shown in Figure 6-6. Click OK.
291
8004chAvail.fm
5. A .zip file is generated. Save this file, and then extract the contents of the .zip file. 6. Open the Studio tool, and click Open Project, as shown in Figure 6-10.
292
8004chAvail.fm
7. Select the .sp3 file in the extracted folder, and click Open, as shown in Figure 6-11.
Figure 6-12 shows the project configuration recovered from the WMC.
293
8004chAvail.fm
294
8004chTIPs.fm
Chapter 7.
295
8004chTIPs.fm
Create a project following best practices S T A R T H E R E Search and download TIP to local workspace
Prerequisites
The following prerequisites are required to work with TIPs in the repository. 1. Make sure you have a Cast Iron community ID. If you do not have a community ID, you can request one at: http://community.castiron.com 2. Click the Preferences icon in the Studio tool bar.
296
8004chTIPs.fm
3. Select Session Login and enter your community user name, password, and the URL of the repository, as shown in Figure 7-3. Click OK at the bottom of the preferences screen.
4. Log in to the community by clicking Login in the status bar (Figure 7-4).
If you system has firewall protection installed, make sure to look for a prompt to allow the access. 5. The login will use the community user name and password you specified in the preferences, as shown in Figure 7-5. Click OK.
297
8004chTIPs.fm
298
8004chTIPs.fm
When you open the TIP configuration editor, the orchestration is still open in the background in Studio. When you select the Sync Selection option at the bottom right corner of the Steps panel, the Studio automatically navigates to the entity in the orchestration or configuration page corresponding to the step in the TIP Configuration Editor that you are editing.
299
8004chTIPs.fm
The Preview tab is used to view the actual page of the current TIP Configuration Wizard step. This page allows you to review the changes made in Edit tab.
1. Open the CommonErrorHandler project in Studio. 2. Launch the TIP Configuration Editor to create a TIP by selecting Tools Create Configuration Wizard. 3. Add a Summary Step that gives an overview of the scenario (Figure 7-8 on page 301). a. In the Steps panel, click Add. Select Summary, and then click OK. b. Rename the step by typing Introduction into the Name field. c. Select the Show Markup field so that you see the HTML markup in the Description and Summary Content areas. d. Enter a description of the TIP in the Summary Content field, as shown in Figure 7-8. To see how your page will look when the TIP configuration wizard is executed, click the Preview tab.
300
8004chTIPs.fm
4. Next, add the Configuration Properties step to list the configuration properties that should be given a value by the user of the TIP. a. In the Steps panel, click Add. Select Configuration Properties, and then click OK. b. Click the Preview tab to review the configuration properties for the project. c. Switch back to the Edit tab and select the Show Markup field so that you see the HTML markup in the Description area. d. Enter the instructions for completing the configuration properties as a bulleted list using HTML tags in the Description field. If the Restrict Properties To section is empty, all the configuration properties of the project are added to this step. You can list just the properties to be configured by adding those properties to the Restrict Properties To section, using the Add button. You need to configure all the properties of the CommonErrorHandler project; thus, leave the Restrict Properties To area empty as shown in Figure 7-9 on page 302. To check how your page will look, click the Preview tab.
301
8004chTIPs.fm
5. Add a step to verify the connection to the FTP server. a. Drag the FTP Endpoint from the Project tab (Figure 7-10 on page 303) to the Steps panel to add a step with the name of the endpoint, FTP.
302
8004chTIPs.fm
Figure 7-10 Select the FTP endpoint in the Project tab to drag to the steps
b. Rename the step by typing Verify FTP Connection in the Name field. c. Select the Show Markup field so that you see the HTML markup in the Description area. d. Enter the instructions for this step in the Description field (Figure 7-11).
6. Add a step to configure the activity that writes the error log to a file.
303
8004chTIPs.fm
a. Drag the Configure task from the checklist of the Write Error Log File To FTP Server activity in the orchestration to the Steps panel to add a step with the name Configure (Figure 7-12).
b. Rename the step by typing Configure Write Error Log File To FTP Server Activity in Name field. c. Select the Show Markup field so that you see the HTML markup in the Description area. d. Enter the instructions in the Description field as shown in Figure 7-13.
304
8004chTIPs.fm
Figure 7-13 Configure Write Error Log File To FTP Server Activity step
7. Optionally, add a step to modify the mapping of the Write Error Log File To FTP Server activity. In this step, you can restrict the fields written to file by the mapping only the required fields. a. Drag the Map Inputs task from the checklist of the Write Error Log File To FTP Server activity (Figure 7-14 on page 306) to the Steps panel (Figure 7-15 on page 306) to add a step with the name Map Inputs.
305
8004chTIPs.fm
Figure 7-14 Select Map Inputs of the activity to drag to the steps
b. Rename the step by typing Map Error Data fields in Name field. c. Enter the instructions in the Description field as shown in Figure 7-15.
8. Add a Verify Orchestration Step to verify the integration. a. In the Steps panel, click Add. Select Verify Orchestration, and then click OK. b. Rename the step by typing Verify Integration into the Name field.
306
8004chTIPs.fm
c. Select the Show Markup field so that you see the HTML markup in the Description area. d. Enter the instructions in the Description field as shown in Figure 7-16.
9. Click Close, and save the project to save the TIP changes. You can modify this TIP at any time by launching the TIP Configuration Editor again. Remember: Only the creator of a TIP can modify the TIP. After creating or modifying TIP, be sure to save the changes before closing the project. If you close the project without saving, your changes to the TIP are not saved. The Finished step is added as the last step by default. This step contains a page that is used to rate the TIP. The step is not visible in the TIP Configuration Editor.
307
8004chTIPs.fm
The steps to upload TIPs are as follows: 1. In Studio, login to Cast Iron community, See Prerequisites on page 296. 2. Launch the Upload Project Wizard in the Studio menu by selecting Solutions Upload Project to Repository. Note that you wont have this option in the menu if you arent logged in. 3. The Upload Project Step 1 of 3 window opens, as shown in Figure 7-17 on page 308.
Enter the summary information listed in Table 7-1, and then click Next.
Table 7-1 Summary information Field Name Path Description Enter name of the TIP Specify the path in Cast Iron solutions repository where Studio will upload the TIP. If the path you enter does not exist, it will be created. For example, /RedBooks/MyTips Categorize the TIP to any of the following types: Usecases Best_Practices Utilities General Give a brief overview of the TIP
Category
Description
4. The Upload Project Step 2 of 3 window opens (Figure 7-18 on page 309).
308
8004chTIPs.fm
Enter the source and target endpoint information listed in Table 7-2, and then click Next.
Table 7-2 Source and target endpoint Field Name Description Version Description Enter name of the source and target Endpoints respectively Give a brief description of the source and target endpoints respectively Enter the version number of source and target endpoints configuration respectively
309
8004chTIPs.fm
6. Click Finish. You are prompted to accept a license agreement as shown in Figure 7-20. Read the license agreement, and then select the I have read and accept this license agreement option. Click OK, and the TIP is uploaded to the Cast Iron solutions repository.
310
8004chTIPs.fm
This window includes the following sections: Search By Specify the condition for searching the TIPs:
311
8004chTIPs.fm
Keywords: Specify any keyword as a search condition. Filter: Enter information to be used as a the search condition (Figure 7-22).
Results: List the TIPs that match the search criteria. Details: Provides the metadata for the TIP as shown in Figure 7-21 on page 311. Description: Gives a brief overview of the integration scenario covered in the selected TIP. In the keywords field, enter the text error handler as shown in Figure 7-23, and then click Go. Note that the text is part of the searchable tags entered in Figure 7-19 on page 309. The result is a list of TIPs matching the search condition. Note that you can view the rating of a TIP (entered by previous users) and you can see which TIPs are IBM certified.
312
8004chTIPs.fm
4. Browse through the descriptions of the TIPs in the Results section by selecting each TIP and reading the information in the Details and Description sections. When you find the one that you want to download, select it, and click Download. 5. When prompted, read and accept the license agreement, and click OK. 6. A dialog box opens for you to select a location to download the TIP as shown in Figure 7-24. Select the location, and click Open. The TIP is downloaded to specified location and opened in Studio for use.
313
8004chTIPs.fm
3. Read the instructions, and enter valid values for the required configuration properties as shown in Figure 7-26. Click Next.
314
8004chTIPs.fm
4. Verify the connection to the FTP server by clicking Test Connection. If you can connect successfully to the endpoint, a message displays, as shown in Figure 7-27. Click OK, and then click Next.
315
8004chTIPs.fm
5. Select the directory for FTP to write the file to and select the type of file as shown in Figure 7-28. Then, click Next.
Figure 7-28 Configuration Wizard Configure Write Error Log File To FTP Serve activity step
316
8004chTIPs.fm
6. Optionally, you can change the mapping in the Map Error Data fields step, as shown in Figure 7-29. For our scenario, the current mapping is fine. Click Next.
7. The next step (Figure 7-30 on page 318) allows you to verify that the TIP is working properly. We will skip testing for now. Click Finish.
317
8004chTIPs.fm
8. The final configuration panel looks like Figure 7-31 on page 318. Click Close.
9. Now, test this orchestration using the Invoke Service Tool in the Studio: a. Launch the Invoke Service Tool from the Studio menu by selecting Orchestrations Invoke Service. A window will open with the SOAP envelope. 318
Getting Started with IBM WebSphere Cast Iron Cloud Integration
8004chTIPs.fm
b. Enter test values in the fields as shown in Figure 7-32 on page 319, and click Execute.
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header> <cas:header xmlns:cas="http://www.approuter.com/schemas/2003/1/castirontypes"/> </SOAP-ENV:Header> <SOAP-ENV:Body> <tra:CommonErrorHandler xmlns:tra="http://www.castiron.com/schemas/training"> <tra:jobId>test123</tra:jobId> <tra:jobStartTime>2011-11-30T21:21:21</tra:jobStartTime> <tra:projectName>Project123</tra:projectName> <tra:configurationName>COnf123</tra:configurationName> <tra:orchestrationName>Orch123</tra:orchestrationName> <tra:routerHostName>Host123</tra:routerHostName> <tra:message>Message123</tra:message> <tra:activityId>Act123</tra:activityId> <tra:activityName>ActName123</tra:activityName> <tra:faultTime>2011-11-30T21:21:21</tra:faultTime> </tra:CommonErrorHandler> </SOAP-ENV:Body> </SOAP-ENV:Envelope> c. View the results by clicking Show Response as shown in Figure 7-33. Validate that the result is as expected.
Chapter 7. Reusability with Template Integration Projects (TIPs)
319
8004chTIPs.fm
10.The TIP is now configured and ready to use. Click Finish. 11.You can also rate the TIP as discussed in 7.7, Rating and reviewing TIPs on page 320. 12.Click Close.
320
8004chTIPs.fm
a. In the My Rating section, move the slider until the appropriate number of stars are highlighted. b. In the My Title field, give a brief description. c. In the My Summary field, add more review comments for the project. d. Click Submit Review. The Studio uploads the rating and review comments to the Cast Iron solutions repository. 3. Click Close.
321
8004chTIPs.fm
a. In the My Rating section, move the slider until appropriate number of stars are highlighted. b. In the My Title field, give a brief description. c. In the My Summary field, add more review comments for the project. 3. Click OK. Studio uploads the rating and review comments to the Cast Iron solutions repository.
322
8004chCDK.fm
Chapter 8.
Disclaimer: The intent of this tutorial is to demonstrate the use of IBM WebSphere Cast Iron Cloud Integration to integrate and utilize third party applications, and does not claim any endorsement or affiliation with the listed products. All product and company names are trademarks or registered trademarks of their respective holders, and IBM disclaims any ownership in such third-party marks. Use of such third-party marks does not imply any affiliation with or endorsement by or for IBM or IBM WebSphere Cast Iron Cloud Integration. The use of any third party trademarks, logos, or brand names is for informational and instructional purposes only, and does not imply that such trademark owner has authorized IBM to promote its products or services.
323
8004chCDK.fm
324
8004chCDK.fm
List Objects Use this API to discover and list the objects in the endpoint. Start the API by clicking Browse in the Configure panel of the connector activity. A browse window opens, as shown in Figure 8-2 that allows you to search for object types. The List Objects orchestration is invoked internally and the result is displayed in the Object Type and Object Label columns.
Describe Objects Use this API to list all of the fields and attributes of the selected object. Start it by selecting an object from the list of objects that are displayed in the object selection window (Figure 8-2), and then clicking OK. This will open the list of fields in the object, as shown in Figure 8-3.
325
8004chCDK.fm
XML File
.par File
All of these components are interpreted by the CDK platform and render as a connector to Studio and the run time. However, the run time uses only the .par file. This section discusses each of these components in detail.
326
8004chCDK.fm
ci-connector-config.xsd This schema contains the syntax to define connector configuration details, for example the endpoint field details and activity details, including the configure, input, and output tasks. This file is used by Studio and the deployment engine to read the configuration of the connector. ci-connector-api.xsd You use this schema to access the endpoint. Studio needs to communicate with the appropriate connector using the connector APIs. This schema file defines the syntax for the request and response of the Test Connection, List Objects, and Describe Object APIs. Both files are common for all connectors. These schema files provide the syntax and define how elements and attributes are represented in the XML and WSDL file. For further information about the structure of these files, refer to: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/topic/com.ibm.websphere.cast_i ron.cdk.doc/cdk_schemas.html
<con:connectorConfiguration xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation = "http://www.approuter.com/schemas/cdk/config/ci-connector-config.xsd" xmlns:con = "http://www.approuter.com/schemas/cdk/config/" category = "CRM" name = "MyConnectorPluginConnector" label = "MyConnector" version = "1.0" notes = "First release of MyConnector." release-date = "2010-11-30T00:00:00.0Z" connection-ns = "http://www.approuter.com/schemas/module/myconnector/connection/"> <con:description>IBM WebSphere Cast Iron MyConnector</con:description> <con:endpoint name = "MyConnector" endpoint-name = "MyConnector"> <con:field-group name = "details" label = "Connection Details"> <!--Template Endpoint field deatils --> <con:field name = "InternalFieldName" label = "DisplayFieldName" configurable = "true"> <con:type>DataType of field</con:type> <con:value-restriction> <con:min-length value = "1"/>
327
8004chCDK.fm
</con:value-restriction> </con:field> <!--Example Endpoint field deatils --> <con:field name = "userName" label = "User Name" configurable = "true"> <con:type>string</con:type> <con:value-restriction> <con:min-length value = "1"/> </con:value-restriction> </con:field> <con:field name = "password" label = "Password" configurable = "true"> <con:type>string</con:type> <con:format>password</con:format> </con:field> </con:field-group> <con:test-connection-action short-description = "Tests the connection to the endpoint system"/> <con:endpoint-description>MyConnector Endpoint description</con:endpoint-description> </con:endpoint> <con:activity-group> <!--Template Activity Details --> <con:activity name = "InternalActivityName" label = "DisplayActivityName"> <con:operation-name>Update</con:operation-name> <con:description>Breif description of actiivty</con:description> <con:task-list> <!--Consists of required tasks for current activity--> <con:configure-task> <con:type>browse</con:type> <con:applies-to>inputs</con:applies-to> </con:configure-task> </con:task-list> </con:activity> <!--Example Activity Details --> <con:activity name = "InsertObject" label = "Insert Object"> <con:operation-name>Insert</con:operation-name> <con:description>MyConnector Insert Object</con:description> <con:task-list> <con:configure-task> <con:type>browse</con:type> <con:applies-to>inputs</con:applies-to> </con:configure-task> </con:task-list> </con:activity> </con:activity-group> <con:operations default-endpoint-location = "local:///MyConnector/1.0.0.0"/> </con:connectorConfiguration>
328
8004chCDK.fm
<wsdl:definitions name = "MyConnector" targetNamespace = "http://www.myconnector.com/connector" xmlns:wsdl = "http://schemas.xmlsoap.org/wsdl/" xmlns:tns = "http://www.myconnector.com/connector" xmlns:xsd = "http://www.w3.org/2001/XMLSchema" xmlns:soap = "http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns:conf = "http://www.approuter.com/schemas/cdk/api/"> <wsdl:types> <xsd:schema targetNamespace = "http://www.approuter.com/schemas/cdk/api/" xmlns:xsd = "http://www.w3.org/2001/XMLSchema" elementFormDefault = "qualified"> <xsd:element name = "details"> <xsd:complexType> <xsd:sequence> <xsd:element minOccurs = "1" name = "url" type = "xsd:string"/> <xsd:element minOccurs = "1" name = "userName" type = "xsd:string"/> <xsd:element minOccurs = "1" name = "password" type = "xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> <xsd:schema elementFormDefault = "qualified" attributeFormDefault = "unqualified" targetNamespace = "http://www.myconnector.com/connector"> <xsd:complexType name = "InsertObject"/> <xsd:element name = "Insert"> <xsd:complexType> <xsd:sequence> <xsd:element maxOccurs = "unbounded" minOccurs = "0" name = "InsertObject" type = "tns:InsertObject"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name = "InsertResponse"> <xsd:complexType> <xsd:sequence>
329
8004chCDK.fm
<xsd:element maxOccurs = "unbounded" minOccurs = "0" name = "Result" type = "tns:Result"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:complexType name = "Result"> <xsd:sequence> <xsd:element minOccurs = "0" name = "Id" type = "xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:schema> </wsdl:types> <wsdl:message name = "InsertRequest"> <wsdl:part element = "tns:Insert" name = "request"/> </wsdl:message> <wsdl:message name = "InsertResponse"> <wsdl:part element = "tns:InsertResponse" name = "response"/> </wsdl:message> <wsdl:message name = "details"> <wsdl:part element = "conf:details" name = "details"/> </wsdl:message> <wsdl:portType name = "MyConnectorPort"> <wsdl:operation name = "Insert"> <wsdl:input message = "tns:InsertRequest"/> <wsdl:output message = "tns:InsertResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name = "MyConnectorBinding" type = "tns:MyConnectorPort"> <soap:binding style = "document" transport = "http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name = "Insert"> <wsdl:input> <soap:header message = "tns:details" part = "details" use = "literal"/> <soap:body use = "literal"/> </wsdl:input> <wsdl:output> <soap:body use = "literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name = "MyConnectorService"> <wsdl:port binding = "tns:MyConnectorBinding" name = "MyConnectorPort"> <soap:address location = "http://{property:/ApplianceDataIP}/MyConnector_Connector/1.0.0.0"/> </wsdl:port> </wsdl:service> </wsdl:definitions>
330
8004chCDK.fm
Enter the following information in this page: a. Enter the name of the connector in Name field. b. Enter the version number of the connector in the Version field, using the format X.X.X, where X is an integer. This field is used to specify the proper version number when updating the connector. c. Enter a brief overview of connector in Description field.
2
331
8004chCDK.fm
d. Add the WSDL or Schema (XSD) file that will be used as part of the connector development. WSDL files are usually provided by a SaaS provider, but the Schema file is created by the developer and contains the I/O types of activities. Click Browse to select the file location. Select the file, and then click OK. If the selected file imports other files, a window opens so that you can locate the other files also. Click Locate to specify their location. When finished, click OK. The selected file is processed and loaded into Studio. Click Next. 3. Add connection fields. Next, you enter the endpoint information, as shown in Figure 8-6.
On this page, enter the following information: e. Add Endpoint Connection Fields In this section, specify the fields that are used to connect to the endpoint. These fields display in the Endpoint Panel of the connector. The order of the fields in this section is maintained in the Endpoint Panel as well. By default, the user name and password fields are pre-configured. The data in the remaining sections corresponds to the selected connection field in this section. To add a connection field, click the Add icon ( ). Double-click the added field under the Connection Field Name column to change the name, and then press Enter. To delete a connection field, select the connection field, and then click the Delete icon ( ).
332
8004chCDK.fm
Use the Move Up and Move Down icons ( connection fields. f. Endpoint Connection Fields Details
) and (
In this section, specify the details of the selected field that you added in the Add Endpoint Connection Fields section. The Name field displays the name of selected connection field. The Format field is used to select the format of data that is entered for the selected connection field. Here, you can set format as either STRING, which is used to display text that is entered as plain text, or PASSWORD, which is used to display a special character to hide the text value that is entered in the field. The Type field is used to select the data type of the selected connection field. Available data types are STRING, BASE_64, BOOLEAN, INT, DECIMAL, DATE, DATE_TIIME, and ANY_TYPE.
g. Field Constraints In this section optionally, you can set constraints to the selected field. Enable field constraints by checking Enable Constraints. Set the value and field constraints. Click Next. 4. Add activities Activities can be either generic or specific: Generic activities are executed on multiple objects. Thus, the input and output of this activity should be dynamically configurable because different objects have different schemas. For example, in the Salesforce.com connector, you can add a generic activity, such as Update Objects, which can be performed on multiple objects, such as Accounts, Contacts, and others. Specific activities perform only a particular job. Thus the input and output for this type of activity should be static. For example, in the Google Calendar connector, you can add a specific activity such as CreateEntry that creates an event in Google Calendar.
333
8004chCDK.fm
As shown in Figure 8-7, enter the details of all the activities of the connector. << Linda, any way you can correct Google_calenar (calendar) in the picture? If not, I can recreate it.>>
Enter the following information: a. Add Connector Activities In this section, enter the names of the activities in the connector. The order of the activities in this section is maintained in the activity toolbox of Studio. By default, this section has one activity entry. You can rename or delete this entry . Data in the remaining sections corresponds to the selected activity in this section. To add an activity, click the Add icon ( ). Double-click the added activity under the Activity Name column to change the name, and then press Enter. To delete an activity, select the activity, and then click the Delete icon ( Use the Move Up and Move Down icons ( b. Activity Details This section displays the name of the selected activity and its input/output details, as follows: Dynamic Input/Output Requirement Some activities can be performed on multiple objects; thus, the input and output of these activities are not static. So, input and output should be discoverable during configuration of the activity. To enable discovery of input or output, select the ). ) to change the order of activities.
334
8004chCDK.fm
Input/Output Requires Dynamic Discovery option, and then select whether input, output, or both must be discovered dynamically. Select Input/Output Data In this section, select the input and output schemas for the selected activity. The orchestrations created in the connector will have Web Services Provide Service activity, whose input and output is configured to selected input/output schema respectively. Important: If the Input/Output Requires Dynamic Discovery option in the Activity Details panel is select, select the abstract schema for input/output that must be dynamically discovered. 5. View the final summary of the input. The CDK Wizard generates the required artifacts. A summary page summarizes the list of artifacts that are generated and the further steps that are needed to complete the development of the connector. The wizard will create an orchestration for the connector and for each API that is relevant to the connector. If you selected the Input/Output Requires Dynamic Discovery option, you will get an orchestration for each of three APIs: Test Connection, List Objects and Describe Objects.
335
8004chCDK.fm
d. To add the WSDL file, click Browse, and select the GcalType.wsdl file. Then, click OK. This WSDL file imports two schema files: Common.xsd GcalResp_Imp2.xsd To locate the imported files, click Locate, and then click OK (Figure 8-8).
e. Click Next. 6. The Google login requires only the user name and password fields. By default, these fields are added and pre-configured in the Add Connection Fields page. Click Next. 7. Because you will create a Google Calendar event, you need to create an activity called CreateEntry. In the Add Activities page, as shown in Figure 8-9, enter the following information: a. In the Add Connector Activities section, double-click activity0 and change the name to CreateEntry. Then, press Enter. b. The input and output schemas of the CreateEntry activity are not dynamically discoverable and will have to be added manually. In the Select Input/Output section, click Select Input, and a window with schemas in the GcalType.wsdl file opens. Select the entry schema, and then click OK. The Input Type field is populated with the selected schema name. c. Click Select Output, and a window with schemas in the GcalType.wsdl file opens. Select the entry_response schema, and then click OK. The Output Type field is populated with the selected schema name.
336
8004chCDK.fm
d. Click Next. 8. The CDK Wizard now has the required information to create Studio artifacts and orchestrations. A confirmation window displays. Click Yes to generate these artifacts and orchestrations. 9. The Final Summary page gives the summary of the orchestrations that were created and information about the next steps required for the connector development, as shown in Figure 8-10. As you can see, two orchestrations were created. The CreateEntry orchestration and the TestConnection orchestration, allowing you to use the Test Connection API. This is the only API of the three that is available for this connector. This is because the CreateEntry activitys input/output is not discoverable. The List Objects and Describe Object APIs are used only for dynamic discovery of schemas in an activity.
337
8004chCDK.fm
10.Click Finish to close the CDK Wizard. 11.The new connector project will be open in the Studio.
338
8004chCDK.fm
You can extend this orchestration to meet your needs. In this case, we want the Test Connection orchestration to process the TestConnectionRequest data received in the Web Service Provide Service activity. This involves extracting the connection information and using it in an HTTP Post Activity to login to the Google account. It must also handle a login failure. A Send Reply activity will return a proper message and a boolean value in a TestConnectionResponse, which will be used to display the result of Test Connection in a dialog box. In this example, the Test Connection orchestration is completed using the activities in Table 8-1.
Table 8-1 Activities in the Test Connection orchestration Activity Web Service Provide Activity Apply XSLT Map Variables If If-> Map Variables Map Variables Try CatchAll Try-> HTTP Post Utility Try -> If Activity Name TestConnection Activity Use After entering endpoint Details in Endpoint Panel, when you click Test Connection button. This orchestration is instantiated where this activity receives entered endpoint details as TestConnectionRequest Extracts username and password in TestConnectionRequest To check if the extracted password is encoded, we use Decode Password Configuration function and save the result in String variable If the resultant string variable in above activity is not empty or , the we can say the extracted password is encoded If the password is encoded, the replaced the extracted password value with decoded version of it using Decode Password Configuration Once we have connection details in hand, initialize other variables used for login say GoogleSource, GoogleService and accountType Add try catch block, to handle gracefully if any error happens during the execution HTTP Post activity used for authenticating to Google If any error happens during execution in this block execution flows continues from here this activity is the one that makes a login request to login Check if login is successful
Apply XSLT Decode Password Encoded Map Variables Init Variables Login CatchAll Login Success
339
8004chCDK.fm
Activity Try ->If ->Map variables and Try->Else -> Map Variables Catch -> Map Variables Send Reply
On error during execution of the activity in try block, initialize proper error response to TestConnectionResponse variable Send the initialized TestConnectionResponse as Connector activity response
Figure 8-13 on page 341 shows the second half of the orchestration.
340
8004chCDK.fm
In this example, the orchestration is extended. The orchestration must log in to a Google account. It must then extract auth code from the login result and use it in a request to a Google account. The Google ReST API is used to create an entry in Google Calendar. The orchestration must be able to handle errors. It also must handle the case where on the first request to create the calendar entry a response is received with a redirect URL, and send the same request to the new URL. The following steps outline the flow of the new orchestration: 1. The Web Service Provide Service starter activity will receive the request to create an entry in Google Calendar. 2. The next series of steps are the same as those in the Test Connection orchestration. They log in to Google Calendar. 3. Extract the Auth code from the login response and save it in string variable. 4. Use the extracted Auth value in an HTTP Post Activity (CreateEntry) and the data received in the Provide Service starter activity to send a request to the ReST API to create an entry in Google Calendar. a. If the request is redirected (HTTP response 302) i. Extract the redirect URL from response. ii. Resend the calendar entry request to the extracted URL iii. If the entry is created, send the response to the Connector Activity
341
8004chCDK.fm
b. If the calendar entry is created (no redirect URL), send a response to the Connector Activity. c. If the calendar entry creation fails, send a response with a meaningful error message to the Connector Activity. 5. If any errors occur during the previous steps, send a a. Send a meaningful error message to the Connector Activity. Figure 8-15 shows the first steps of the orchestration.
342
8004chCDK.fm
Figure 8-17 on page 343 shows the final steps in the orchestration.
343
8004chCDK.fm
344
8004chCDK.fm
Enable the display of all processes of the activity by selecting Show CDK Connector Activity Logs in the Orchestrations tab of Studio preferences, as shown in Figure 8-18. To open the preferences select Edit > Preferences > Orchestration.
You can perform an integration test on the CreateEntry activity of the Google Calendar connector, which you developed in 8.3.2, Develop a Google Calendar connector using the CDK Wizard on page 335, with the following steps: 1. Create a new project in Studio. In Studio Menu, select File New New Project. 2. Create a new orchestration and select it. The orchestration is displayed in Studio Workspace. 3. Drag the CreateEntry activity of the Google Calendar connector from the Activity toolbox to the Orchestration, as shown in Figure 8-19.
345
8004chCDK.fm
4. In the Studio workspace, click the activity to highlight it. 5. Select Pick Endpoint in the checklist panel to open the Pick Endpoint panel. Then, click New. 6. Enter the connection details, as shown in Figure 8-20, and verify the connection by clicking Test Connection.
7. Complete the input mapping by entering test data as the default values to the required fields. 8. Enable the CDK Activity execution log as shown in Figure 8-18 on page 345. 9. Right-click the activity and select Verify Activity. Figure 8-21 shows internal data flow of the activity as displayed in the Verify tab of Studio.
346
8004chCDK.fm
4. Select the location, and click Save. 5. In the confirmation window, click OK.
347
8004chCDK.fm
2. Select the archive file of the Google Calendar connector and then click Select Connector. as shown in Figure 8-24.
3. In the confirmation window, click OK. Now the Google Calendar connector is ready to use.
348
8004chCDK.fm
3. Enter the community user name and password and click OK.
349
8004chCDK.fm
4. Launch the Plugin Connectors window from Studio Menu by selecting Solutions Plugin Connectors. Figure 8-26 shows the window that opens.
Use the following sections in this window to manage CDK Connectors: The Available tab, shown in Figure 8-27, lists all the CDK Connectors that are available to install. To install a connector or connectors, select the required connector or connectors, and then click Install.
350
8004chCDK.fm
The Installed tab, shown in Figure 8-28, lists all the connectors that are installed in Studio, including the connectors that are published to local repository. You can update or uninstall a connector or connectors. Select the connector or connectors, and then click either Update or Uninstall as appropriate.
Using the Installed tab: Note the following information about the Installed tab: The Update button is enabled only if the selected connector has an update. Newly created connectors, such as the Google Calendar connector, are not hosted in the server. However, these connectors are listed in the Installed tab because they are published to local repository. The Description field includes a brief overview of the selected connector. The Release notes field specifies the changes that were part of the current version of the selected connector. The Check for updates allows you to query updates for connectors based on a time line, which is configurable. By default, this field is set to On Startup. You can change the value to Daily, Weekly, Alternate Weeks, Monthly, or Never by selecting the connector in the drop-down menu of the field. You can check the updates instantly by clicking Check Now.
351
8004chCDK.fm
352
8004chErrHand.fm
Chapter 9.
353
8004chErrHand.fm
Orchestration1
Orchestration2
Orchestration2
Orchestration4
354
8004chErrHand.fm
Figure 9-2 on page 355 shows the common error handler orchestration. The endpoint WebService_In has a Type of Provide and a Transport of HTTP. The Port and Path fields use the following configuration properties: ErrorWSPort ErrorWSPath The port on which the web service listens The URI that is used to call the web service, set to ErrorLoggerRemote by default in the TIP
Tip: If the common error handler will be deployed to Cast Iron Live the Type of this endpoint must be changed to Cast Iron Cloud. The port is then automatically set.
The project also contains an FTP endpoint which is used by an FTP Put File activity in the orchestration. The FTP endpoint holds the connection properties to the FTP server where the error log files are written. The endpoint uses defaults for all settings apart from the Host Name, User Name, and Password, which use the following configuration properties: ErrorFTPServerIP ErrorFTPServerID ErrorFTPServerPW The IP address of the FTP server that will be used The user ID to connect to this FTP server The password associated with this user ID
In the orchestration in Figure 9-2, the Provide Service activity (A) copies its input data to an output variable called commonErrorHandlerData. The activity is configured to require a response. The two associated Send Reply activities send a success or failure string message back to the calling orchestration. The activity has an Activity Name of ReceiveErrorLogRequest. Tip: The Activity Name of the Provide Service activity is used to set the operation name for this orchestration when it is called using web services.
355
8004chErrHand.fm
The Put File activity (B) sets the Save In Directory field to a configuration property called ErrorFTPPutDirectory. The activity sets the file name of the file to be created using the following built-in functions, one after the other: 1. Get Current Date and Time 2. Format Date String 3. Concatenate The Put File activity also uses the custom function shown in Example 9-1 to set the data that is written to this file.
Example 9-1 Custom function to create the data written to the error file
function formatErrorData(jobId, jobStartTime, projectName, configurationName, orchestrationName, routerHostName, errorName, errorMessage, activityId, activityName, faultTime) { return 'Job ID: ' + jobId + ' - Job Start Time: ' + jobStartTime + ' - Project Name: ' + projectName + ' - Configuration Name: ' + configurationName + ' - Orchestration Name: ' + orchestrationName + ' - Router Host Name: ' + routerHostName + ' - Error Name: ' + errorName + ' - Error Message: ' + errorMessage + ' - Activity ID: ' + activityId + ' - Activity Name: ' + activityName + ' - Fault Time: ' + faultTime; } The orchestration also includes a Global Exception Handler as described in 3.11.2, Global exception handler on page 158. The Log Message activity (C) in the Global Exception Handler writes a Critical log message to the log with the following message: The Common Error Handler has failed.
356
8004chErrHand.fm
Figure 9-3 The Assets section of the common error handler configuration details
b. Click ReceiveErrorLogRequest to show the generated WSDL that is associated with the common error handler web service. c. Click Download at the bottom of the window to download the WSDL file to a local machine. The WSDL is given a default name of WebServicesWSDL.wsdl. Change this default name to make it clear that this WSDL file is the WSDL file for the common error handler, for example CommonErrorHandler.wsdl. d. Close the Web Services Assets window. 4. Start the common error handler configuration from the Home or Repository panes of the Web Management Console. 5. Open the existing orchestration that will call the common error handler in the Studio, and add the WSDL file that you downloaded to the project: a. Select the Project tab. b. Right-click WSDLs, and then select Add Document. c. Browse to find the WSDL file and click OK. 6. Create a Web Services endpoint in the project that contains the calling orchestration. a. In the Project toolbox tab, right-click Endpoints and select Create Endpoint > WebService. b. Select Remote for the Invoke Location drop-down menu field. c. Browse to find the WSDL file that is associated with the common error handler. Selecting the WSDL file sets all other properties. d. Create the Location text field property as a configuration property, for example CommonErrorHandlerLocation as highlighted in Figure 9-4.
357
8004chErrHand.fm
e. Close the Web Service settings. 7. Set the value of the configuration property that contains the web service Location to the location of the remote common error handler orchestration. In Figure 9-4, the configuration property is called CommonErrorHandlerLocation. Click Project Configuration Properties. Use the following format for the Location: http://CastIronVM:CastIronPort/RemoteURI Where: CastIronVM The IP address of the Cast Iron runtime where the common error handler has been deployed. This must be the data IP address for the Cast Iron runtime and not the management IP address. The Port set for the common error handler remote orchestration, defined in the ErrorWSPort configuration property of the common error handler TIP. The URI set for the common error handler remote orchestration, defined in the ErrorWSPath configuration property of the common error handler TIP.
CastIronPort
RemoteURI
Tip: If the common error handler has been deployed to Cast Iron Live, the Location must be set to the correct URL format for an HTTP request that is sent to Cast Iron Live. The Cast Iron Live HTTP request URL format is described in 3.6.8, Using HTTP and web service starter activities with Cast Iron Live on page 116. The URL will be of the form: https://<Hostname>:443/env/<Environment>/<RequestURI> For example, a complete URL can be: https://provide.castiron.com:443/env/Development/ErrorLoggerRemote 8. Use this web services endpoint to create an Invoke Service activity within the orchestration at the point where the common error handler will be called. The inputs for this activity are the JobInfo variable and a variable that includes the faultInfo data. Map these two variables to the corresponding input variables of the activity.
358
8004chErrHand.fm
9. Test the orchestration in the Studio. If the Studio has network access to the Cast Iron runtime where the common error handler is running, the orchestration will be able to invoke the common error handler in case of error. 10.Publish the project that contains the orchestration to the same Cast Iron runtime on which the common error handler orchestration is running. The orchestration will now use the CommonErrorHandlerOrchestration for its common error handling. Examples of using the common error handler are included in the scenarios in this book. The common error handler is used to provide error handling in the following scenarios: Chapter 10, Scenario: Bidirectional account synchronization on page 361 Chapter 11, Scenario: CRM to cloud calendar services on page 439 Chapter 12, Scenario: Data enrichment and aggregation on page 469
359
8004chErrHand.fm
360
8004chScenario1.fm
10
Chapter 10.
Disclaimer: The intent of this tutorial is to demonstrate the use of IBM WebSphere Cast Iron Cloud Integration to integrate and utilize third party applications, and does not claim any endorsement or affiliation with the listed products. All product and company names are trademarks or registered trademarks of their respective holders, and IBM disclaims any ownership in such third-party marks. Use of such third-party marks does not imply any affiliation with or endorsement by or for IBM or IBM WebSphere Cast Iron Cloud Integration. The use of any third party trademarks, logos, or brand names is for informational and instructional purposes only, and does not imply that such trademark owner has authorized IBM to promote its products or services.
361
8004chScenario1.fm
Cast Iron
New customers
SAP Customer Master
salesforce.com Accounts
362
8004chScenario1.fm
Tip: This scenario refers to companies as both customers and accounts as follows: In SAP, the companies are called customers. In Salesforce.com, the customers are called accounts.
10.3 Prerequisites
To build and test the orchestrations in this scenario, the following requirements must be met: WebSphere Cast Iron Studio Cast Iron Studio Version 6.1.0.1 is already installed. See Chapter 2, Installing and setting up WebSphere Cast Iron integration on page 27 for more information. WebSphere Cast Iron appliance The scenario includes the Common Error Handler, as discussed in Chapter 9, Common error handlers on page 353. Thus, you must have access to an Integration Appliance that is running the error handler. Cast Iron Template Repository The scenario uses a TIP from the Cast Iron template repository. You need to have a Cast Iron community user to access the repository. SAP System and User You must have access to an SAP system with valid customers. You must have an SAP account. The user for the account must be able to read the customer data from SAP and be allowed to update customer data in SAP. SAP Libraries You must have the SAP JCO libraries installed in Cast Iron Studio. If you want to test your orchestration on the appliance, the SAP libraries must be installed there as well. For information on installing these libraries, see to Chapter 2, Installing and setting up WebSphere Cast Iron integration on page 27. A Salesforce.com account You must have a Salesforce.com account. The user ID must be able to read account data from Salesforce.com and to create and update account data in Salesforce.com. In Salesforce.com, you must define the following fields for the Account object: An external ID field of type text and an external ID named ExtAccountID or similar. The external ID contains the SAP customer number in a format of SAP_xxx later on. An external field of type text that is named SalesOrganization or something similar. To test feedback loops, you need to have another Salesforce.com user in the same Salesforce.com environment with the same rights. In that scenario, one user represents the sales people or call center assistant working with Salesforce.com, and the other user is used for integration purpose. Tip: The Salesforce.com password that this scenario uses for Cast Iron is a combination of the login password and a security token. Before you work through the steps listed in 10.6, Use Case 2: Synchronizing from Salesforce.com to SAP on page 411, request a security token from the Salesforce.com portal.
363
8004chScenario1.fm
364
8004chScenario1.fm
4. Several TIPs are available for SAP to Salesforce.com integration. Select T0037, and read the description as shown in Figure 10-3.
5. Click Download, and save the TIP to a place of your choice. A warning displays as shown in Figure 10-4 on page 365. Click Yes to open the TIP anyway.
365
8004chScenario1.fm
In step 2, review the TIP requirements. The first two prerequisites listed in Figure 10-6 are already met. This scenario does not use the ExtSource field, so you can ignore the third requirement. Click Next to continue to step 3.
The following sections describe the remaining steps of the configuration wizard.
366
8004chScenario1.fm
You need to enter the following information: 1. Enter your credentials for SAP and Salesforce.com. The credentials for Salesforce.com are the password concatenated with the security token. If you have two users for Salesforce.com (one for sales and one for integration), use the integration user. 2. Adjust the other settings, for example the SAP Country and the SAP Sales Organization, to fit your environment. 3. After you enter this information, click Next to move to the next step in the wizard. Important: If you created global configuration properties for some of these values, click Import to open the Import Properties panel, shown in Figure 10-8. Select the source and target fields for a value, and then click Value to import those configuration. When you are finished, click OK.
367
8004chScenario1.fm
368
8004chScenario1.fm
If required, you can now change additional connectivity settings for Salesforce.com, such as providing proxy information. Then you can verify the connection: 1. Click Test Connection. Studio attempts to log in to Salesforce.com. If the login is successful, a message opens that displays your organizations name, as shown in Figure 10-10.
2. Click OK. If there is an issue with the connection, review the Salesforce.com connection settings.
369
8004chScenario1.fm
3. After the connection to Salesforce.com is successful, click Next to go to the next step in the wizard.
370
8004chScenario1.fm
To verify the SAP connectivity: 1. Click Test Connection. If the connection is successful, a message similar to that shown in Figure 10-12 opens.
2. Click OK. If there is an issue with the connection, review the SAP connection settings. 3. After the connectivity to SAP is successful, click Next to go to the next step in the wizard.
371
8004chScenario1.fm
372
8004chScenario1.fm
Displayed at the right of this panel are three elements that have the letter D to the right of the name. This letter indicates that a default value is defined for these values. The elements hold country and sales organization information as well as a search flag. These elements are used to build the search criteria for the accounts. The default values refer to the configuration properties listed in Enter the credentials on page 366. You can add additional mappings or change the existing ones. When you are finished, click Next to go to the next step in the wizard.
373
8004chScenario1.fm
374
8004chScenario1.fm
To retrieve the list of fields that are available for your Salesforce.com environment: 1. Click the blue circle. Studio connects to Salesforce.com to retrieve a current list of standard and customer fields, also called metadata, for your Account object. While Studio connect, the message shown in Figure 10-15 displays.
2. Verify that the list is updated with the ExAccountID__c and SalesOrganization__c fields and that they are selected, as shown in Figure 10-16.
3. Select ExtAccountID_c in the list of custom fields, and verify that ExtAccountID__c is selected in the External ID field (shown at the top of the screen), as shown in Figure 10-17.
4. Clear fields that you do not need, for example the fields for shipment details, such as ShippingCity. 5. Click Next to go to the next step in the wizard.
375
8004chScenario1.fm
As indicated in the figure, the field for the sales organization on the right side is not mapped. To store the sales organization into Salesforce.com, you must put the information into the field: 1. Right-click the SalesOrganisation__c field, and select Define Default Value. Click the symbol on the right side of the entry field as indicated in Figure 10-19, and select the configuration property SAPSalesOrg. Then, click OK.
Figure 10-19 Use case SAP to SFDC TIP wizard define mapping for SAP sales organization
2. Follow the link from the SAP field CUSTOMER on the left to the Salesforce.com field ExtAccountID on the right. This is a direct mapping, meaning that the content is copied from the source to the target. However, for this scenario, you do not want to store the SAP customer number as is into Salesforce.com. Instead, you need the SAP customer number to use the following format: SAP_<SAPcustomernumber> Therefore, you must modify the mapping, and enhance it with a concatenate function.
376
8004chScenario1.fm
3. Click the function symbol (f) to the left of the Back button at the bottom of the screen, as indicated in Figure 10-20.
4. Grab the Concatenate function, and drop it on the link between CUSTOMER and ExtAccountID__c, as shown in Figure 10-21. Then, double-click the created Concatenate (&) symbol to open the concatenate function.
5. Enter SAP_ for the second input string, and click Up. The function now looks as shown in Figure 10-22.
377
8004chScenario1.fm
6. Click OK, and then right-click the Concatenate function symbol (&) and select Apply Function Graph. The mapping now looks as shown in Figure 10-23.
7. The mapping is now finished from SAP to Salesforce.com. Click Next to go to the next step in the wizard.
Before you verify the orchestration: Before you complete this step, verify with your SAP administrator that the SAP query will not return hundreds of records, which can cause problems in Salesforce.com. If you are worried about testing the orchestration at this time, you can click Next and skip to step 10.5.3, Customizing the orchestration on page 380. To verify and start the orchestration:
378
8004chScenario1.fm
1. Click Start Orchestration. The orchestration is triggered by an HTTP request. So, start the HTTP post utility using Tools HTTP Post Utility. Then, use the following URL to send the request (as shown in Figure 10-25): http://<hostname>/SyncSAPSFDC
2. Studio shows that the orchestration is triggered and completes quickly (unless you have a lot of customer accounts that are processed or a connection problem). Expand the tree and verify that each account was processed successfully (Figure 10-26).
3. Log into Salesforce.com and verify that the accounts were created. 4. Then, go back to Cast Iron Studio, and click Next to continue to the next step in the wizard.
379
8004chScenario1.fm
To see the configuration properties for this configuration, go to Project Configuration Properties. The properties display as shown in Figure 10-28. Notice that there are credentials for Salesforce.com and for SAP. In addition, there are search parameters for SAP.
The following sections walk through the process for an incoming request:
380
8004chScenario1.fm
The activity listens on port 80 for the /SyncSAPSFDC URL and does not return any data. The second activity is the SAP Get Cust List activity. It takes the country, the sales organization, and a search flag as input (see Figure 10-30) and returns in the SAPSearchResult variable a list of SAP customer numbers for these criteria. The BAPI function that is used is Customer Search.
The next activity is the For Each loop, which loops through all the customer numbers in the list. Notice in the details that this activity takes the SAPSearchResult as input and creates a loop variable named SAPCutomer that contains just one customer number. Click into the field, and change the variable to SAP_OneCustomerNumber. The activity looks now as shown in Figure 10-31.
381
8004chScenario1.fm
The loop uses the SAP BAPI with the Customer object and the GetDetail2 method to get the customer details for the SAP customer number, as shown in Figure 10-32.
This search returns an element named SAPCustDetail with the SAP customer information as shown in Figure 10-33.
The returned SAP customer record is validated in the If-Then activity, which in this case performs a simple validation when the number of CUSTOMER records returned is greater 0, as shown in Figure 10-34. 382
Getting Started with IBM WebSphere Cast Iron Cloud Integration
8004chScenario1.fm
You can adjust the validation, for example to avoid a customer without a name, as follows: 1. Click the If Customers to Upsert activity, and click Add in the properties pane to add another expression. 2. For the left hand expression, select the SAPCustDetail variable and the CustomerAddress NAME element. Studio creates the related XPATH expression automatically. 3. For the operation, use the != option for not equal. 4. For the right expression, insert quotation marks (), which indicates an empty string. The expression now looks as shown in Figure 10-35.
383
8004chScenario1.fm
e. Double-click the Concatenate function, and build a meaningful message from the input fields by adding strings with text blocks and moving them to the right place. The definition shown in Figure 10-37 creates the following message Invalid customer with customer number xxx and customer name yyy
f. Click OK to close the concatenate function. g. Right-click the Concatenate function in the map, and select Apply Function Graph.
384
8004chScenario1.fm
Try-Catch block
First, a Try-Catch block handles failures that might occur during an update. Without this block, for example, if one account cannot be updated due to an error, the entire orchestration stops and no other account is updated within the synchronization. As shown in Figure 10-38, the Catch All branch is empty, which is not recommended. You will add a Log Message activity and, later, the Common Error Handler. To make the orchestration more readable and easier to understand, follow these steps: 1. Rename the Try activity to Try Upsert. click the name or right-click and select Rename to change the name. 2. Rename the CatchAll Block to CatchUpsert. 3. Click the CatchUpsert block, and rename the variables to SFDC_UpsertFaultName, SFDC_UpsertFaultData, and SFDC_UpsertFaultInfo so that you can identify them easily later. The CatchUpsert now looks as shown in Figure 10-39.
4. Drag a Log Message activity to the catch branch, and name it Log Error during Upsert. 5. In the Map Inputs section define the error message as follows: a. Set the level to ERROR.
385
8004chScenario1.fm
b. As input, select the SFDC_UpsertFaultInfo variable, which contains details about the fault. c. Add the concatenate function. Map the input elements name, message, activityName, and faultTime to the concatenate function. Map the output element message to the function. Create a message for the concatenate, such as: Fault xxx, error yyy in activty zzz during Upsert at TTT For details, refer to the procedure beginning with step a on page 383.
2. Click Map Inputs for the input mapping. In the configuration wizard (step 2 on page 376), you configured the ExtAccountID__c field to be filled with a the SAP_xxxx string, where xxxx is the SAP customer number. 3. Click Map Outputs to view the results that are stored in the SFDCUpsertResponse variable. 4. The If Upsert SFDC Account Fails If-Then activity, validates that the upsert was successful by looking at the success element of the SFDCUpsertResponse variable (refer to Figure 10-41).
386
8004chScenario1.fm
2. For the successful upsert, set the message level to INFO and the message content to text similar to the following text: Upsert of customer xxx successful If you do not remember how to build the log message, refer to the example with the else branch starting with step 1 on page 383. The final if block looks similar to that shown in Figure 10-43.
387
8004chScenario1.fm
Global catch
The final step is to add a global catch to the orchestration, which ensures that if a problem occurs, the error is captured and can be handled appropriately. If you do not create a global catch, any error that is not caught in a try-catch block causes the orchestration to fail with a generic error message that contains the information of the fault variables. A global catch provides flexibility in handling errors. To define the global catch follow these steps: 1. Right-click the starting point of the orchestration, and select Add CatchAllBranch, as shown in Figure 10-44, to create a new branch.
2. Click the CatchAll block, and rename the variables to GlobalCatchFaultName, GlobalCatchFaultData, and GlobalCatchFaultInfo. The result looks similar to that shown in Figure 10-45.
3. Add a Log Message activity to the catch block. For ease of use, you can simply reuse the Log Message activity we created in the try-catch block for the upsert (see step on page 385). To do so follow these steps:
388
8004chScenario1.fm
a. Go to the Log Message activity in the Upsert try-catch block. Right-click the activity, and select Copy. b. Go to the empty activity in the catch branch of the global catch. Right-click the empty activity, and select Paste. c. Click Map Inputs. Right-click one of the mappings, and select Edit Function Graph. iv. Now, right-click the SFDC_UpsertFaultInfo variable, and select Remove Variable. v. Click Select Inputs, and select the GlobalCatchFaultInfo variable. vi. Because the elements in GlobalCatchFaultInfo are the same as in the SFDC_UpsertFaultInfo variable, the mapping is now done automatically. If the mapping does not come back, create the mapping again using the Concatenate function. vii. Verify the mapping, and click Apply Function Graph. viii.Rename the activity to Log Error during Sync, and adjust the message within the concatenate slightly as follows: Fault xxx, error yyy in activity zzz during Sync at TTT
Create a filter
To create a filter, follow these steps: 1. Put a terminate activity just behind the Get Cust List Invoke BAPI SAP activity to avoid the results being sent to Salesforce.com (see Figure 10-46)
2. Click the Verify tab and start the orchestration within Studio. 3. Use the HTTP Post Utility to send a request to http://<yourhost>/SyncSAPSFDC.
389
8004chScenario1.fm
4. Expand the instance tree to Get Cust List Map Outputs To Orchestration, and click the SAPSearchResult element to display the content of the element. The content is a list of customer numbers (Figure 10-47). Depending on your SAP system, this list can be long.
390
8004chScenario1.fm
You can also filter the list of returned customers in the output mapping of the SAP activity as follows: 1. Go to the Get Cust List output mapping, and right-click the item element in SAPSearchResult. 2. Select the Filter Recurring Nodes option, and enter an XPATH-Expression filter, such as starts-with(CUSTOMER, "0000"). Click OK. The item element then gets the symbol f for function, as shown in Figure 10-48.
For more flexibility in filtering, you can also use a filter activity as follows: 1. Create a variable named SAP_ListFilter of type string and with default value 0000. 2. Drag a Filter and Profile activity between the SAP activity and the Terminate activity, as shown in Figure 10-49.
3. Rename the activity to Extract SAP Customers. 4. In the checklist, select Configure. Select the SAPSearchResult variable and the item element as shown in Figure 10-50. The XPATH is created automatically.
5. Click Filter Expression. You can define the filter expression using two methods: define the filter expression as shown in Figure 10-51.
391
8004chScenario1.fm
Use the Advanced button, and insert the following expression: starts-with(CUSTOMER, bpws:getVariableRaw('SAP_ListFilter')) = true() or bpws:getVariableRaw('SAP_ListFilter') = "*" The logic for both methods is the same. If SAP_ListFilter is set to *, the filter returns all customer numbers. If the filter is set to anything else, the filter returns all customer numbers that start with that filter expression. For example, if filter is set to 1001 the filter expression returns all customer numbers starting with 1001 such as 1001 and 1001231. You can also use another expression based on other XPATH functions, such as substring, contains, or other functions. 6. For the Profile Summaries definition, do not enter anything. 7. In Map Outputs, map the goodXML CUSTOMER field as shown in Figure 10-52.
392
8004chScenario1.fm
d. Right-click the SAP_ListFilter variable and select the Define Default Value option. Then, set a default value, for example, an asterisk (*). e. Click the small green dot in the Default Value field to create a configuration property from this filter named SAP_ListFilter_Default. Click Create. Then, click OK. 5. Test the orchestration using the HTTP Post Utility. If you do not enter anything for the HTTP body, the value from the project configuration property SAP_ListFilter_Default will be used as the filter criteria. If you enter a search string in the body of the HTTP request, that value will be used as filter criteria. You now have a very flexible filter that can be customized in the run time either in the Web Management Console (WMC) using a configuration property or using an HTTP request parameter. Before you continue: Remove the Terminate activity because this scenario will not need it.
Naming conventions
Naming conventions can provide an easier understanding of the assets. Adjust the project now to fit to your naming conventions. Consider the following naming conventions: Variables Before renaming any variable, first remove the variables that are not in use. (On the Variables tab, right-click a variable and then select the Remove Unused Variables option.) This scenario uses the naming convention that an endpoint-specific variable has the format endpointname_valuedetails. Each word starts with an uppercase letter, for example SAP_OneCustomer and SFDC_UpsertResponse. To modify the variables to fit to your naming conventions, go to the Variables tab, and select the variable of choice. The middle right section shows the dependencies. In the lower right Properties section, you can then rename the variable. Configuration Properties
393
8004chScenario1.fm
This scenario uses the same rules for configuration properties as for variables. To change them, go to Project Configuration Properties, and select the property that you want to change. Activities This scenario uses the naming convention that the words in the activity name start with an uppercase letter, for example Upsert SFDC Account. You can change the name of an activity by double-clicking on the name in the orchestration graph, or by selecting the activity and changing the name in the Checklist Summary. Orchestrations This scenario uses the naming convention that an orchestration the naming convention endpoint1_endpoint2_purpose, for example SAP_To_SFDC _SyncAccounts. To rename an orchestration, right-click it in the Project tab, and select Rename. Projects This scenario uses the naming convention that a project indicates the endpoints and the usage. The project here currently has the name inherited from the template, which is T0037_SAPCustomerToSFDCAccounts. To rename the project, save it under another name. for example, SAP_To_SFDC_SyncAccounts. Endpoints If the endpoints in the project can be used for both inbound and outbound flow, the default name is sufficient. However, if an endpoint provides only one direction, for example with HTTP endpoints, add that information to the name, for example SAP and HTTP_In. Also, rename the endpoint for Salesforce to Salesforce.com. To rename an endpoint, right-click the endpoint in the Project tab, and select Rename. URLs Use a naming convention for URLs that is similar to the convention for orchestrations. The URL used in the Receive Request activity is currently named /SyncSAPSFDC. Unfortunately, this name does not specify in any way what will be synchronized. So, a better approach is to use the URL /SAP_To_SFDC_SyncAccounts. Change the URL by clicking Configure in the Checklist for the activity, and then updating the URL.
394
8004chScenario1.fm
Configuration properties
Configuration properties help to make the project more flexible without having to go back to Studio for changes. Consider the following examples of settings that can be made more flexible using a configuration property: You can change the HTTP_In endpoint configuration properties. Double-click the endpoint in the orchestration graph to open the properties. As shown in Figure 10-54, the port is defined statically to port 80.
This setting might be sufficient in your current environment, but your operations team might want the endpoint listener on a different port. So, it makes sense to create a configuration property named HTTP_In_Port that defines a specific port for the endpoint. To do this, click the green circle next to the 80 (indicated in Figure 10-54), and insert the name into the field. Then, click Create and close the properties. You can change the HTTP Receive Request activity. As shown in Figure 10-55, the URL is specified statically in the Configure pane.
Replace the URL with a configuration property so that you can change the URL easily later on.
Project settings
You can make an activity more flexible by changing project settings. To view the current project settings, click Project Project Settings. Figure 10-56 shows an example.
395
8004chScenario1.fm
Comments
Each activity provides the option to add comments that describe the activity in more detail, for example by providing the purpose of a query or an if-statement. Comments make the project more readable and are part of the documentation that can be generated automatically (by selecting File Generate Project Documentation).
3. Take a look at the output of the orchestration. As shown in Figure 10-58, the orchestration processed three SAP accounts and inserted or updated them to Salesforce.com successfully.
396
8004chScenario1.fm
You can expand each of the sections further to see the inbound and outbound mapping. For each variable, you can see the content at run time. 4. Now log in to the Salesforce.com CRM system, and verify that the accounts have been created successfully in Salesforce.com. 5. Perform additional testing with any additional or updated accounts.
Test failures
This section discusses the types of scenarios where a failure could occur.
No matching record
Test a failure scenario by providing a search criteria in the HTTP request that does not return any matching records. As shown in Figure 10-59, the For Each loop does not start because there is no record available. If you want to get an error message for such a scenario, add an if-statement just before the loop.
397
8004chScenario1.fm
398
8004chScenario1.fm
To avoid this situation, follow these steps: 1. Put the SAP Get Cust Detail activity into a Try-Catch block. 2. Rename the Try-Catch activity and the variables. 3. Put a Message Log activity into the catch block. 4. Because the Get Cust Detail was moved to the Try-Catch block, the scope of the SAP_CustDetail variable changed. To make the variable visible outside of the Try-Catch block, define a default value for the variable. To do so, click the Variables tab. Then, click the variable, and provide a default value, such as <Customer.GetDetail2.Response/>. Figure 10-62 shows the Try-Catch block. 399
8004chScenario1.fm
If the Get Cust Detail activity fails, the orchestration goes into the Try-Catch block, and the message is logged. Then, the next activity, which is the If Customer To Upsert activity, validates whether or not the customer is updated. This validation relies on the value in the SAP_CustDetail variable, which by default is set in the Get Cust Detail activity. However, in the failing scenario, the validation takes the default setting or any setting that was set before. This design is flawed, because if the Get Cust Detail activity fails, you do not want the orchestration to go into the validation. Instead you want the orchestration to continue with the next record in the loop. To implement this logic, add the Continue activity just behind the Log Message in the catch block as shown in Figure 10-63.
This configuration tells the orchestration to jump to the next item to process in the loop. Now, the handling of this error is better. 5. Test the orchestration again with a failing Get Cust Detail. This time the orchestration catches the failure, and jumps to the next item in the loop as shown in Figure 10-64.
400
8004chScenario1.fm
401
8004chScenario1.fm
2. Click the CommonErrorHandlerWS_Out endpoint, and drag it to the location. Select Invoke Service as shown in Figure 10-67.
3. Click the web service, and rename it to Log Error. 4. Click Map Inputs, and select the JobInfo and GlobalCatchFaultInfo variables as input. 5. Create a link from the JobInfo variable to the CommonErrorHandler variable. The fields are mapped automatically based on the name. 6. Create a link from the GlobalCatchFaultInfo variable to the CommonErrorHandler variable. The fields are mapped automatically based on the name. 7. Compare the orchestration with that shown Figure 10-68, and verify that all fields of the CommonErrorHandler variable are mapped.
402
8004chScenario1.fm
4. View the run time of the Common Error Handler. 5. Set the SAP_SalesOrg configuration property back to the original value. 6. Add the Common Error Handler invocation to the other Try-Catch blocks.
403
8004chScenario1.fm
3. With the move of the activities into the first branch, the scope of the SAP_SearchResult variable changes, meaning that the variable is no longer globally visible. To change this setting, set the default value for the SAP_SearchResult variable to <Customer.Search.Response/>. 4. Add a Map Variables activity to the second branch. The Map Variables activity maps the SAP_FilterList field into the SAP_SearchResult->Customer field. (Instead of the Map activity, you can also use a Read XML activity if you want to provide more than one customer number.) Figure 10-70 shows the first part of the orchestration.
404
8004chScenario1.fm
3. The project is validated automatically before it is published. 4. After successful validation, click Yes to save the project. 5. Enter or validate the host name for the target run time, the user name and password as shown in Figure 10-72.
To publish a project to the run time, the user must have the administrative or publisher role for the target run time. Enter or verify the login data, and then click OK. 6. The project is published to the run time. If publishing was successful, a success message displays, as shown in Figure 10-73. Otherwise, you get an error message with some indication of why the publishing failed.
405
8004chScenario1.fm
4. In the WMC, click Repository Upload Project. 5. Click Browse, and specify the .par file to be uploaded. The project number and the project name and version are retrieved from the .par file, but you can change these settings, as shown in Figure 10-75. 6. Click Upload to upload the project.
7. A success message, as shown in Figure 10-76. Be aware that this message closes quickly.
406
8004chScenario1.fm
Before you start the configuration, make sure that everything is in place as follows: 1. Verify that the libraries for SAP are installed on the Integration Appliance: a. Click System Upgrade, and then click Update Connection Libraries. b. Ensure that the following SAP libraries are installed, as indicated in Figure 10-78: sapjco3.jar sapjco3.so sapidoc3.jar
If they are not installed, click Update to upload them. Otherwise, click Cancel. c. If the library names contain no number 3 in the name, for example sapidoc.jar, these .jar files are not SAP JCo Release 3 libraries but are older versions and are not supported. Uninstall any older libraries, and install appropriate libraries.
2. Click Home to go back to the first panel, as shown in Figure 10-77 on page 407. 3. Next, examine the configuration properties to ensure that the settings are correct. Click the configuration name to view the configuration details.
Chapter 10. Scenario: Bidirectional account synchronization
407
8004chScenario1.fm
The Configuration Details panel displays all the configuration properties that are defined in the project. In addition, it shows the settings for logging and other parameters. If the configuration is in the Unpublished status, click Edit to change the values, as indicated in Figure 10-79. Verify that the settings are correct, and then start the configuration.
Tip: If you start an orchestration in Studio on the Verify tab, only that orchestration is started. In the Integration Appliance, you start all orchestrations in the configuration at the same time. So, if for testing purposes you have different versions of the same orchestration in your configuration, disable the other versions, or the configuration will not start. To disable an orchestration, go to the Configuration Details panel, and click Edit, as indicated in Figure 10-80. Then, disable the orchestration.
408
8004chScenario1.fm
4. To test the orchestrations, use Studio and the HTTP Post Utility. However, this time, specify the data IP address of the Integration Appliance as the target IP address. 5. Send several HTTP requests to the Integration Appliance, and after each request, return to the WMC to check the statistics with regard to running, completed, and finished configurations. 6. View the log by clicking Logs System Log. Validate whether warnings or errors occurred.
409
8004chScenario1.fm
So, the idea here is to use APIs that allow the management of recurring elements. The orchestration is simplified as shown in Figure 10-81.
The orchestration contains the following activities: The Receive Request activity It receives a request with or without a search criteria and triggers the orchestration. The SAP activity Get Customer List. Previous examples used the Customer Search function to retrieve a list of customer numbers. Now, the orchestration uses the Customer2 GetList function, which returns a recurring element with all customers that match the criteria. With the customer number, it also returns the basic data, such as name, address, and so on. The Split activity Although SAP is capable of returning hundreds of account records in one chunk, it does not make sense to send them in one chunk synchronously to Salesforce.com. So, you can use the Split activity to split the recurring element into chunks of an appropriate size (for example 20, 50, or 100 records). The Split activity is similar to a loop but returns a recurring element with a subset of the original elements. Refer to Figure 10-82.
The Filter and Profile activity Previous examples use the Filter and Profile activity to filter the customer numbers based on a search criteria. Now, the orchestration uses the Filter activity to do validation of multiple datasets in one step. Figure 10-83 shows the filter criteria.
410
8004chScenario1.fm
The Filter activity returns a recurring element for valid accounts, a recurring element for invalid accounts, and statistics. The Upsert activity As before, the Upsert activity inserts or updates accounts in Salesforce.com. The activity returns a recurring element that contains details for each account record whether or not the upsert was successful. Consider the following additional information: The orchestration as shown in Figure 10-81 on page 410 is not complete because it does not contain any kind of error handling. If you want to do more complex validation, replace the Filter activity with a loop that validates each record separately and that flags each record as good or bad. Then, filter the good records and use those records for the upsert.
411
8004chScenario1.fm
3. Remove the existing orchestrations from the new project. 4. Create a new orchestration, and rename it to SFDC_To_SAP_SyncAccounts. Now, you can continue to build the parts of the orchestration.
3. In the Checklist click Summary and set Activity Name to Receive Sync Time. 4. In the Checklist click Pick Endpoint and set the endpoint to HTTP_In if not already set. 5. In the Checklist click Configure. a. Set the URL to SFDC_To_SAP_SyncAccounts, and then create a configuration property for the URL. b. Leave the message type to text. c. Select Requires a Reply. 6. In the Map Outputs section: Create a new variable called SyncTimeString, and map this variable to the HTTP Request body. Then, create another variable named SyncTimePattern to contain the format pattern. Use the yyyy/MM/dd/HH/mm/ss pattern, which means the date/time string has the following format: year/month/day/hours/minutes/seconds To map outputs: a. Click Select Outputs. Then, because you want to create a new variable, click New. b. Under Primitive Types, click string, and then click Next. Enter SyncTimeString for the variable name, and then click Finish. c. The SyncTimeString variable is selected as output variable, so click OK. d. Create a link from the element body to the SyncTimeString variable. e. Click Select Outputs. Then, click New, and create another variable of type string. Enter SyncTimePattern for the variable name, and then click Finish. f. The SyncTimePattern variable is selected as output variable, so click OK. g. Right-click the SyncTimePattern variable, and select Define Default Value. Set the default value to yyyy/MM/dd/HH/mm/ss.
412
8004chScenario1.fm
h. Click the bullet to create a configuration property called SyncTimePattern. Figure 10-85 shows the final mapping.
413
8004chScenario1.fm
10.Now, link the Read Date String function to the SyncTime variable. Double-click the Read Date String function. Verify that the mapping is the same as that shown in Figure 10-86, and then click OK.
11.Right-click the Read Date String function, and select Apply Function Graph.
414
8004chScenario1.fm
4. Save the orchestration (File > Save). The entire orchestration now looks like in Figure 10-88. Although it is not a complete orchestration from a business point of view, it is a complete orchestration from a technical point of view and can now be tested.
415
8004chScenario1.fm
Now, start the orchestration again, and this time test it with the test HTTP body content. This time, the test fails, as shown in Figure 10-90, and no response is sent back to the calling application. Click OK to continue.
416
8004chScenario1.fm
2. The SyncTime variable is defined in the activity. Because this activity is now part of the Try-Catch block, it is not visible outside of the Try-Catch block. It must be visible outside of the Try-Catch block, so you need to set a default value for the variable as follows: a. Go to the Variables tab. Select the SyncTime variable. b. In the lower corner, set the Default Value to 2011-10-01T10:00:00+02:00. This value is a valid value for the variable as demonstrated in Start and test the orchestration on page 415. You can also replace this value with another value. However, remember that the variable is set based on the value in the Receive Sync Time activity. 3. Move the Send Acceptance activity in the Try branch. 4. Click the Catch activity, and rename the following activities and variables: The Catch activity to The FaultName variable to The FaultData variable to The FaultInfo variable to CatchSyncTimeParse SyncTimeParseFaultName SyncTimeParseFaultData SyncTimeParseFaultInfo
Send a response
1. Add another Send Response activity to Catch branch, and rename it to Send SyncTime Failure. 2. Click Map Inputs, and create a return message using these steps: a. Click Select Inputs, and select the SyncTimeString and SyncTimePattern variables. b. Click the Functions tab, and drag the Concatenate function to the middle of the map. c. Create a link from the SyncTimeString and SyncTimePattern variables to the Concatenate function. d. Create a link from the Concatenate function to the body variable. e. Double-click the Concatenate function. and create a message such as Sync request failed due to invalid time format, received time: xxx, defined pattern: yyy. Then click on OK and apply the function graph.
417
8004chScenario1.fm
Start the orchestration, and test it again with the test HTTP body. This time the orchestration sends a response back with the following content: Sync request failed due to invalid time format, received time: test, defined pattern: yyyyyyy/MM/dd/HH/mm/ss. Remember to save the orchestration.
3. In the Checklist, click Summary and set Activity Name to Get Updated Accounts From Salesforce.com. 4. In the Checklist, click Pick Endpoint and set the endpoint to Salesforce.com if not already set. 5. In the Checklist, click Configure. To configure the activity, connect to Salesforce.com, and retrieve a list of available objects, including the standard objects and any custom objects. Follow these steps: 418
Getting Started with IBM WebSphere Cast Iron Cloud Integration
8004chScenario1.fm
a. Click Browse. Select the Account object, as shown in Figure 10-93, and click OK.
b. The Salesforce.com connector returns the list of fields that are available in the Account object. This list includes standard and custom fields. Select the fields that you need for the integration. Be aware that the more fields that you select the more performance overhead you produce. At a minimum, however, select the fields shown in Figure 10-94 because you need them for the integration. The list in the figure is reduced for better visibility.
6. Next, map the following inputs: a. Click Select Inputs, and select SyncTime. b. Create a link from the SyncTime variable to the startDateTime variable. 7. Map Outputs The left part of the map shows a variable named objects. The objects variable contains the recurring Account element, which has as elements all the fields that you selected previously.
419
8004chScenario1.fm
Because you need all fields from the elements of the objects variable, copy the entire structure: a. Click the objects variable, and then click Copy. b. Select objects, and click Create to create a variable with the name objects. c. Click the Variables tab, and rename the variable to SFDC_UpdatedAccounts. 8. At this point, you have completed the steps to retrieve the updated accounts from Salesforce.com based on SyncTime. Your orchestration will look similar to that shown in Figure 10-95. (The Try-Catch block is collapsed for better visibility in this figure.) Save the orchestration.
9. Complete the following test: a. Go into the Salesforce.com portal, and update some accounts. b. Start the orchestration. c. Use the HTTP Post Utility, and send in the body a current sync time in the format yyyy/MM/dd/HH/mm/ss.
420
8004chScenario1.fm
All the accounts that have been changed since the last synchronization (the time included in the HTTP request) are returned. In Studio, compare your results with those shown in Figure 10-96.
421
8004chScenario1.fm
To implement this logic, follow these steps: 1. Drag a For Each activity to the right of the Get Updated Objects activity. 2. Change the settings of the For Each activity as follows: a. Rename the Activity Name to Loop Through Salesforce.com Accounts. b. Rename the Variable Name to SFDC_UpdatedAccounts. c. For the Element Name, click the button to the right of the field, and select Account. d. Rename the Single Element Variable Name to SFDC_OneAccount. e. Compare your settings to those shown in Figure 10-97.
8004chScenario1.fm
a. Click the Functions tab, and drag the Substring After function to the middle of the map. b. Create a link from the ExtAccountID__c element from the SFDC_OneAccount variable to the Substring After function. c. Create a link from the Substring After function to the SAP_CustomerNumber variable. d. Double-click the Substring After function, and insert as matchString the value SAP_. The mapping now looks similar to that shown in Figure 10-98.
e. Click on OK to accept the configuration of the function, then right-click on the function and select Apply Function Graph. 5. Next, validate whether the value that was extracted to SAP_CustomerNumber is not empty: a. Drag an If-Then activity to the right of the Map Variables function but within the loop. b. Click the If part of the activity, and change the name to If SAP Customer. c. For the Where clause, select for Left Hand Expression the SAP_CustomerNumber variable, for Operation the != option, and for the Right Hand Expression enter two single quote marks () as the value. d. Click the Else part of the activity, and change the name to No SAP Customer. 6. Save the project.
423
8004chScenario1.fm
3. In the Checklist click Summary and set Activity Name to Get Customer Details From SAP. 4. In the Checklist click Pick Endpoint and set the endpoint to SAP if not already set. 5. In the Checklist click Configure. To configure the activity, connect to SAP and retrieve a list of available objects, including the standard objects and custom objects. Then select the related method from that list. To configure the activity: a. Click Browse. The Obtaining list of Business Objects from SAP message displays for a short time, and then the BAPI list displays. b. Click the Business Object Repository line, and then enter the first letter of the search string customer2. In the Search For entry field, enter the next letters of the search string. While you are entering the business object name, the cursor moves to the right position in the list, as shown in Figure 10-100.
c. Expand the Customer2 object by clicking the plus sign (+). d. Select the GetDetail2 method, and click OK. A Please Wait notification displays with the Generating schemas statement. Compare your configuration panel with that shown in Figure 10-101.
424
8004chScenario1.fm
Figure 10-101 Use case SFDC To SAP, configure Customer2 Get Detail
6. In the Checklist click Map Inputs. Map the SAP account number into the appropriate input field: a. Click Select Inputs, and select SAP_CustomerNumber. b. Create a link from the SAP_CustomerNumber variable to the @CustomerNo element of the request variable. 7. In the Checklist click Map Outputs. This scenario does not sort elements at this moment. So, for now, keep all the returned data. a. Click the response variable to highlight it. Then, click Copy. b. Select the response output parameter, and click Create to create an orchestration variable named response and to create the mapping. c. Click Variables, and rename the response variable to SAP_CustomerGetDetailsResponse. 8. Remember to save the project before you continue.
3. In the checklist, change the following settings: 4. In the Checklist click Summary and set Activity Name to Update SAP Account. 5. In the Checklist click Pick Endpoint and set the endpoint to SAP if not already set. 6. In the Checklist click Configure.
Chapter 10. Scenario: Bidirectional account synchronization
425
8004chScenario1.fm
You have to complete the same steps as you did for the Get Customer Details From SAP activity previously. Although the business object is the same (Customer2), the method to select it this time ChangeFromData1. The configuration panel looks similar to that shown in Figure 10-103.
7. In the Checklist click Map Inputs. Map data from Salesforce.com and from the GetDetail request to the inbound structure. In addition, tell SAP which of the fields that are delivered to use for the update by marking these fields with an X in the CompanyDataX input element structure. Map the following inputs: a. Click Select Inputs, and select the SAP_CustomerNumber variable. b. Create a link from the SAP_CustomerNumber variable to the @CustomerNo element of the variable request. c. Click Select Inputs, and select the SFDC_OneAccount variable. d. Collapse the PersonalData, PersonalDataX, OptionalPersonalData, and OptionalPersonalDataX output sections because you will not map into these blocks. e. Create a link from the SFDC_OneAccount variable to the CompanyData element structure of the variable request for the following elements: Name to BillingStreet to BillingCity to BillingPostalCode to BillingCountry to Phone to Fax to SalesOrganisation__c to NAME STREET CITY POSTL_COD1 COUNTRY TEL1_NUMBR FAX_NUMBER SalesOrganisation
426
8004chScenario1.fm
f. You also need data from the SAP query. Click Select Inputs, and select the SAP_CustomerGetDetailsResponse variable. g. Create a link from the CustomerAddress element structure of the SAP_CustomerGetDetailsResponse variable to the CompanyData element structure of the request variable for the following elements: LANGU to LANGU_ISO to LANGU LANGU_ISO
427
8004chScenario1.fm
Do not use auto mapping for parts of the SAP structure because you want only these fields mapped. h. Create a link from the CustomerGeneralDetail element structure of the SAP_CustomerGetDetailsResponse variable to the CompanyData element structure of the request variable for the following elements: CURRENCY to CURRENCY_ISO to CURRENCY CURRENCY_ISO
Do not use auto mapping for parts of the SAP structure because you want only these fields mapped. Tip: If your SAP system does not return a value for the currency, define a default value in the input mapping for the SAP update activity or in the output of the SAP Get Details activity. Otherwise, you will run into the following error during update: An error occurred while trying to execute activity Execute BAPI. Error is: com.ibm.j2ca.base.exceptions.InvalidRequestException: BAPI Interface failed to process the request.Error thrown by SAP: Message = Internal error: The "Currency" field for structure PI_PERSONALDATA is blank, error code: F2887 i. Now, specify the fields to be updated by defining a default value of X for the related fields in the output structure CompanyDataX. Update the following fields: NAME STREET CITY POSTL_COD1 COUNTRY TEL1_NUMBR FAX_NUMBER
Define for each field an individual configuration property to provide more flexibility on which fields are updated.
428
8004chScenario1.fm
j. Finally, compare the mapping for the CompanyDataX with that shown in Figure 10-105.
8. In the Checklist click Map Outputs. At this time, you do not need to sort elements. Keep all the returned data. Map the following outputs: a. Click response to highlight it. Then, click Copy. b. Select the response output parameter, and click Create to create an orchestration variable named response and to create the mapping. c. Click the Variables tab, and rename the response variable to SAP_CustomerChangeFromDataResponse. Remember to save the project before you continue.
429
8004chScenario1.fm
To fix this issue, follow these steps: 1. Drag a Log Message activity as a replacement for the empty activity onto the Else branch. Name the activity Log Invalid Salesforce.com Account. 2. In the Map Inputs section: a. Set the level to WARNING. b. Select as input the SFDC_OneAccount variable. c. Select the Id, Name, and ExtAccountID__c elements as input and the message element as output. Use the Concatenate function to build a message such as: Error during synchronization. Invalid Salesforce.com account: id=xxx, name=yyy, ExtAccountID=zzz.
2. Rename the catch to GlobalCatchAll and rename the variables to GlobalFaultName, GlobalFaultData, and GlobalFaultInfo. 3. Add a Log Message activity to the branch, and rename it to Log Global Error. Set the level to ERROR, and set the message as follows: Critical error during synchronization, name= aaa, message=bbb, id=ccc. activity name = ddd, fault time: eee. 4. Use the GlobalFaultInfo variable and the Concatenate function to build this function. The global catch block now looks as shown in Figure 10-108.
430
8004chScenario1.fm
Although the global catch block is required to have some kind of error handling, this basic configuration is not sufficient. As an example, perform a test with a simulated SAP failure during SAP update. You can force this failure by removing the currency value from the mapping. Figure 10-109 shows the result. It shows that Salesforce.com returned three updated records. So the loop should have had three iterations. However, because the first one failed during the SAP update, the orchestration went into the global catch block, which then logged the error. Thus, no further updates were done.
Figure 10-109 Test with failing SAP update but global catch
To avoid this error, put the SAP activities into a Try-Catch block: 1. Drag a Try-Catch activity between the If SAP Customer activity and the Get Customer Details From SAP activity. 2. Rename the Try activity to Try Working With SAP.
431
8004chScenario1.fm
3. Move the two SAP activities to the Try-Catch block. 4. Click the catch block, and rename the catch to CatchSAP. 5. Rename the catch variables to SAPFaultName, SAPFaultData, and SAPFaultInfo. 6. Now, add a Log Message activity to the catch block: a. Copy the Log Message activity from the global catch block to the SAP catch block. Rename it to Log SAP Error. b. Click Map Inputs, and edit the function graph. c. Remove the GlobalFaultInfo variable and add the SAPFaultInfo variable. The fields are remapped. d. Double-click the Concatenate function, and change the error message to the following text: Error during synchronization, access to SAP failed. name= aaa, message=bbb, id=ccc. activity name = ddd, fault time: eee. The Try..Catch block should now look like Figure 10-110
Now, running the test again with the failing SAP update, the error is caught by the SAP catch block, and an error message is issued of the following form: Error during synchronization, access to SAP failed. Name=sap.Execute BAPI.operation, message=An error occurred while trying to execute activity invokeBAPI. Error is: com.ibm.j2ca.base.exceptions.InvalidRequestException: BAPI Interface failed to process the request.Error thrown by SAP: Message = Internal error: "The "Currency" field for structure PI_PERSONALDATA is blank, error code: F2887, id=126, activity name =Update SAP Account, fault time: 2011-10-12T01:29:16.776+02:00 Importantly, the orchestration continues the loop with the next account, as shown in Figure 10-111.
432
8004chScenario1.fm
Figure 10-111 Test with failing SAP update but SAP catch
Now, the error handling is acceptable. The last step includes the Common Error Handler. For details about how to add the Common Error Handler, refer to 10.5.7, Using the Common Error Handler on page 401. Add the Common Error Handler to every catch block of your orchestration.
433
8004chScenario1.fm
If any data set in SAP or Salesforce.com is updated, a feedback loop occurs. How can you avoid these loops?
434
8004chScenario1.fm
SELECT Id, AccountNumber, BillingCity, BillingCountry, BillingPostalCode, BillingState, BillingStreet, ExtAccountID__c, Fax, LastModifiedById,
435
8004chScenario1.fm
LastModifiedDate, CreatedById, CreatedDate, Name, Phone, SalesOrganisation__c FROM Account WHERE LastModifiedDate > $SyncTime AND LastModifiedById != $IntegrationUserID AND ExtAccountID__c != '' This query returns all selected fields if the account has been modified after SyncTime, not by the integration user, and if the external ID is not empty. Enter the query, and then click the checkmark to validate the query (as indicated in Figure 10-112).
Tips: Some hints for validation: The Validate Query function (triggered by clicking on the checkmark) first checks the syntax of the query and then connects to Salesforce.com to validate the fields. If validation fails during syntax, ensure that the validation is using the correct quotes. If validation fails during field validation, make sure Studio can connect to Salesforce.com. If the validation still fails, you can get additional hints by clicking Orchestration Validate. 6. In the Checklist click Map Inputs. The query defines two parameters, $SyncTime and $IntegrationUserID. Create the following mappings. Click Select Inputs, and select SyncTime. Map SyncTime from the left to SyncTime on the right. Right-click IntegrationUserID, and define the default value 005A00000011pokIAA. Click the bullet to create a configuration property named IntegrationUserID. 7. In the Checklist click Map Outputs. a. Click Select Outputs, and select SFDC_UpdatedAccounts. b. Create a link from the objects element of the objects variable to the objects element of the SFDC_UpdatedAccounts variable. This mapping links all the Salesforce.com data fields as shown in Figure 10-113.
436
8004chScenario1.fm
8. Remove the Get Updated Accounts From Salesforce.com activity. The orchestration now looks as shown in Figure 10-114.
437
8004chScenario1.fm
2. Verify which accounts have been updated. 3. Now go to the Salesforce.com portal and validate that these accounts have been modified by the integration user. 4. Use the SFDC_To_SAP_SyncAccounts orchestration with the feedback loop detection (the one with the Query Object activity) to synchronize some accounts from SFDC to Salesforce.com. a. b. c. d. Start the orchestration if not already started. Start the HTTP Post Utility. Use the URL http://<yourhost>/SFDC_To_SAP_SyncAccounts. In the body, enter the synctime in the format yyyy/MM/dd/hh/mm/ss.
5. View the output within Studio and notice that none of the accounts that were synchronized from SAP to Salesforce.com are synchronized back to SAP, as shown in Figure 10-115.
6. Now log in to the Salesforce.com portal with a user other than the integration user. 7. Change one or more account records. 8. Run the test from step 4 again with the same time stamp. All changed account records are now returned by Salesforce.com and synchronized to SAP.
438
8004chScenario2.fm
11
Chapter 11.
439
8004chScenario2.fm
11.2.1 Prerequisites
To follow this scenario you will need the following accounts or logins: A NetSuite account A Google account A Cast Iron Live login If you do not have a Cast Iron Live account, the scenario can be developed and verified in Studio installed on your PC. The Studio steps will be the same as detailed in this chapter, but you will not be able to initiate Studio from Cast Iron Live nor publish the project to a Cast Iron Live environment. To create the project, select the Studio menu Solutions->Search for TIPs, search for Google Calendar. Select NetSuite _Google_syncCalendar_CastIronLive and create the project. 440
Getting Started with IBM WebSphere Cast Iron Cloud Integration
8004chScenario2.fm
Events found?
Yes
Log in to Google
Stop
No
Send Message
Stop
Stop
This scenario modifies the primary orchestration as follows: Invoke the orchestration either for a scheduled activity or using HTTP Request Send an email to the Google account if an error occurs
441
8004chScenario2.fm
Tip: If your session in Cast Iron Live times out, you cannot save the project in your Studio session to Cast Iron Live. Either set the Cast Iron Live timeout to a long time (or never) or save the project to your local disk.
442
8004chScenario2.fm
2. From the Target Endpoint drop-down menu, select Google Calendar, as shown in Figure 11-5.
3. Click Search. The list of TIPs with Google Calendar as the Target Endpoint displays, as shown in Figure 11-6. Note that this list may vary.
Figure 11-6 List of TIPs using Google Calendar as the target endpoint
4. Click NetSuite _Google_syncCalendar_CastIronLive. Template details display in the bottom pane, as shown in Figure 11-7.
443
8004chScenario2.fm
5. Click Create a project based on this template. A new browser window opens that shows an Initializing status bar. When complete, the TIP Configuration Wizard opens in the new browser window and displays the Introduction step, as shown in Figure 11-8. Click Next.
Figure 11-8 TIP configuration wizard step 1: Introduction window for the TIP configuration
6. In step 2, enter the NetSuite account details, as shown in Figure 11-9, and then click Next.
7. In step 3, enter the Google account details, as shown in Figure 11-10, and then click Next.
444
8004chScenario2.fm
8. In step 4, enter the Cast Iron Live details, as shown in Figure 11-11, and then click Next.
Figure 11-11 TIP configuration wizard step 4: Cast Iron Live details
9. In step 5, click Test Connection to test the Google connection. A dialog box opens to confirm a successful connection. If the connection is successful, close the dialog box, and then click Next.
445
8004chScenario2.fm
Figure 11-12 TIP configuration wizard step 5: Testing the Google connection
446
8004chScenario2.fm
10.In step 6, click Test Connection to test the NetSuite connection. A dialog box opens to confirm a successful connection. If the connection is unsuccessful, go back to step 2 by clicking the Back button and then enter the NetSuite account details again (as shown in Figure 11-9 on page 444). If the connection is successful, close the dialog box, and then click Next.
Figure 11-13 TIP configuration wizard step 6: Testing the NetSuite Connection
447
8004chScenario2.fm
12.In step 8, you can provide a review of the TIP at this point. Click Close.
You have now completed the configuration steps for the project and have a completed set of orchestrations. When using a TIP, if you do not need to make any modifications then you can publish the project to the Cast Iron runtime. Having completed the TIP configuration you now have access to all orchestrations in Studio and can develop these. In this scenario you will modify the primary orchestration.
448
8004chScenario2.fm
11.5.1 Add the HTTP Receive Request starter activity to the orchestration
To add the HTTP Receive Request starter activity in addition to the Schedule start, use the Pick activity. This activity enables more than one starter activity to be included in the orchestration. Follow these steps to add the activity: 1. The project has multiple orchestrations. Ensure that you have the primary orchestration, NetSuite_Google_syncCalendar, open in the workspace, as shown in Figure 11-17 . If the primary orchestration is not open, go to the Project tab on the right, and then under Orchestrations, double-click the NetSuite_Google_syncCalendar orchestration to open the orchestration to a tab on the workspace.
449
8004chScenario2.fm
2. Go to the Activities tab, and expand the Logic section, as shown in Figure 11-18.
Figure 11-18 The Pick activity in the Logic section of the Activities tab
3. Drag the Pick activity to the empty orchestration as the first activity in the orchestration in front of the Schedule Job activity, as shown in Figure 11-19. A Pick group is created and shows two empty starter activities. The Pick group enables more that one starter activity to be used in the orchestration. If you want to have more than two starter activities, right-click the Pick item, and use the Add Receive Branch menu item.
Figure 11-19 Orchestration showing the Pick activity to allow multiple starter activities
450
8004chScenario2.fm
4. Drag the Schedule Job activity in the orchestration to the uppermost Add Starter Activity of the Pick group, as shown in Figure 11-20. When the prompt displays, click Yes in the Replace Activity dialog. Note: Rather than drag, you can use cut and paste for moving activities in the orchestration. Cut and paste is available through standard shortcut keys, right-click context menu and through the main menu.
Figure 11-20 Moving the Schedule Job activity into the Pick group
5. Open the HTTP section on the Activities tab, and drag the Receive Request activity to the remaining Add Starter Activity of the Pick group. Figure 11-21 shows the Checklist for the HTTP Receive Request activity.
Figure 11-21 Pick group with HTTP Receive Request as a starter activity with Schedule Job
6. Click Pick Endpoint in the checklist for the HTTP Receive Request activity.
451
8004chScenario2.fm
8. Click Configure in the Checklist. Then, enter /syncNetSuiteGoogleCalendar in the text box for URL (Path After Hostname). Select the Requires a Reply option. Refer to Figure 11-23
452
8004chScenario2.fm
To perform an initial test: 1. Right-click the Search Records activity (Lookup NetSuite Calendar Events), and then select Verify Activity, as shown in Figure 11-24. A dialog box opens starting the orchestration.
2. When the dialog box closes, go to the Verify tab, as shown in Figure 11-25.
453
8004chScenario2.fm
3. Click Instance #1 (COMPLETED), and then click the Expand All icon (
).
Instance #1 shows the details for the job of the NetSuite Search Records activity only. The runtime engine in Studio shows all messages in to and out of each activity. Refer to Figure 11-26.
Figure 11-26 Verify tab showing the expanded NetSuite Search Records activity
454
8004chScenario2.fm
4. Click the last entry, lookupNetSuiteCalendarEventsResponse. In the Variable/Parameter Message Data pane at the bottom you can now see the data retrieved from NetSuite as an XML document. Refer to Figure 11-27.
455
8004chScenario2.fm
b. Name the variable HTTPStarterActivity, and click Finish. 2. Click the Schedule Job activity. a. Click Map Outputs in the Checklist. b. Click Select Outputs and select the HTTPStarterActivity variable. Click OK. c. Right-click on the HTTPStarterActivity in the To Orchestration area and select Define Default Value. Set a default value of False for this variable, and click OK, as shown in Figure 11-28.
Figure 11-28 Setting a variable value in Map Outputs for Schedule Job activity
3. Click the activity Receive Request, and then select Map Outputs. a. Click Select Outputs. b. Select the HTTPStarterActivity variable. c. Set its default value to True, as shown in Figure 11-29. Click OK.
Figure 11-29 Setting a variable value in Map Outputs for HTTP Receive Request activity
Now the variable is set, and a response can be sent to the HTTP request.
456
8004chScenario2.fm
4. Drag an IfThen activity to the orchestration within the existing IfThen activity and outside of the For Each NetSuite Events activity, as shown in Figure 11-30.
a. Rename the If item. Right-click, and then select Rename. Enter the following name: If HTTP Start b. Click the Left Hand Expression text box, and then click the Define New Variable Expression icon ( ). c. Select HTTPStarterActivity in the drop-down list shown in Figure 11-31. Then, select the variable HTTPStarterActivity and click OK.
d. Set the Op value to = (equals). e. Click the Right Hand Expression text box and enter True(). 5. Drag an HTTP Send Response activity to the IfThen block after the If item. a. In the Checklist, select Map Inputs, and set the default value for the body as follows: Events have been synchronized Figure 11-32 shows the completed IfThen block.
457
8004chScenario2.fm
458
8004chScenario2.fm
2. Paste the block into the orchestration in the Else branch of the first IfThen activity in the orchestration, as shown in Figure 11-34.
3. Click the Send Response activity. 4. Select Map Outputs in the checklist, and set the default value for the body as follows: No events found to be synchronized
2. Drag the Search Records activity into the Try block, as shown in Figure 11-36.
459
8004chScenario2.fm
3. Go to the Project tab. Right-click Endpoints, and then select Create Endpoint Email. A new tab is created with the email configurations, as shown in Figure 11-37. a. Select the Send Email to Server option. b. Enter the host name and port for the email server, in this case, smtp.gmail.com as the host name and port 465 c. Select the Log into the Server with User Name and Password option. d. Use the drop down in the User Name and Password fields to select the configuration parameters for your Google user name and password. e. Select Email over SSL. f. Click Test Connection.
460
8004chScenario2.fm
4. Select the workspace tab for the orchestration. 5. From the Email section on the Activities, drag a Send Email activity to the CatchAll branch of the Try activity as shown in Figure 11-38
461
8004chScenario2.fm
6. Select Pick Endpoint in the Checklist. Click Browse, select the Email endpoint, and then click OK. 7. Click Configure in the Checklist. a. Enter the email details. In this scenario, set the From and To email addresses as the Google email address and leave the CC and BCC blank. b. Enter the following text for the Subject, as shown in Figure 11-39: NetSuite Search Records Failure
8. Click Map Inputs in the Checklist. The To Activity section requires the body of the email. This scenario sends the job details. 9. Click Select Inputs, and select the JobInfo variable. Click OK. 10.From the Functions tab, drag a Concatenate function into the middle untitled pane of Map Inputs. a. From the From Activity pane map the jobId, jobStartTime, and projectName to the Concatenate function box in the middle section. To form a map, click the field and then drag to the function. Refer to Figure 11-40.
b. Map the Concatenate function in the middle pane to the body in the To Orchestration pane. 11.Double-click the Concatenate function. a. Add three empty fields by clicking Add three times.
462
8004chScenario2.fm
b. Then, use the Up button to position these fields above each of the three job fields, as shown in Figure 11-41.
12.In the Functions Parameter dialog box, complete these steps (refer to Figure 11-42): a. In the first empty text box, enter Job ID. Ensure that there is a space at the end of the text string. b. In the second empty text box, enter Job Start Time. Ensure that there is a space at the end of the text string. c. In the third empty text box, enter Project Name, and then click OK. Ensure that there is a space at the end of the text string.
Figure 11-42 Completed Concatenate configuration Chapter 11. Scenario: CRM to cloud calendar services
463
8004chScenario2.fm
13.Right-click the Concatenate function, and select Apply Function Graph, as shown in Figure 11-43.
8004chScenario2.fm
Environment name: The choice of environments is shown only if you have more than one environment. You might not have an environment called Development, in which case you need to select an appropriate environment for testing this scenario.
465
8004chScenario2.fm
3. Select All for the Logging Level for the orchestration NetSuite_Google_syncCalendar, as shown in Figure 11-46.
4. Click Save (located at the bottom left corner). Then, click the Run Configuration icon ( ).
466
8004chScenario2.fm
467
8004chScenario2.fm
468
8004chScenario3.fm
12
Chapter 12.
469
8004chScenario3.fm
Cast Iron
FTP server Order File Lotus Domino Database Order
470
8004chScenario3.fm
Each order file that is sent from the partner can contain multiple orders from different customers. Multiple products can be ordered within each customer order. Each product order is held as an item within the order. Figure 12-2 on page 471 shows a representation of an order file.
Order File Item1 Order1 Item2 Item3 Item1 Item2
Order2
The invoicing system needs one document for every item received, not for every order. Thus, each order must be transformed in to a set of items as shown in Figure 12-3.
Order data + Item1 data Order data + Item2 data Order data + Item3 data
The order file contains the product ID and quantity for each product that is ordered. It does not contain the product description or the price of each product. This data is retrieved from the product database. In addition, products are different sizes and weights. Thus, when they are delivered to the customer, products with smaller sizes and weights can be transported using Air Freight, which can be faster but also more expensive. Products with larger sizes and weights can use slower transport methods, which can be less expensive. The product database contains a transport type for each product that shows which transport method can be used for that product. This data is also retrieved from the product database. The information retrieved from the product database is combined with each item as shown in Figure 12-4.
471
8004chScenario3.fm
An order date and a total price for each item is added to the data. A delivery date is calculated using the transport for the product, and a message giving the estimated delivery date is added to the data, as shown in Figure 12-5. This field is a message string and not just the delivery date because it includes extra text besides the date.
Item
Completed Item
Finally, a Lotus Domino document is created for each item, which is then used to send an invoice to the customer.
472
8004chScenario3.fm
Figure 12-7 shows an example of the structure of the incoming order file.
Order File /CustID1/CustName1/OrderID1/:ItemID1,ProdID1,Qty1:ItemID2,ProdID2,Qty2:... /CustID2/CustName2/OrderID2/:ItemID1,ProdID1,Qty1 /CustID3/CustName3/OrderID3/ :ItemID1,ProdID1,Qty1 :ItemID2,ProdID2,Qty2
Order header
Each order file contains multiple orders, with one order per line. Each order is separated by an end-of-line character. The data in each order uses the delimiters shown in Table 12-1 on page 473 to separate it.
Table 12-1 The delimiters used in the order file Delimiter Slash (/) What it is used for Indicates the start of each top level piece of data in the order, such as CustomerID, CustomerName, OrderID, and the items Indicates the start of each item Separates each piece of data in an item -, for example ItemID, ProductID, and Quantity
The invoice system requires that a Domino document be created for every item in the order file.
473
8004chScenario3.fm
474
8004chScenario3.fm
The flow of the processing in this scenario is as follows: 1. FTP Poll Directory a. An FTP Poll Directory activity polls an FTP server every 20 seconds for any files in a directory. When a file is detected, the data in the file is read in to the orchestration. b. The name of the file is stored in a variable. 2. Transform Read Flat File a. The data from the file is read in as a single string of data. This data is then parsed using a Flat File Schema to turn it in to a set of orders with the correct structure. Flat File Schemas are explained in 3.10.4, Flat File Schema parsing on page 151. b. The total number of orders that are read is stored in a variable. 3. Transform Apply XSLT An XML Stylesheet is used to turn the set of orders into a set of items. 4. Data Quality Lookup A database Lookup is performed to read the product description, price, and transport for each item from the products database. The Lookup activity combines the functionality of a For Each loop with a Database Execute Query. The activity returns two sets of data: The first set contains a list of the aggregations of the original items and the fields returned from the products database as shown in Figure 12-10.
Item CustomerID CustomerName OrderID ItemID ProductID Quantity Item CustomerID CustomerName OrderID ItemID ProductID PRODUCTS ID DESC PRICE TRANSPORT Quantity DESC PRICE TRANSPORT
Figure 12-10 Aggregating item record structure and database record structure
The activity also returns a list of all of the items with products that cannot be found on the products database. This list of items is given default values for the missing fields as follows: DESC PRICE TRANSPORT 5. Data Quality Merge The two sets of data that are returned from the Lookup activity are then merged to produce one list of items. ERROR: PRODUCT ORDERED WAS INVALID 0 ERROR
475
8004chScenario3.fm
Hint: If two items have the same Customer ID, Order ID, and Item ID, the item from the Lookup Success list is used. This occurrence is an error condition and should not happen if the order file is created correctly. 6. Domino Create Document A data structure is created for each item in the file. This data structure maps the relevant fields to those fields that are needed for the Domino document. The following fields are mapped directly to their equivalents in the Domino document: CustomerID CustomerName OrderID ItemID Description Quantity
The following fields are mapped as indicated: The OrderDate field is populated with the current date. The Price field is returned as a String from the Lookup activity. The Number function is used to convert this to a number. The Total field is calculated from the Quantity and Price. The DeliveryMessage field is populated using a Lookup Table and a Custom Function: The Lookup Table is used to look up the transport for the item and to return a number of shipping days. The Custom Function takes this number of days and adds it to the current date. The function then returns a delivery message of the form: Your expected delivery date is <Delivery Date> The Domino document is then created in the Domino database. 7. Utilities Create Job Keys To allow a Cast Iron administrator to view the status of order files that have been processed by the orchestration in the Web Management Console, two Job Keys are created. The two Job Keys hold the name of the file that was processed and the total number of orders in that file. These Job Keys are populated using variables set in earlier activities. An incoming order file using the format shown in Example 12-1 produces four Domino documents as shown in Figure 12-11. Note: The Order and Delivery dates depend on the date on which the orchestration ran.
Example 12-1 A sample incoming order file
/8660001/Customer1/1/:1001,PROD24,3:1002,BadProduct,1:1003,PROD43,1 /8970001/Customer2/1/:1001,PROD35,1
476
8004chScenario3.fm
$ $
$ $
$ $
$ $
Figure 12-11 The Domino documents produced from the sample incoming order file
Every orchestration needs to include error handling. For this scenario, error handling is performed by the common error handler described in Chapter 9, Common error handlers on page 353. In the completed scenario, the Lookup, Merge, and Create Documents activities are run inside a Try activity. The orchestration also includes a global error handler. Both the Try activity and the global error handler use Web Services Invoke Service activities to call the common error handler.
477
8004chScenario3.fm
478
8004chScenario3.fm
a. Select the Server where you want to install the database. b. Enter a title: CastFE c. Enter the file name to use: CastFE.nsf d. In the template section, select your local server and the CastFE template. e. Click OK.
479
8004chScenario3.fm
5. Click Test Connection at the bottom of the FTP endpoint pane to confirm that the connection values entered for the endpoint are correct. 6. If the connection test fails, change the values for the configuration properties by selecting Project Configuration Properties and then testing again.
480
8004chScenario3.fm
Figure 12-14 shows the completed database endpoint. Leave any settings not shown here at the default values.
7. Click Test Connection at the bottom of the Database endpoint pane to confirm that the connection values entered for the endpoint are correct. 8. If the connection test fails, change the values for the configuration properties by selecting Project Configuration Properties and then testing again. 9. On the Project tab, rename the Database endpoint that you just created. Right-click the Database endpoint, and then select Rename. Rename the Database endpoint DB2.
4. Click Test Connection at the bottom of the Database endpoint pane to confirm that the connection values entered for the endpoint are correct.
481
8004chScenario3.fm
5. If the connection test fails, change the values for the configuration properties by selecting Project Configuration Properties and then testing again.
2. In the Orders entity tab, select the Document Ends with EOS (end of stream) option. Then, in the Delimiters section, set Line End for both Child and Child Delimiter Position options. The flat file schema will use new line as the record delimiter. Refer to Figure 12-17.
Figure 12-17 Basic Properties and Delimiters for the Orders flat file schema
482
8004chScenario3.fm
3. With the Orders entity editor opened and the Schema Layout tab selected, you next need to design the file structure. Right-click Orders New Child Record, as shown in Figure 12-7.
Figure 12-18 Creating a new record for the Orders flat file schema
Figure 12-19 Creating a new record in the Order flat file schema
b. Select the Order child record that you just created, and complete the following configuration, as shown in Figure 12-20: c. In the Basic Properties panel, select Unbounded for Occurrences. d. In the Delimiters panel, enter a slash (/) character for Child. e. In the Child Delimiter Position drop-down menu, select Before.
483
8004chScenario3.fm
4. In the Schema Layout tab, right-click Orders Order New Child Field (Figure 12-21).
a. Name the new child CustomerID. b. In the Basic Properties panel, change the Type field (below the Name field) to Integer in the Type drop-down menu. 5. In the Schema Layout tab, right-click Orders Order New Child Field and name the new child CustomerName. 6. In the Schema Layout tab, right-click Orders Order New Child Field. a. Name the new child OrderID. b. In the Basic Properties panel, change the field type to Integer in the Type drop-down menu. 7. In the Schema Layout tab, right-click Orders Order New Child Record. In the New Record window, name the new child Items and click OK. Select the Items child record that you just created, and complete the following configuration, as shown in Figure 12-22: a. In the Delimiters panel, enter a colon (:) character for Child. b. In the Child Delimiter Position drop-down menu, select Before. c. Enter a colon (:) character for the Child Delimiter Position option.
484
8004chScenario3.fm
At this point, the layout looks like that shown in Figure 12-23.
8. In the Schema Layout tab, right-click Orders Order Items New Child Record. a. In the New Record window, name the new child Item, and click OK. Complete the following configuration, as shown in Figure 12-24. b. In the Basic Properties panel, select Unbounded for the Occurrences setting. c. In the Delimiters panel, enter a comma (,) character for the Child option.
9. In the Schema Layout tab, right-click Orders Order Items Item New Child Field and name the new child ItemID. Then, in the Basic Properties panel, change the field type to Integer in the Type drop-down menu. 10.In the Schema Layout tab, right-click Orders Order Items Item New Child Field and name the new child ProductID. Then, in the Basic Properties panel, change the field type to string in the Type drop-down menu. 11.In the Schema Layout tab, right-click Orders Order Items Item New Child Field and name the new child Quantity. Then, in the Basic Properties panel, change the field type to Integer in the Type drop-down menu.
485
8004chScenario3.fm
The Orders flat file schema tab in which you are working now looks like that shown in Figure 12-25.
Figure 12-25 The Orders flat file schema for the input file
12.Next, you need to test the Orders flat file schema. In the Orders entity tab, enter the sample data shown in Example 12-2 into the test panel, and click the Test icon. Refer to Figure 12-26. This test parses the sample data in to an XML structure, which displays on the right side of the test pane. If the test is successful, the XML structure displays and no error message opens.
Example 12-2 Sample data to run a flat file schema test
/8660001/Customer1/1/:1001,PROD24,3:1002,BadProduct,1:1003,PROD43,1 /8970001/Customer2/1/:1001,PROD35,1
Figure 12-26 Test panel showing the result on the right side
486
8004chScenario3.fm
Example 12-3 Template data for the Items flat file wizard
customerid,customername,orderid,itemid,productid,quantity customerid,customername,orderid,itemid,productid,quantity 2. In Studio, start the wizard by selecting Project Flat File Wizard. 3. For the sample data, click Browse and then select the template file that you just created. This step loads the file content into the Sample Data container. You can also type the sample data without creating a template file. Refer to Figure 12-27. Click Next.
Figure 12-27 Providing sample data for the flat file wizard
4. The template that you provided is a comma-separated value (CSV) format. So, you can accept the defaults for the file format, which is the Character-delimited format option. Click Next. 5. Accept the defaults for the Field Delimiters page: Fields separated by comma Fields enclosed by double quote Click Next. 6. In the Header and Trailer pane, select the Treat first row as header for the field names option. This option uses the values that you provided in the sample data as field names for the Items flat file schema. Click Next. 7. Name the schema that you are creating Items and click Finish. Refer to Figure 12-28.
8. Adjustments are still needed in the Items flat file schema that you just created. In the Project tab, double-click the Items flat file schema in the Flat File Schema section as shown in Figure 12-29.
487
8004chScenario3.fm
Figure 12-29 Opening the Items flat file schema for edition
9. After the entity tab Items is opened, delete the header node because it is not going to be used. Right-click the header, and select Delete as shown in Figure 12-30.
Figure 12-30 Deleting the header node from the Items flat file schema
10.Next, rename the data node to Item. First, select the data node. Then, in the Basic Properties panel, select Name and replace data with Item. Refer to Figure 12-31.
11.For each field in the Item structure, update the name and type so that it matches the details shown in Table 12-4.
488
8004chScenario3.fm
integer
string
integer integer
string
integer
12.You can test the Items flat file schema with the template data used within the wizard in the same manner that you tested the Orders flat file schema. 13.At this point you might want to close any open entity tabs, and save your project.
489
8004chScenario3.fm
2. In the Custom Function window, enter a function name of createDeliveryDateMessage. Click Add to create a parameter.Call the parameter numberOfDays and give it a type of number, as shown in Figure 12-33.Click Next.
3. In the Create a Custom Function window, enter the JavaScript function shown in Example 12-4. This JavaScript function calculates a delivery date based on the current date and the number of days that the delivery takes. A Lookup Table is created in 12.9.7, Create a lookup table on page 491 to select the number of days each product takes to be delivered. This function returns a string which includes the delivery date.
Example 12-4 JavaScript function to calculate a date in future
if (numberOfDays == -1){ return "NO DELIVERY DATE SET" } else { var today = new Date(); var calculatedDate = today.getTime() + (numberOfDays*24*60*60*1000); var newDate = new Date(calculatedDate); return "Your expected delivery date is " + newDate.toDateString(); }
490
8004chScenario3.fm
4. Click Compile. When the success message displays, as shown in Figure 12-34, click OK. Then, click Finish.
2. Enter ShippingTimes for the Table Name. Use the Add button to enter the values listed in Table 12-5.
491
8004chScenario3.fm
Table 12-5 Lookup Table rows Key AIR ROAD SEA SKATEBOARD Value 1 3 10 30
3. In the Create Lookup Table window, enter -1 for both the Default Value and Value if nil fields, as shown in Figure 12-36.
8004chScenario3.fm
12.10.8, Add a Merge activity on page 506 12.10.9, Add a For Each activity on page 508 12.10.10, Add the Create Documents activity on page 509 12.10.11, Log the job keys using the Create Job Keys activity on page 515 12.10.12, Test the orchestration on page 517 12.10.13, Add error handling on page 517
fileNameProcessed totalOrders
decimal
493
8004chScenario3.fm
2. From the Checklist pane, click Summary and rename this activity to Read Orders File over FTP. 3. From the Checklist pane, click Pick Endpoint. Click Browse and select FTP, then click OK. This will bind the FTP endpoint that you created earlier in 12.9.1, Create and test an FTP endpoint on page 480. 4. From the Checklist pane, click Configure. a. Enter *.txt for the File Named field. b. Create a new configuration property for this field named FTPFileName in the same way you did earlier in 12.9.1, Create and test an FTP endpoint on page 480. c. For the In Directory, click Browse and select the slash (/) field. At this point a connection to the FTP server must be working. d. Create a new configuration property and name it as FTPDirectory. e. Select Keep in place for the After reading the file option. With this option selected the Poll Directory activity will not move or delete the file. At this point, the Configuration pane looks similar to that shown in Figure 12-39.
494
8004chScenario3.fm
5. In the checklist, select Configure Delivery Rules and change the Polling Interval to 20 seconds. 6. Click Map Outputs. a. In the From Activity panel (left side) select filename and click Copy. b. In the Copy Parameters window that opens, select filename and then Create. c. Repeat the same steps for the data field. The Map Outputs pane looks as shown in Figure 12-40.
495
8004chScenario3.fm
2. While you are working in the Variables tab, create a new variable named totalOrders of type int. a. Right-click anywhere in the Variables panel, and select Create New Variable. b. In the window that opens (Figure 12-42), select int as the data type and click Next. c. Then, enter totalOrders for the name, and click Finish.
496
8004chScenario3.fm
3. Repeat the previous step to create another variable named ordersParsedData. For the data type, select Flat File Schemas Orders Orders (Figure 12-43).
Figure 12-43 Selecting a variable type from a flat file schema type
4. Create another variable of type Flat File Schemas Items Items, and name it allItems. This variable will be used in a further XSLT step in the orchestration. Figure 12-44 shows the variables panel at this point.
2. In the Checklist, select Configure and click Browse for Select a Flat File Schema. Select Orders from the Project Explorer window. 3. In the Checklist, select Map Inputs, then click Select Inputs, and select ordersFileData from the Select Inputs window.
Chapter 12. Scenario: Data enrichment and aggregation
497
8004chScenario3.fm
4. Drag orderFileData from the left panel to Data on the right panel. Refer to Figure 12-46.
5. In the Checklist, select Map Outputs. 6. Click Select Outputs and select the totalOrders variable. 7. Repeat the previous step, this time selecting ordersParsedData. 8. Right-click anywhere inside the From Activity panel, and select Show Additional Property Nodes, as shown in Figure 12-47.
a. In the From Activity panel on the left, drag occurrence to totalOrders in the To Orchestration panel on the right. This step updates the totalOrders job key with the number of total orders read from the input file. b. Right-click anywhere inside the From Activity panel, and select Hide Additional Property Nodes. 9. Drag Orders Order on the left (recurring element) to ordersParsedData Orders Order (recurring element) on the right side, as illustrated in Figure 12-48.
498
8004chScenario3.fm
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <Items> <xsl:apply-templates select="/Orders/Order/Items/Item"/> </Items> </xsl:template> 499
8004chScenario3.fm
<xsl:template match="/Orders/Order/Items/Item"> <Item> <CustomerID><xsl:value-of select="../../CustomerID"/></CustomerID> <CustomerName><xsl:value-of select="../../CustomerName"/></CustomerName> <OrderID><xsl:value-of select="../../OrderID"/></OrderID> <ItemID><xsl:value-of select="ItemID"/></ItemID> <ProductID><xsl:value-of select="ProductID"/></ProductID> <Quantity><xsl:value-of select="Quantity"/></Quantity> </Item> </xsl:template> </xsl:stylesheet> To add the Apply XSLT activity, follow these steps: 1. From the Projects tab, right-click Stylesheets Add Document. Browse and select the scenario3.xslt file. 2. Select the Activities tab, and then drag Transform Apply XSLT to the right of the Read Flat File activity. 3. Rename this activity to Transform Orders to List of Items. 4. In the Checklist, select Pick Stylesheet. Click Browse and select the scenario3.xslt file that you added earlier. 5. In the Checklist, select Set Input & Output. For the input panel, click Browse and select ordersParsedData. 6. For the output panel on the right, click Browse and select allItems. The Apply XSLT settings now look as shown in Figure 12-50.
500
8004chScenario3.fm
2. From the Checklist pane on the bottom left, click Pick Endpoint and Browse. Select the endpoint named DB2 you created earlier. 3. Click Configure. a. From the Variable Name drop-down menu select allItems. b. For the Element Name field, click the ellipsis, and select Items item. Refer to Figure 12-53.
501
8004chScenario3.fm
4. Each item contains a product ID that is used as a key to find a description, price and transport method for the product in the database. Select Configure > Enter Query and type the SQL query from Example 12-6.
Example 12-6 Query products table
SELECT DESC, PRICE, TRANSPORT FROM PRODUCTS WHERE ID=? 5. Validate the SQL query by clicking the Validate Query button (see Figure 12-54).
6. Still in the Checklist, select Setup Input Parameters. a. Scroll to the right in the table, until you see a column named XPath. b. Click the cell to select it and then click the ellipsis button. c. A Select XPath window opens. (See Figure 12-55). d. Select item ProductID and click OK.
502
8004chScenario3.fm
Notice that after you validate the query, selecting Setup Result Set in the checklist shows the database details of the following fields that are part of query: Description Price Transport The Lookup activity reads data from the database intelligently. Thus, it batches and caches data for optimization. Selecting Delivery Rules in the checklist shows advanced configurations for this activity, such as the Preload cache and Cache at most options. To learn more about these configurations, visit the information center at: http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/topic/com.ibm.websphere.cast_i ron.doc/use_the_lookup_activity.html
503
8004chScenario3.fm
3. Click on the Lookup Products Data in Database activity in the orchestration. 4. In the Map Outputs panel click the Select Outputs... button. Holding the Control key, select both itemsFound and itemsNotFound. Click OK. Now these two variables are loaded into the To Orchestration column. Tip: Sometimes, the From Activity pane of the Lookup activity Map Outputs task does not populate properly. If this happens, restart Studio. 5. Drag goodXML items item onto itemsFound items item and drag badXML items item onto itemsNotFound items item. Refer to Figure 12-57.
504
8004chScenario3.fm
Because itemsNotFound was mapped from badXML, which contains items where no data was found in the database, you need to provide default values for the DESC, PRICE, and TRANSPORT fields in the itemsNotFound variable. 6. In the To Orchestration pane on the right, right-click itemsNotFound DESC and select Define Default Value from the menu. Type ERROR: PRODUCT ORDERED WAS INVALID as the default value. 7. Repeat this step to add default values for itemsNotFound PRICE and itemsNotFound TRANSPORT. For PRICE set 0 (zero) as default and for TRANSPORT set ERROR for the default value. In the mapping pane, these three fields now are presented with a big D (default) on the left side. See Figure 12-58.
Figure 12-58 Default values assigned for desc, price, and transport
In this scenario, we want to create invoices even if something is wrong with the input data, more specifically if product details could not be found in the database. This is the reason you used default values for items with products not found in the Lookup activity.
505
8004chScenario3.fm
2. This activity will merge itemsFound and itemsNotFound variables. In the Checklist pane on the left, click Configure. a. In the Left Variable that Contains the Recurring Element to Loop Through section: i. Click the drop-down in the Variable Name field and select itemsFound. ii. Click the ellipsis to the right of the Element Name field and select Items Item. b. In the Right Variable that Contains the Recurring Element to Loop Through section: i. Click the drop-down in the Variable Name field and select itemsNotFound. ii. Click the ellipsis to the right of the Element Name field and select Items Item. The Configure panel should be like Figure 12-60.
3. Select Configure Merge Properties. a. In the drop-down menu for the Merge Type field, select Merge and keep left duplicates. b. You will include three Left Sort Keys. Click the Add button three times. 506
Getting Started with IBM WebSphere Cast Iron Cloud Integration
8004chScenario3.fm
c. You need to change the XPath value for each row you just added. Click the ellipsis button inside the first cell in the XPath column and select CustomerID. For the XPath values for the other two lines, select OrderID and ItemID respectively. d. Repeat the same steps for the Right Sort Keys table. The final result is presented in Figure 12-61.
4. Select Map Outputs. Click Copy and select mergedXML in the Copy Parameters window. Click OK. See Figure 12-62.
507
8004chScenario3.fm
5. Now, you will give a proper name to the variable copied in the Map Outputs panel. Select the Variables tab. Find and select the variable named mergedXML. Rename it to itemsMergedData in the properties panel located at the bottom. See Figure 12-63.
All the activities using this variable will be updated automatically. 6. Save your project.
a. In the drop-down menu for the Variable that Contains the Recurring Element to Loop through Variable Name field, select itemsMergedData.
508
8004chScenario3.fm
2. Click the ellipsis button to select a value for the Element Name field. In the Select Recurring Element window select Items Item and then click OK. 3. Enter item for the Variable Name field in the Single Element Returned by the Loop section. Figure 12-65 shows the For Each settings.
2. In the Checklist pane, select Pick Endpoints Browse. Select the Domino endpoint you created earlier. 3. Select Configure and then Browse to select the Domino database where this orchestration will insert the documents. After the Domino database is selected, you must also select the Order form. Click Finish. Figure 12-67 presents the result with these two fields selected. Notice that the two fields Database and Form are pulled from the Domino server, so when you click Browse, a list of databases and forms are displayed that have been pulled from the Domino Server.
509
8004chScenario3.fm
4. Select Map Inputs in the Checklist pane. Click the Select Inputs... button. Select the variable item from Select Inputs window and click OK. See Figure 12-68 on page 510.
The data structure on the right side panel (To Activity) was defined when you selected the form in the previous step. 5. You will now start an extensive mapping. The target fields are highlighted on the bottom of the right panel (To Activity). See Figure 12-69.
510
8004chScenario3.fm
Hint: Collapse the CommonProperties node to simplify the mapping view. See Figure 12-69. a. Drag CustomerID on the left to CUSTID on the right. Click Yes in the warning message window. This message warns of data type mismatch. It does not affect your project. See Figure 12-70 on page 511. From now on in this Map Inputs panel, click Yes for all the warning messages that pops up.
Figure 12-70 The warning message when you map CustomerID to CUSTID
b. Drag CustomerName on the left to CUSTNAME on the right. c. Drag OrderID on the left to ORDERID on the right. d. Drag ItemID on the left to ITEMID on the right. e. Drag Quantity on the left to QTY on the right. f. Drag DESC on the left to DESC on the right. 6. Go to Functions tab and drag DateTime Get Current Date to the central mapping pane. See Figure 12-71 on page 512.
511
8004chScenario3.fm
a. Now drag the Get Current Date function to the ORDERDATE in the To Activity column. b. Right-click the Get Current Date function in the center pane and select Apply Function Graph. See Figure 12-72.
7. The PRICE field you are going to map now is represented as a String. We need to convert it to the appropriate data type (Number) before pushing it to Domino database because in Domino this field is represent as a number. a. Go to Functions tab and drag Miscellaneous Number to the central mapping pane. b. Drag PRICE on the left to the Number function you just added. c. Drag the Number function to PRICE on the right. Right-click the Number function and select Apply Function Graph. See Figure 12-73 on page 513.
512
8004chScenario3.fm
8. The Total is calculated based on the price of the item times the quantity. a. From the Functions tab, drag Miscellaneous Number to the central pane. b. From the Functions tab, drag Mathematical Multiply to the central pane. c. Drag PRICE on the left to the Number function in the central pane. d. Drag the Number function to the Multiply function in the central pane. e. Drag Quantity on the left to the Multiply function you just added. f. Drag the Multiply function to TOTAL on the right. g. Right-click the Number function and select Apply Function Graph. See Figure 12-74.
9. The next step is to calculate the estimated delivery time. Remember that the products table contains a transport column that identifies the transportation method for each product. You also created a custom function (createDeliveryDateMessage) in 12.9.6, Create a custom function on page 489 and a Lookup table (ShippingTimes) in 12.9.7, Create a lookup table on page 491. You use both artifacts to calculate the delivery date message. The lookup table contains the number of days that each transport method will take and the custom function
Chapter 12. Scenario: Data enrichment and aggregation
513
8004chScenario3.fm
calculates the delivery date based on the current date plus the number of days for the selected transport. From the Functions tab, drag Lookup Tables ShippingTimes to the central pane. 10.From the Functions tab, drag Custom Functions createDeliveryDateMessage to the central pane.
11.Drag TRANSPORT on the left to the ShippingTimes lookup table you just added. 12.On the central pane, drag ShippingTimes to the createDeliveryDateMessage custom function you just added. Click YES on the warning message. 13.Drag the custom function to DELIVERYMSG on the right. 14.Right-click the custom function and select Apply Function Graph. See Figure 12-76.
514
8004chScenario3.fm
Note: You might notice the mapping lines have different colors. For more information on mapping, see 3.9, Maps on page 128. 15.Save your project.
12.10.11 Log the job keys using the Create Job Keys activity
In the initial steps of your orchestration (12.10.1, Create job keys on page 493), you prepared two orchestration job keys that hold the input file name and the total number of orders. Now it is time to log these two job keys using the Create Job Keys activity.
515
8004chScenario3.fm
Follow these steps: 1. From the Activities tab, drag Utilities Create Job Keys to the right of and outside the For Each block. Rename it to Record filename and total orders. See Figure 12-78.
2. In the Checklist pane, select Map Inputs. a. Click the Select Inputs... button. In the Select Inputs window hold the Control key and select both fileNameProcessed and totalOrders. Click OK. b. Drag fileNameProcessed on the left to fileNameProcessed on the right. c. Drag totalOrders on the left to totalOrders on the right.
3. Save your project. Figure 12-80 illustrates the orchestration at this point.
516
8004chScenario3.fm
517
8004chScenario3.fm
4. A Try activity is added that encapsulates and handles errors for the activities shown in Figure 12-82. The Invoke Service is added to the CatchAll branch.
5. A general purpose Catch All activity is added for the activities that are not handled by the Try activity. Refer to Figure 12-83.
518
8004chScenario3.fm
It is a good idea to test the orchestration again in Studio, forcing error situations to check whether the orchestration and the CommonErrorHandler are working together as expected. In this scenario, an error can be forced by changing the input file data to a different format, or by shutting down the FTP server or the database. After you have tested the orchestration in Studio, you can publish and deploy it to a Cast Iron runtime. Deployment is discussed in 3.13, Exporting and publishing on page 170. You can publish the project from Studio directly on the appliance. Alternatively, you can export it as a .par file and upload it from the WMC as described in 4.2.13, Uploading and downloading a project on page 197. After the project is published, go to the WMC, validate the configuration properties, and start the configuration. The orchestration will immediately poll the FTP server and execute against any files that it finds there. Tip: The FTP Poll activity remembers the files that it has already received. There is a property in the activity called Duplicate List Size that has a minimum of 10,000 files. So, it remembers at least 10,000 files based on the name and time stamp that it has already processed. So, to retest the orchestration with the same file, you need to stop and undeploy the orchestration and then restart it. Alternatively, you can change the file content, which updates the time stamp automatically.
519
8004chScenario3.fm
520
8004addm.fm
Appendix A.
Additional material
This book refers to additional material that can be downloaded from the Internet as described in the following sections.
521
8004addm.fm
522
8004bibl.fm
Related publications
The publications listed in this section are considered particularly suitable for a more detailed discussion of the topics covered in this book.
IBM Redbooks
The following IBM Redbooks publications provide additional information about the topic in this document. Note that some publications referenced in this list might be available in softcopy only. Connect Cloud and On-premise Applications Using IBM WebSphere Cast Iron Integration, REDP-4674 You can search for, view, download or order these documents and other Redbooks, Redpapers, Web Docs, draft and additional materials, at the following website: ibm.com/redbooks
Online resources
These websites are also relevant as further information sources: IBM WebSphere Cast Iron Version 6.1 Information Center http://publib.boulder.ibm.com/infocenter/wci/v6r1m0/index.jsp WebSphere Cast Iron Cloud Integration http://www-01.ibm.com/software/integration/cast-iron-cloud-integration/ Cast Iron Express http://express.castiron.com/express/ WebSphere Cast Iron Cloud Integration prerequisites http://www-01.ibm.com/software/integration/cast-iron-cloud-integration/reqs/ IBM Support Portal: http://www-947.ibm.com/support/entry/portal/Overview IBM Fix Central http://www.ibm.com/support/fixcentral WebSphere Cast Iron Cloud integration Fixpacks http://www-933.ibm.com/support/fixcentral/swg/selectFixes?parent=ibm~WebSphere& product=ibm/WebSphere/WebSphere+Cast+Iron+Cloud+integration&release=All&platfor m=All&function=all WebSphere Cast Iron Cloud integration Community page http://community.castiron.com Salesforce Implementation Considerations
523
8004bibl.fm
http://www.salesforce.com/us/developer/docs/api/Content/implementation_consider ations.htm WebSphere Cast Iron Live Security,: http://www-01.ibm.com/common/ssi/cgi-bin/ssialias?infotype=SA&subtype=WH&htmlfi d=WSW14139USEN WebSphere DataPower Service Gateway XG45 http://www-01.ibm.com/software/integration/datapower/XG45/ VMware vSphere vMotion http://www.vmware.com/products/vmotion/overview.html Google Calendar APIs and Tools http://code.google.com/apis/calendar/data/2.0/developers_guide_protocol.html
524
To determine the spine width of a book, you divide the paper PPI into the number of pages in the book. An example is a 250 page book using Plainfield opaque 50# smooth which has a PPI of 526. Divided 250 by 526 which equals a spine width of .4752". In this case, you would use the .5 spine. Now select the Spine width for the book and hide the others: Special>Conditional Text>Show/Hide>SpineSize(-->Hide:)>Set . Move the changed Conditional text settings to all files in your book by opening the book file with the spine.fm still open and File>Import>Formats the
8004spine.fm
525
To determine the spine width of a book, you divide the paper PPI into the number of pages in the book. An example is a 250 page book using Plainfield opaque 50# smooth which has a PPI of 526. Divided 250 by 526 which equals a spine width of .4752". In this case, you would use the .5 spine. Now select the Spine width for the book and hide the others: Special>Conditional Text>Show/Hide>SpineSize(-->Hide:)>Set . Move the changed Conditional text settings to all files in your book by opening the book file with the spine.fm still open and File>Import>Formats the
8004spine.fm
526
Back cover