Sunteți pe pagina 1din 132

Infor ION Technology Connectors

Administration Guide
Release 12.0.x
Copyright © 2017 Infor

Important Notices
The material contained in this publication (including any supplementary information) constitutes and
contains confidential and proprietary information of Infor.
By gaining access to the attached, you acknowledge and agree that the material (including any
modification, translation or adaptation of the material) and all copyright, trade secrets and all other
right, title and interest therein, are the sole property of Infor and that you shall not gain right, title or
interest in the material (including any modification, translation or adaptation of the material) by virtue
of your review thereof other than the non-exclusive right to use the material solely in connection with
and the furtherance of your license and use of software made available to your company from Infor
pursuant to a separate agreement, the terms of which separate agreement shall govern your use of
this material and all supplemental related materials ("Purpose").
In addition, by accessing the enclosed material, you acknowledge and agree that you are required to
maintain such material in strict confidence and that your use of such material is limited to the Purpose
described above. Although Infor has taken due care to ensure that the material included in this publication
is accurate and complete, Infor cannot warrant that the information contained in this publication is
complete, does not contain typographical or other errors, or will meet your specific requirements. As
such, Infor does not assume and hereby disclaims all liability, consequential or otherwise, for any loss
or damage to any person or entity which is caused by or relates to errors or omissions in this publication
(including any supplementary information), whether such errors or omissions result from negligence,
accident or any other cause.
Without limitation, U.S. export control laws and other applicable export and import laws govern your
use of this material and you will neither export or re-export, directly or indirectly, this material nor any
related materials or supplemental information in violation of such laws, or use such materials for any
purpose prohibited by such laws.
Trademark Acknowledgements
The word and design marks set forth herein are trademarks and/or registered trademarks of Infor and/or
related affiliates and subsidiaries. All rights reserved. All other company, product, trade or service
names referenced may be registered trademarks or trademarks of their respective owners.

Publication Information

Release: Infor ION 12.0.x


Publication Date: May 29, 2017
Document code: ion_12.0.x_iontechconopag_on-premise_en-us
Contents

Contents

About this guide..............................................................................................................7


Contacting Infor...........................................................................................................................9

Chapter 1: Introduction................................................................................................11

Chapter 2: File connection points...............................................................................13


Connection properties..............................................................................................................................14
Document properties...............................................................................................................................16
Defining a read file action for reading files..............................................................................................16
Defining a write file action for writing files................................................................................................18
File share locations..................................................................................................................................19
Keywords.................................................................................................................................................20
File name pattern restrictions..................................................................................................................23
File templates..........................................................................................................................................23
Creating a file template from a file connection point............................................................................24
Creating a file template from a file templates list.................................................................................24
File template properties...........................................................................................................................25
Optional fields......................................................................................................................................30
Field Enclosing Character....................................................................................................................31

Chapter 3: Database Connection point.......................................................................33


Connection settings.................................................................................................................................33
Documents...............................................................................................................................................35
Specifying a new action for reading the database...................................................................................36
Specifying a new action for writing the database....................................................................................37
Specifying a new request/reply action.....................................................................................................38
Specifying a new intermediate step action..............................................................................................38
Changing or deleting an action................................................................................................................39
Notes on saving a database connection point.........................................................................................39
Defining statements for database connection points...............................................................................40
Example tables.....................................................................................................................................40
Reading from the database..................................................................................................................40
Writing to the database........................................................................................................................45
Using reply BODs.................................................................................................................................47
Exception handling and consistency of data........................................................................................49
Example statements for database connection points using MySQL....................................................50
Example statements for database connection points using Oracle.....................................................56

Infor ION Technology Connectors Administration Guide | 3


Contents

Example statements for connection points using DB2.........................................................................59


Example statements for connection points using DB2 400..................................................................60
Example statements for connection points using Postgres (PPAS)....................................................70

Chapter 4: Using customer-specific JDBC drivers....................................................75


Creating a single, flattened, jar file..........................................................................................................75
Deploying your own database.................................................................................................................76
Properties................................................................................................................................................77
Example: Deploying MySQL JDBC driver...............................................................................................80
Using your own database in a connection point......................................................................................81

Chapter 5: Message queue connection points...........................................................83


BOD ID....................................................................................................................................................84
Connection properties..............................................................................................................................84
Documents...............................................................................................................................................88
Supporting Native mode of IBM MQ........................................................................................................91
Configuring a message queue connection point as a JMS server..........................................................91
Connection properties..........................................................................................................................91
Documents...........................................................................................................................................92
Additional properties............................................................................................................................93
Registering JMS Vendors with ION.........................................................................................................94
Extracting the bundle wrapper utility....................................................................................................95
Preparing for registration......................................................................................................................96
Deploying the JMS vendor.................................................................................................................100
Defining a connection point for JMS messages....................................................................................100

Chapter 6: Web service connection points..............................................................103


Connecting to a web service.................................................................................................................104
Scenarios...............................................................................................................................................105
Sending data to a web service..............................................................................................................106
Generating metadata for incoming BOD............................................................................................107
Retrieving data from a web service.......................................................................................................110
Generating metadata for BOD document..........................................................................................112
Triggering scenario................................................................................................................................118
Generating metadata for BOD document..........................................................................................119
Enrichment scenario..............................................................................................................................123
Transforming BOD documents..........................................................................................................124
Advanced settings.................................................................................................................................128
Guaranteed delivery..............................................................................................................................129
Advanced scheduling options................................................................................................................129
Specifying the time zone....................................................................................................................130
Managing web service connection points..............................................................................................130

4 | Infor ION Technology Connectors Administration Guide


Contents

Viewing received unprocessed messages for Message queue connection points............................131

Infor ION Technology Connectors Administration Guide | 5


Contents

6 | Infor ION Technology Connectors Administration Guide


About this guide

This guide describes how to configure and manage technology connectors using ION Desk.

Intended audience
The document is intended for users who are responsible for:
• System Administrators
• Business Process Administrators
• Business Analysts
• Database Administrators
• Application Administrators

Related documents
You can find the documents in the product documentation section of the Infor Xtreme Support portal,
as described in "Contacting Infor".
• Infor ION Installation and Configuration Guide
• Infor ION Desk User Guide
• Infor Ming.le Installation Guide for standalone IFS
• Infro Federation Services Administration Guide

Infor ION Technology Connectors Administration Guide | 7


About this guide

8 | About this guide


Contacting Infor

If you have questions about Infor products, go to the Infor Xtreme Support portal.
If we update this document after the product release, we will post the new version on this website. We
recommend that you check this website periodically for updated documentation.
If you have comments about Infor documentation, contact documentation@infor.com.

Infor ION Technology Connectors Administration Guide | 9


Contacting Infor

10 | Infor ION Technology Connectors Administration Guide


Introduction
1

With ION Connect you can establish connections between applications which can either be Infor
applications or third-party applications. Typically, Infor applications use standard BODs (business object
documents), while third-party applications do not.
Each third party application has its own data structure. You will require mapping to transform the data
from the third party application to the data as expected by other connection points.
These are typical examples of using the third party connector. A database is used for illustrating a third
party destination.

Document flow to send order data from the database to the Infor application.

Connectivity options to connect to Infor applications are explained in the ION Desk user guide. This
guide explains the connectivity options to connect to locally deployed third-party applications.

Database connection point


Defines a connection from ION to a third-party application that cannot send or receive BODs, but has
a database available. In this way, you can retrieve data from a database and send it to one or more
Infor applications. Or you can use data from Infor BODs to update your database.

Infor ION Technology Connectors Administration Guide | 11


Introduction

File connection point


Defines a connection from ION to a third-party application that cannot send or receive BODs, but can
create/process files.

Web Service connection point


Defines a connection from ION to a third-party application that cannot send or receive BODs, but has
a web service interface available. In this way, you can retrieve data from a web service and send it to
one or more applications. Or you can use data from BODs to invoke a web service.

Message Queue connection point


ION offers connectivity through message queues. In ION Desk you can create a connection point to
read or write a message queue. ION uses JMS (Java Messaging Standard) queues. This enables you
to send or receive messages to or from ION.
Details about these connection points are explained in this guide. For information about connection
points in general and how to create and use document flows, see the ION Desk User Guide.

12 | Infor ION Technology Connectors Administration Guide


File connection points
2

The file connection point defines a connection from ION to an application that cannot send or receive
BODs, but can create / process files. In this way, data can be retrieved using files that are processed
in ION and then sent to one or more Infor applications. In addition, ION can create files using data from
Infor BODs which can be processed by other applications.
We recommend that you avoid using files that are larger than 5 Mb. ION is able to handle larger files
(depending on the available system resources for ION), but proper operation of all ION functionality
cannot be guaranteed in all circumstances
In a document flow, a file connection point can be used in a similar way as any other type of connection
points. Data from a file is packed as a BOD in the ION Service and can be delivered to any other
connection point or used in an event monitor or workflow activation policy. Data in BODs from any
connection point can be converted to a file. Because all data is packed as BOD messages, document
flows can contain mappings or content-based routing.
Each file has its own structure and format. In order to use file connection point, a file template must be
defined. This template describes what type of files are processed and how the content is mapped to a
BOD.
See "File templates" on page 23.
A file connection point specifies:
• The standard properties for any connection point, such as name and tenant. Note that for file
connection points the logical ID type is fixed ('file'). The logical ID is lid://infor.file. followed
by the connection point name. In the logical ID, the characters from the name are converted to lower
case.
• The protocol and connection settings to access the file system.
• Which documents (BODs) are sent and received and how the file is read or written.
The Connection properties section explains the connection properties in a file connection point.
To create a file connection point, see Infor ION Desk User Guide.
After setting the connection properties, click Test. You will be informed whether the test is successful
and if the connection details are correct.

Infor ION Technology Connectors Administration Guide | 13


File connection points

Connection properties
You can specify connection properties on the Connection tab of a file connection point.
This table shows the transfer protocol independent properties:

Property Description
Transfer Protocol Select one of the supported protocols: Shared Folder, FTP, FTPS
or sFTP.
FTPS - Explicit FTP over TLS
The 'Explicit FTP over TLS mode' is supported by ION. In this vari-
ant, the connection is made using SSL/ TLS extension over the
plain FTP. Normally the default port 21 is used. The Implicit FTP
over TLS mode or the negotiate mode is not supported. This mode
switches to plain FTP in case FTPS connection fails.
The sFTP protocol is a secure FTP protocol or ftp over SSH. This
protocol differs from the FTPS protocol described earlier. Both are
supported.

Host Name Specify the host name of the server that hosts the files.
Port Name Specify the port for FTP, FTPS or sFTP transfer protocols. For FTP
and FTPS, the default port is 21 and for sFTP, the default port is 22.
User Specify the user name to connect to the file system.
Password Specify the password to connect to the file system.

When transfer protocol FTPS is selected, additional properties are displayed. To use this protocol,
complete these tasks:
1 Ask your FTP administrator for the correct server certificate of the file server.
2 Verify the certificate.
3 When you agree on the authenticity of the certificate, click Import and Trust Certificate.
4 A window is displayed. Browse to the location of your certificate and select it.
5 Click Open.
6 The certificate is imported in the ION trust store
This table shows the FTPS specific properties:

Property Description
Import and Trust Certificate Import server public certificate
Enable Passive Mode Clear to Disable Passive Mode and enable Active Mode.
• Passive mode: Port number is received from server.
• Active mode: Random port number is selected by ION from
data port range.

14 | Infor ION Technology Connectors Administration Guide


File connection points

Property Description
Override Default Data Port Range When Active mode is selected, a random port in the range of 1024
for Active Mode – 65535 is automatically chosen.
Select this check box to override the default data port range. You
can choose your own port range for ION to use.
Minimum Port Specify the minimum port number for active mode data port range.
The default value is 1024.
Maximum Port Specify maximum port number for active mode data port range.
The default value is 65535.
Use Client Certificate to Authenti- Select this check box to enable 2-way SSL authentication. The
cate FTPS server is requested to use a client certificate in addition to
user name and password. The server certificate is verified for au-
thenticity by ION.
Client SSL Keystore Password Specify client SSL keystore password.
Import Client Certificate Import client private certificate.

When sFTP is selected, you can authenticate through a password or a private/public key pair. When
the private/public key pair is used for authentication, both FTP client and the FTP server have their
own pairs. Their public keys must be exchanged. In ION there is no key generation feature. To use
this mode of authentication, you must:
1 Ask your security provider for a Private/Public key pair for ION. You can also create a key pair for
ION with a third party key generation tool that supports the OpenSSH format such as Puttygen.
2 Import the Private key of ION’s pair together with its passphrase using Client Private Key
Passphrase and Import the Client Private Key fields.
3 Share the Public key of ION’s pair with the FTP administrator of the file server.
4 Obtain the Public key of FTP server from the FTP administrator and import it into ION from the File
connection point details page.
This table shows the sFTP specific properties:

Property Description
Authentication using public and pri- Select this check box to enable authentication using public and
vate keys private keys.
Import server public key Import server public key in openSSH format, with this structure:
<modeled host name> <public key type> <public key>
An example:
nlbanhoudetan01 ssh-rsa AAAB3NzaC1yc2EAAAA…
Client Private Key Passphrase Specify Client Private Key Passphrase.
Import Client Private key Import client private key in openSSH format.

Infor ION Technology Connectors Administration Guide | 15


File connection points

Document properties
On the Document tab of the File connection point, specify:
• Multiple actions to read or write files.
• Which File Template is used for each action defined
• How incoming documents must be written to files.
• How documents must be produced based on data read from file.

Defining a read file action for reading files


1 Start ION Desk.
2 Click Model > Connect > Connection Points
3 Click New and select File.
4 Click the Documents tab
5 Click Add. A new action is created and listed in the Action List.
6 Select the action entry and specify the action type Read File to read a file and construct a BOD
using the file content.
7 If Create non-existing folder(s) is selected, the specified folders for Read, Error or Archive are
automatically created.
8 In the File Template & BOD Settings section specify the File Template to use when reading files.
a Select from already defined templates or click New to define a new file template. To view the
details of the selected template, click Details.
For details, see "File templates" on page 23.
b After the file template is specified, the BOD Noun that is associated with the specified template
is filled. If the template does not have an associated BOD, an error occurs.
c Select which BOD Verb to use in the read action.
9 In the Read File Settings section specify this information:
Read Location
Specify the read location in the file server from which the files is read. This is defined relevant to
the hostname defined in the connection tab setting. This is a required field.
For guidelines on how to define the correct location, see "File share locations" on page 19.

Error Location
Specify the Error Location on the file server. Files are moved to this location in case an error occurs
during reading or performing the 'After Read' action. This is defined relevant to the hostname on
the connection tab setting. This is a required field.

Note: if a file with the same name already exists in the Error Location, the File Connector renames
the file. A timestamp is added to the file name to avoid overwriting existing files.

16 | Infor ION Technology Connectors Administration Guide


File connection points

For guidelines on how to define the correct location, see "File share locations" on page 19.

File Name Pattern


Specify the file name pattern that represents the name of the file(s) that is read by that action. This
allows the usage of wildcards (? for one character and * for multiple characters). This field is
case-sensitive and required.
We do not recommend that you specify a file name pattern of *.*. This pattern allows the file
connector to retrieve everything from the source folder. Sometimes when the file is read, a thumbprint
file is created by the operating system. Or if you rename a file after the read, the already processed
and renamed file is reprocessed. To avoid such undesirable outcome, you must be cautious when
selecting this pattern.

After Read
Select which after read action to run when the read action is finished successfully. Available options
are:
• Move File: specify the Archive Location in the file server to which the files are moved. This is
defined relevant to the hostname defined in the connection tab setting.
For guidelines on how to define the correct location, see "File share locations" on page 19.
Note: if a file with the same name already exists in the Error Location, the File Connector renames
the file. A timestamp is added to the file name to avoid overwriting existing files.

• Rename File: specify the New File Name Pattern that specifies the new file name. This field
is case-sensitive. This pattern does not allow wildcards (? or *) and other characters.
For more details, see "File name pattern restrictions" on page 23.
This pattern can allow the usage of keywords. Press Ctrl + Space to view the list of possible
keywords. For a complete list of keywords, see "Keywords" on page 20.
• Delete File: processed files are deleted. No extra properties must be configured.

10 In the Schedule section, specify one of these options:


Basic Scheduling
In Basic Scheduling, ION is always polling the folder in the Read location. If there are no more new
files found to be processed on a given polling attempt, the polling daemon goes in sleep mode.
The duration of the sleep mode is specified in milliseconds by the property Daemon Sleep Time
(ms).
Advance Scheduling
Specify an advance scheduling option based on a CRON expression. When a trigger is executed
based on CRON, all matching files at that point in time are processed.
See "Advanced scheduling options".

11 In the Polling Settings section, specify this information:


a Select the Sort By option that is used to retrieve files from the Read Location to start the reading
action. Files are sorted in an ascending order either by Name or Modification Date Time.
b Other polling properties values:
• Number of Error Retries

Infor ION Technology Connectors Administration Guide | 17


File connection points

• Default Minimum Retry Delay


• Default Retry Delay Change Unit
• Default Maximum Retry Delay
• Default Retry Delay Number
For explanation of these properties, see "Advanced properties for polling" in the ION Desk User
Guide.

12 After the configuration for the Read File action is finished, click Test.
A test is run to check if the specified (Read, Error and Archive) locations are valid and accessible.
This also validates if the permissions provided to run the required action are sufficient. A message
is displayed to inform you whether the test is successful or not.

Defining a write file action for writing files


Complete these steps:
1 Start ION Desk.
2 Click Model > Connect > Connection Points
3 Click New. Select File connection point.
4 Click the Documents tab.
5 Click Add. A new action is created and listed in the Action List.
6 Select the action entry and specify the action type Write File to write a file based on the content of
a BOD.
7 If Create non-existing folder(s) is selected, the specified folder for Write is automatically created
if it does not exist in the file server.
8 In the File Template & BOD Settings section specify the File Template to use when writing files.
a Select from already defined templates or click New to define a new file template. To view the
details of the selected template, click Details.
For more details, see "File templates" on page 23
b After the file template is specified, the BOD Noun that is associated with the specified template
is filled. If the template does not have an associated BOD, an error message occurs.
c Select which BOD Verb to use in the write action.
9 In the Write File Settings section specify this information:
Write Location
Specify the write location on the file server in which the files are written. This is relevant to the
hostname defined in the connection tab setting. This is a required field.
Note: From ION version 12.0 you can also use keyword(s) to define write location, details see
"Keywords" on page 20. For guidelines on how to define the correct location, see "File share
locations" on page 19.

18 | Infor ION Technology Connectors Administration Guide


File connection points

File Name Pattern


Specify the file name pattern that represents the name of the file(s) that is written by that action.
This field is case-sensitive. This does not allow the usage of wildcards (* or ?) and other characters.
For more details, see "File name pattern restrictions" on page 23
This pattern allows the reference to fields defined within the file template used in the action
(configured in the next step) and the usage of some keywords.
For a complete list of keywords, see "Keywords" on page 20.

Before Write action - Overwrite


Select which action to run before writing a file. These options are available:
• Overwrite: If selected: the created file will replace any existing file that was created in the Write
Location with the same name.
• Append: If selected and a file with the same name already existed in the Write Location, the
content is written at the end of the existing file content. Note that for files of type "XML", there
is only one root level element allowed per file. Therefore using the Append action for files of
type 'XML' or Full BOD results in an invalid XML. In such situations you receive a warning to
use the Overwrite option.
• Error if File Exists: If selected, the write action fails to create the file in case a file with the same
name already existed in the Write Location. An error occurs and a Confirm BOD is generated.

10 In the Polling Settings section, specify this information:


a Select the Sort By option that is used to retrieve files from the Read Location to start the reading
action. Files are sorted in an ascending order either by Name or Modification Date Time.
11 After the configuration for the Write File action is finished, click Test.
A test is done to check if the specified Write Location is accessible using the specified connection
configuration. This also validates if the credentials that are provided have the required privileges.
A message is displayed to inform you whether the test is successful or not.

File share locations


When configuring file connection point actions, specific folder locations must be defined for 'Read
Location', 'Error Location', 'Archive Location' and 'Write Location'. For any of these locations, follow
these guidelines:
• You can use either / or \ when specifying the location folder path.
• No need to put / at the beginning of the path
• Valid example: share/ReadFolder
• Invalid example: c:/share/ReadFolder
Note: When configuring file connection point, the locations can be verified when testing the actions in
order to check their correctness and accessibility. In activating file connection point, these locations
are not validated.

Infor ION Technology Connectors Administration Guide | 19


File connection points

Keywords
As mentioned in the File Connection Configuration, there are keywords that can be used where the
File Connector creates new files:
• Read File: If the Rename option is selected, the new name of the file (New File Name Pattern) can
be specified using keywords.
• Write File: The name created by the action (File Name Pattern) can be specified using keywords
and to specify the write location.
The available keywords and in which action configuration they can be used are listed in the this table:

Keyword Description Action : Configuration


original_filename Name of the file that is read by the Read File Read: New File Name Pattern
action type without the file extension. Write: File Name Pattern
For Write File action type, this keyword is re-
placed by the value specified in the "File Name"
attribute (if available) that is specified in the ref-
erenced File Template.
original_extenstion Extension of the file that is read by the Read File Read: New File Name Pattern
action type. Write: File Name Pattern
For Write File action type, this keyword will be
replaced by the value specified in the "File Exten-
sion" attribute (if available) that's specified in the
referenced File Template
document_id Document ID of the BOD associated with the File Read: New File Name Pattern
Template used in the read or write file action Write: File Name Pattern
type.
Ensure that document_id is a mandatory field in
the corresponding file template. Clear the Option-
al flag.
current_datetime Current UTC date time represented as "yyyy-MM- Read: New File Name Pattern
dd_HH-mm-ss-SSSS". Where: Write: File Name Pattern
• y: year
• M: Month in year
• d: Day in month
• H: Hour in day (0-23)
• m: Minute in hour
• s: Second in minute
• S: Millisecond

current_date Current UTC date represented as "yyyy-MM-dd". Read: New File Name Pattern
Where: Write: File Name Pattern
• y: year

20 | Infor ION Technology Connectors Administration Guide


File connection points

Keyword Description Action : Configuration


• M: Month in year
• d: Day in month

tenant_id The TenantId populated in Message Header Read: Not applicable


which can be used to decide the write location Write: Write Location and File
Name Pattern
accounting_entity The AccountingEntity populated in Message Read: Not applicable
Header Write: Write Location and File
Name Pattern
location_id The Location populated in Message Header Read: Not applicable
Write: Write Location and File
Name Pattern
noun_name The BODType populated in Message Header Read: Not applicable
Write: Write Location and File
Name Pattern
variation_id The VariationId populated in Message Header Read: Not applicable
Write: File Name Pattern
<fieldname> Any field name defined in the File Template used Read: New File Name Pattern
in the read or write file action type. Write: File Name Pattern
Ensure that the field is mandatory in the corre-
sponding file template. Clear the Optional flag.

Press Ctrl + Space to view the list of possible keywords. When a keyword is selected, it is displayed
between square brackets. For example, to rename a file using the keyword, the New File Name Pattern
can be set to: [original_filename][document_id][current_datetime].copy.
The list of keywords listed for use in:
• Read File action
• New File Name Pattern configuration

• Write File action


• File Name Pattern configuration

is affected by the File Template configuration selected. Details of the different cases are listed in this
table:

original_ original_ document_ current_ current_


Keywords filename extenstion id datetime date <fieldname>
No File Template Read File action Read & Write File actions N/A
Selected in Connec-

Infor ION Technology Connectors Administration Guide | 21


File connection points

original_ original_ document_ current_ current_


Keywords filename extenstion id datetime date <fieldname>
tion Point
Read/Write action
Text Template Se- Read File action Read & Write File actions Read & Write File ac-
lected - Use At- tions
tributes for File
Name not selected
Text Template Se- Read & Write File ac- Read & Write File actions Read & Write File ac-
lected - Use At- tions tions
tributes for File
Name is selected
Binary Template Read File action Read & Write File actions Only Document ID data
Selected - Use At- field is applicable for
tributes for File Read & Write File ac-
Name not selected tions
Binary Template Read & Write File ac- Read & Write File actions
Selected - Use At- tions
tributes for File
Name is selected

Note: The behavior of the File Connector when handling keywords in file name pattern (when writing
or renaming files) is:
1 If one of the data fields keywords used in the file name pattern is no longer valid (for example, it no
longer exists in the selected template), then the keyword is literally used in the file name.
2 If the element/attribute - referenced by a keyword - does not exist in the incoming document, then
the keyword is literally used in the file name.
3 If the element/attribute - referenced by a keyword - exists in the incoming document but is blank, a
blank string is the value used to replace the keyword.
4 If the element/attribute - referenced by a keyword - exists in the incoming document and has value,
this value is the one used to replace the keyword.
Likewise the behavior of the File Connector when handling keywords in file write location is:
1 Values of all keywords defined in the write location come from the OUTBOX Message Header table
and will be substituted in place. If the resulting write location does not match an existing folder a
confirm BOD will be generated unless the option ‘Create non-existing folder(s)’ is set to true.
2 If any keywords referenced in the write location is not populated with value in Message Header,
regardless the option ‘Create non-existing folder(s)’, a Confirm BOD is generated and the write
action fails.

22 | Infor ION Technology Connectors Administration Guide


File connection points

File name pattern restrictions


When ION is creating files - in write actions or when renaming files in after read action), the file name
pattern must be specified. These are the restrictions:
• Illegal Characters: / ? < > \ : * | " ^ & null ; #
• Illegal Conventions: Placing a space at the end of the name or placing a period at the beginning or
the end of the name.
In case any of the characters exist in the file name pattern (whether from the values set by the user or
coming from standard or fields keywords), the File Connector replaces these characters with % followed
by the character ASCII Code before creating the file.
Other file system restrictions are currently not checked by the File Connector; such as the maximum
File Name length allowed and the reserved keywords. In case an error occurs while creating the file
due to any of these errors:
• For the Write Action: the write operation fails and a confirm BOD is created.
• For the After Read Action: the rename operation fails and the file is moved to the Error Location.

File templates
The file template represents the specification of the files that can be read or written by ION using the
file connection point.
ION supports two types of files; text and binary.
For text files the file template specifies the type of formatting (delimited, fixed-length, delimited &
fixed-length, XML or Full BOD) and the configuration properties required for each format type.
Templates of type 'Full BOD' or 'XML' both transport an XML document. In case of Full BOD, the noun
must already be available in the ION registry. The BOD XML supplied to ION must comply with the
Infor message semantics such as its root element must be of type <VerbNoun> and must include
ApplicationArea and DataArea sections. Such files are transported without any additional process.
For XML templates, you must specify a name for the custom noun and provide a sample file. Based
on this a custom noun schema is generated where you can define the document ID. During file transfer,
a custom BOD is generated and the supplied XML data is placed inside the noun section of the Data
Area.
For binary files the file template specifies the settings for "Raw Data" format type. Binary file type is
used for reading files and preserving its content without change using "Base-64 Encoding". When a
file is read, its content is encoded and then mapped to a "Raw Data" element of a custom BOD. A
document id is generated. When writing binary files, the content of the "Raw Data" element of the
incoming BOD is expected to be already encoded (using Base-64 encoding). The content is decoded
first and then written to the file.
Once the configuration of a file template is completed, a BOD is generated and linked to that file
template. This BOD represents the schema to use for reading and writing the file content.

Infor ION Technology Connectors Administration Guide | 23


File connection points

When reading files, each field of an input line is transformed into the corresponding element in the
specified BOD. Records read in files can be treated differently based on the Generated BOD option
in the file template configuration setting. For example:
• Generated BOD - Single: Each noun in the input BOD data schema is transformed into a line of
output text in the same file. A BOD instance with repeated elements is written as a single file with
multiple lines. For Binary files, this is the default setting. A BOD instance with repeated elements is
written as a single file. Content of every element is decoded (using base64encoding) and
concatenated before it is written to the file.
• Generated BOD - Multiple: Each noun in the input BOD data schema is transformed into a line of
output text in a separate file. A BOD instance with repeated elements is written as multiple files and
each file contains just one line..
You can create a new file template from a:
• File connection point
• File templates list

Creating a file template from a file connection point


To create a file template from a file connection point:
1 Select Model > Connect > Connection points.
A list of existing connection points is displayed.
2 Open a file connection point or create a new one.
The File Connection Point details page is displayed.
3 Set the properties for the new connection point.
4 On the Document tab, create the required read and write actions.
5 In the File Template & BOD Settings section, click New for each created action.
The File Template details page is displayed.
6 Set the properties of the new file template (explained later).
7 Click Generate BOD to generate a BOD based on the template configuration.
8 Save the file template and click Back to return to the connection point details.

Creating a file template from a file templates list


To create a file template from a file templates list:
1 Select Model > Connect > File Templates.
A list of existing file templates is displayed.
2 Click New.
The File Template details page is displayed.

24 | Infor ION Technology Connectors Administration Guide


File connection points

3 Set the properties for the new file template (explained later).
4 Click Generate BOD to generate a BOD based on the template configuration (explained later).
5 Save the file template and click Back to return to the connection point details.
The file template is ready for use in file connection points.

File template properties


When configuring the file template, the properties shown in this table must be defined:

File
Type Format Type Property Description
All All Types Name Name to appear as the label for the File template config-
Types uration. This is a mandatory field and must be unique
across all templates defined.
All All Types Description Short description of the template configuration.
Types
All All Types File Type Specify type of content in the file. Supported file types:
Types Text & Binary.
All All - except Full Use Attributes This determines whether to store the original file name
Types BOD for File Name and extension in the created documents when reading
files or not. This option is not selected by default. If select-
ed, then two properties are enabled to specify the name
of the attributes that carry the file name and file extension.
These 2 properties are File Name Attribute and File
Extension Attribute.
All All - except Full File Name At- This property is available if Use Attributes for File Name
Types BOD tribute is selected. This specifies the name of the attributes that
are added to the noun tag of the created BOD when
reading files. It holds the file name of the file read. The
name specified in this field must match the rules of XML
attributes. The File Name Attribute and File Extension
Attribute properties must be different - otherwise BOD
generation fails.
All All - except Full File Extension This property is available if Use Attributes for File Name
Types BOD Attribute is selected. This specifies the name of the attributes that
are added to the noun tag of the created BOD when
reading files. It holds the file extension of the file read.
The name specified in this field must match the rules of
XML attributes. The File Name Attribute and File Exten-
sion Attribute properties must be different - otherwise
BOD generation fails.

Infor ION Technology Connectors Administration Guide | 25


File connection points

File
Type Format Type Property Description
All All - except Full File Path At- This property is available if Use File Attributes is
Types BOD tribute switched on. It carries the value of folder path as defined
in Read Locaton. It is added to the noun tag as attribute
of the created BOD when reading files.
Text On- All Types File Encoding The character encoding for the text file content. Supported
ly encoding are UTF-8 and ISO8859-1.
All All Types Format Type The type of formatting for the file content. Text files can
Types be one of these types; Delimited, Fixed-Length, Fixed-
Length & Delimited, Full BOD or XML.
Binary files are of type Raw Data.
Text On- Delimited / Field Separator This specifies a separator character between fields when
ly Fixed-Length & Delimited or Fixed-Length & Delimited is specified in the
Delimited Format Type property. When rendering text, each element
in the input BOD data schema is separated by the Field
Separator in the output text string. When parsing text,
each field becomes an element in the output BOD data
schema. Only one character can be specified or \t (tab).
Text On- Delimited / Line Separator This specifies the character(s) that determine the end of
ly Fixed-Length / each line. When parsing text, each line is treated as a
Fixed-Length & new record in the output BOD data schema. When render-
Delimited ing text, each data record is separated by the line separa-
tor character in the output text string.
Supported escaped characters: \t (tab), \r (Carriage
Return) and \n (Line Feed) or a combination of these.
Limitation: Currently you cannot generate a BOD for files
that use literal \r(slash followed by r) as a line separator.
Text On- Delimited Field Enclosing This specifies the characters used to enclose a field. Each
ly Character field can have a start enclosing character and an end
enclosing character. The start and end character can be
the same or different. When parsing the field, all data
within properly enclosed characters is treated as valid
content. The enclosing characters are not considered part
of the data. See Enclosing Character.
Text On- Fixed-Length / Fill Character This is the type of character that is used to fill the blank
ly Fixed-Length & space in a field and between fields. Only one character
Delimited can be specified \t.
All Delimited / Data Fields This specifies the data schema for the input or output text.
Types Fixed-Length / All data fields defined are on the same level; hierarchy
Fixed-Length & structure is not supported. For each data field, a name
must be defined. For fixed-Length formats, the field length

26 | Infor ION Technology Connectors Administration Guide


File connection points

File
Type Format Type Property Description
Delimited / Raw (characters) must be specified. The field sequence is
Data displayed; to change the order of the fields, use the up
and down arrows. Field names must be unique.
Each data field has an Optional flag. Selecting this flag
makes the field optional. All cleared fields are treated as
mandatory.
See "Optional Fields" on page 30.
For Raw Data, there are only two data fields defined; one
for Document ID and the other for the Raw Data content.
You can set the labels for these two fields, but cannot
delete these fields or add more fields. Field names must
be unique.
Text On- Delimited Optional Value The value which can be substituted to indicate a field is
ly Indication optional. Only one indicator is allowed per file. Any field
that is not present in a row must be represented by this
value.
These values are allowed for the Optional value indicator:
• Value can be left blank. In this case an empty value is
assumed.
• A NULL character (*\0*).
• Any string of Alpha numeric characters with no spaces.
It is a data type independent value. It must be treated
by the applications as a special token indicating option-
al of any field regardless of its data type.
Note that, the onus is still on the application to represent
the optional field with the appropriate indicator and its
delimiter.
The following is the behavior when a field is marked as
optional and when the optional value indicator is left
empty:
• When the first field in a row is optional, A line separator
is expected, or beginning of the file, immediately fol-
lowed by a field separator.
• When an intermediate field is optional, that field is ex-
pected to be flanked by two field separators on either
sides.
• When the last field is optional, a field separator is ex-
pected followed by the line separator, or the end of
file.

Infor ION Technology Connectors Administration Guide | 27


File connection points

File
Type Format Type Property Description
In all cases an appropriate delimiter corresponding to that
field position is expected. A record with less number of
delimiters than the defined number of fields is treated as
an invalid file.
The optional value indicator cannot be the same value as
a field separator or the line separator.
Text On- XML Sample XML Click Browse to select a sample XML file. This XML is
ly used to detect the XML schema to render or parse. The
content of the sample XML file is displayed in the Sample
XML Contents property.
Text On- Full BOD Document Select one of the available BODs in ION Registry. Any
ly BOD can be selected; standard or custom.
All All - except Full BOD Noun This specifies the noun of the BOD that is generated -
Types BOD based on the file template configuration specified. The
BOD noun cannot be similar to one of the existing ION
standard BODs. In addition, if the BOD Noun specified
matches an existing Custom BOD, a warning message
is displayed and the user can choose to overwrite the
existing BOD.
Text On- Delimited / Generated This specifies how records in text are used to create BOD
ly Fixed-Length / BOD instances or how BOD data area is written to text:
Fixed-Length &
• (Read) Generated BOD - Single: All lines in a file are
Delimited
treated as one record that is mapped to one BOD. A
file with multiple lines result in one BOD instance with
repeating noun for each line.
• (Read) Generated BOD - Multiple: Each line in a file
is treated as a record that is mapped to one BOD, a
file with multiple lines results in multiple BOD instances
created.
• (Write) Generated BOD - Single: Each noun in the input
BOD data schema is transformed into a line of output
text in the same file. A BOD instance with repeated
elements is written as a single file with multiple lines.
• (Write) Generated BOD - Multiple: Each noun in the
input BOD data schema is transformed into a line of
output text in a separate file. A BOD instance with re-
peated elements is written as multiple files and each
file contains just one line. For Raw Data files, the de-
fault settings for "Generated BOD" is "Single" for both
reading and writing binary files.

28 | Infor ION Technology Connectors Administration Guide


File connection points

File
Type Format Type Property Description
Text On- XML Include XML XML Header specifies the version number. and optionally
ly header while the character encodings, as part of a grammar document's
writing files XML declaration on the first line of the document. If
present, this header must appear on the first line of all
XML documents. Selecting this property allows ION to
automatically add the XML header to XML files while
writing. Note:
1 The "version" attribute is added with value '1.0'.
2 The "encoding" type attribute is added with the value
as specified in the file format template for "File Encod-
ing". This is either "utf-8" or "ISO8859-1".
3 The "standalone" attribute is added with the value
"yes".
For example, if the property Include XML header
While writing files is selected and if the 'File Encoding'
is specified as 'UTF-8', then for every XML file that ION
writes it adds a header in this format: <?xml ver-
sion="1.0" encoding="UTF-8" standalone=
"yes"?>

This setting is only applicable when ION is writing a XML


file to a destination. When ION is reading a XML file, it
automatically removes the XML header line if encoun-
tered. This is necessary because during the 'read file'
operation, the XML file is embedded into the Noun section
of the data area of the BOD. Because retaining the XML
header inside a section of another XML makes the result-
ing BOD as an invalid XML.

Once the configuration of a format template is completed and saved, click Generate BOD to start the
BOD generation steps.
BOD generation is applicable for Delimited, Fixed-Length, Fixed-Length & Delimited and XML and Raw
Data Format types. For Full BOD, there is no need to generate a BOD since it already exists in the
registry.
• In case all configurations are valid, a window is displayed to browse and select a sample file which
content matches the file template configuration defined. This is used to validate the configuration
defined against the provided sample content. This is applicable for Delimited, Fixed-Length and
Fixed-Length & Delimited format types.
• Once it is validated, another window is displayed; listing the BOD schema elements and the option
to change the data type of the elements . A Document ID element must be specified in order to
complete the BOD generation steps. For Raw Data files, the Document ID is already selected. If
Use Data Fields for File Name is selected, the attributes for File Name and File Extension are

Infor ION Technology Connectors Administration Guide | 29


File connection points

listed as well. When you click OK, information is displayed about the structure of the generated
BODs.
After these steps are completed, a BOD is generated (noun and verbs schema) and stored in ION
Registry as a custom BOD and linked to the file template. This BOD represents the schema to use for
rendering and parsing text content.
Custom BODs generated from File Format Templates can be managed through Custom Documents
on the Registry menu in ION Desk.
In case of Delimited, Fixed-Length, Fixed-Length & Delimited type of files, the contents of the noun in
the DataArea section must match the file format template defined. Otherwise a confirm BOD is
generated.

Optional fields
In case of Delimited, Fixed-Length, Fixed-Length & Delimited type of files, you can make a field optional
by selecting the Optional flag. All fields without this optional flag are treated as mandatory.
An application that produces a delimited file and wants to omit an optional field must still mark the field
separator for the omitted field. It can be substituted with the optional value indicator if applicable. In
case of fixed length/ fixed length & delimited files, the omitted field's position must be filled with correct
number of fill characters.
An application that consumes the file data must treat an optional field as omitted from the source if it
encounters the optional value indicator, in case of delimited files.
In case of fixed length/ fixed length & delimited files fill characters must be filled in the field's position.
When reading from a file, these conditions on each field are checked:
• Is the field marked as optional in the file template.
• Does this field's position in the file data contain the optional value indicator.
When both conditions are true, the field is treated as blank. No further validation is performed to check
if the optional value matches with its data type. While generating a custom BOD from the file data, this
field is ignored and the XML element corresponding to the field is not included. The file is processed
fully and will not be moved to the error folder.
When writing to a file, these conditions on each field are checked:
• Is the field marked as optional in the file template.
• Is this XML element corresponding to the field absent in the incoming BOD
When both conditions are true, the field is treated as blank. While writing this BOD data to a file, it will
fill the field's position with the optional value indicator. No data type validation is performed. The BOD
is processed fully and no confirm BOD is raised.

30 | Infor ION Technology Connectors Administration Guide


File connection points

Field Enclosing Character


A common scenario in ‘Delimited’ text files is that, the character that is used as a field or line separator
is sometimes required to be part of the data. For example, a comma is frequently used as a field
separator. But a comma is also often part of the data in a given field.
The field enclosing characters provide a mechanism to escape such characters which otherwise have
a special meaning. The enclosing character field is defined by specifying a start character at the
beginning and an end character at the end of the field. Both the start and the end enclosing character
can be the same such as a double quote in this example: "field with , in data". Or they can
be different such as the curly brackets in this example: {field with , in data}. You can also
define a set of characters defining a pattern for start and end enclosing characters such as /* and */ in
this example: /* field with, in data*/. Enclosing characters can in turn be part of the data if
they are escaped dually. In this example a double quote is used both as an enclosing character and
as part of the data: "field with "" in data". The double quote that is specified twice in succession
is considered as part of the data. The resulting data after parsing is field with " in data.
Because of this Dual escaping, the start or end enclosing character cannot be defined using repeating
characters. For example; you cannot choose a pattern such as ## or $$ as a start or end field enclosing
character.
You can choose from a set of predefined start and end character. To define your own pattern of start
and end characters, choose ‘Others’.
Presence of a start and end characters in a field is optional. You can use the enclosing characters to
enclose all fields or only those fields that you require. Line Separator, Field Separator, Optional Value
Indicators and the Field enclosing characters must be unique. They cannot be the same as any of the
other four entities.

Infor ION Technology Connectors Administration Guide | 31


File connection points

32 | Infor ION Technology Connectors Administration Guide


Database Connection point
3

With the Database Connector you can connect applications that cannot send or receive BODs, but
have a database available. In this way, you can retrieve data from a database and send it to one or
more Infor applications. Or you can use data from Infor BODs to update your database.
In a document flow, the use of database connection points is comparable to the use of any type of
connection points. Data from a database is packed as a BOD and delivered to any other connection
points. Data in BODs from any connection point can be delivered to a database. Because all data is
packed as BOD messages, you can extend your document flow using mappings or content-based
routing, for example.
The definitions of a database connection point:
• The standard properties for any connection point, such as name and tenant. For database connection
points the logical ID type is fixed ('database'). The logical Id is lid://infor.database followed
by the converted name.
• How to connect to the database.
• Which documents are sent and received and how the data must be read from or written to the
database for these documents.

Connection settings
On the Settings tab of a database connection point, specify these properties:

Property Description
Database driv- Select one of the supported database drivers. See the table with the Supported
er: database drivers shown after this table.
Database Select how to specify the address of the database:
• Basic - specify properties for the database. The properties to be specified depend
on the selected Database Type. The URL to connect to the database is built auto-
matically.
• Advanced - specify the URL to connect to the database. Use this if you must use
advanced settings that are not shown when selecting Basic.

Infor ION Technology Connectors Administration Guide | 33


Database Connection point

Property Description
Host Name Specify the host name of the server that hosts the database. This field is only enabled
if Basic is selected.
Port Number Specify the number of the port that must be used to connect to the database. This
field is only enabled if Basic is selected.
Schema Name Specify the name of the database schema to be used. This field is only enabled if
Basic is selected and the Database Type is SQL Server, MySQL or DB2.
SID Specify the name of the Oracle schema ID to be used. This field is only enabled if
Basic is selected and the Database Type is Oracle.
URL: Specify the URL of the database that contains the In-box and Outbox tables. The
URL is dependent of the database type. See the Supported Database table for details.
If you selected the Basic configuration for the database address, the URL is read-
only.
User Name: Specify the user name to connect to the database. Note: When using SQL Server
with Windows authentication, specify a valid Windows domain username instead of
a SQL Server user name.
Password: Specify the password to connect to the database.

This table lists supported database types and the URL formats:

Supported
Database
drivers URL format
SQL Server Select this option to connect to a Microsoft SQL server database using the jTDS
(jTDS) driver. Until ION 11.1.10 this label was called as "SQL Server".
When using SQL Server authentication on a default instance: jdbc:jtds:
sqlserver://hostname:port/schemaname
When using Windows authentication: jdbc:jtds:sqlserver://hostname:port
/schemaname;domain=WindowsDomain
When using a named instance there are two formats; the first format is more consistent
with the URL format of the default SQL instance:
• jdbc:jtds:sqlserver://hostname/schemaname;instance=NamedIn-
stance
• jdbc:jtds:sqlserver://hostname;instance=NamedInstance;database
Name=schemaname

SQL Server This option is introduced in ION 11.1.10. Select this option to connect to a Microsoft
(Microsoft) SQL server database using the Microsoft JDBC Driver 4.0 driver. We recommend
that you use this option while connecting to a Microsoft SQL Server setup in a cluster
mode.
The URL is specified in this format:

34 | Infor ION Technology Connectors Administration Guide


Database Connection point

Supported
Database
drivers URL format
jdbc:sqlserver://hostname\instanceName:port ;property=value;
property=value
For example, when using SQL Server authentication on a default instance with the
MultiSubnetFailover property of a cluster setup:
jdbc:sqlserver://hostname:1433;databaseName=schemaName;Multi
SubnetFailover=true
For a complete connection URL specification of this driver, see the Microsoft docu-
mentation at:
https://msdn.microsoft.com/en-us/library/ms378428(v=sql.110).aspx
My SQL jdbc:mysql://hostname:port/schemaname
Oracle jdbc:oracle:thin:@//hostname:port/oracle_sid
DB2 jdbc:db2://hostname:port/schemaname
DB2/400 jdbc:as400://hostname;naming=system;libraries=schemaname;prompt=
false
Postgres jdbc:postgresql://hostname:port/schemaname?stringtype=unspeci-
(PPAS) fied
For a complete connection URL specification of this driver, see the Postgres docu-
mentation at:
https://jdbc.postgresql.org/documentation/93/connect.html
To use this driver in ION, the parameter “?stringtype=unspecified” is required.

After setting the properties, click Test. You are informed whether the test is successful and if the
connection details are correct.

Documents
On the Documents tab of the database connection point, you can specify:
• How incoming documents must be handled.
• How documents must be produced based on data from the database.
• Multiple actions to read or write the database.
This table lists the supported scenarios in a database connection point:

Infor ION Technology Connectors Administration Guide | 35


Database Connection point

Scenario Description
Read data from the database that is based on a schedule and publish a document
containing the data.

Write database scenario. Receiving a document and based on that write the database.

Request/reply scenario. When handling a Process BOD, an Acknowledge BOD must


be sent in reply. This scenario is proven to work only with Microsoft SQL Server
database.

Using the database as an intermediate step in a flow. A document is used to trigger


a stored procedure, and a new document is published using the resulting data. This
scenario is used in multiple situations, such as:
• A document containing customer data is coming in. Based on this document you
can read the open orders for the customer, and send these orders to a next step
in the flow.
• A document containing employee data is coming in, but the data is not complete
yet because the salary information is stored in a separate database. The employee
data is sent to the stored procedure of the database connection point. The stored
procedure retrieves the employee ID from the document, reads the employee's
salary from the database and adds the value to the document. The document is
passed on to the next step in the flow.
This scenario is proven to work only with Microsoft SQL Server database.

Specifying a new action for reading the database


1 On the Documents tab, click Add.
2 Select the scenario Read Database.
3 Specify the statement to read the data.
You can use stored procedures. The statement must provide an XML result set. The result set must
either contain:
• Single BOD DataArea (if a single BOD must be published).
• Multiple BOD DataAreas (if multiple BODs must be published).
Note that each DataArea must contain a single document instance. For example, when using SQL
Server the statement can contain: EXEC GetItems;
See "Custom Nouns" in the Infor ION Desk User Guide.
4 Click Test if the specified connection details are correct.

36 | Infor ION Technology Connectors Administration Guide


Database Connection point

5 If the document is already specified in ION Registry, select the Document.


6 If the resulting document is not specified in theION registry, click Generate to generate the document
metadata into the registry.
A message is displayed with the result. You can adapt data types before the data is generated in
the registry.
7 Select one of the elements as the ID and click OK to generate the metadata.
Note that if a custom document exists with the same name, the existing definition is overwritten.
Note: the generation invokes the statement (comparable to the Test action), to retrieve data. The
metadata in the registry is generated based on the resulting data. Verify that the statement returns
a complete and representative data set when using the Generate action.
For example, if your test data only contains numeric values for a particular element, this element is
specified as an Integer data type. You can change the data type to String if string values can occur
for the same element. If the test data is incomplete or you must adapt the metadata, you can edit
the generated metadata in the registry. See the Infor ION Technical Reference Guide (U9829US).

8 Select the Verb to be used.


Note: if you select the verb Process your database connection point can receive an Acknowledge
reply. If this reply must be handled, add a new action Write Database to handle the Acknowledge
for the same document. This is optional; if your database connection point does not handle the
Acknowledge then it is ignored (deleted) in the ION Service

9 Specify the schedule. This time interval determines how often the statement is invoked to retrieve
documents from the database.
You can either specify a basic schedule where the trigger is every 'x' seconds/ minutes/ hours/ days.
Or specify an advance schedule based on a CRON expression.

Specifying a new action for writing the database


1 On the Documents tab, click Add.
2 Select the scenario Write Database.
3 Define the statement used to handle the data from the incoming document. You can use a stored
procedure.
4 In the statement, specify the [Data] placeholder to refer to the incoming data.
The incoming XML is a single DataArea which can contain one or more document instances. For
example, when using SQL Server the statement can contain: EXEC StoreItems '[Data]';
5 Click Test to test if the statement details specified are correct.
6 Specify a BOD XML in the dialog box that is displayed.
7 Click OK to run the test.
You are informed if errors occur. If the test has finished successfully, check the database whether
the data is stored as expected.
8 Select the document. If the document is not defined in ION Registry, add the required metadata.

Infor ION Technology Connectors Administration Guide | 37


Database Connection point

9 Select the Verb to be used.

Specifying a new request/reply action


Specifying a new action for handling a Process BOD and sending an Acknowledge BOD in reply.
1 On the Documents tab, click Add.
2 Select the scenario Request / Reply.
3 Define the statement used to handle the data from the incoming document. Use a stored procedure.
In the statement specify the [Data] placeholder to refer to the incoming data.
The incoming XML is a single DataArea which can contain one or more document instances. For
example, when using SQL Server the statement can contain: EXEC ProcessItem '[Data]';
The statement must provide an XML result set, containing the DataArea for the Acknowledge BOD
to be published in reply.
4 Click Test to test if the statement details specified are correct.
5 Specify a Process BOD XML in the dialog box that is displayed.
6 Click OK to run the test.
You are informed if errors occur. If the test has finished successfully, check the database whether
the data is stored as expected.
7 Select the document. If the document is not defined in the ION Registry, add the required metadata.
See "Custom Nouns" in the Infor ION Desk User Guide.

Specifying a new intermediate step action


Specifying a new action for writing the database.
Complete these steps:
1 On the Documents tab, click Add.
2 Select the scenario Intermediate step.
3 Define the statement used to handle the data from the incoming document. Use a stored procedure.
In the statement, specify the [Data] placeholder to refer to the incoming data. This is replaced by
the DataArea from the incoming document. For example, when using SQL Server the statement
can contain: EXEC ProcessItem '[Data]';
The statement must provide an XML result set, containing the DataArea for the document to be
sent.
For details, see "Specifying Statements for Database Connection Points" in the Infor ION Technical
Reference Guide (U9829US).
4 Click Test to test if the statement details specified are correct.

38 | Infor ION Technology Connectors Administration Guide


Database Connection point

5 Specify a BOD XML in the dialog box that is displayed.


6 Click OK to run the test.
You are informed if errors occur. If the test has finished successfully, the resulting BOD is displayed.
You can check the database whether the data is handled as expected.
7 Select the document to be received. If the document is not defined in the ION Registry, add the
required metadata.
The verb is automatically chosen as 'Sync' and cannot be changed.
8 Select the document to be sent. If the document is not defined in the ION Registry, you can generate
the definition.
9 Click Generate to generate the document metadata into the registry.
A message is shown with the result. You can adapt data types before the data is generated in the
registry. Select one of the elements as the ID and click OK to generate the metadata.
Note that if a custom document exists with the same name, the existing definition is overwritten.
Note: When using this scenario, the modeling in the document flow is different than usual:
• In the database activity properties, you must select the Send Document based on Incoming
Document check box
• Select the procedure to be used.
• The activity can only have one document type as input. The output document of the activity is
selected automatically.
The active connection point differs. Select Connect > Manage > Active Connection Points.
• A specific connection point is used, using the original logical id with an additional postfix.

Changing or deleting an action


To view or change an action in a database connection point, select the action on the Documents tab.
To remove an action, select the action in the table and click Remove.

Notes on saving a database connection point


Saving a, new or changed, database connection point does not influence the ION Service. Activating
a document flow, that includes the database connection point, automatically activates the connection
point. Specifically, for the required documents to be read from the database, the specified statement
is run based on the selected schedule. For documents to be sent to the database, the specified statement
is run when a document arrives.
Click Back to return to the previous page, when the database connection point is complete.

Infor ION Technology Connectors Administration Guide | 39


Database Connection point

Defining statements for database connection points


To define statements to read or write a database through a database connection point is explained
with several examples. The sample SQL statements that are provided are MS SQL Server-specific.
For similar examples of stored procedures in other supported types of database connection points,
see the appropriate sub sections.
Note: These examples show how you can use statements in ION Connect. The examples must not
be regarded as the only or the preferred approach and they might not fit each actual business case.
While reading from a database, the result set of the SQL query or the stored procedure must be returned
as type VARCHAR or CLOB. No other types are supported.

Example tables
The examples are based on a database that contains order data. This sample database contains these
tables:
• Orders
• OrderLines
This table shows the layout of the orders table:

orderNumber orderStatus orderDateTime customer lastModification


1 Planned 28 Mar, 2011 Smith 29 Mar, 2011
8:05:30 9:00:00
2 Pending 29 Mar, 2011 Johnson 30 Mar, 2011
14:10:00 16:00:00

This table shows the layout of the OrderLines table:

orderNumber lineNumber item quantity price


1 1 Chair 4 25.00
1 2 Table 1 225.00
2 1 Laptop 1 600.00

Reading from the database


To retrieve data from a database, you can define a statement in the database connection point.

40 | Infor ION Technology Connectors Administration Guide


Database Connection point

A simple query
In the database connection point, you can define a statement for retrieving data from a database. If it
is sufficient to read the same set of data each time again, instead of only the new or changed data,
you can use a query directly in ION Desk.
The query must provide an XML result set being the DataArea for the BOD to be published.
If multiple BODs must be published, the XML result set must contain multiple DataAreas.
See "Publishing multiple BODs" on page 44.
When using SQL Server, the statement is as follows:

SELECT Orders.orderNumber, Orders.orderStatus,


Orders.orderDateTime, Orders.customer,
OrderLines.lineNumber, OrderLines.item,
OrderLines.quantity, OrderLines.price
FROM Orders, OrderLines
WHERE OrderLines.orderNumber = Orders.orderNumber
FOR XML AUTO, ELEMENTS, root('DataArea');

You can use a JOIN statement instead of a where clause.


Note: Ensure that your query does not return too much data at once. Otherwise the data cannot be
handled in the available system memory. Returning too much data at once results in an exception. To
limit the amount of data returned at once, you can for example use the SELECT TOP 20 statement.
The number of objects that can be handled successfully depends on the size of the objects and the
available memory in the system.
To use tag names that differ from the table or column names, you can use aliases:

SELECT MySalesOrder.orderNumber as orderID, MySalesOrder.orderStatus,

MySalesOrder.orderDateTime, MySalesOrder.customer,
MySalesOrderLine.lineNumber, MySalesOrderLine.item,
MySalesOrderLine.quantity, MySalesOrderLine.price
FROM Orders AS MySalesOrder, OrderLines AS MySalesOrderLine
WHERE MySalesOrderLine.orderNumber = MySalesOrder.orderNumber
FOR XML AUTO, ELEMENTS, root('DataArea');

The name of the top-level elements inside the data area is the document name. In this example, the
document name is MySalesOrder. Therefore, if the Sync verb is used, the produced BOD is
SyncMySalesOrder.
In that case, the resulting BOD message is:

<?xml version='1.0' encoding='UTF-8'?>


<SyncMySalesOrder>
<ApplicationArea>
<Sender>
<LogicalID>lid://infor.database.orderdb</LogicalID>

Infor ION Technology Connectors Administration Guide | 41


Database Connection point

<ConfirmationCode>OnError</ConfirmationCode>
<ComponentID>External</ComponentID>
</Sender>
<CreationDateTime>2011-03-29T14:20:00Z</CreationDateTime>
</ApplicationArea>
<DataArea>
<Sync>
<TenantID>Infor</TenantID>
<AccountingEntityID/>
<LocationID/>
<ActionCriteria>
<ActionExpression actionCode="Replace"/>
</ActionCriteria>
</Sync>
<MySalesOrder>
<orderID>1</orderID>
<orderStatus>Planned</orderStatus>
<dateTime>2011-03-28T08:05:30Z</dateTime>
<customer>Smith</customer>
<MySalesOrderLine>
<lineNumber>1</lineNumber>
<item>Chair</item>
<quantity>4</quantity>
<price>25.00</price>
</MySalesOrderLine>
<MySalesOrderLine>
<lineNumber>2</lineNumber>
<item>Table</item>
<quantity>1</quantity>
<price>225.00</price>
</MySalesOrderLine>
</MySalesOrder>
<MySalesOrder>
<orderID>2</orderID>
<orderStatus>Pending</orderStatus>
<dateTime>2011-03-29T14:10:00Z</dateTime>
<customer>Johnson</customer>
<MySalesOrderLine>
<lineNumber>1</lineNumber>
<item>Laptop</item>
<quantity>1</quantity>
<price>600.00</price>
</MySalesOrderLine>
</MySalesOrder>
</DataArea>

Note:
• The ApplicationArea is always created automatically by the database connector.
• The verb area, Sync in this example, is generated automatically if it is not included in the result set
that is output returned by your stored procedure. If you must use specific values for
AccountingEntityID, LocationID, or the actionCode attribute for example, you can provide the verb

42 | Infor ION Technology Connectors Administration Guide


Database Connection point

area from the stored procedure. Alternatively, you can use a Mapping activity in the document flow
to map a data field from MySalesOrder to one of the elements in the verb area.
• If the result set is empty, no BOD is published.

Caution: We recommend that you publish a separate BOD for each object instance (such as
a sales order).
See "Publishing multiple BODs" on page 44.
Including multiple object instances in a single BOD can result in failures when you send such
a BOD to an application, and can give unexpected results when you use content-based routing
or filtering.

Query using a time stamp


You can include logic to only publish changed data. This is required to sync only the changes to another
system or to decrease the number of messages or the message size. It is also required to define an
event monitor on data from a database, otherwise the same alert is reported for each time the same
data is published.
ION does not prescribe the mechanism to be used for detecting changes, it depends on your specific
situation. For example, the data in your database can or does not have a time stamp.
In this example we assume a time stamp is available, and we keep track of the last moment data was
read. Therefore, we introduce a new table: LastChangeRetrieval.
This table shows the layout of the LastChangeRetrieval table:

LastChangeRetrieval
tableName lastRetrieval
Orders 30 Mar, 2011 18:00:00

To use this, multiple statements are required. Consequently you cannot define these statements directly
in ION. Instead, you must call a stored procedure from ION.
The stored procedure GetOrders can contain this code:

BEGIN
-- Prevent extra result sets from interfering with SELECT statements

SET NOCOUNT ON;

-- Declare variables
DECLARE @currentTime as datetime;
DECLARE @lastTime as datetime;

-- Determine time range


SET @currentTime = CURRENT_TIMESTAMP;
SET @lastTime = (SELECT lastRetrieval FROM LastChangeRetrieval

Infor ION Technology Connectors Administration Guide | 43


Database Connection point

WHERE tableName='Orders');
IF (@lastTime is null)
BEGIN
-- Insert new row for first time retrieval
SET @lastTime = 0;
INSERT INTO LastChangeRetrieval (tableName, lastRetrieval) VALUES
('Orders', 0);
END

-- Select the data


SELECT MySalesOrder.orderNumber AS orderID, MySalesOrder.orderStatus,

MySalesOrder.orderDateTime, MySalesOrder.customer,
MySalesOrderLine.lineNumber, MySalesOrderLine.item,
MySalesOrderLine.quantity, MySalesOrderLine.price
FROM Orders AS MySalesOrder, OrderLines AS MySalesOrderLine
WHERE MySalesOrderLine.orderNumber = MySalesOrder.orderNumber and
MySalesOrder.lastModification >= @lastTime and
MySalesOrder.lastModification < @currentTime
FOR XML AUTO, ELEMENTS, root('DataArea');

-- Update status
UPDATE LastChangeRetrieval SET lastRetrieval = @currentTime
WHERE tableName ='Orders';
END

Then in ION, you define this statement to read the database:

EXEC GetOrders;

The output is the same as in the previous example, except that at the next scheduled read action, only
the items having a newer time stamp are included.
To prevent memory exceptions, limit the amount of data that is read at once.
See "A simple query" on page 41.
When you use a database connection point for the first time, a load of data might be retrieved, because
none of the existing data was retrieved before. In that case you can temporarily use a small schedule
interval in the database connection point, to gradually publish the complete data set.
The inserts or updates you perform in your stored procedure are fully transactional. They are only
committed to the database if the resulting data is posted successfully by ION in a persistent store.
Consequently, no data is lost.

Publishing multiple BODs


In the examples above, a single BOD document was published at each scheduled read action. To
include one order instance in each BOD message, your stored procedure must return multiple DataArea
nodes.

44 | Infor ION Technology Connectors Administration Guide


Database Connection point

Note: Publishing multiple BODs is required in these cases:


• The size of the BOD gets too big to handle if all records are returned in a single BOD message.
• The Process verb is used, because a Process BOD must contain only one instance.
• Receiving applications expect only one instance of a noun per BOD message.
To publish multiple BODs, you can change the query as follows:

SELECT(SELECT MySalesOrder.orderNumber as orderID,


MySalesOrder.orderStatus, MySalesOrder.orderDateTime,
MySalesOrder.customer,
MySalesOrderLine.lineNumber, MySalesOrderLine.item,
MySalesOrderLine.quantity, MySalesOrderLine.price
FROM Orders as MySalesOrder, OrderLines as MySalesOrderLine
WHERE MySalesOrderLine.orderNumber = MySalesOrder.orderNumber
and
MySalesOrder.lastModification >= @lastTime and
MySalesOrder.lastModification < @currentTime
FOR XML AUTO, ELEMENTS, type).query(
'for $i in /MySalesOrder return
<DataArea>{$i}</DataArea>');

Depending on the used database, you possibly must follow additional conventions and syntax. For
example, in SQL Server the SET ARITHABORT ON flag must be enabled. In that case you must create
a stored procedure because multiple statements are used.
The stored procedure GetOrders can contain this code:

BEGIN
SET ARITHABORT ON

-- At this point the same query as above


END

Then in ION, the following statement is defined to read the database:

EXEC GetOrders;

Note: Although multiple BODs are published, the data is retrieved using a single XML. So, to avoid
memory problems, you must limit the amount of data returned at once.
See "A simple query" on page 41.

Writing to the database


To write data to a database, you can define a statement in the database connection point.

Infor ION Technology Connectors Administration Guide | 45


Database Connection point

A simple procedure
In the database connection point, you can define a statement for writing data to a database. Assume
that the used BOD XML is the same as in the example of Reading from the database, above. So a
SyncMySalesOrder BOD is sent to the database connection point.
In that case, a procedure to handle the BOD data can contain this code:

BEGIN
-- Prevent extra result sets from interfering with SELECT statements

SET NOCOUNT ON;

-- Parse XML
DECLARE @parsedXmlData int;
EXEC sp_xml_preparedocument @parsedXmlData OUTPUT, @xmlData;

-- Insert orders
INSERT INTO Orders (orderNumber, orderStatus, orderDateTime, customer)

SELECT orderNumber, orderStatus, orderDateTime, customer


FROM OPENXML (@parsedXmlData, '/DataArea/MySalesOrder', 2)
WITH (orderNumber nvarchar(20) 'orderID',
orderStatus nvarchar(20) 'status',
orderDateTime datetime 'orderDateTime',
customer nvarchar(20) 'customer')

-- Insert lines
INSERT INTO orderLines (orderNumber, lineNumber, item, quantity,
price)
SELECT orderNumber, lineNumber, item, quantity, price
FROM OPENXML (@parsedXmlData,
'/DataArea/MySalesOrder/MySalesOrderLine', 2)
WITH (orderNumber nvarchar(20) '../orderID',
lineNumber int 'lineNumber',
item nvarchar(20) 'item',
quantity int 'quantity',
price decimal 'price')
END

The procedure must have an argument to hold the data from the incoming BOD:

@xmlData XML

In ION, this statement is defined, assuming the name of the stored procedure is StoreOrders:

EXEC StoreOrders @xmlData='[Data]';

The [Data] token is a placeholder for the incoming data. At runtime this is replaced with the DataArea
XML of the incoming BOD.

46 | Infor ION Technology Connectors Administration Guide


Database Connection point

Note: The statement for writing the database must contain the [Data] token exactly once.

More complex logic


In the previous example, the only complexity in the stored procedure was the use of two tables, order
header and lines. In practice, the logic can be more complex.
Data may already exist in the database. Consequently, instead of inserting, it may be required to update
the existing data. This may especially be complex in case of transactional data, where a document
usually includes a header and multiple lines. In such cases a change does not only require updates of
existing header and lines, but also the deletion or the addition of lines.
The incoming BOD has an actionCode that you can use. But note that the actionCode is set from the
perspective of the BOD sender. If the sender indicates that a document is changed it might be a new
document for the receiver, because of content-based routing or filtering that might be performed in
between.
Consequently, in the stored procedure you can for example implement this logic:
• If the actionCode is Delete, delete the object if it exists.
• For other actionCodes, check whether the object already exists. If so, update the existing object,
otherwise insert the object.
• If an existing object must be updated, compare the lines from the incoming document to the lines
existing in the database and depending on that, perform inserts, updates, or deletions of lines.
Finally, ensure the stored procedure implementation does not violate the consistency of the data in the
database. Updating a database directly bypasses the logic of the application that owns the database.
If in the document flow the writing to the database is preceded by a mapping activity, you should check
the defined mapping to ensure that the resulting data is valid for the database.

Using reply BODs


When sending a Process BOD from a database connection point, it may receive an Acknowledge BOD
in reply. And when receiving a Process BOD in the database connection point, it must provide an
Acknowledge BOD as the reply.
Note: Get and Show BODs are not supported for database connection points in the current release.

Receiving a Process BOD and sending an Acknowledge BOD


The stored procedure must accept an XML as input and provide XML as output. Both are a single
DataArea.

Infor ION Technology Connectors Administration Guide | 47


Database Connection point

The stored procedure can contain this code:

BEGIN
-- Prevent extra result sets from interfering with SELECT statements

SET NOCOUNT ON;

-- Parse XML
DECLARE @parsedXmlData int;
EXEC sp_xml_preparedocument @parsedXmlData OUTPUT, @xmlData;

-- Insert order
INSERT INTO Orders (orderNumber, orderStatus, orderDateTime, customer)

SELECT orderNumber, orderStatus, orderDateTime, customer


FROM OPENXML (@parsedXmlData, '/DataArea/MySalesOrder', 2)
WITH (orderNumber nvarchar(20) 'orderID',
orderStatus nvarchar(20) 'status',
orderDateTime datetime 'orderDateTime',
customer nvarchar(20) 'customer');

-- Insert lines
INSERT INTO orderLines (orderNumber, lineNumber, item, quantity,
price)
SELECT orderNumber, lineNumber, item, quantity, price
FROM OPENXML (@parsedXmlData,
'/DataArea/MySalesOrder/MySalesOrderLine', 2)
WITH (orderNumber nvarchar(20) '../orderID',
lineNumber int 'lineNumber',
item nvarchar(20) 'item',
quantity int 'quantity',
price decimal 'price');

-- Get output XML for Acknowledge


DECLARE @docId nvarchar(20);
SET @docId =
(SELECT orderNumber
FROM OPENXML (@parsedXmlData, '/DataArea/MySalesOrder', 2)
WITH (orderNumber nvarchar(20) 'orderID'));
SELECT MySalesOrder.orderNumber as orderID, MySalesOrder.orderStatus,

MySalesOrder.orderDateTime, MySalesOrder.customer,
MySalesOrderLine.lineNumber, MySalesOrderLine.item,
MySalesOrderLine.quantity, MySalesOrderLine.price
FROM Orders as MySalesOrder, OrderLines as MySalesOrderLine
WHERE MySalesOrderLine.orderNumber = @docId
FOR XML AUTO, ELEMENTS, root('DataArea');
END

In this case, the document is not changed during insert; for example, no ID is generated and no default
values are used. Therefore, you maybe can get the Acknowledge DataArea in a more efficient way,
using the MySalesOrder instance from the DataArea that is input for the stored procedure.

48 | Infor ION Technology Connectors Administration Guide


Database Connection point

In ION, this statement is defined, assuming the name of the stored procedure is 'ProcessOrders':

EXEC ProcessOrders @xmlData='[Data]';

The [Data] token is a placeholder for the incoming data. At runtime this is replaced with the DataArea
XML of the incoming BOD.
Note: Although the communication in ION is performed through asynchronous messages, the database
connector always sends the reply BOD immediately.

Sending a Process BOD and receiving an Acknowledge BOD


When an action to read the database is specified and the used verb is Process, the database connection
point will asynchronously receive an Acknowledge BOD in reply.
To handle this Acknowledge, define an additional action to write the database, using the same document
name as used for the Process BOD, and select the Acknowledge verb.
So, finally two actions are defined in the database connection point:
• A read action to send the Process BOD
• A write action to handle the corresponding Acknowledge BOD
The handling of the Acknowledge is optional for database connection points. If no action is defined to
handle the Acknowledge, the Acknowledge BODs are ignored.

Exception handling and consistency of data


If the statement or stored procedure raises an error, a ConfirmBOD is created. This ConfirmBOD must
include the exception message. To raise an error, you can for example use this code:

RAISERROR ('Customer ' + @customerId + ' does not exist',10, 1)

A ConfirmBOD is also created if the database throws an exception or the transaction cannot be
committed successfully.

Transaction management
The database transaction is managed by the ION Service. Therefore, delivery is guaranteed. An
incoming message is removed from the queue in the same transaction that commits the changes to
the database.
Note: Consequently, it is not allowed to commit or abort inside the used stored procedure. Oracle
database does not permit Read and Write operations simultaneously within the same procedure without
relinquishing the transaction control. This can lead to the situation that the stored procedure execution
succeeds but the full transaction from ION perspective fails. Due to this incompatibility, currently the

Infor ION Technology Connectors Administration Guide | 49


Database Connection point

Request-Reply action and DB connector as an intermediate step are proven to work only with Microsfot
SQL server.
When reading the database, the ION Service also manages the transaction. The statement to read the
database may perform inserts or updates, for example to keep track of the timestamp when reading.

Data consistency
The ION Service delivers BODs to the database. The ION Service does not control the contents of the
BOD or the actions performed inside the stored procedure.
Note: When defining stored statements or procedures you must be aware of the requirements or
constraints of the database you are writing to. You can send data directly to a database. Business logic
or validations, that are implemented in the application to which the database belongs, are bypassed
in that case. Oracle database does not permit Read and Write operations simultaneously within the
same procedure without relinquishing the transaction control. This can lead to the situation that the
stored procedure execution may succeed but the full transaction from ION perspective may fail. Due
to this incompatibility, currently the Request-Reply action and DB connector as an intermediate step
are proven to work only with Microsoft SQL server.

Example statements for database connection points using MySQL


This is an example about how to read data from, and store data in, the database, without exception
handling and without updating existing row(s).
This table shows the records in the Orders table:

orderNumber orderStatus
1 new
2 in process
3 completed

This table shows the records in the OrderLine table:

orderNumber lineNumber item quantity price


1 1 VW Polo 1 10000.00
2 1 hubcap 4 100.00
2 2 tire 4 400.00
3 1 battery 1 90.00

50 | Infor ION Technology Connectors Administration Guide


Database Connection point

Reading from the database


In MySQL, you cannot convert a query to xml data from a SELECT statement. Therefore, you must
perform the conversion through a stored function. This function must have a return parameter of type
varchar:

Helper functions/procedures:
-- this procedure adds a tag to parameter result

PROCEDURE `addStartTag`(INOUT result blob, tag varchar(15))


BEGIN
set result = concat(result,"<", tag, ">" );
END

-- this procedure adds a value to the parameter result

PROCEDURE `addValue`(INOUT result blob, tagValue blob)


BEGIN
set result = concat(result, tagValue);
END

-- this procedure adds an end tag to the parameter result

PROCEDURE `addEndTag`(inout result blob, tag varchar(15))


BEGIN
set result = concat(result, "</", tag, ">");
END

-- this procedure add a start tag, its value and the end tag to
parameter result
-- example <tag>tagvalue</tag>

PROCEDURE `addTag`(INOUT result blob, tagName varchar(15), tagValue


varchar(50))
BEGIN
declare startTag varchar(20) default "";
declare endTag varchar(20) default "";

call addStartTag(result, tagName);


call addValue(result, tagValue);
call addEndTag(result, tagName);

END

The read function:


-- this function reads a sales order and its line from the database
and puts the
-- result set into a xml string with a root tag 'DataArea' and per line
a MySalesOrder tag

FUNCTION `readSalesOrder`() RETURNS varchar(10000) CHARSET latin1

Infor ION Technology Connectors Administration Guide | 51


Database Connection point

begin

declare done int default 0;


declare orderID int;
declare orderStatus varchar(10);
declare lineNumber int;
declare item varchar(30);
declare quantity decimal(10,0);
declare price decimal(10,2);
declare result varchar(10000) default "";

-- create cursor to loop over the query


declare cur1 cursor for
SELECT o.orderNumber as orderID, o.orderStatus, line.lineNumber,
line.item,
line.quantity, line.price
FROM Orders as o, OrderLine as line
WHERE o.orderNumber = line.orderNumber;

-- set the 'done' variable after the cursor declaration


DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
open cur1;

-- set the root tag


call addStartTag(result, "DataArea");
set result = ("<DataArea>");

fetch cur1 into orderID, orderStatus, lineNumber, item, quantity,


price;
while done = 0 do

-- set tag row


call addStartTag(result, "MySalesOrder");

-- set the query results into their tag's


call addTag(result, "orderID", orderID);
call addTag(result, "orderStatus", orderStatus);
call addTag(result, "lineNumber", lineNumber);
call addTag(result, "item", item);
call addTag(result, "quantity", quantity);
call addTag(result, "price", price);

-- set end tag row


call addEndTag(result, "MySalesOrder");

fetch cur1 into orderID, orderStatus, lineNumber, item,


quantity, price;
end while;

-- set end tag root


call addEndTag(result, "DataArea");

52 | Infor ION Technology Connectors Administration Guide


Database Connection point

-- close the cursor


close cur1;

RETURN result;
End

This is the Result xml:

<?xml version="1.0" encoding="utf-16"?>


<Messages>
<SyncMySalesOrder>
<ApplicationArea>
<Sender>
<LogicalID>infor.database.connectiontest</LogicalID>
<ConfirmationCode>OnError</ConfirmationCode>
<ComponentID>External</ComponentID>
</Sender>
<CreationDateTime>2011-07-08T06:01:04.100Z</CreationDateTime>
<BODID>infor.database.connectiontest:1310104864100:0</BODID>
</ApplicationArea>
<DataArea>
<Sync>
<TenantID>infor.test.connection</TenantID>
<AccountingEntityID />
<LocationID />
<ActionCriteria>
<ActionExpression actionCode="Replace" />
</ActionCriteria>
</Sync>
<MySalesOrder>
<orderID>1</orderID>
<orderStatus>new</orderStatus>
<lineNumber>1</lineNumber>
<item>VW Polo</item>
<quantity>1</quantity>
<price>10000.00</price>
</MySalesOrder>
<MySalesOrder>
<orderID>2</orderID>
<orderStatus>in process</orderStatus>
<lineNumber>1</lineNumber>
<item>hubcap</item>
<quantity>4</quantity>
<price>100.00</price>
</MySalesOrder>
<MySalesOrder>
<orderID>2</orderID>
<orderStatus>in process</orderStatus>
<lineNumber>2</lineNumber>
<item>tire</item>
<quantity>4</quantity>

Infor ION Technology Connectors Administration Guide | 53


Database Connection point

<price>400.00</price>
</MySalesOrder>
<MySalesOrder>
<orderID>3</orderID>
<orderStatus>completed</orderStatus>
<lineNumber>1</lineNumber>
<item>battery</item>
<quantity>1</quantity>
<price>90.00</price>
</MySalesOrder>
</DataArea>
</SyncMySalesOrder>
</Messages>

Writing to the database


To write to the database, apply a stored procedure and use the ExtractValue() function:

helper functions:
-- this function returns the expression that count the occurrence of
the searchExpr

FUNCTION `createCountExpression`(searchExpr varchar(50)) RETURNS


varchar(100) CHARSET latin1
BEGIN
declare result varchar(100) default "";
set result = concat("count(",searchExpr,")");
return result;
END

-- this function create the extract expression to get the value of the
paramter tag[idx]

FUNCTION `createExtractExpression`(searchExpression varchar(50), idx


int, tag varchar(15)) RETURNS varchar(100) CHARSET latin1
BEGIN
declare result varchar(100) default "";

set result = concat(searchExpression, "[", idx, "]/", tag);


return result;
END

-- this procedure stores the data of a MySalesOrder bod into the


-- database

PROCEDURE `StoreSalesOrder`(xmlData blob)


BEGIN

54 | Infor ION Technology Connectors Administration Guide


Database Connection point

declare totalRecords int;


declare salesOrderExpr varchar(30);
declare countExpr varchar(30);
declare idx int default 1;
declare extractExpr varchar(30);

-- field variables
declare id int;
declare orderStatus varchar(10);
declare lineNumber int;
declare item varchar(45);
declare quantity decimal(10,0);
declare price decimal(10,2);

declare prefId int default 0;

-- Create the expression for the salesOrder tag


set salesOrderExpr = concat("//", "MySalesOrder");

-- Create the expressin to count the number of salesorders/lines


set countExpr = createCountExpression(salesOrderExpr);

set totalRecords = ExtractValue(xmlData, countExpr);

while idx <= totalRecords do


-- look for order id
set extractExpr = createExtractExpression(salesOrderExpr, idx,
"orderID");
set id = ExtractValue(xmlData, extractExpr );

-- look for order status


set extractExpr = createExtractExpression(salesOrderExpr, idx,
"orderStatus");
set orderStatus = ExtractValue(xmlData, extractExpr );

-- look for order line


set extractExpr = createExtractExpression(salesOrderExpr, idx,
"lineNumber");
set lineNumber = ExtractValue(xmlData, extractExpr );

-- look for item


set extractExpr = createExtractExpression(salesOrderExpr, idx,
"item");
set item = ExtractValue(xmlData, extractExpr );

-- look for quantity


set extractExpr = createExtractExpression(salesOrderExpr, idx,
"quantity");
set quantity = ExtractValue(xmlData, extractExpr );

-- look for price


set extractExpr = createExtractExpression(salesOrderExpr, idx,

Infor ION Technology Connectors Administration Guide | 55


Database Connection point

"price");
set price = ExtractValue(xmlData, extractExpr );

-- insert data
-- insert orders (header) if necessary
if prefid <> id then
insert into orders (orderNumber, orderStatus)
values (id, orderStatus);
call log(id);
call log(orderStatus);
set prefid = id;
end if;

Commands to run
To retrieve data, run this command:

select readSalesOrder()

To insert data, run this command:

call StoreSalesOrder('[Data]');

Example statements for database connection points using Oracle


This example shows how to perform these actions:
• Read data in XML format from an Oracle schema using a "READ" ION connection point.
• Write data in another Oracle schema.
In this example, these schemas are used:
• TESTDBSOURCE for reading data
• TESTDBTARGET for writing data

Tables
These tables are created, each in a different Oracle schema:
• TESTDBSOURCE.ORDERS
• TESTDBTARGET.ORDERS

56 | Infor ION Technology Connectors Administration Guide


Database Connection point

Both tables are generated with this DDL:

CREATE
TABLE "ORDERS"
(
"ID" NUMBER NOT NULL ENABLE,
"ORDER_NUMBER" VARCHAR2(20 BYTE) NOT NULL ENABLE,
"ORDER_STATUS" VARCHAR2(20 BYTE),
"DATE_TIME" DATE,
"CUSTOMER" VARCHAR2(20 BYTE),
CONSTRAINT "ORDERS_PK" PRIMARY KEY ("ID") USING INDEX PCTFREE 10
INITRANS 2
MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576

MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1


FREELIST
GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT)
TABLESPACE "USERS" ENABLE
)
SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS
255
NOCOMPRESS LOGGING STORAGE
(
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0
FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE
DEFAULT
CELL_FLASH_CACHE DEFAULT
)
TABLESPACE "USERS" ;

Functions
To read data in XML format from the TESTDBSOURCE schema, use the GET_ORDERS function:

CREATE OR REPLACE
FUNCTION GET_ORDERS RETURN CLOB IS
retval CLOB;
BEGIN
SELECT xmlelement("DataArea",
xmlagg(xmlelement("MySalesOrder",
xmlforest(ORDER_NUMBER as "OrderNumber",
ORDER_STATUS as "OrderStatus",
DATE_TIME as "DateTime", CUSTOMER as "Customer")))

as MySalesOrder)
.getClobVal()AS xml_frag
INTO retval FROM TESTDBSOURCE.ORDERS;

Infor ION Technology Connectors Administration Guide | 57


Database Connection point

RETURN retval;
END;

To write data in XML format in the TESTDBTARGET schema, use the F_PUT_ORDERS function:

create or replace
FUNCTION F_PUT_ORDERS(xmlData VARCHAR2) RETURN NUMBER AS

Order_NO varchar2(32767);
Order_Status varchar2(32767);
--NewOrderStatus varchar2(32767);
Customer varchar2(32767);
xmlContent xmlType;
o xmlType;
c xmlType;
s xmlType;
xmlEData varchar2(32676);
BEGIN

xmlContent := xmlType(xmlData);
if(xmlContent is not null) then
o:=
xmlType.extract(xmlContent,'DataArea/MySalesOrder/ORDER_NUMBER/text()');

Order_NO := o.getStringVal();
Order_NO := utl_i18n.unescape_reference(Order_NO);
--read the values from xml := 1;
c := xmlType.extract(xmlContent,
'DataArea/MySalesOrder/ORDER_STATUS/text()');
if(c is not null) then
Order_Status := c.getStringVal();
Order_Status := utl_i18n.unescape_reference(Order_Status);
else
Order_Status := 'test';
end if;
s := xmlType.extract(xmlContent,
'DataArea/MySalesOrder/CUSTOMER/text()');
if(s is not null) then
Customer := utl_i18n.unescape_reference(Customer);
Customer := s.getStringVal();
else
Customer := 'test';
end if;
end if;
--insert the values into database
INSERT INTO TESTDBTARGET.ORDERS(order_number,order_status,customer)
values(Order_NO,Order_Status,Customer);
RETURN 1;
END F_PUT_ORDERS;

58 | Infor ION Technology Connectors Administration Guide


Database Connection point

This procedure is also required to run the F_PUT_ORDERS function:

CREATE OR REPLACE PROCEDURE TESTDBTARGET.PUT_ORDERS


(xmlData IN VARCHAR2)
AS
x NUMBER;
BEGIN
x := TESTDBTARGET.F_PUT_ORDERS(xmlData);
END PUT_ORDERS;

Commands to run
To retrieve data, run this command:

select TESTDBSOURCE.GET_ORDERS from dual

To insert data, run this command:

CALL TESTDBTARGET.PUT_ORDERS('[Data]')

Note: To insert data, you must use a stored procedure because you cannot run a DML statement from
within a SELECT statement.

Example statements for connection points using DB2


This is an example of how to read data from, and write data to, a database using DB2.

Tables
This table shows the records in the DOCUMENTS table:

Name Data Type Length Nullable


ID VARCHAR 10 No
DOCS VARCHAR 1024 No

This table shows the records in the IN_DOCUMENTS table:

Name Data Type Length Nullable


C_ID BIGINT 8 No
C_XML BLOB 1048576 No

Infor ION Technology Connectors Administration Guide | 59


Database Connection point

Procedures
This is the code of the GETORDERS procedure:

create procedure GETORDERS()


language sql
result sets 1
begin
declare mycur cursor with return to caller for
Select DOCS FROM DOCUMENTS Where ID='2';
open mycur;
end@

This is the code of the INSERT_ORDERS procedure:

create procedure INSERT_ORDER(IN xml VARCHAR(1024))


language sql
begin
INSERT INTO <SCHEMA>.IN_DOCUMENTS (C_ID, C_XML)
SELECT MAX(IN_DOCUMENTS.C_ID)+ 1 , BLOB(xml) FROM IN_DOCUMENTS;
end@

Commands to run
To retrieve data, run this command:

call GETORDERS()

To insert data, run this command:

call INSERT_ORDER('[Data]')

Example statements for connection points using DB2 400


This example shows how to read data from, and write data to, a database named iontest for DB2
400. This code is written using the V6R1 release of the operating system. Depending on the operating
system release, you can use other mechanisms to achieve the same results.
The ION Database Connector is supported with a DB2-400 system of at least version V6R1 with the
latest PTF level.

60 | Infor ION Technology Connectors Administration Guide


Database Connection point

Tables
To create the Orders table, run this code:

CREATE TABLE IONTEST/ORDERS (ORDERNUM CHAR ( 20) NOT NULL,


ORDERSTAT CHAR ( 20), ORDERTSTMP TIMESTAMP , CUSTOMER CHAR (20
), LASTMOD TIMESTAMP NOT NULL WITH DEFAULT) RCDFMT ROrders

To create the Orderlines table, run this code:

CREATE TABLE IONTEST/ORDERLINE (ORDERNUM CHAR (20 ) NOT NULL,


LINENUM INT NOT NULL, ITEM CHAR (20 ), QUANTITY INT , PRICE DEC
(18 , 2)) RCDFMT ROrderline

To create the ProcOrd table, run this code:

CREATE TABLE IONTEST/ProcOrd (ORDERNUM CHAR (20 ) NOT


NULL, PROCESSst CHAR (20 )) RCDFMT RProcOrd

To create the Orders_PUT table, run this code:

CREATE TABLE IONTEST.ORDERS_PUT (


ORDERNUM CHAR(20) CCSID 37 NOT NULL ,
ORDERSTAT CHAR(20) CCSID 37 DEFAULT NULL ,
ORDERTSTMP TIMESTAMP DEFAULT NULL ,
CUSTOMER CHAR(20) CCSID 37 DEFAULT NULL ,
LASTMOD TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
)
RCDFMT RORDERS

Stored procedures created


To create the stored procedures, run this code:

CREATE PROCEDURE iontest/GETORDERS


LANGUAGE RPGLE
SPECIFIC iontest/GETORDERS NOT DETERMINISTIC EXTERNAL
NAME IONTEST/GETORDERS PARAMETER STYLE GENERAL

CREATE PROCEDURE iontest/PUTORDERS (IN string varChAR(32000))

LANGUAGE RPGLE SPECIFIC iontest/putorders NOT DETERMINISTIC


EXTERNAL NAME
iontest/putorders PARAMETER STYLE GENERAL

Infor ION Technology Connectors Administration Guide | 61


Database Connection point

This is the code of the GETORDERS procedure:

H option(*nodebugio: *SRCSTMT : *SHOWCPY ) CVTOPT(*VARCHAR)


H DFTACTGRP( *NO ) ACTGRP(*CALLER) BndDir( 'QC2LE' )
H DEBUG(*YES) ALWNULL(*USRCTL)

d GetOrders PR
d numResults 10i 0
d GetOrders PI
d numResults 10i 0

D MYDBCLOB s SQLTYPE(DBCLOB:400)

d Results ds occurs(5 )
d resultxml 10000A varying

d x s 10i 0
d y s 2 0
d wrkxml s 64000 varying
d recxml s 32000 varying
D rtnstr s 50A
D icv_RtnCod s 10i 0

d ordh e ds extname(orders)
d qualified
D Nullind Ds
D Nullsh 5i 0 Dim(5)

D Nullsind Ds
D Nullsd 5i 0 Dim(5)

d ordd e ds extname(orderLine)
d qualified

D W3CALCOBJ PR extpgm('W3CALCOBJ')

D CMD_LENGTH s 15p 5
D CMD_TO_RUN s 2000
D CMD_return s 50

D Qcmdexc PR extpgm('QCMDEXC')
D cmd_TORUN 2000 CONST options(*varsize)
D CMD_LENGTH 15p 5 CONST

/COPY QSYSINC/QRPGLESRC,QTQICONV

/free
cmd_TO_RUN = 'Addlible IONTEST';
cmd_length = %checkr(' ':cmd_to_run);
monitor;

62 | Infor ION Technology Connectors Administration Guide


Database Connection point

callp Qcmdexc (cmd_TO_RUN:CMD_LENGTH);


on-error;
cmd_TO_RUN = cmd_TO_RUN;
endmon;
// Provide the ability to "suspend" this job.
callp(e) W3CALCOBJ ();

x = 0;
wrkxml = '';

exec sql declare cursorord cursor for select * from


IONTEST/orders;
exec sql open cursorord;

exec sql fetch next from cursorord into :ordh :nullsh;


if sqlCode < 0;
endif;

if sqlCode <> 100;


dou sqlCode = 100;

// insert into ProcOrd


exec sql insert into iontest/Procord (ordernum, PROCESSst)
values(:ordh.ordernum, 'SENT');
exsr createxml;

if %len(wrkxml) + %len(recxml) < 32000;


wrkxml += recxml;

else;
if (X+1) >= 10;
x += 1;
%occur(Results) = x;
resultxml = '<DataArea>'+ wrkxml + '</DataArea>';
wrkxml = '';
if x >= 10;
leave;
endif;
endif;
endif;

exec sql fetch next from cursorord into :ordh :nullsh;


enddo;
endif;

if %len(wrkxml) > 1;
x += 1;
%occur(Results) = x;
resultxml = '<DataArea>'+ wrkxml + '</DataArea>';
wrkxml = '';
endif;

if x > 0;

Infor ION Technology Connectors Administration Guide | 63


Database Connection point

exsr CreateResultSet;
endif;

exec sql close cursorord;


// exec sql close cursorordl;

*inlr = *On;
RETURN;

//-------------------//
// createxml //
//-------------------//
begsr createxml;

recxml = '<MySalesOrder>';
recxml += '<orderID>' + %trim(ordh.ORDERNUM) + '</orderID>';
if Nullsh(2) = 0;
recxml += '<orderStatus>' + %trim(ordh.orderstat)
+ '</orderStatus>';
endif;
if Nullsh(3) = 0;
recxml += '<orderDateTime>' + %trim(%char(ordh.ORDERTSTMP))

+ '</orderDateTime>';
endif;
recxml += '<customer>' + %trim(ordh.customer)
+ '</customer>';

// get order lines


exec sql declare cursorordl cursor for
select * from IONTEST/orderline where :ordh.orderNum =
orderNum
order by orderNum,linenum;
exec sql open cursorordl;
exec sql fetch next from cursorordl into :ordd :nullsd;
if sqlCode < 0;
endif;

IF SQLcODE <> 100;


dou sqlCode = 100;
recxml += '<MySalesOrderLine>';
recxml += '<lineNumber>' + %trim(%char(ordd.LINENUM))
+ '</lineNumber>';
if Nullsd(3) = 0;
recxml += '<item>' + %trim(ordd.item)
+ '</item>';
endif;
if Nullsd(4) = 0;
recxml += '<quantity>' + %trim(%char(ordd.quantity))
+ '</quantity>';
endif;
if Nullsd(5) = 0;

64 | Infor ION Technology Connectors Administration Guide


Database Connection point

recxml += '<price>' + %trim(%char(ordd.price))


+ '</price>';
endif;
recxml += '</MySalesOrderLine>';

exec sql fetch next from cursorordl into :ordd :nullsd;


enddo;
endif;

recxml += '</MySalesOrder>';
exec sql close cursorordl;

endsr;

//-------------------//
// CreateResultSet //
//-------------------//
begsr CreateResultSet;

EXEC SQL SET RESULT SETS ARRAY :Results FOR :x ROWS;

endsr;

/end-free

Note: If you use version 7.1, you can use XML functions such as XMLELEMENT and XMLAGG to
build the XML easier. See the following statement for an example.

SELECT xmlserialize(content
xmlelement(name "DataArea",
xmlagg(
xmlelement(Name "MySalesOrder",
xmlelement(Name "orderID", ORDERNUM),
xmlelement(Name "orderStatus", orderstat),
...
)
)
)
AS CLOB(1M) ) as "result" FROM cursorord

This is the code of the PutORDERS procedure:

H option(*nodebugio: *SRCSTMT : *SHOWCPY ) CVTOPT(*VARCHAR)


H DFTACTGRP( *NO ) ACTGRP(*CALLER)
H DEBUG(*YES) ALWNULL(*USRCTL)

d PutOrders PR
d inXML 32000A varying
d PutOrders PI

Infor ION Technology Connectors Administration Guide | 65


Database Connection point

d inXML 32000A varying

d x s 3 0
d Y s 3 0
d ordernumber s 20
d orderstatusw s 20
d ordertimestmp s Z
d custnum s 20
d lastTimestmp s Z
d timewrk s 26
d linew s 5 0
d itemw s 20
d Quantityw s 5 0
d pricew s 7 2

d numnsch s 2 0

D DataArea ds qualified
D Sync likeDS(Sync)
D MySalesOrder likeDS(MySalesOrder) Dim(10)

D xmlnMySalesOrder...
D 10I 0

D Sync ds qualified template


D TenantID likeds(TenantID)
D AccountingEntityID...
D likeDS(AccountingEntityID)
D LocationID likeDS(LocationID)
D ActionCriteria likeDS(ActionCriteria)

D TenantID ds qualified template


D data 30A

D AccountingEntityID...
D ds qualified template
D data 30A

D LocationID ds qualified template


D data 30A

D ActionCriteria ds qualified template


D ActionExpression...
D likeDS(ActionExpression)

D ActionExpression...
D ds qualified template
D actionCode 20A
D data 30A

D
D MySalesOrder ds qualified template

66 | Infor ION Technology Connectors Administration Guide


Database Connection point

D orderID likeDS(orderID)
D orderStatus likeds(orderStatus)
D dateTime likeDS(dateTime)
D customer likeDS(customer)
D MySalesOrderLine...
D likeds(MySalesOrderLine)
D dim(10)
D xmlnMySalesOrderLine...
D 10I 0

D orderID ds qualified template


D data 30A

D orderStatus ds qualified template


D data 30A

D dateTime ds qualified template


D data 30A

D customer ds qualified template


D data 30A

D MySalesOrderLine...
D ds qualified template
D lineNumber likeDs(lineNumber)
D item likeDs(item)
D quantity likeDs(quantity)
D price likeDS(price)

D lineNumber ds qualified template


D data 30A

D item ds qualified template


D data 30A

D quantity ds qualified template


D data 30A

D price ds qualified template


D data 30A

D W3CALCOBJ PR extpgm('W3CALCOBJ')

D CMD_LENGTH s 15p 5
D CMD_TO_RUN s 2000
D CMD_return s 50

D Qcmdexc PR extpgm('QCMDEXC')
D cmd_TORUN 2000 CONST options(*varsize)
D CMD_LENGTH 15p 5 CONST

/free

Infor ION Technology Connectors Administration Guide | 67


Database Connection point

cmd_TO_RUN = 'Addlible IONTEST';


cmd_length = %checkr(' ':cmd_to_run);
monitor;
callp Qcmdexc (cmd_TO_RUN:CMD_LENGTH);
on-error;
cmd_TO_RUN = cmd_TO_RUN;
endmon;

// Provide the ability to "suspend" this job.


callp(e) W3CALCOBJ ();

monitor;
XML-Into DataArea
%XML(inxml:'case=any allowextra=yes countprefix=xmln '
+ ' allowmissing=yes datasubf=data');
on-error;
// send escape message
return;
endmon;

// Process Order

if DataArea.xmlnMySalesOrder <> 0;
for x = 1 to DataArea.xmlnMySalesOrder;

ordernumber = DataArea.MYSALESORDER(x).ORDERID.DATA;
orderstatusw = DATAAREA.MYSALESORDER(x).ORDERSTATUS.DATA;

custnum = DataArea.MYSALESORDER(x).CUSTOMER.DATA;
timewrk = DataArea.MYSALESORDER(x).DateTime.DATA;
timewrk = %subst(timewrk:1:10)+'-'+%subst(timewrk:12:8)
+'.000000';
timewrk = %xlate(':':'.':timewrk);
ordertimestmp =%timestamp(timewrk);
lastTimestmp = %timestamp();

// process header file


exec sql insert into iontest/ORDERS
(ordernum, orderstat, ORDERTSTMP, customer, LASTMOD)
values(:ordernumber, :orderstatusw, :ordertimestmp,
:custnum,
:lastTimestmp);

if DataArea.MySalesOrder(x).xmlnMySalesOrderLine <> 0;

for y = 1 to DataArea.MySalesOrder(x).xmlnMySalesOrderLine;

linew = %int(

DataArea.MySalesOrder(x).MySalesOrderLine(y).lineNumber);
itemw =DataArea.MySalesOrder(x).MySalesOrderLine(y).item;

68 | Infor ION Technology Connectors Administration Guide


Database Connection point

quantityw = %int(
DataArea.MySalesOrder(x).MySalesOrderLine(y).quantity);

pricew = %dec(
DataArea.MySalesOrder(x).MySalesOrderLine(y).price:7:2);

exec sql insert into iontest/ORDERline


(ordernum, LINENUM , item, QUANTITY, price)
values(:ordernumber, :linew, :itemw, :quantityw,
:pricew);

endfor;

endif;

endfor;
endif;

*inlr = *On;
RETURN;
/End-Free

Commands to run
To retrieve data, run this command:

call iontest/GETORDERS

To insert data, run this command:

call iontest/PutORDERS ('[Data]')

Example data:

Infor ION Technology Connectors Administration Guide | 69


Database Connection point

Example statements for connection points using Postgres (PPAS)


This example shows how you can perform these actions:
• Read data in XML format from an Postgres database using a "READ" ION connection point.
• Write data to another Postgres database.

Tables
These tables are created in the Postgres database:
• Orders
• Orderlines
To create the tables, run this code:

CREATE SEQUENCE g_orders_id;

CREATE TABLE orders


(
ordernumber character varying(20) NOT NULL,
orderstatus character varying(20),
orderdatetime timestamp with time zone,
customer character varying(20),
lastmodification timestamp with time zone,
CONSTRAINT orders_pkey PRIMARY KEY (ordernumber)
);

CREATE TABLE orderlines


(
ordernumber character varying(20) NOT NULL,
linenumber integer NOT NULL,
item character varying(20),
quantity integer,
price numeric(18,2),
CONSTRAINT orderlines_ordernumber_fkey FOREIGN KEY (ordernumber)
REFERENCES orders (ordernumber) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
);

Stored Procedures
To fill the tables with test data you can use the stored procedure generateorders

CREATE OR REPLACE FUNCTION generateorders(numberoforders integer,


startnumber integer)
RETURNS void AS
$BODY$

70 | Infor ION Technology Connectors Administration Guide


Database Connection point

DECLARE counter INT ;


numberOfLines INT ;
orderPK VARCHAR(20);

BEGIN
numberOfLines = 2;
for counter in startNumber .. (startNumber + numberOfOrders) LOOP
orderPK = 'SAL_' || counter;
case
when numberOfLines = 0 then
INSERT INTO Orders (orderNumber, orderStatus, orderDateTime,
customer, lastModification)
VALUES (orderPK, 'Open', now(), 'Johnson', now());
when numberOfLines = 1 then
INSERT INTO Orders (orderNumber, orderStatus, orderDateTime,
customer, lastModification)
VALUES (orderPK, 'Open', now(), 'Jones', now());
INSERT INTO OrderLines (orderNumber, lineNumber, item, quantity,
price)
VALUES (orderPK, 1, 'Laptop', 1, 600.00);
when numberOfLines = 2 then
INSERT INTO Orders (orderNumber, orderStatus, orderDateTime,
customer, lastModification)
VALUES (orderPK, 'Open', now(), 'Smith', now());
INSERT INTO OrderLines (orderNumber, lineNumber, item,
quantity, price)
VALUES (orderPK, 1, 'Desk', 1, 150.00);
INSERT INTO OrderLines (orderNumber, lineNumber, item,
quantity, price)
VALUES (orderPK, 2, 'Chair', 4, 25.00);
end case;
end loop;
perform setval('g_orders_id', counter);
END;

$BODY$
LANGUAGE plpgsql;

To read data in XML format from the Orders and orderliness table, use
the getallorders stored procedure:
CREATE OR REPLACE FUNCTION getallorders(t_age interval)
RETURNS text AS
$BODY$
declare ids text[];
begin
select into ids array(select ordernumber from orders where now() -
lastmodification < t_age);
return getorders(ids);
end;

Infor ION Technology Connectors Administration Guide | 71


Database Connection point

To use the XML data from an incoming BOD as input and to write to the database, use the stored
procedure processbod. This procedure creates a new Order if it does not exist. If the Order exists,
the procedure will update the order.

CREATE OR REPLACE FUNCTION processbod(xmlcontent xml)


RETURNS text AS
$BODY$

declare

orders xml[];
order_xml xml;
tempVal text;
-- variables for the order header

id text;
orderStatus_ varchar (20);
orderDatetimeStr text;
orderDatetime_ timestamp;
customer_ varchar (20);
processedIds text[];

-- orderLine
lineIds text[];
lineId text;
item_ varchar(20);
quantity_ integer;
price_ numeric(18,2);

begin
orders := xpath('//Order', xmlcontent);

foreach order_xml in array orders


loop
--return xpath('//Order/OrderHeader/OrderStatus/text()', order_xml);

id := array_to_string(xpath('//DocumentId/text()', order_xml),'');
orderStatus_ :=
array_to_string(xpath('//Order/OrderHeader/OrderStatus/text()',
order_xml), ',');
orderDatetimeStr :=
array_to_string(xpath('//Order/OrderHeader/OrderDate/text()',
order_xml), ',');
customer_ :=
array_to_string(xpath('//Order/OrderHeader/Customer/text()', order_xml),
',');

if orderDatetimeStr is null or orderDatetimeStr = '' then


orderDatetime_ = now();
else
orderDatetime_ = cast(orderDatetimeStr as timestamp with time zone);

72 | Infor ION Technology Connectors Administration Guide


Database Connection point

end if;

if id = '' then
id := 'SAL_' ||nextval('g_orders_id');
orderDatetime_ = now();
end if;

select into tempVal ordernumber from Orders where ordernumber = id;


if not found then
insert into orders(ordernumber, orderstatus, orderdatetime, customer,
lastmodification) values (id, orderStatus_, orderDatetime_, customer_,
now());
else
update orders set orderstatus = orderStatus_, orderdatetime =
orderDatetime_, customer = customer_ , lastmodification = now()
where ordernumber = id;
end if;
processedIds := array_append ( processedIds, id);

lineIds :=
xpath('//Order/OrderLines/OrderLine/OrderLineNumber/text()', order_xml);

if array_ndims(lineIds) >= 1 then


foreach lineId in array lineIds
loop
item_ :=
array_to_string(xpath('//Order/OrderLines/OrderLine[OrderLineNumber='
|| lineId || ']/Item/text()', order_xml),',');
quantity_ :=
array_to_string(xpath('//Order/OrderLines/OrderLine[OrderLineNumber='
|| lineId || ']/Quantity/text()', order_xml),',');
price_ :=
array_to_string(xpath('//Order/OrderLines/OrderLine[OrderLineNumber='
|| lineId || ']/Price/text()', order_xml),',');

select into tempVal linenumber from orderlines where ordernumber


= id and linenumber = cast (lineId as integer);
if not found then
insert into orderlines (ordernumber, linenumber, item, quantity,
price) values (id, cast (lineId as integer), item_, quantity_, price_);

else
update orderlines set item = item_, quantity = quantity_ , price
= price_
where ordernumber = id and linenumber = cast (lineId as integer);

end if;
end loop;
end if;

end loop;

Infor ION Technology Connectors Administration Guide | 73


Database Connection point

return getOrders(processedIds);
end;
$BODY$
LANGUAGE plpgsql;

Commands to run
To generate test data, run this command:

generateorders(numberOfOrders, StartNumber)

To retrieve test data, run this command:

getallorders (interval)

For example: getallorders(‘1 second’) OR getallorders(‘1 minutes’) OR getallorders(‘1 day’)


To insert data, run this command:

Processbod('[Data]')

74 | Infor ION Technology Connectors Administration Guide


Using customer-specific JDBC drivers
4

How to use your own database in ION.


ION provides JDBC connectivity for databases such as SQL Server, Oracle, DB2, and DB2/400. You
can also use a different database, if it meets these requirements:
• The database must support JDBC.
• If you use the database in an application connection point, the database must provide the Inbox
and Outbox tables.
• If you use the database in a database connection point, the database must provide the functionality
required for database connectivity.
See "Database Connection point" on page 33
• A driver jar file is available for the database. You cannot use multiple files, such as multiple jar files
or a jar file combined with a zip file. In such cases, you must first create a single, flattened, jar file
to be used in ION.
See "Creating a single, flattened, jar file" on page 75.

Creating a single, flattened, jar file


To create a single, flattened, jar file:
1 Create a temporary directory. For example: C:\Temp\FlatJars.
2 Extract the individual jar files into this directory.
For example, if there are five jar files, you must extract each of them into the same folder.
3 Open a command prompt and navigate to this directory.
4 If you are using JDK 1.7, run this command: jar –cvf "[jarFileName]"./
Note: If you are using JDK 1.6 or lower, run this command: jar -cvf "[jarFileName]" *.*
For example, navigate to the C:\temp\FlatJars folder and run this command: jar -cvf
"flattened.jar" ./
A single jar file with the specified name is created under the temporary directory. For example:
C:\temp\FlatJars\flattened.jar

Infor ION Technology Connectors Administration Guide | 75


Using customer-specific JDBC drivers

Deploying your own database


To use your own database in ION, first make the database driver available in the ION Service.
Because the program to register the driver is run externally, ION uses the standard JAVA_HOME
environment variable available in the system. Therefore, you need a version of Java Software Developer's
KIT, or JDK, that is installed and configured in the machine where you run the program. Ensure that
you install JDK, not a Java Runtime Environment (JRE). The version of JDK you install must be
supported by ION. For the current JDK version supported by ION, see the Infor ION Installation and
Configuration Guide (U9854 US).
Note: Deploying your database driver in ION requires technical knowledge.
To deploy a specific JDBC driver in ION:
1 Log on to ION Desk. Select Configure > ION Service.
The Configure ION Service page is displayed.
2 Click the Configuration Files tab.
3 In the Custom database drivers section, click Download wrapper.
4 The Save As window is displayed. Specify the file name as BundleWrapper.zip and click Save.
5 The zip file is downloaded at the selected location. A message that the file is downloaded is displayed.
Click OK.
6 Unzip the BundleWrapper zip file. If possible, extract the BundleWrapper in C:\temp. If you
use a different location, see the InstallPath property in step 3.
7 Copy the custom driver jar to the BundleWrapper\OriginalJar folder.
If there are multiple jar files, create a single flat jar using the procedure explained above and use
that file instead.
8 Change the properties.txt file to reflect the driver specifics.
See "Properties" on page 77.
9 Run build.bat. A zip file is generated. This zip file is required to start up the bundle.
10 Complete these steps:
a In ION Desk, select Configure > ION Service. Then click the Configuration Files tab.
b In the Custom database drivers section, click Upload.
c Upload the zip file.
If the upload is successful, a message that the file is uploaded is displayed. The entry is displayed
in the list of Custom database drivers.

Now you can model your Infor Application connection point or the database connection point using the
new DB vendor. You do not have to stop or restart the ION Service.

76 | Infor ION Technology Connectors Administration Guide


Using customer-specific JDBC drivers

Properties
The BundleWrapper\examples folder contains examples of property files for all standard databases.
If your database is not included in this folder, you must prepare the property file.
This table shows the properties that you must specify in the properties.txt file:

Property Description
InstallPath Specify the absolute path where the zip file is un-
zipped. The default value is: C:\temp\Bundle
Wrapper.
Note: If you change this path, you must also
change the localRepository property in the \
BundleWrapper\build\settings.xml file.
Example:
InstallPath=C:\mylocation\BundleWrap-
per

OriginalJar Specify the file name of the jar that was copied to
the OriginalJar folder.
Example:
OriginalJar=derbyclient.jar
BundleSymbolicName Specify a unique identifier for a bundle, based on
the reverse domain name convention. This conven-
tion is also used by the Java packages.
Example:
BundleSymbolicName=com.infor.ion.org.
apache.derbyclient
BundleVersion Specify the version to be used for the OSGi bundle.
A version must be of this format:
positiveInteger (.positiveInteger (.
positiveInteger))-(buildNr|qualifier)
The first three positions must be a positive integer.
We recommend to use the driver version.
Example:
BundleVersion=10.8.1000002.1095077
BundleName Specify any short human-readable name for the
OSGi bundle to be created for the database driver.
Example:
BundleName=Derby Driver Bundle
BundleDescription Specify any description for the OSGI bundle to be
created for the database driver.
Example:

Infor ION Technology Connectors Administration Guide | 77


Using customer-specific JDBC drivers

Property Description
BundleDescription=JDBC Driver for
Derby wrapped as an OSGi Bundle
SpringDriverClassName Specify the fully qualified class name of the
database driver.
Example:
SpringDriverClassName=org.apache.der-
by.jdbc.ClientDriver
SpringTypeName Specify the name of the database type. This name
must differ from any standard database type sup-
ported by ION, or any other customer-specific
database type.
Example:
SpringTypeName=Derby
SpringReturnAutoGeneratedKeys Specify whether auto-generated keys should be
selected automatically by the database. The default
value is false. ION uses a prepared statement for
executing insert statements on the Inbox tables.
By default, this statement lists the C_ID column as
the key to be returned by the statement.
Set the value to true if your database does not al-
low explicit selection of columns to be returned for
insert statements. In that case the database will
automatically determine which generated key to
return.
Example:
SpringReturnAutoGeneratedKeys=false
SpringWrapAsLob Specify whether to submit a byte arrays or strings
to the JDBC driver wrapped in a JDBC Blob or
Clob object, using the JDBC setBlob or setClob
methods with a Blob or Clob argument.
Default is false, using the common JDBC 2.0
setBinaryStream and setCharacterStream methods
to set the content.
Switch this to true for explicit Blob/Clob wrapping
against JDBC drivers that require such wrapping,
such as PostgreSQL's.
Example:
SpringWrapAsLob=false
SpringStreamAsLob Specify whether to submit a binary stream or
character stream to the JDBC driver as explicit
LOB content, using the JDBC 4.0 setBlob/setClob
method with a stream argument.

78 | Infor ION Technology Connectors Administration Guide


Using customer-specific JDBC drivers

Property Description
Default is false, using the common JDBC 2.0
setBinaryStream and setCharacterStream methods
to set the content.
Switch this to true for explicit JDBC 4.0 usage,
provided that your JDBC driver supports those
JDBC 4.0 operations. For example, Derby's.
This setting affects stream arguments, byte array
and string arguments, requiring JDBC 4.0 support.
For supporting LOB content against JDBC 3.0, see
the SpringWrapAsLob setting.
Example:
SpringStreamAsLob=false
SpringOracleLobHandler Specify whether the Oracle Lob Handler must be
used. This handler is only used by Oracle drivers.
Default is false.
Example:
SpringOracleLobHandler=false
SpringJdbcUnprocessedPollingEntriesSql Specify the query to select the new messages from
the outbox. This query is only required if the
database type is used for an application connection
point. For database connection points, the query
is not used.
You must use placeholders in this query:
• If you specify ?1 in the query, the placeholder
is replaced by the state: 0=unprocessed,
1=processed.
• If you specify ?2 in the query, the placeholder
is replaced by the number of rows to retrieve.
When getting status information, the * in the query
is replaced by the C_WAS_PROCESSED column
name. The ?1 is replaced by 0. The ?2 is replaced
by 1. Consequently, the query must always contain
the * in the select clause.
Example:
SpringJdbcUnprocessedPollingEntries
Sql=select * from COR_OUTBOX_ENTRY
where C_WAS_PROCESSED = ?1 order by
C_MESSAGE_PRIORITY desc, C_ID limit
?2
SpringJdbcConnectionTestSql Specify the query to test an application connection
point. The query validates whether ION can con-
nect to the required inbox and outbox tables in the
database.

Infor ION Technology Connectors Administration Guide | 79


Using customer-specific JDBC drivers

Property Description
You must use placeholders in this query:
• If you specify ?1 in the query, the placeholder
is replaced by the required column names.
• If you specify ?2 in the query, the placeholder
is replaced by the required table names.
• If you specify ?3 in the query, the placeholder
is replaced by the number of rows to retrieve.
Example:
SpringJdbcConnectionTestSql=select ?
1 from ?2 limit ?3
SpringDatabaseConnectionTestSql Specify the query to test a database connection
point. The query validates whether ION can con-
nect to the database. This query must be indepen-
dent of the contents of the database.
Example:
SpringDatabaseConnectionTestSql=se-
lect CURRENT DATE from SYSIBM.SYSDUM-
MY1
SpringUrlRegularExpression Optionally specify a regular expression if the URL
to connect to the database must meet specific re-
quirements.
For example, the URL of DB2/400 must contain
the ;prompt=false property, otherwise a Java
Swing window is displayed when inserting incorrect
user data. Consequently the adapter hangs, if the
URL does not contain this string.
Example:
SpringUrlRegularExpression=^.*;
prompt=false.*$

Example: Deploying MySQL JDBC driver


As an example, this section explains the specific steps required to register the JDBC driver for the
MySQL database.
To register the JDBC driver for the MySQL database:
1 Unzip the BundleWrapper zip file. If possible, extract the BundleWrapper in C:\temp. If you
use a different location, see the InstallPath property in step 5.
2 Download the MySQL JDBC driver binary jar com.springsource.com.mysql.jdbc-5.1.6.
jar from this location:

80 | Infor ION Technology Connectors Administration Guide


Using customer-specific JDBC drivers

http://ebr.springsource.com/repository/app/bundle/version/detail?name=com.
springsource.com.mysql.jdbc&version=5.1.6
Note: If you used Internet Explorer, the file might be downloaded with a .zip extension. If so,
rename the downloaded file: change the extension to .jar.

3 The JDBC driver of MySQL comes in a single jar and can be used as such. Therefore, you can skip
the preparation step to merge multiple jars into one jar file. Place the com.springsource.com.
mysql.jdbc-5.1.6.jar in the BundleWrapper\OriginalJar folder.
4 Rename the BundleWrapper\examples\properties.mysql.txt file to properties.txt
and copy this file to the \BundleWrapper folder. Modify this file to reflect the driver specifics.
See "Properties" on page 77.
5 Run build.bat. A zip file (OSGi bundle) is generated. This file is required to start up the bundle.
6 Complete these steps:
a In ION Desk, select Configure > ION Service. Then click the Configuration Files tab.
b In the Custom database drivers section, click Upload.
c Upload the zip file.

Using your own database in a connection point


After the deployment as described in the "Deploying your own database" section is completed, you
can use your database in these connection points:
• Application connection points of type JDBC
• Database connection points
To use the database in a connection point:
1 Add an application connection point of type JDBC or a database connection point, and select the
appropriate database type from the Database Type list.
The name of the database type in the list is identical to the name specified in the SpringTypeName
property.
If ION Desk was already running before the custom JDBC driver was deployed, the new database
type might not be visible. To resolve this, refresh the browser where ION Desk runs.
2 Specify the URL for the database. For customer-specific JDBC drivers, a configuration in basic
mode is not possible.
3 Complete the rest of the process, such as testing the connection, selecting documents, defining a
document flow, and activation, in the usual way.

Infor ION Technology Connectors Administration Guide | 81


Using customer-specific JDBC drivers

82 | Infor ION Technology Connectors Administration Guide


Message queue connection points
5

You can use connectivity through message queues. In ION Desk you can create a connection point to
read or write a message queue. ION uses JMS (Java Messaging Standard) queues. This enables you
to send or receive messages to or from ION.
The Message Queue Connector of ION acts either as a JMS server or as a JMS client. When the
connection point is configured as a JMS Server, the required message queues are generated and
hosted by ION. ActiveMQ is used. If your application can read or write JMS message queues without
using JMS, you can connect through ION.
If you are already using JMS queues from another server, you must implement a bridge. This bridge
reads the JMS messages from your own queue and writes them to the ION queue or the other way
around.
When the connection point is configured as a JMS Client, ION can directly connect to external JMS
queues provided by other vendors and transport messages back and forth.
Regardless of using the connection point as a server or a client, you can use complete BODs as
messages, or use any XML message. In the latter case,ION ensures that your XML message is packed
as a BOD in the ION Service. In this way, your data can be handled and monitored in ION just like any
other BOD. For example, you can use mapping or content-based routing on your messages, trigger
alerts and workflows. Consequently, you can use message queue connection points in a document
flow just like any other type of connection point.
A message queue connection point specifies:
• The standard properties for any connection point, such as name and tenant. Note that for message
queue connection points the logical ID type is fixed ('jms'), the logical ID is lid://infor.jms.
followed by the converted name.
• What queue(s) to use and how to connect to these queues.
• Which documents can be sent and received and how the BODs must be translated to JMS messages
or the other way around.
For an explanation about the connection properties for Message queue connection point used as a
JMS client, see the "Connection properties" on page 84.
For configuring Message queue connection point as a JMS Server see "Configuring a message queue
connection point as a JMS server" on page 91.

Infor ION Technology Connectors Administration Guide | 83


Message queue connection points

BOD ID
BODID is an XML element present in the ApplicationArea section of a BOD. The JMS header
property of JMSCorrelationID is treated as the equivalent of a BODID. Any XML message published
from a JMS application which is not a complete BOD is wrapped as an Infor BOD by the message
queue connector. In such cases ION uses the JMSCorrelationID header property to construct the
BODID. If the JMSCorrelationID is not provided by the source application the BODID is filled with
the value null.
On the other direction, the BODID is used to construct the JMSCorrelationID when a JMS message,
that is not a complete BOD, is delivered by ION to a JMS queue.

Connection properties
This section explains the properties you can specify on the Connection tab of a message queue
connection point.
You are prompted to select the external JMS type that you want ION to connect to. Select one of the
pre-registered JMS vendors.
See "Registering JMS Vendors with ION" on page 94.
There are some common properties irrespective of the selected JMS vendor and there are some vendor
specific properties.
The vendor independent properties of the connection point correspond to the sample implementation
that are provided in this folder:
JMSClientBundleWrapper/examples
Sometimes, different samples are supplied for the same vendor depending on the protocols used. For
example, there are several samples for TIBCO EMS to connect using SSL, SSL-JNDI and TCP.
Registering a driver for one of these protocols does not enable other protocols to communicate with
TIBCO EMS server. Each protocol support must be treated as a separate JMS client registration.
See "Registering JMS Vendors with ION" on page 94.
The samples that are provided are meant to be used as a reference. The configuration details and
customizations that are required for the actual registration of a JMS client driver can differ from the
samples provided. This depends on the deployment requirements of the JMS server.
This table shows the vendor independent properties of the connection point:

Property Description
Default queue for This property is used for reading one or more documents from the JMS queue
Reading: on the external JMS server and use them in ION. Specify the name of the queue
that is used for reading those messages that do not have a specific queue. On
the Documents tab you can select the Use Default Queue for all documents
option. ION does not poll any other queue and uses this queue to read all docu-

84 | Infor ION Technology Connectors Administration Guide


Message queue connection points

Property Description
ments. Confirm BODs that are published by the external JMS servers are also
expected in this queue. Ensure that this queue is unique to this connection point
and is not used as a read queue in any other connection point.
Default queue for This property is required to write one or more documents from ION to the JMS
Writing: queue. Specify the name of the queue on the external JMS server that is used
for writing those messages that do not have a specific queue. On the Documents
tab, you can select the Use Default Queue for all documents option. ION writes
all incoming documents of this connection point to this queue.
Authentication None: no authentication is required for the message queues. Basic: a user name
and password are required for the message queues.
User Name: If basis authentication is used, specify the user name to be used for the queues.
These credentials are used by ION to read or write the message queues.
Password: If basis authentication is used, specify the password to be used to connect to the
message queues.

This table shows the vendor specific properties of the connection point:

Table 1: Active MQ 5.5.1

Property Description
URL Specify the URL of the address of the external JMS server. The format is: tcp:
//MachineName:portNumber
Note that the machine name is the name of the external JMS server. If this is a
remote host, ensure to specify the correct host name and test if the port is acces-
sible.
Administration Port: The JMX port that is used by the Active MQ server. This is used by ION to retrieve
the metrics that are related to the Manage pages of ION Desk. You can find this
port number from the activemq.xml file available under this folder: activemq
Install Dir/conf

Table 2: IBM MQ 7.1.0

Property Description
Host Specify the machine name of the IBM MQ server.
The machine name is the name of the external JMS server. If this is a remote
host then ensure to specify the correct host name.
Port Port of the IBM MQ server. Ensure that the port is accessible.
Queue Manager Queue Manager of the chosen IBM MQ service
Channel Channel of the chosen IBM MQ service

Infor ION Technology Connectors Administration Guide | 85


Message queue connection points

Table 3: Tibco 6.3.0 (TCP based connection without using JNDI)

Property Description
URL Specify the URL of the address of the Tibco server. The format is:
tcp://MachineName:PortNumber
The machine name is the name of the external JMS server. If this is a remote
host, ensure to specify the correct host name and test if the port is accessible.

Table 4: Oracle AQ 11.2.0.1

Property Description
URL Specify the URL of the address of the Oracle AQ JMS server. The format is:
jdbc:oracle:thin:@//HostName:PortNumber/SystemID
The machine name is the name of the external JMS server. If this is a remote host
then ensure to specify the correct host name and test if the port is accessible.
Internal Logon This is the role used while making connection. This can be either default or sys-
dba.
Queue Table Table where the queues are stored

To use the Tibco EMS 8.2.0 (JNDI with SSL security) option, the TIbco Enterprise Message Service
Server must be configured to support SSL. See the official Tibco EMS documentation and sample files:
https://docs.tibco.com/pub/activematrix_businessworks_plugin_for_microsoft_sharepoint/6.0.0/doc/
html/GUID-18028D0D-02E9-411F-A5B0-FA3011FCDF71.html
Afterwards you must import the server certificate of the Tibco EMS server into ION.
• Ask your TIbco EMS administrator for the correct server certificate. This corresponds to the
configurations that are specified in the tibemsd.conf and factories.conf file of TIBCO EMS
server. Verify the certificate. The extensions cer, der and crt are supported byION. Rename the
certificate file with one of these extensions before proceeding.
• Ensure that the certificate file does not contain the private key.
• When you agree on the authenticity of the certificate, click Import and Trust Certificate.
• A window is displayed. Browse to the location of your certificate and select it. Click Open.
• The certificate is imported in the ION trust store.
ION is tested with TIBCO EMS as the JNDI provider. Continue with specifying the remaining TIBCO
EMS specific properties that are shown in this table:

Table 5: Tibco EMS 8.2.0 (JNDI with SSL security)

Property Description
JNDI URL Specify the provider URL of the TIBCO EMS JNDI server. The
format is: tibjmsnaming://<HOST>:<PORT>
JNDI Username Specify the JNDI username. Note that this is different than the
username required to connect to the JMS queues.

86 | Infor ION Technology Connectors Administration Guide


Message queue connection points

Property Description
JNDI Password Specify the password for the JNDI user.
Factory Name Specify the Queue connection factory set in the factories.conf file
of TIBCO EMS in the Queue Connection Factory field. For exam-
ple: SSLQueueConnectionFactory
Factory Context Specify the Initial context factory to be used for the JNDI lookup.
For example: com.tibco.tibjms.naming.TibjmsInitialContextFactory
URL Package Prefixes Specify the package that provides the context class user
to perform JNDI and SSL operations. For example: com.tibco.tib-
jms.naming
SSL Client Identity: Import Client • Ask your TIbco EMS administrator for the correct client identity
Certificate certificate. This corresponds to the configurations that are
specified in the factories.conf file of TIBCO EMS server.
Verify the certificate. The formats PKCS12 , JKS and JCEKS
are supported by ION. The Related extensions are:
• .p12
• .pfx
• .jks
• .jceks

• When you agree on the authenticity of the certificate, click


Import Client Certificate.
• A window is displayed. Browse to the location of your certificate
and select it. Click Open.

SSL Client Keystore Password Specify the password for the client certificate.

The Tibco 8.2.0 (Plain SSL connection without JNDI) option uses SSL channel to connect to TIBCO
EMS. It requires SSL enabling on the TIBCO side. The server certificate must be imported into ION.
Ask your TIbco EMS administrator for the correct server certificate. This corresponds to the configurations
that are specified in the tibemsd.conf and factories.conf file of TIBCO EMS server. Verify the
certificate. The extensions cer, der and crt are supported byION. Rename the certificate file with
one of these extensions before proceeding.
• Log on to ION Desk.
• Select Configure > ION Service.
• Click the Configuration Files tab.
• Click Import Certificate in the Certificate Store.
• A window is displayed. Browse to the location of your certificate and select it. Click Open.
Continue with specifying the remaining TIBCO 8.2.0 specific properties that are shown in this table:

Infor ION Technology Connectors Administration Guide | 87


Message queue connection points

Table 6: Tibco 8.2.0 (Plain SSL connection without JNDI)

Property Description
URL Specify the SSL URL of the address of the Tibco server. The format
is: ssl://MachineName:PortNumber

If you chose another JMS vendor that is registered by you, the connection properties that you defined
are shown. Specify appropriate values.
Click Test to verify whether the connection details are correct. You are informed whether the test is
successful.

Documents
To specify properties for a document verb:
1 Start ION Desk.
2 Click Model > Connect > Connection points.
3 Click New and select Technology > Message Queue.
4 Click the Documents tab.
5 You can instruct ION to use a default read and write queue for all documents, or use a specific read
and write queue per document type. To use the default queue, select the Use Default Queue for
all documents option. In that case, ION uses the default queue that is defined in the Settings tab.
6 Select the documents that can be sent or received by the application. The selected documents must
match the actual capabilities of the application.
7 Click Add Document to add a document type.
8 Select the document and click Add Verbs to add verbs for a document type.
The documents and verbs are selected from the ION registry.

This table shows the verb you can specify for each document:
Content Description
Write to Queue: The document type must be written to the message queue. If the option, Use
Default Queue for all documents is switched off, you can specify a specific
queue where to write this document. The incoming messages are delivered to
this queue. If you do not specify a specific queue name, the default queue that
is defined in the Settings tab is used.
Read from Queue: The document type must be read from the message queue. If the option, Use
Default Queue for all documents is switched off, you can specify a specific
queue where to retrieve this document. ION polls this queue. Ensure that this
queue is unique to this connection point and not used as a read queue in any
other connection point. If you do not specify a specific queue name, the default
queue that is defined in the Settings tab is used.

88 | Infor ION Technology Connectors Administration Guide


Message queue connection points

Content Description
JMS Type: An indication of the type of document that is read from or written to the message
queue. This is used for the standard JMS header property JMSType, which
defines the type of the data that is included in the message. When writing the
queue, the JMS Type must be set. The value is used in the JMSType header
property when sending the JMS message to the message queue. When reading
the queue, the JMS Type is used to determine what type of BOD arrives. The
JMSType header property for an incoming message is read and depending on
the value a document type is chosen for the BOD message. If the queue is only
used for one document type then the JMS Type can be blank. In that case any
incoming message results in the specified document type. If multiple document
types are read from the queue, the JMS Type must be set. It can be blank for
one of the document types.
Content Until ION 12.0.5, this column had a check box and was called ‘Full BOD’. Now
this column is renamed to ‘Content’.
Select one of the available content types:
• Full BOD: Select this option if the application that is at the other side of the
queue is able to send or receive Full BODs. The message queue must contain
the complete BOD message. Note: the message that is read from the queue
cannot contain any characters that cannot be included in an XML message.
When this option is selected, the BOD XML is transported as is to the JMS
destination back and forth. This option is automatically selected for those
connection points from previous ION environments where the check box for
‘Full BOD’ was selected.
• XML: Select this option if the JMS message is a valid XML but does not ad-
here to the Infor BOD XML standards. Note: the message that is read from
the queue must not contain any characters that cannot be included in an
XML message. This option has an effect only during the scenario of message
transfer from ION to an external queue. In this scenario, the data in the noun
instance of the BOD is treated as a valid XML. All namespaces that are de-
fined in the XML header element of the incoming BOD are transferred to the
root element of the data in the noun instance. If multiple instances of data in
the noun section exist, each of them is constructed as a separate JMS
message and delivered to the destination queue. A confirm BOD is thrown
if the data in the noun instance is not a valid XML.
• nonXML: This option is automatically selected for those connection points
from previous ION environments where the ‘Full BOD’ check box was cleared.
Select this option if the JMS message is not an XML but any text. When 'non
XML' is selected, the message in the message queue is used as the data in
the noun instance of the BOD. For example, if the document is 'MyOrder'
and the verb is 'Sync'.

Infor ION Technology Connectors Administration Guide | 89


Message queue connection points

Content Description

This table shows examples of how the JMS Types are used when reading messages from the queue:
Configuration of Documents BODs created for incoming messages
SyncSalesOrder, JMS Type is not set For any JMS message a SyncSalesOrder BOD is created, in-
dependent of the value of the JMSType header property
SyncSalesOrder, JMS Type = "Sale- If the JMSType of the JMS message is "SalesOrder", a Sync-
sOrder" SalesOrder BOD is created. Otherwise the incoming message
is logged and skipped in the message tracker log file. Set the
log level of this file to DEBUG mode while troubleshooting.
SyncSalesOrder, JMS Type = "Sale- If the JMSType of the JMS message is "SalesOrder", a Sync-
sOrder" SyncMyObject, JMS Type is SalesOrder BOD is created For any other JMSType a
not set SyncMyObject BOD is created
SyncSalesOrder, JMS Type = "Sale- If the JMSType of the JMS message is "SalesOrder", a Sync-
sOrder" SyncContract, JMS Type = SalesOrder BOD is created. If the JMSType of the JMS mes-
"Contract" sage is "Contract" then a SyncContract BOD is created. Other-
wise the incoming message is logged in the message tracker
log file and skipped. Set the loglevel of this file to DEBUG mode
while troubleshooting.

If no messages must be deleted, specify one (generic) received document with a blank JMS Type.
Route that document type to an application, database, web service or message queue where you want
to handle the unexpected messages.

90 | Infor ION Technology Connectors Administration Guide


Message queue connection points

Click Remove to remove a document or verb. Errors are reported in the Document flow messages
pane when:
• Removing a document or verb that is used in a document flow.
• Neither default queue is specified nor a specific queue for a document is specified.
• The same JMS queue is used for reading and writing messages.

Supporting Native mode of IBM MQ


If you are using IBM MQ as your JMS server, IBM MQ supports these modes:
• Native mode.
• JMS compliant mode.
The default mode in ION is the JMS compliant mode. In order to support the native mode, an extra
parameter is needed while specifying the queue configuration. This parameter changes the
TextMessages of MQRFH2 format to simple MQSTR format.
To support the native mode of IBM, specify the name as:
queue:///<<queue_name>>?targetClient=1
Queue names specified as part of default read/ write queue in the connection properties tab and
individual queues specified in the documents tab must adhere to this format.

Configuring a message queue connection point as a


JMS server
When configuring a Message queue connection point as a JMS Server, a message queue connection
point creates queues within ION that can be used by external parties.
Select Connection Point as JMS Server.

Connection properties
This table shows the properties you can specify on the Settings tab of a message queue connection
point:

Property Description
URL: Specify the URL of the address to be used by the JMS service. The format is:
tcp://<machineName>:<portNumber> . The <machineName> must be the

Infor ION Technology Connectors Administration Guide | 91


Message queue connection points

Property Description
name of the machine that hosts ION. The <portNumber> must be the number of
a free port that is less than 50000 and accessible for the clients. In the ION Grid
based deployment, it is possible that ION Service is hosted in more than one
host. In this case, you must choose the host where the ION Connect Grid appli-
cation is running. Specify the fully qualified machine name of this host. In this
scenario, specifying localhost is not supported
Queue for Reading: Specify the name of the queue to use for reading messages. This property is re-
quired to read one or more documents from the JMS queue and use them in ION
.
Queue for Writing: Specify the name of the queue to use for writing messages. This property is re-
quired to write one or more documents fromION to the JMS queue.
Authentication None: no authentication is required for the message queues.
Basic: a user name and password are required for the message queues.
User Name: If basis authentication is used, specify the user name for the queues. The appli-
cation that is at the other side of the queue must use this to read or write the
message queues.
Password: If basis authentication is used, specify the password for connecting to the message
queues.

Click Test to verify whether the connection details are correct. You are informed whether the test is
successful.

Documents
To specify properties for a document verb:
1 Start ION Desk.
2 Click Model > Connect > Connection points.
3 Click New and select Technology > Message Queue.
4 Click the Documents tab
5 Select the documents that can be sent or received by the application. The selected documents must
match the actual capabilities of the application.
6 Click Add Document to add a document type.
7 Select the document and click Add Verbs to add verbs for a document type.
The documents and verbs are selected from the ION registry.

This table shows the verb you can specify for each document:
Verb Description
Write to Queue: The document type must be written to the message queue.

92 | Infor ION Technology Connectors Administration Guide


Message queue connection points

Verb Description
Read from Queue: The document type must be read from the message queue
JMS Type: See the description in the "Configuring a Message queue connection point" on
page 91.
Full BOD See the description in the "Configuring a Message queue connection point" on
page 91.

Click Remove to remove a document or verb. When removing a document or verb that is used in a
document flow, an error is reported in the document flow messages pane.

Additional properties
When modeling a Message Queue connection point, you can optionally define additional JMS properties.
These properties are added when sending a message to the JMS write queue. The properties are set
at the level of connection point and will apply to all messages delivered by this connection point. The
source value for the additional property can be a:
• Constant value defined by the user.
• Value from one of the existing ION header fields in a message. For example:
• BatchId
• BatchSequence
• BatchSize
• BatchRevision
• BatchAbortIndicator
• MessageId
• TenantId
• BODType
• CreationDateTime
• FromLogicalId
• ToLogicalId
• Priority
• DocumentId
• AccountingEntity
• Location
• RevisionId
• VariationId

Infor ION Technology Connectors Administration Guide | 93


Message queue connection points

Specifying additional properties


1 Start ION Desk
2 Select Model > Connect > Connection points.
3 Click New
4 Select Technology > Message Queue
5 Click the Additional Properties tab.
6 Click Add.
The Additional property dialog box is displayed.
7 Specify the JMS Property name.
The first character must be a letter (upper case or lower case), the dollar sign "$", or the underscore
character "_"; subsequent characters can be letters, digits, dollar signs, or underscore characters.
Property name is case-sensitive. The name cannot be one of these reserved strings:
• All ION header field values listed earlier.
• Encoding
• ReferenceId
• Text
• JMSCorrelationID
• JMSDeliveryMode
• JMSDestination
• JMSExpiration
• JMSMessageID
• JMSPriority
• JMSRedelivered
• JMSReplyTo
• JMSTimestamp
• JMSType

8 Select a constant value or use an ION header field. Provide an input value accordingly.
9 Click Ok.
10 Click Edit to modify an existing property or click Remove to remove a property.

Registering JMS Vendors with ION


You can register external JMS vendors in ION, to use the message queue connection point as a JMS
client.
The ION JMS client connector is tested with these external vendors under their default installation
conditions:

94 | Infor ION Technology Connectors Administration Guide


Message queue connection points

• IBM MQ 7.1.0
• Tibco EMS 6.3.0
• ActiveMQ 5.5.1
• Oracle AQ 11.2.0.1
In addition to this, you can also use ION to connect to a different JMS vendor.
If you want ION to connect to any of the external JMS queues, you must register the client libraries of
the external JMS vendors with ION. These Client libraries are usually not distributable. So, to connect
to the queues of external vendors, you must have the client libraries. You must wrap these libraries
into a bundle that you can deploy in ION. You can perform this bundle wrapping process on any machine.
You must upload the final output to ION Service using the options in ION Desk.
Because the bundle wrapper program is run externally, ION uses the standard JAVA_HOME environment
variable available in the system. Therefore, you require a version of Java Software Developer's KIT,
or JDK, that is installed and configured in the machine where you run the program. Ensure that you
install JDK, not a Java Runtime Environment (JRE). The version of JDK you install must be supported
by ION. For the current JDK version supported by ION, see the Infor ION Installation and Configuration
Guide (U9854 US).
Note: The bundle wrapper registration process in ION requires technical knowledge of Java and JMS
technologies.
You can create a Message queue connection point based on the any of the registered vendors. The
list of properties in the connection point reflects the definition in the vendor specific class at that time
and permanently remains fixed. When you alter the properties of an existing vendor specific class and
re-upload the driver, the older properties are still present in any previously defined connection points
of that type. Therefore, if you change the list of properties in your driver you are required to freshly
recreate your connection point.

Extracting the bundle wrapper utility


To extract the bundle wrapper utility:
1 Log on to ION Desk. Select Configure > ION Service.
The Configure ION Service page is displayed.
2 Click the Configuration Files tab.
3 In the Custom JMS Client libraries section, click Download wrapper.
4 The Save As window is displayed. Specify the file name as JMSBundleWrapper.zip and click
Save.
5 The zip file is downloaded at the selected location. A message that the file is downloaded is displayed.
Click OK.
6 Extract this zip file on a machine where JDK is installed.
Extract the file to, for example, C:\temp.

Infor ION Technology Connectors Administration Guide | 95


Message queue connection points

Preparing for registration


Before you can register external JMS vendors in ION, you must::
1 Prepare the custom client library Jar files provided by the respective vendor.
See "Preparing vendor-specific JMS client Jar files" on page 96.
2 Prepare a properties.txt file to reflect the vendor specifics.
See "Preparing a property file" on page 97.
3 Prepare a Java class file that implements the interfaces required by ION.
See "Implementing a vendor-specific JMS connection factory" on page 98.

Preparing vendor-specific JMS client Jar files


1 Ensure that the JMS client libraries of the concerned vendors are available.
For the vendors who are tested with ION, the table shows which files are required. For other vendors,
see the vendor-specific documentation to identify the required client libraries.

JMS Vendor Client jar files required


IBM WebSphere MQ 7.1 These jar files are found in the [Install Path]/IBM/Web
Sphere MQ/java/lib/ folder:
a com.ibm.mq.commonservices.jar
b com.ibm.mq.headers.jar
c com.ibm.mq.jar
d com.ibm.mq.jmqi.jar
e com.ibm.mq.pcf.jar
f com.ibm.mqjms.jar
g connector.jar
h dhbcore.jar

Tibco EMS 6.3 a [Install Path]/ems/6.3/lib/tibjms.jar


b [Install Path]/ems/6.3/lib/tibjmsadmin.jar

Tibco EMS 8.2. a [Install Path]/ems/6.3/lib/tibjms.jar


b [Install Path]/ems/6.3/lib/tibjmsadmin.jar
c [Install Path]/ems/6.3/lib/jms-2.0.jar
d [Install Path]/ems/6.3/lib/tibcrypt.jar (This jar is only required
when you use the SSL option)

Active MQ 5.5 [Install Path]/apache-activemq-5.5.1/lib/ac-


tivemq-core-5.5.1.jar
Oracle AQ 11.2.0.1 a [ORACLE_HOME]\oc4j\rdbms\jlib\Aqapi.jar

96 | Infor ION Technology Connectors Administration Guide


Message queue connection points

JMS Vendor Client jar files required


b ojdbc5.jar or ojdbc6.jar available under [ORACLE_
HOME]\jdbc\lib

2 You cannot use multiple files, such as multiple jar files or a jar file combined with a zip file. In case
of multiple files, you must first create a single, flattened, jar file to be used in ION.
To create a single, flattened, jar file:
a Create a temporary directory. For example: C:\temp\JMSClientBundleWrapper\jars.
b Place the individual jar files into this directory.
Use the table to determine which jar files are required for your JMS vendor.
c Navigate to the build folder in the extracted location of the JMSClientBundleWrapper.
For example: C:\temp\JMSClientBundleWrapper\build
d Run the runant tool with this command:
runant flatten -Dflattened.jar.file.name=<final jar file name> -
Djmsclient.jars.dir=<location of individual jars>
For example: runant flatten -Dflattened.jar.file.name="C:\temp\JMSClient
BundleWrapper\OriginalJar\Tibcoflatten.jar" -Djmsclient.jars.dir="C:\
temp\JMSClientBundleWrapper\jars"

3 In the example the final jar file is already placed in the folder: JMSClientBundleWrapper\
OriginalJar
If you used another target location in the previous step, then, copy it to this folder: /JMSClient
BundleWrapper/OriginalJar

Preparing a property file


1 Create a properties.txt file that contains vendor-specific properties.
For the vendors who are tested with ION, example property files are provided as part of the
downloaded JMSBundlewrapper zip file in this folder: \JMSClientBundleWrapper\examples\
[Vendor Name]. For example, C:\temp\JMSClientBundleWrapper\examples\IBMWMQ.
For other vendors, you must create a property file based on the template that is provided in: \
JMSClientBundleWrapper\examples\Others. For example, C:\temp\JMSClientBundle
Wrapper\examples\Others.
Specify these properties in the properties.txt file:

InstallPath
Specify the absolute path where the zip file is unzipped. The default value is C:\temp\JMSClient
BundleWrapper.
Note: If you change this path, you must also change the localRepository property in this file:
\JMSBundleWrapper\build\settings.xml

Example:

Infor ION Technology Connectors Administration Guide | 97


Message queue connection points

InstallPath=C:\mylocation\JMSBundleWrapper
OriginalJar
Specify the file name of the jar that was copied to the OriginalJar folder.
Example:
OriginalJar= com.infor.ion.ibmmq-7.1.0 jar
BundleSymbolicName
Specify a unique identifier for a bundle, based on the reverse domain name convention. This
convention is also used by the Java packages.
Example:
BundleSymbolicName= com.infor.ion.ibmmq
BundleVersion
Specify the version to be used for the OSGi bundle.
A version must be of this format:
positiveInteger (.positiveInteger (.positiveInteger))-(buildNr|qualifier)
The first three positions must be a positive integer.
We recommend that you use the JMS server version.
Example:
BundleVersion=7.1.0
BundleName
Specify any short human-readable name for the OSGi bundle to be created for the JMS Client.
Example:
BundleName= com.infor.ion.ibmmq
BundleDescription
Specify a description for the OSGi bundle to be created for the JMS Client.
Example:
BundleDescription=IBM MQ
JMSProviderCode
This name is displayed together with the version in ION Desk.
Example:
JMSProviderCode = IBMWMQ
SpringBeanId
Specify a unique identifier accross all custom wrapper (JMS & Dynamic JDBC) projects.
Example: SpringBeanId = jmsTibcoClientImpl

2 When the property file is ready, copy the file to: \JMSClientBundleWrapper

Implementing a vendor-specific JMS connection factory


1 Prepare a Java class file that implements the interface exposed by ION.

98 | Infor ION Technology Connectors Administration Guide


Message queue connection points

For vendors that are supported by ION, an example Java class file called VendorSpecificJms
Impl.java is provided in the \JMSClientBundleWrapper\examples\[Vendor Name] folder.
Note that this java class file is provided as a reference. You possibly must modify or extend this
reference code depending on the actual deployment conditions of your JMS server setup; for example
if a remote queue is used, or other specific configurations.
For other vendors, you must create a Java class file based on the template that is provided in the
\JMSClientBundleWrapper\examples\Others folder.
This table shows the interface methods that must be implemented:

Interface method Description


getVendorIdentityProperties Connection properties required to connect to
vendor JMS server required. Username and
password are included as standard properties
for every JMS vendor. Therefore, you do not have
to define these properties in this method.
getConnectionFactory (Map<String, Builds a connection factory object based on the
String> connPropsMap) vendor-specific connection property values de-
fined in the getVendorIdentityProperties
method. Values for these properties are specified
in ION Desk during the connection point modeling
time.
The connPropsMap parameter specifies the
vendor-specific connection property values.
getQueueMessageCount (Map<String, Retrieves the number of messages per queue.
String> connPropsMap, String[] queue The numbers are displayed in various number
Name, Connection conn) of messages columns in the Active Connection
Points screen in the Manage > Connect menu
in ION Desk.
The connPropsMap parameter specifies the
vendor-specific connection property values.
The queueName parameter specifies the list of
queue names.
The conn parameter specifies the JMS Connec-
tion object.
getQueueNames (Map<String, String> This method is not used yet by ION. You can
connPropsMap, Connection conn) leave this method unimplemented for now. When
implemented, this method is used to retrieve the
list of queue names.
The connPropsMap parameter specifies the
vendor-specific connection property values.
The conn parameter specifies the JMS Connec-
tion object.

2 When this Java class file is ready, copy it to the /JMSClientBundleWrapper/OriginalJar


folder.

Infor ION Technology Connectors Administration Guide | 99


Message queue connection points

Deploying the JMS vendor


After the preparation is complete, you can deploy the JMS vendor in ION.
To deploy a specific JMS driver in ION:
1 Ensure that the custom jar is placed into the JMSClientBundleWrapper\OriginalJar folder.
2 Ensure that the VendorSpecificJmsImpl.java file is properly implemented and placed into the
JMSClientBundleWrapper\OriginalJar folder.
3 Ensure that the properties.txt file reflects the vendor specifics and is placed in the /JMSClient
BundleWrapper folder.
4 Run the build.bat script. These results are possible:
• The BUILD SUCCESSFUL message is displayed. A zip file is created (OSGi bundle) in the /
JMSClientBundleWrapper folder. This file is required to start up the bundle.
• The execution of build.bat fails because of insufficient write privileges or because of lack of
correct jar files. A relevant detail error message is displayed. Take corrective action based on
the error and retry.

5 Complete these steps:


a In ION Desk, select Configure > ION Service. Then click the Configuration Files tab.
b In the Custom JMS Client libraries section, click Upload.
c Upload the zip file.
d If this is a replacement of an already active driver, then the ION service must restart. Click Yes
and wait for a few minutes until the ION service is running again
If the upload is successful, a message that the file is uploaded is displayed. The entry is displayed
in the list of Custom JMS Client Libraries.

Now you can model your Message queue connection point as a client using the new JMS client
registered..

Defining a connection point for JMS messages


Here is explained how to define a Message Queue Server connection point that you can use to read
or write JMS messages to or from external applications. This is only relevant, if you define the message
queue connection point as a JMS provider. The examples in this section are ActiveMQ-specific.
To get started with ActiveMQ, download the examples from the ActiveMQ download site.
See http://activemq.apache.org/download.html.
The download contains an example folder. The examples use the apache ActiveMQ server to connect
to, and read or write messages. Prerequisites for these examples are a Java SDK and the ant build
tool.
You can use two examples, Producer and Consumer, to see messages flowing from Producer to the
ActiveMQ server to Consumer. Complete these steps:

100 | Infor ION Technology Connectors Administration Guide


Message queue connection points

1 To start the server, run this command from the command line:

bin/activemq console

2 To start the Consumer, run this command:

ant consumer

3 To start the Producer, run this command:

ant producer

2000 text messages are sent now from Producer to the message queue named TEST.FOO at tcp:
//localhost:61616, which is created by the ActiveMQ server. The messages are received by
Consumer, which is listening to that created queue.

Instead of this example server, you can model a document flow, which performs almost the same, in
ION. In ION, these connection points are modeled:
• A Message Queue connection point to which Producer can send its messages.
• Another connection point from which Consumer can receive its messages.
The ION engine routes the messages from one connection point to another.
Points of attention:
• Model the Producer connection point with these properties:
• url: tcp://localhost:61616
• Queue for Reading: TEST.FOO
Document settings depend on the messages that are written to the queue. Select a BOD and select
the Read from Queue check box.
See Message Queue connection points.
• Model the Consumer connection point with these properties:
• url: tcp://localhost:61618
• Queue for Writing: TEST.FOO
Document settings depend on the messages that are read from the queue. Select a BOD and select
the Write to Queue check box.
See Message Queue connection points.

The difference between the example and the model is the fact that the Consumer should not directly
read from port 61616 because the ION engine is reading this queue. ION routes the incoming messages
to all connection points which are modeled.

Infor ION Technology Connectors Administration Guide | 101


Message queue connection points

In the modeled flow messages are coming in at port 61616 of the incoming adapter and are routed to
the outgoing adapter with port 61618. The Consumer example receives 2000 messages from port
61616 by default; in this case it should be overruled by:

ant -Durl=tcp://localhost:61618 consumer - Dmax=1

The Producer example sends text messages which are received by Consumer. ION cannot receive or
send plain text messages, only xml messages are allowed.
See Message Queue connection points.
Therefore, you must change the Producer example so that the message is xml. Reading a file which
contains a Full BOD is convenient; in that case you can replace the createMessageText() method in
src/Producer.java by this example:

private String createMessageText(int index) {


File file = new File("bod.xml");
String content = "";
try {
content = FileUtils.readFileToString(file);
} catch (IOException e) {
e.printStackTrace();
}
return content;
}

You can overrule the default of producing 2000 messages by:

ant producer -Dmax=1

With these settings one message that contains the content of bod.xml is sent to ION.

102 | Infor ION Technology Connectors Administration Guide


Web service connection points
6

The Web Service Connector can connect applications that are unable to send or receive BODs, but
have a web service interface available. In this way, you can retrieve data from a web service and send
it to one or more applications. Or you can use data from BODs to invoke a web service.
In a document flow, the use of web service connection points is comparable to the use of any type of
connection points. Data from a web service is packed as a BOD and delivered to any other connection
points. Data in BODs from any connection point can be delivered to a web service. Because all data
is packed as BOD messages, you can extend your document flow using mappings or content-based
routing.
When using standard BODs, you must transform the BOD contents to a web service request or transform
a web service response to the BOD. To avoid unnecessary custom BODs, this transformation can be
done inside the web service connector.

Prerequisites
You can use a web service in ION in these cases:
• The web service is accessible through SOAP (Simple Object Access Protocol) over http or https.
REST (Representational State Transfer) is not supported.
• The web service is accessible anonymously or by using basic authentication (RFC 2617).
• The WSDL version is 1.1. Version 2.0 (also known as 1.2) is not supported in ION.
• The WSDL does not contain overloaded operations (multiple operations having the same name but
different input or output). To use one of these operations, use a copy of the WSDL and remove the
variants that you do not use.
• The WSDL does not contain circular references. For example, the WSDL cannot import an XSD
that in turn imports the WSDL again.
• In case of an RPC-style web service, both the input and the output must be a single parameter.
Although it can be an XML node having child nodes.
• The web service does not use WS-A (Addressing).
• At least one input parameter in the WS operation that is referred from ION must be of complex data
type.
Web services show a lot of variety. Not all web services adhere to standards such as WS-I or WS-I
Basic Profile and different practices are used. Although ION was tested with various web services, we
cannot guarantee that any web service works with ION. If you have problems using your web service
in ION, go to the Infor Xtreme Support portal at http://www.infor.com/inforxtreme

Infor ION Technology Connectors Administration Guide | 103


Web service connection points

Connecting to a web service


In ION, you can model document flows for web service connection in the same way as for other
connectors. In the document flow, a web service activity is added and the web service connection point
is selected.
To create web service connection points:
1 Click Model > Connect > Connection Points.
2 Specify a (unique) name. The logical ID that identifies the connection point is derived from the name.
For example, if the name is MyWebService, the logical id is infor.ws.mywebservice.
3 Specify the URL to the WSDL:
For example https://somewhere:1234/myservice.svc?wsdl or https://somewhere:1234/myservice?wsdl
• The URL starts with http:// or https://. In the latter case, ION automatically retrieves the
public key to connect to the service when loading the WSDL and verifies if the certificate is trusted
in ION.
• If the certificate is not trusted, an alert to download the certificate is displayed.
• Download the certificate using your browser and inspect the certificate.
• When you agree on the authenticity of the certificate, click Import and Trust Certificate.
• A window is displayed. Browse to the location of your certificate and select it. Click Open.
• The certificate is imported in ION's trust store. Continue working with the URL.

4 Specify the authentication:


• Select None if no authentication is required to invoke the web service.
• Select Basic and specify a user name and password if authentication is required.
Note that the same authentication is used when loading the WSDL and (after activation) when
invoking the web service from the ION Service. Either the same authentication must be sufficient
for both the WSDL and the service, or the WSDL is accessed without authentication. The web
service connector cannot be used if a different user name is required for accessing the WSDL and
accessing the service.
Additionally, if authentication is required for accessing the WSDL and the WSDL contains import
statements, then these are loaded if the URL (at least up to the first question mark) is the same. If
the URL differs then the authentication mechanism cannot recognize it.
Note:
As specified in RFC 2617, using basic authentication is not secure when using http, because user
name and password are passed over the network as text. Using https avoids this.
When a connection using basic authentication is unsuccessful, a retry is attempted with same
credentials using Windows NTLM authentication.

5 Click Load WSDL.


The loaded WSDL is used in ION Desk to enable you to select the operations and to connect to the
service in the ION Service. If the WSDL is changed on the server, the configuration in ION is not
changed until you click Load WSDL again.
When a WSDL was loaded before, and you already selected operations to be used by the connection
point, ION checks whether the selected operations are compatible. If one or more operations are

104 | Infor ION Technology Connectors Administration Guide


Web service connection points

not available in to the new WSDL, or the used input or output is incompatible, these are removed.
You are asked to confirm this; if you click No then the changed WSDL is not loaded.
6 Select the service to be used.
If the WSDL only contains one service, the service name is selected automatically.
7 Select the port name.
If the selected service only has one port, the port name is selected automatically. Note that if you
want to use operations from multiple services or from multiple service ports you must create multiple
web service connection points.
8 Click Test to verify that you can connect to the selected service and port using the selected
authentication.

Scenarios
This table lists the scenarios supported by the web service connector:

Image Scenario description


Sending data to a web service.

Retrieving data from a web service that is based on a schedule.


This scenario can be used for event management or workflow.
See the Infor ION Desk User Guide.
Using an incoming document to trigger a web service operation and publish
the resulting data. This is called the triggering scenario.

For an incoming document, use a web service to retrieve additional data


and add that to the document. This is called the enrichment scenario.

The scenario for invoking a web service based on a Process BOD and returning an Acknowledge BOD
in reply is not supported.

Infor ION Technology Connectors Administration Guide | 105


Web service connection points

Sending data to a web service


To send data to a web service, the model in ION Desk is as follows. A document flow contains a web
service activity, usually at the end of the flow. In the activity, the web service connection point to be
used is selected. This diagram is an example document flow:

In the web service connection point the connection settings must be defined and the WSDL must be
loaded, as described earlier.
After that, you can model:
• The operation to be used.
• The BOD document to be used. The document is defined using a document type (such as SalesOrder)
and a verb. In this scenario, you can use these verbs : Sync, Acknowledge, Load or Update.
• The transformation from the BOD document to the web service input.
• You can use an automatic transformation. In that case the web service input must be inside the
noun element of the BOD. Because the required input for the web service operation is known,
an XSD is included in the WSDL. A custom BOD can be generated in the ION Registry.
In case of automatic transformation, the incoming BOD must contain exactly one noun instance.
If it contains no noun instance or multiple noun instances the BOD is rejected, resulting in a
Confirm BOD.
• You can use your own transformation by selecting Advanced. In that case you must provide an
XSLT to map the incoming BOD to the web service request. This provides more flexibility. For
example, you can set header elements in the web service request, or you can retrieve the required
data from an incoming standard BOD. But it is more complex to model.
When using the Advanced transformation, click Details to specify the transformation. If no XSLT
was specified before, a default XSLT is provided. Use this template as a starting point. It is not
a working XSLT.
The Advanced transformation option supports both XSLT "1.0" and "2.0" standards. Specify
the appropriate version you want to use in the version attribute of the XSLT header.

106 | Infor ION Technology Connectors Administration Guide


Web service connection points

Generating metadata for incoming BOD


If you use the automatic transformation, you can generate the metadata for the incoming BOD document:
1 Click Generate Metadata.
2 Specify a name for the custom document, such as 'MySalesOrder'. We recommend that you use
the prefix 'My' to avoid name clashes with existing or future standard BODs.
3 Select the element that is used as the identifier for the document.
4 Click OK to generate the metadata.
After generating the metadata, it can be used elsewhere in ION. For example for content-based
routing, filtering, event management or workflow activation policies.
Metadata generation is not only run for the specified verb, but for multiple verbs. These verbs are
used:
• Sync
• Process
• Acknowledge
• Get
• Show
• Load
• Update
These multiple verbs are to avoid regenerating metadata, when using another verb later. Not all
verbs can be used in the web service connector.
If the specified document name already exists as a custom document, you are informed about this.
You can cancel the action. If you continue, the existing custom document metadata is overwritten.
If the document you selected already exists as standard document, the generation fails.
If you already have a document that matches the (automatic or user-defined) transformation, select
that document using the … button. Do not click Generate Metadata in that case.
After completing the configuration in the connection point, you can run a test.
5 Click Test
A window is displayed.
6 Specify or paste an example BOD.
7 Click OK.
The specified transformation is run and the web service operation is started. In case of exceptions,
you are informed. If the action was successful, check the system that provides the web service, to
verify whether the data is as expected.
The web service connection point can be used in a document flow. Select the connection point in
the web service activity. Select the incoming document (or documents) to be sent to the web service.
After completing the flow, you can activate it. For example by adding an activity that publishes the
document and a mapping activity if required.
This diagram shows the active document flow:

Infor ION Technology Connectors Administration Guide | 107


Web service connection points

The incoming BOD document is transformed to the input as required for the web service operation.
The web service is started using this input. If the process is successful, the process ends here. The
web service output is ignored.
If the connection to the server cannot be made a retry is automatically done. A Confirm BOD is
generated for the incoming document, when:
• The server is available, and web service is unavailable.
• The web service returns a fault or another exception occurs.
To check this, select Connect > Manage > Error BODs.
An example of an automatic transformation for an RPC-style web service:

An example of an automatic transformation for a document-style web service

108 | Infor ION Technology Connectors Administration Guide


Web service connection points

Example of an advanced (user-defined) transformation

Note that the XSLT has the BOD DataArea XML as input and has the complete SOAP envelope
XML as output.
The current version of ION does not provide mapping tools to create an XSLT. Use the tool of your
choice, using the XSD from the WSDL on one hand. And the BOD XSD from the ION Registry on
the other hand.

Infor ION Technology Connectors Administration Guide | 109


Web service connection points

In this case use this XSLT:

<?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"/>
<!-- change indent to "no" after testing -->
<xsl:template match="DataArea">
<S:Envelope
xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Header>
<Environment><xsl:value-of
select="Sync/TenantID"/></Environment>
<Region>Default</Region>
</S:Header>
<S:Body
<MyOperationName>
<Customer>
<ID><xsl:value-of
select="MyCustomer/Header/DocumentID/ID"/></ID>
<Name><xsl:value-of
select="MyCustomer/Header/Contact/Name"/></Name>
</Customer>
</MyOperationName>
</S:Body>
</S:Envelope>
</xsl:template>
</xsl:stylesheet>

Retrieving data from a web service


To retrieve data from a web service, the model in ION Desk is as follows. A document flow contains a
web service activity, usually at the start of the flow. In the activity, the web service connection point to
be used is selected. This diagram is an example document flow:

110 | Infor ION Technology Connectors Administration Guide


Web service connection points

In this scenario the invocation of the web service is based on a schedule, the same web service
operation is invoked multiple times. If the operation always returns full set of data, the same data is
sent multiple times to the next step in the flow.
In the web service connection point the connection settings must be defined and the WSDL must be
loaded, as described earlier.
After that, you can model:
• The operation to be used.
• The BOD document to be used. The document is defined using a document type (such as SalesOrder)
and a verb. In this scenario, these verbs can be used: Sync, Process, Load or Update.
• A schedule to define how often the web service must be invoked. You can either specify:
• A basic schedule where the trigger is every 'x' seconds/ minutes / hours /days.
• An advance schedule that is based on a CRON expression.
To specify an advance schedule, see "Advance Scheduling Options for the Database/ File and web
service connection points." on page 129.
• The input to be used for the web service. The ION Desk provides a template based on the XSD
from the web service operation. You can specify values as required or remove irrelevant elements.
Note that the input is fixed in this scenario.
• Whether the output must be split into multiple BODs. Use this option if the web service returns
multiple objects. For example, a GetOrders operation can retrieve multiple orders. In that case, for
each order a BOD can be published.
When using this option, you must select the (repeating) element. For example, if the output of the
web service is:

Orders
Order
OrderNumber
Customer Smith
Order
OrderNumber 2
Customer Jones

Infor ION Technology Connectors Administration Guide | 111


Web service connection points

Then you can select the Order element. The Order elements are input for the transformation to the
BOD documents .
When using splitting, all elements above the split element are not used. These elements are
unavailable in the transformation.
• The transformation from the web service output to the BOD document.
• You can use an automatic transformation. In that case the web service output is put inside the
noun element of the BOD. The output of the web service operation is known, because an XSD
is included in the WSDL. Therefor, a custom BOD can be generated in the ION Registry.
• To use your own transformation select Advanced. Provide an XSLT to map the web service
response to the BOD to be sent. This provides more flexibility. You can use header elements
from the web service response, or include data from the web service in a specific location in the
BOD. In spite of that, it is more complex to model.
When using the advanced transformation, click Details to specify the transformation. If no XSLT
was specified before, a default XSLT is provided, to be used as a starting point.
The Advanced transformation option supports both XSLT "1.0" and "2.0" standards. Specify the
appropriate version to use in the version attribute of the XSLT header.

Generating metadata for BOD document


If you use the automatic transformation, you can generate the metadata for the BOD document to be
sent:
1 To use splitting, first select the Split check box and select the split element because this impacts
the metadata to be generated.
2 Click Generate Metadata.
3 Specify a name for the custom document, such as 'MySalesOrder'. It is advised to use the prefix
'My' to avoid name clashes with existing or future standard BODs.
4 Select the element that is used as the identifier for the document.
5 Click OK to generate the metadata. After generating the metadata, it can be used elsewhere in ION
, for example for content-based routing, filtering, event management or workflow activation policies.
When generating the metadata, the generation is done for multiple verbs (Sync, Process,
Acknowledge, Get, Show, Load and Update). This is to avoid regenerating the metadata if you want
to use another verb later. Not all verbs can be used in the web service connector.
If the document name you selected already exists as a custom document, you are informed and
you can cancel the action. If you continue, the existing custom document metadata is overwritten.
If the document you selected already exists as standard document, the generation fails.
If you already have a document that matches the (automatic or user-defined) transformation, you
can select that document using the '…' button. Do not clickGenerate Metadata.
After completing the configuration in the connection point, you can test it.
6 Click Test.

112 | Infor ION Technology Connectors Administration Guide


Web service connection points

The web service is invoked, the output is transformed and the resulting BODs are displayed. The
web service connection point can be used in a document flow.
7 Select the connection point in the web service activity and select the document (or documents) to
publish based on data from the web service.
After completing the flow (for example by adding a mapping activity if required and an activity that
receives the document), you can activate it.
This diagram shows the active document flow:

The web service is invoked based on the specified schedule. If required, the result is split into multiple
items. Then the result is transformed to a BOD document (or multiple BOD documents, if splitting
was done).
If ION cannot connect to the service then it automatically retries. If the web service returns a fault
or another exception occurs then an error is logged.
An example of an automatic transformation for an RPC-style web service:

An example of an automatic transformation for a document-style web service

Infor ION Technology Connectors Administration Guide | 113


Web service connection points

Example of an advanced (user-defined) transformation

Note that the XSLT has the complete SOAP envelope XML as input and has the BOD DataArea
XML as output. When using the advanced transformation in combination with splitting, the XSLT
(and its children) has the split element as input.

114 | Infor ION Technology Connectors Administration Guide


Web service connection points

In this case (without splitting) use this XSLT:

<?xml version="1.0" encoding="UTF-8"?>


<xsl:stylesheet version="2.0"
xmlns:xsl=http://www.w3.org/1999/XSL/Transform
xmlns:se=http://schemas.xmlsoap.org/soap/envelope/
exclude-result-prefixes="se">
<xsl:output method="xml" version="1.0" encoding="UTF-8"
indent="yes"/>
<!-- change indent to "no" after testing -->
<xsl:template match="se:Envelope">
<DataArea>
<Sync>
<AccountingEntity/>
<Location>
<xsl:value-of select="se:Header/Environment"/>
</Location>
</Sync>
<MyCustomer>
<Header>
<DocumentID>
<ID><xsl:value-of
select="se:Body/MyOperationName/Customer/ID"/></ID>
</DocumentID>
<Contact>
<Name><xsl:value-of
select="se:Body/MyOperationName/Customer/Name"/></Name>
</Contact>
</Header>
</MyCustomer>
</DataArea>
</xsl:template>
</xsl:stylesheet>

If no elements in the verb part are set it can be left out in the XSLT. The verb part is automatically
added if it is missing. In the verb part, the tenant is set. If a verb part containing a TenantID element
is created by the XSLT, the value is overwritten. Additionally, the main node of the BOD
(SyncMyCustomer) and the ApplicationArea is added including its contents.
Example of an automatic transformation including splitting, if the Customer element is used:

Infor ION Technology Connectors Administration Guide | 115


Web service connection points

In this case two BODs are published:

When using an advanced transformation in combination with splitting, note that only the split element
and its children are available for use in the XSLT. An example of an XSLT on the split element:

<?xml version="1.0" encoding="UTF-8"?>


<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:se=http://schemas.xmlsoap.org/soap/envelope/
exclude-result-prefixes="se" >

116 | Infor ION Technology Connectors Administration Guide


Web service connection points

<xsl:output method="xml" version="1.0" encoding="UTF-8"


indent="yes"/>
<!-- change indent to "no" after testing -->
<xsl:template match="Customer">
<DataArea>
<MyCustomer>
<Header>
<DocumentID>
<ID><xsl:value-of select="ID"/></ID>
</DocumentID>
<Contact>
<Name><xsl:value-of select="Name"/></Name>
</Contact>
</Header>
</MyCustomer>
</DataArea>
</xsl:template>
</xsl:stylesheet>

Based on this advanced transformation these BODs are published:

Infor ION Technology Connectors Administration Guide | 117


Web service connection points

Triggering scenario
In the triggering scenario, an incoming document is used to trigger a web service operation, and the
resulting data is published. For example, a BOD containing customer data is coming in. Based on this
BOD you want to invoke a web service that returns the open orders for a customer. And you want to
send these orders to a next step in the flow.
In this case, the model in ION Desk is as follows. A document flow contains a web service activity in
the middle of the flow. In the activity, the web service connection point to be used is selected. An
example document flow is shown in this diagram.

In the web service connection point the connection settings must be defined and the WSDL must be
loaded, as described earlier.
After that, you can model:
• The operation to be used.
• The BOD document to be used as input. The document is defined using a document type (such as
MyCustomer). In this scenario, the verb is always Sync.
• The transformation from the BOD document to the web service input.
• You can use an automatic transformation. In that case the web service input must be inside the
noun element of the BOD. The required input for the web service operation is known (an XSD
is included in the WSDL). A custom BOD can be generated in the ION Registry.
In case of automatic transformation, the incoming BOD must contain exactly one noun instance.
If it contains no noun instance or multiple noun instances the BOD is rejected, resulting in a
Confirm BOD.
• You can use your own transformation by selecting Advanced. In that case you must provide an
XSLT to map the incoming BOD to the web service request. This provides more flexibility. For
example, you can set header elements in the web service request, or you can pick the required
data from an incoming standard BOD. But it is more complex to model.
When using the Advanced transformation, click Details to specify the transformation. If no XSLT
was specified before, a default XSLT is provided to be used as a starting point. It is not a working
XSLT.
The Advanced transformation option supports both XSLT "1.0" and "2.0" standards. Specify the
appropriate version to use in the version attribute of the XSLT header.

118 | Infor ION Technology Connectors Administration Guide


Web service connection points

• The BOD document to be used as output. Again, the document is defined using a document type.
The verb is always Sync in this scenario.
• Whether the output must be split into multiple BODs. Use this option if the web service returns
multiple objects. For example, a GetOrders operation can retrieve multiple orders. In that case, for
each order a BOD can be published.
When using this option, you must select the (repeating) element
For example, if the output of the web service is:

Orders
Order
OrderNumber
Customer Smith
Order
OrderNumber 2
Customer Jones

Then you can select the Order element.


When using splitting, all elements above the split element are not used. These elements are not
available in the transformation.
• The transformation from the web service output to the BOD document. Again, you can use the
automatic transformation (enabling you to generate the BOD definition in the registry). Or use your
own transformations (giving you advanced flexibility, but more complex to model).

Generating metadata for BOD document


If you use the automatic transformation, you can generate the metadata for the BOD document. You
can do this for both the document to be received and the document to be sent:
1 To use splitting, first select the Split check box and select the split element, this impacts the metadata
to be generated.
2 Click Generate Metadata.
3 Specify a name for the custom document, such as MySalesOrder. We recommend that you use the
prefix 'My' to avoid name clashes with existing or future standard BODs.
4 Select the element that is used as the identifier for the document.
5 Click OK to generate the metadata.
After generating the metadata, it can be used elsewhere in ION, for example for content-based
routing, filtering, event management or workflow activation policies.
When generating the metadata, the generation is done for multiple verbs (Sync, Process,
Acknowledge, Get, Show, Load and Update). This is to avoid regenerating the metadata if you want
to use another verb later. Not all verbs can be used in the web service connector.
If the document name you selected already exists as a custom document, you are informed about
this and you can cancel the action. If you continue the existing custom document metadata is
overwritten. If the document you selected already exists as standard document, the generation fails.

Infor ION Technology Connectors Administration Guide | 119


Web service connection points

If you already have a document that matches the (automatic or user-defined) transformation, you
can select that document using the '…' button. Do not use the Generate Metadata button in that
case.
6 After completing the configuration in the connection point, you can run a test.
a Click Test.
b Specify or paste an example BOD.
c Click OK. The specified transformation is done and the web service operation is invoked. For
the output, the specified transformation is done. In case of exceptions, you are informed. If the
action was successful, the resulting BODs are shown in a window. If the web service operation
is expected to run any changes on the database, you can verify whether the data is as expected.
The web service connection point can be used in a document flow. Select the connection point in
the web service activity and select the procedure to be used. Select the document that is used to
trigger the web service call. The resulting document is automatically set in the document flow.
In this scenario, you can only use one document as input for the web service activity, and one
document as output.
Complete the flow. For example by adding an activity that publishes the required document, an
activity that receives the resulting document and mapping activities if required. After completing,
activate the flow.
When the document flow is active, this happens:

The incoming BOD document is transformed to the input as required for the web service operation.
Then the web service is invoked using this input. If the process is successful, the output is used for
the next steps. If required, the result is split into multiple items. Then the result is transformed to a
BOD document (or multiple BOD documents, if splitting was done).
If ION cannot connect to the server it automatically retries. A Confirm BOD is generated for the
incoming document, when:
• The server is available, and web service is unavailable.
• The web service returns a fault or another exception occurs.
To check this, select Connect > Manage > Error BODs.
Example
If the incoming BOD is a SyncMyCustomer, a user-defined transformation retrieves the customer
ID from the BOD. This ID is used as input for the web service. The web service retrieves the orders
for the customer. The result is split, because one BOD per order is required. Then the automatic
transformation is used to create the SyncMyOrder BODs to be published.
Example of an advanced (user-defined) transformation for an RPC-style web service:

120 | Infor ION Technology Connectors Administration Guide


Web service connection points

Note: the XSLT has the BOD DataArea XML as input and the complete SOAP envelope XML as
output. You can use this XSLT:

<?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"/>
<!-- change indent to "no" after testing -->
<xsl:template match="DataArea">
<S:Envelope
xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Header/>
<S:Body>
<GetCustomerOrders>
<Customer>
<CustomerID><xsl:value-of
select="MyCustomer/Header/DocumentID/ID"/></CustomerID>
</Customer>
</GetCustomerOrders>
</S:Body>
</S:Envelope>
</xsl:template>
</xsl:stylesheet>

The web service response is split and transformed automatically into BODs:

Infor ION Technology Connectors Administration Guide | 121


Web service connection points

Note: when using the Advanced transformation, the XSLT has the complete SOAP envelope XML
as input and the BOD DataArea XML as output. When using the advanced transformation in
combination with splitting, the XSLT has the split element (and its children) as input.

122 | Infor ION Technology Connectors Administration Guide


Web service connection points

Enrichment scenario
In the enrichment scenario, for an incoming document, a web service is used to retrieve additional data
and add that to the document. For example, a BOD containing employee data is coming in. The data
is not complete yet because the salary information is stored in a separate application. A web service
is available to retrieve the salary for an employee. This information must be added to the employee
BOD before sending it to a next step in the flow.
In this case, the model in ION Desk is as follows. A document flow contains a web service activity in
the middle of the flow. In the activity, the web service connection point to be used is selected. This is
the same as the triggering scenario.
This diagram shows an example document flow:

In the web service connection point the connection settings must be defined and the WSDL must be
loaded, as described earlier.
After that, you can model:
• The operation to be used.
• The BOD document to be used. The document is defined using a document type (such as
MyEmployee). In this scenario, the type of the incoming BOD document is the same as the type
of the outgoing BOD document. The verb is always Sync.
• The transformation from the BOD document to the web service input.
• You can use an automatic transformation. In that case the web service input must be inside the
noun element of the BOD. The required input for the web service operation is known, an XSD is
included in the WSDL. Therefor, a custom BOD can be generated in the ION Registry.
In case of automatic transformation, the incoming must contain exactly one noun instance. If it
contains no noun instance or multiple noun instances then the BOD is rejected, resulting in a
Confirm BOD.
In most cases automatic transformation cannot be used in the enrichment scenario. If you use
an existing web service, the probability is low that the content of the BOD noun matches the input
for the web service.

Infor ION Technology Connectors Administration Guide | 123


Web service connection points

• You can use your own transformation by selecting Advanced. In that case you must provide an
XSLT to map the incoming BOD to the web service request. This provides more flexibility. For
example, you can set header elements in the web service request, or you can pick the required
data from an incoming standard BOD. This more complex to model.
When using the advanced transformation, you can specify the transformation by clicking Details.
If no XSLT was specified before, a default XSLT is provided. This default XSLT is a template to
be used as a starting point. It is not a working XSLT.
The Advanced transformation option supports both XSLT "1.0" and "2.0" standards. Specify
the appropriate version you want to use in the version attribute of the XSLT header.

• To merge the output into the incoming BOD, select the element of the BOD that must contain the
output of the web service.
For example, if the input is a MyCustomer BOD. You select the MyCustomer/OrderData element.
Then the output of the web service is attached as the last child of the OrderData element.
• The transformation from the merged BOD document to the ultimate BOD document. This step is
optional. If the merged BOD meets the definition in the registry then no transformation is required.
This is the case for example if;.
• You use a custom BOD and you extend the custom BOD in the registry with the elements from
the web service.
• You use the UserArea of a standard BOD.

If a transformation is required, you must specify an XSLT for this.

Transforming BOD documents


After completing the configuration in the connection point, you can test it:
1 Click Test.
2 In the pop-up, type or paste an example BOD.
3 Click OK. The specified transformation is done and the web service operation is invoked. The web
service output is merged into the BOD and on the result the specified transformation is done.
In case of exceptions, you are informed. If the action was successful, the resulting BODs are displayed
in a pop-up. If the web service operation is expected to execute any changes on the database, you
can verify whether the data is as expected.
Now the web service connection point can be used in a document flow. Select the connection point
in the web service activity and select the procedure to be used. Select the document that is used
to trigger the web service call. The resulting document is automatically set in the document flow.
In this scenario, you can only use one document as input for the web service activity, and the same
document as output.
Complete the flow. For example by adding an activity that publishes the required document, an
activity that receives the resulting document and mapping activities if required. After completion,
you can activate the flow.
When the document flow is active, this happens:

124 | Infor ION Technology Connectors Administration Guide


Web service connection points

The incoming BOD document is transformed to the input as required for the web service operation.
Then the web service is invoked using this input. If the process is successful, the output is merged
into the BOD document. If required the resulting merged BOD document is transformed to the final
BOD document.
If ION cannot connect to the server it automatically retries. A Confirm BOD is generated for the
incoming document, when:
• The server is available, and web service is unavailable.
• The web service returns a fault.
• Another exception occurs.
This becomes visible in Connect > Manage > Error BODs page.
Example 1: adding salary information to an existing employee document
The incoming document SyncMyEmployee contains the employee ID, name and address. A web
service is available to retrieve the salary based on the employee ID. The salary value is added to
the same SyncMyEmployee document.

Infor ION Technology Connectors Administration Guide | 125


Web service connection points

Note: the XSLT has the BOD DataArea XML as input and the complete SOAP envelope XML as
output.
To achieve this, use this XSLT:

<?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"/>
<!-- change indent to "no" after testing -->
<xsl:template match="DataArea">
<S:Envelope
xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Header/>
<S:Body>
<GetEmployeeSalary>
<EmployeeID><xsl:value-of
select="MyEmployee/ID"/></EmployeeID>
</GetEmployeeSalary>
</S:Body>
</S:Envelope>
</xsl:template>
</xsl:stylesheet>

The content from the response is merged into the employee BOD. If the MyEmployee element is
selected as the parent element for the merge, the response is added as the last element in My
Employee:

Note: the SOAP envelope and header are not included when merging. In this example an RPC-style
web service is used, the children of GetEmployeeSalary are included when merging. In case of
a document-style web service, the children of the Body element are merged into the BOD.

126 | Infor ION Technology Connectors Administration Guide


Web service connection points

As the last step, a transformation is used to align the BOD to its definition. In this example it means
that the irrelevant EmployeeID element is removed:

<SyncMyEmployee>
<ApplicationArea>

</ApplicationArea>
<DataArea>
<Sync>

</Sync>
<MyEmployee>
<ID>100</ID>
<Name>John Smith</Name>
<Address>...</Address>
<Salary>30,000</Salary>
</MyEmployee>
</DataArea>
</SyncMyEmployee>

In the XSLT, both the input and the output is the DataArea.
To achieve this, use this XSLT:

<?xml version="1.0" encoding="UTF-8"?>


<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:se="http://schemas.xmlsoap.org/soap/envelope/">
<xsl:output method="xml" version="1.0" encoding="UTF-8"
indent="yes"/>
<!-- change indent to "no" after testing -->
<xsl:template match="@*|node()"> <!-- identity template -->
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="DataArea/MyEmployee/EmployeeID"/>
</xsl:stylesheet>

Example 2: automatic transformation


When using automatic transformation, the example will be the same, except that the complete data
from the noun instance is used as input for the web service. In case of an RPC-style web service:

Infor ION Technology Connectors Administration Guide | 127


Web service connection points

In case of a document-style web service:

Advanced settings
For each operation that is used in a web service connection point, you can set a time-out. When invoking
the web service operation, the ION Service waits for a response. If no response is received in the
specified time-out interval, the web service invocation is regarded as failed.
To set the time-out:
1 In the Documents tab of the web service connection point, select the operation for which the time-out
must be set.

128 | Infor ION Technology Connectors Administration Guide


Web service connection points

2 Specify the value for the Web Service Operation Time-out.


Specify a high value if the web service operation is time-consuming, for example because much
data is processed. If the time-out is too low, the same data can be offered again later for processing.
Specify a low value if the web service operation is fast, to avoid long waiting times in case of failure.
What if a time-out happens:
• In the 'retrieve data from a web service' scenario, an error message is logged. Next time a new
try is done based on the schedule.
• In the other scenarios, an incoming BOD is being processed. A Confirm BOD is created for the
incoming BOD and ION continues processing the next incoming message.

Guaranteed delivery
Guaranteed delivery is provided by ION. That means that each message is delivered at least once.
When using the web service connector, the data changes or database transactions that take place
behind the web service are not controled by ION. Although this is the same for any application that
uses a web service. It is important to be aware of this, because the implementation of the web service
can have consequences for the delivery of the messages.
Some examples:
• When sending data to a web service.
If the web service processed the data but was unable to respond, then ION does not know that the
data was processed. The same data is resend to the web service later again.
• When reading data from a web service.
If the web service both retrieves the data and marks the data as retrieved in a single operation. If
then the response does not reach ION. Or the resulting message cannot be posted on a queue
inside ION. Then the data is not picked up next time again.
• In the triggering or enrichment scenario.
If ION cannot build the resulting BOD or post the BOD to the queue, again ION cannot roll back the
web service operation.

Advanced scheduling options


In a database, file or web service connection point, a schedule can be defined for reading data. The
user can specify a number of minutes, hours, days or weeks. You can specify more details in an
advanced schedule using a CRON expression. For example, to run an expression on 8 pm every day,
or to run every week on Monday, Wednesday and Friday at 5 am.
The Quartz CRON scheduler is used, where the expression is of this format:

Infor ION Technology Connectors Administration Guide | 129


Web service connection points

[Seconds] [Minutes] [Hours] [Day of the Month] [Month] [Day of the week]
[Year]
For example, for triggering:
• The scheduler at 9:30 AM every day, you can use the expression: 0 30 9 ? * *
• The scheduler every 5 minutes, you can use the expression: 0 0/5 * * * ?.
To learn more about the cron fields and sample expressions, see the documentation of quartz scheduler
at:
http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/crontrigger
Note that support for specifying both a day-of-week and a day-of-month value is not provided. If you
must specify both, use the '?' character in one of the fields.

Timezone
All specified time in the cron expression will be treated as UTC time by default. You can also specify
the time zone in which the scheduled triggers must occur.

Specifying the time zone


1 Click Browse next to time zone.
A window with a standard list of time zones is displayed.
2 Specify the first few letters of the major city in your time zone in the Filter field.
Search results that match your input are immediately displayed.
3 Select your time zone and click OK.
The next three scheduled triggers are calculated based on the provided cron expression and the
selected time zone. The trigger times are displayed as a read only text next to the cron expression
field. Verify if the scheduled triggers match your expectation.
When you specify an invalid cron expression, an error message is immediately displayed on leaving
the focus of the field. Read the error message and specify a valid cron expression to correct the
error.
When a cron expression resolves in overlapping triggers, the execution of trigger that is already in
progress will continue and the new trigger must be discarded.

Managing web service connection points


Managing active web service connection points is comparable to other connection points. To view the
active connection points Click Connect > Manage > Active Connection Points.
Note: For each triggering and enrichment scenario that is used in an active document flow, a separate
active connection point is listed. The name and logical ID of those active connection points will have

130 | Infor ION Technology Connectors Administration Guide


Web service connection points

a postfix to make them unique. The active connection point having the original name and logical ID will
handle the other scenarios (sending data to a web service and retrieving data from a web service based
on a schedule). This is comparable to database connection points.
Counters are available. These counters have the same meaning as any connection point:
• Incoming Pending Messages.
• Received Processed Messages.
• Sent Processed Messages.
These counters are not applicable for web service connection points, they are empty:
• Received Unprocessed Messages.
• Received Processed Messages in Inbox.
• Sent Unprocessed Messages.
• Sent No Route Messages. Note that web service operations for sending a document will only be
invoked if this document is needed for :
• A document flow.
• Event monitor.
• Workflow activation policy.
• When the document is a Workflow BOD or a Pulse BOD.

• Sent No Route Messages in Outbox.


• Sent Processed Messages in Outbox.

Viewing received unprocessed messages for Message queue


connection points
An additional drill-down button is displayed in the Received Unprocessed Messages column for Message
queue connection points. These are the messages delivered to the outbound queue which is consumed
by the external JMS application.
To view these messages using the same procedures described earlier.

Infor ION Technology Connectors Administration Guide | 131


Web service connection points

132 | Infor ION Technology Connectors Administration Guide

S-ar putea să vă placă și