Direct Style Effect Systems -The Print[A] Example- A Comprehension Aid
IBM Integeration Bus(IIB) Fundamentals
1. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
IBM Integration
Bus
ندکنهیته:ه
ینابرقیدحم
شیوریا2
الس1396
2. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
point-to-point Architecture:
Integrating IT systems has traditionally been a complex and arduous task. If you’ve ever tried to get more than
a few IT systems to communicate with each other, you’re familiar with all the problems involved.
Obscure, poorly documented point-to-point
connections (or interfaces), involving a bewildering
collection of formats, protocols, and technologies,
make up an infrastructure that only the most
courageous dare tamper with.
Hub and Spoke Architecture:
Some years back, a way of dealing with this problem emerged in the shape of an architectural mode called Hub
and Spoke.
This architecture was built around the notion of
having one central piece of software (the Hub) deal
with all the complexities of inter-system
communication. A new class of software,
called Message Brokers, entered the stage,
providing the technology to build those hubs.
Enterprise service bus (ESB):
An ESB is fundamentally an architecture. It is a set of rules and principles for integrating numerous applications
together over a bus-like infrastructure. ESB products enable users to build this type of architecture, but vary in
the way that they do it and the capabilities that they offer.
The core concept of the ESB architecture is that you
integrate different applications by putting a
communication bus between them and then
enable each application to talk to the bus. This
decouples systems from each other, allowing them
to communicate without dependency on or
knowledge of other systems on the bus.
5. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
ESB Suite Components:
An Enterprise Service Bus contains the following components:
ESB Server: The ESB Server is the runtime server which listens on the control topic for updates
from the ESB Metadata Server and updates its cache.
ESB Administrative Control: The ESB Admin Control panel will provide a Web-based
interface for managing, administering, and monitoring services that you have registered with the
ESB Metadata Server.
ESB Metadata Server: The database that holds your ESB metadata such as schemas,
transformations, and routing rules. The ESB Metadata Server is the server to which you register the
ESB services that you have designed using Developer IDE and configured using ESB Control.
Developer IDE:
Usually a graphical and user-friendly way to model, edit, and design the services that comprise an
Oracle Enterprise Service Bus system.
Commercial
o Talend Enterprise ESB
o IBM Integration Bus
o IBM WebSphere ESB
o Microsoft BizTalk Server
o Windows Azure Service Bus
o Oracle Enterprise Service Bus (BEA Logic)
o Mule ESB (Enterprise Edition)
Open-source
o Apache Camel
o JBoss ESB
o NetKernel
o Petals ESB
o Spring Integration
o Open ESB
o WSO2 ESB
o Mule ESB (Community Edition)
SOA & ESB :
معماریSOAاشاره موضوع اين بهشکل به بايد سازمان يک افزاری نرم محصوالت طراحي که کند ميم سرويسحورنظر در
آنکه حال ،شود گرفتهESBبهافزارها نرم اين بين ارتباط برقراری نحوهروش به که سازمان یSOAشده طراحيا.کند مي اشاره ،ند
6. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
IIB (IBM Integration Bus):
IIB (formerly known as WebSphere Message Broker) is IBM's integration broker from the WebSphere product
family that allows business information to flow between disparate applications across multiple hardware and
software platforms. The product is an Enterprise Service Bus supplying a communication channel between
applications and services in a service-oriented architecture.
IBM Integration Bus provides capabilities to build solutions needed to support diverse integration requirements
through a set of connectors to a range of data sources, including packaged applications, files, mobile devices,
messaging systems, and databases.
IIBنام با گذشته در کهWebSphere Message Brokerخانواده محصوالت از یکی شده می شناختهWebSphereمربوط
بهIBM.شود منتقل مختلف افزارهای سخت و ها اپلیکشن بین بزینسی اطاعات که باشد میIIBمجموعه طریق ازاکانکتور از ی
با کار برای که امکاناتی و مختلف هایData source... و موبایل مختلف دستگاههای ،فایلها ،ها دیتابیس ،هاتوا می داردنرم ند
.کند یکپارچه باهم را سازمان یک مختلف افزارهای
Provides endpoints and the ability to connect to other endpoints
Off-the-shelf applications, services, web apps, devices, appliances, custom built
software…
Protocols and Message Formats
Protocols - e.g. MQ, TCP/IP, HTTP, File system, FTP, SMTP, POP3 etc.
Message Formats - e.g. Binary (C/COBOL), XML, Industry (SWIFT, EDI, HL7),
User-defined
Mediation Patterns
Route, Transform, Enrich, Filter, Monitor, Distribute, Decompose, Correlate,
Fire and Forget, Request/Reply, Publish/Subscribe, Aggregation, Fan-in, Complex
Event Processing…
7. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
های ورژن انواعIIB:
IIB prerequisites:
IBM MQ –Optional on distributed systems for most applications–Required on z/OS and for the use
of some IBM Integration Bus features
Java 7.1 on all platforms
Supported software:
Supports access to databases: DB2, Oracle, Sybase, SQL Server, Informix, solid DB
Open Driver Manager support enables new ODBC databases to be accessed
JDBC Type 4 for popular databases
Supports access to message-oriented middleware: IBM MQ 7.0.1, 7.1, 7.5, and 8.0–JMS
1.2 and 2.0
Includes access to ERP systems: SAP, Siebel, PeopleSoft, and JD Edwards
ERP(Enterprise resource planning)برنامهسازمانی منابع ریزی،فعالیت از وسیعی طیف شاملکه است مختلفی های
یک عملکرد بهبود بهسازمانمی منتهیشودداده تمام وسیستم یک در را سازمان یک فرایندهای و هانرمیک قالب در و افزاری
می مدیریت دقیق و منظم ،پیوسته بصورت اطالعاتی بانکنماید.
8. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
محیطIIB:
اجرای باIIBش به محیطی با:شویم می روبرو زیر کل
Message flows:
A message flow is a sequence of processing steps that run in an integration node when an input message is
received. An integration node is a set of execution processes that host one or more message flows to route,
transform, and enrich in-flight messages. You can configure message flows to use one or both of the supported
communication models, point-to-point and publish/subscribe.
از توان مي ،فلو مسيج يک براي .شود مي اجرا ورودي ديتاي روي بر که است مراحلي از اي سلسله فلو مسيج يکمدل دو
ارتباطيpoint-to-point & publish/subscribe.کرد استفاده
12. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
Applications:
An application is a container for all the resources that are required to create a solution. An application can
contain IBM® Integration Bus resources, such as flows, message definitions, libraries, and JAR files.
You use applications to group all the resources that are required to deliver an integration solution, enabling easier
development and management.
If you are developing resources for multiple integration solutions in the IBM Integration Toolkit, then consider grouping
your resources into applications. The use of a shared or static library helps organization by grouping reusable resources
together. A shared library can also be used by other applications, services, shared libraries, or integration projects.
نياز مورد منابع همه نگهداري براي ظرف يک اپليکيشناپليکيشن يک .است مساله يک حل درIIBشامل تواند ميمنابعي
مانندflows, librariesوjar fileمسا يک در نياز مورد منابع همه کردن مجتمع براي اپليکيشن از .باشد هامي استفاده له
.است آسانتر توليد و مديريت کار اين حسن .شود
Integration projects:
An integration project is a specialized container in which you create and maintain all the resources associated with one
or more message flows.
You can create an integration project to contain a single message flow and its resources, or you can group together related
message flows and resources in a single integration project to provide an organizational structure to your message flow
resources.
است مخصوصي ظرف يک پروژه(اپليکيشن از کوچکتر ظرفي)شم کهااست مورد منابع تمامي نگهداري و ايجاد برايفاده
.کنيد مي ايجاد را آن فلوهايتان درايجاد آن منابع و فلو مسيج يک نگهداري براي پروژه يک توانيد مي شمامي يا کنيد
ه با مرتبط هاي فلو مسيج از اي مجموعه توانيد.نماييد نگهداري پروژه يک در را مپروژه يک توانيد مي شمابه تبديل را
.نماييد اپليکيشن.نماييد اضافه اپليکشن يک به را پروژه يک توانيد مي همچنين
: باشد ذيل منابع شامل تواند مي پروژه يک
An integration project can contain the following resources:
Message flows
Subflows
Message maps
ESQL files
Database definitions
BAR files
Test Clients
13. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
Creating Application:
يک ايجاد براياپليکشنمراحلزيرنماييد طي را:
1. Open the New Integration Project wizard by clicking File > New > Application.
2. Enter a name for the application. Click Next.
3. Select any existing static libraries to which you want to refer, then click Finish.
Creating integration project:
: نماييد طي را ذيل مراحل پروژه يک ايجاد براي
4. Open the New Integration Project wizard by clicking File > New > Integration Project.
5. Enter a name for the project and select any existing projects to which you want to refer. Click Next.
6. Select any existing static libraries to which you want to refer, then click Finish.
14. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
Note1: The new integration project is created and shown in the Independent Resources folder of the Application
Development view. When you have created an integration project, you might want to create resources to add to the
project.
Note: You cannot create schema files in an integration project; you can create them in an application or library
only.
Note: An integration project can reference a static library but not a shared library.
Note: If you are not ready to create an application or library yet, you can use an integration project to hold resources in
the meantime. When you are ready, you can either create an application or library and move the resources from the
integration project, or you can convert your integration project to an application or library.
Note: To see the project references for your integration project, right-click the integration project and then click:
Properties > Project References. You can also reference resources that exist outside the integration project (such as a
Java™ project or Data Design project) by adding project references. Right-click the integration project, then click
Properties > Project References. Select the projects that you want to reference in your integration project.
You can create resources such as message flows, maps, and ESQL files in an integration project.
To create resources in your integration project, complete the following steps:
1) Click File > New. (Alternatively, expand the Independent Resources folder of the Application Development view,
right-click the integration project, then click New.)
2) Select the resource to create.
The appropriate wizard opens; for example, the New Message Flow wizard.
3) Follow the instructions in the wizard, then click Finish.
The new resource is displayed in the Application Development view, under the integration project.
15. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
Message modeling:
هاي قابليت از يکي .دارند مختلف فرمتهاي با اطالعات به نياز مختلف هاي سيستم که دهد مي نشان زير شکلIIBا کردن فرهماست مکاناتي
.کرد تبديل مختلف قالبهاي به را ديتاها براحتي بتوان کهIIB(درختي ساختار ازtreeبر )و ها داده ساختار داشتن نگه ايخمربوط صوصيات
.کند مي استفاده آنها به
IBM Integration Bus routes and manipulates data after converting it into a logical tree
– Input node of the message flow converts incoming data from a stream of bits into a logical tree
structure through a parsing operation
درIIBبصورت پيغام اين (که ميکنند دريافت کالينت سمت از که را پيغامي وروردي نودهايstreamطريق از را )است
عملياتParing.ميکنند تبديل درختي ساختار يک به
– Output node of message flow creates outgoing data (in the bit stream) from the tree structure by
a serialization operation
عمليات طريق از را درختي پيغامهاي خروجي هاي نود طور همينserializationبه تبديلStreamکنند مي.
:دهد مي توضيح را کار انجام روند زير شکل
16. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
A logical message tree contains the original data, plus other information about the runtime
environment, message transport properties, and other “control” information
ساختار به شده تبديل پيغام يکtreeانت به مربوط خصوصيات ،اجرا محيط درباره ديگري اطالعات بعالوه اصلي هاي داده شاملساير و داده قال
کنت اطالعاتقسمت در اطالعات اين .باشد مي رليHeaderساختارtree.گيرد مي قرار
:نکتهشدن راحتتر براي که کنيد توجهmessage transformationوrouting،IIBآن منطقي فرمت از را ها داده فيزيکي فرمتجدا
آن به که ديتا منطقي فرمت .ميکندmessage assemblyک است روشي ،گويند ميهIIB،پيغام خصوصيات ساختار تا کند مي استفادهبدنه
.دهد شرح را آن هدر و پيغامنام به گره يک با هميشه درختي ساختارrootشود مي شروعنام با ورودي هاي نود در کهInputRootدر و
نام با خروجي نودهايOutputRootشود مي شناختهگره زير ساختار بقيه .rootشو مي ايجاد.ند
Supported message formats in IIB:
ليست زير جدولمهم انواع از برخيدر که پيغام قالبهايIIBشود مي پشتيبانياست شده اورده.
Format Message model schema file
SOAP XML XML Schema 1.0 and WSDL 1.0
Other XML XML Schema 1.0
CSV Data Format Description Language 1.0
Industry standard text or binary data Data Format Description Language 1.0
COBOL structure Data Format Description Language 1.0
C structure Data Format Description Language 1.0
CORBA IDL XML Schema 1.0
JSON The JSON parser does not use a model.
MIME The MIME parser does not use a model.
17. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
IIB Built-in Nodes:
درIIB.اند شده بندی دسته مختلفی های دسته در ها نود این .شود فلواستفاده مسیج در تا شده تهیه مختلفی های نوداز دست اولین
، ها نودWebsphere MQ.دارد نام
Websphere MQ Nodes:
قرار استفاده مورد با کار برای که است نودهایی شامل بخش این
:گیرد می
1) MQInput node:
Use the MQInput node to receive messages from clients that connect to the broker by using the WebSphere®
MQ Enterprise Transport, and that use the MQI and AMI application programming interfaces.
.میگیرد قرار استفاده مورد کالینت سمت از پیغام دریافت برای نود این ازروی بر شده داده قرار های پیغام نود اینMQراد.میکند ریافت
نام به متدی از نود اینMQGetاز پیغام دریافت برایMQهای پیغام است قرار که هایی فلو .کند می استفادهMQدریاف را، کنند ت
از باید.کنند استفاده فلو ابتدای در نود این
: است روبرو شکل به نود این خروجی
Terminal Description
Failure
The output terminal to which the message is routed if an error occurs. Even if the Validation property is set,
messages propagated to this terminal are not validated.
Out
The output terminal to which the message is routed if it is successfully retrieved from the WebSphere
MQ queue.
Catch
The output terminal to which the message is routed if an exception is thrown downstream and caught by
this node.
ایننودخص:پردازیم می آنها بررسی به ذیل در که دارد وصیاتی
Decription Tab:
خصوصیات شامل تب اینNode name،Short
descriptionوLong descriptionباشد می
.است مشخص نامشان از آنها عملکرد که
18. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
Basic Tab:
خصوصیت شامل تب اینQueue nameنام باید آن مقدار که استQueue.است شده تعریف بروکر در که باشد
Input Message Parsing Tab:
روبرو شکل در شده داده نشان خواص شامل تب این
:باشد می
Property Default Description
Message
domain
BLOB
The domain that is used to parse the message. If the field is blank then the default
is BLOB.
.کند می مشخص را شود آناالیز آن با مسیج که دامینی فیلد اینتواند می فیلد این که مقادیری
: است زیر بصورت بگیرد
Message
model
Cleared
The name or location of the message model schema file in which the message is
defined. This list is populated with all available message model schema files for
the Message domain that you have selected.
Message Cleared
The name or location of the message root within your message model schema file. This
list is populated with all available messages that are defined in the Message
model that you have selected.
Physical
format
Cleared
The name of the physical format of the message. If you are using the MRM or IDOC
parser, select the physical format of the incoming message from the list. This list
includes all the physical formats that you have defined for the selected message
model. If you set the Message domain property to DataObject, you can set this
property to XML or SAP ALE IDoc. Set this property to SAP ALE IDoc when you
have to parse a bit stream from an external source and generate a message tree.
19. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
Parser Options Tab:
:است زیر شکل شرح به دارند قرار تب این در که خصوصیاتی
Property Default Description
Parse
timing
On
Demand
This property controls when an input message is parsed. Valid values are On
Demand, Immediate, and Complete.
Parse timing is, by default, set to On Demand, which causes parsing of the
message to be delayed. To cause the message to be parsed immediately, see Parsing
on demand.
Use
MQRFH2C
compact
parser for
MQRFH2
header
Cleared
This property controls whether the MQRFH2C compact parser, instead of the MQRFH2
parser, is used for MQRFH2 headers.
Build tree
using XML
schema
data types
Cleared
This property controls whether the XMLNSC parser creates syntax elements in the message
tree with data types taken from the XML schema. You can select this property only if you set
the Validate property on the Validation tab to Content or Content and Value.
Use
XMLNSC
compact
parser for
XMLNS
domain
Cleared
This property controls whether the XMLNSC compact parser is used for messages in the
XMLNS domain. If you set this property, the message data is displayed under XMLNSC in
nodes that are connected to the output terminal when the input MQRFH2 header or the
Input Message Parsing property Message domain is XMLNS. For more information,
see Manipulating messages in the XMLNSC domain.
20. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
Property Default Description
Retain
mixed
content
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree
when it encounters mixed text in an input message. If you select the check box, elements
are created for mixed text. If you clear the check box, mixed text is ignored and no elements
are created.
Retain
comments
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree
when it encounters comments in an input message. If you select the check box, elements
are created for comments. If you clear the check box, comments are ignored and no
elements are created.
Retain
processing
instructions
Cleared
This property controls whether the XMLNSC parser creates elements in the message tree
when it encounters processing instructions in an input message. If you select the check box,
elements are created for processing instructions. If you clear the check box, processing
instructions are ignored and no elements are created.
Opaque
elements
Blank
This property is used to specify a list of elements in the input message that are to be
opaquely parsed by the XMLNSC parser. Opaque parsing is performed only if validation is
not enabled (that is, if Validate is None); entries that are specified in Opaque
Elements are ignored if validation is enabled.
Advanced Tab:
تب خصوصیاتAdvancedشرح بهشکل:باشد می ذیل
21. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
2) MQOutput node:
Basic Tab:
تب خصوصیاتBasicروبرو شکل شرح به
:هستند
Property Description
Queue
Manager
Name
Enter the name of the WebSphere MQ queue manager to which this output queue (which is
specified by the Queue Name property) is defined.
The Queue Manager Name property is only needed if the queue specified is defined on
another queue manager or is a cluster queue.
Queue Name
If you set the Destination Mode property to Queue Name, you must specify a value
for the Queue Name property. If you set Destination Mode to another value, this
property is ignored.
Advanced Tab:
تب خصوصیاتAdvancedروبرو شکل شرح به
:هستند
22. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
Property Default Description
Destination
Mode
Queue
Name
The queues to which the output message is sent.
If you select Queue Name (the default), the message is sent to the queue that is
named in the Queue Name property. If you select this option, you must set
the Queue Manager Name and Queue Name properties.
If you select Reply To Queue, the message is sent to the queue that is named in
the ReplyToQ field in the MQMD.
If you select Destination List, the message is sent to the list of queues that are
named in the local environment that is associated with the message.
Transaction
Mode
Automatic
This property controls whether the message is put transactionally.
If you select Automatic (the default), the message transactionality is derived from
the way that it was specified at the input node.
If you select Yes, the message is put transactionally.
If you select No, the message is put non-transactionally.
Persistence
Mode
Automatic
This property controls whether the message is put persistently.
If you select Automatic (the default), the persistence is as specified in the incoming
message.
If you select Yes, the message is put persistently.
If you select No, the message is put non-persistently.
If you select As Defined for Queue, the message persistence is set as defined
for the WebSphere MQ queue.
New Message
ID
Cleared
If you select this check box, WebSphere MQ generates a new message identifier to
replace the contents of the MsgId field in the MQMD. This property maps to the
MQPMO_NEW_MSG_ID option of the MQPMO of the MQI. Clear the check box if you
do not want to generate a new ID. A new message ID is still generated if you select
the Request property on the Request tab.
New
Correlation ID
Cleared
If you select this check box, WebSphere MQ generates a new correlation identifier to
replace the contents of the CorrelId field in the MQMD. This property maps to the
MQPMO_NEW_CORREL_ID option of the MQPMO of the MQI. Clear the check box if
you do not want to generate a new ID.
Segmentation
Allowed
Cleared
If you select this check box, WebSphere MQ breaks the message into segments in the
queue manager.
Message
Context
Pass All
This property controls how origin context is handled.
Pass All maps to the MQPMO_PASS_ALL_CONTEXT option of the MQPMO of the
MQI.
Pass Identity maps to the MQPMO_PASS_IDENTITY_CONTEXT option of the
MQPMO of the MQI.
Set All maps to the MQPMO_SET_ALL_CONTEXT option of the MQPMO of the
MQI.
Set Identity maps to the MQPMO_SET_IDENTITY_CONTEXT option of the
MQPMO of the MQI.
Default maps to the MQPMO_DEFAULT_CONTEXT option of the MQPMO of the
MQI.
None maps to the MQPMO_NO_CONTEXT option of the MQPMO of the MQI.
23. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
Property Default Description
Alternate
User
Authority
Cleared
If you select this check box, alternate authority is used when the output message is
put and the MQOO_ALTERNATE_USER_AUTHORITY option is set in the open options
(MQOO) of the MQI. If you select this check box, this option is specified when the
queue is opened for output. The alternative user information is retrieved from the
context information in the message.
Request Tab:
تب خصوصیاتRequestشکل شرح بهزیر:هستند
Property Default Description
Request Cleared
If you select the check box, each output message in the MQMD is generated as a request
message (MQMT_REQUEST), and the message identifier field is cleared (and set to
MQMI_NONE) so that WebSphere MQ generates a new identifier. Clear the check box to
indicate that each output message is not marked as a request message. If you have
set Destination Mode to Reply To Queue, you cannot select this check box.
A new message identifier is generated even if the New Message ID check box is not
selected on the Advanced tab.
Reply-to Queue
Manager
The name of the WebSphere MQ queue manager to which the output queue, which is
specified in Reply-to Queue, is defined. This name is inserted into the MQMD of each
output message as the reply-to queue manager.
Reply-to Queue
The name of the WebSphere MQ queue to which to put a reply to this request. This name
is inserted into the MQMD of each output message as the reply-to queue.
24. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
HTTP nodes:
HTTP nodes can process SwA messages, you must use the MIME message domain and design your flow to
handle the attachments explicitly, and use custom logic to extract and parse the SOAP.
Cases where it might be better to use HTTP nodes include:
Message flows in which a single request node handles multiple SOAP request and responses from more
than one WSDL.
Message flows that interact with Web services that use different standards, such as REST or XML-RPC.
Message flow that never use WS-Addressing, WS-Security, SwA, or MTOM.
1) HTTPInput node:
https://www-01.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ac04565_.htm?cp=SSMKHH_9.0.0&lang=en
Use the HTTPInput node to receive an HTTP message from an HTTP client for processing by a message flow.
If you use the HTTPInput node with the HTTPReply and HTTPRequest nodes, the broker can act as an
intermediary for web services, and web service requests can be transformed and routed in the same way as
other message formats that are supported by IBM® Integration Bus.
از( سمت کامپوننت اینprovider, Serverپيام یک دریافت براي سرویس وب )HTTPاستف کالینت سمت ازمي اده
.شودهمراه به نود این از که صورتي درHTTPReplyوHTTPRequestع به آن از توان مي ، شود استفادهواسطي نوان
.نمود استفاده سرویس وب براي
Web service requests can be received either in standard HTTP (1.0 or 1.1) format or in HTTP over SSL (HTTPS)
format. For more information about web services, see Processing Web service messages.
The HTTPInput node handles messages in the following message domains:
MRM
XMLNSC
XMLNS
MIME
BLOB
XML (this domain is deprecated; use XMLNSC)
JSON
DFDL
HTTP messages are always non-persistent, and have no associated order.
25. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
2) HTTPReply:
https://www.ibm.com/support/knowledgecenter/en/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ac04585_.htm
Use the HTTPReply node to return a response from the message flow to an HTTP client.
.شود می استفاده کالینت به پاسخ برگرداندن برای نود این از
Property Default Description
Ignore transport
failures
Selected
Select Ignore transport failures if you want transport-related failures to be ignored (for
example, if the client is disconnected). If you clear the check box, and a transport-
related error occurs, the input message is propagated to the Failure terminal. If you
clear the check box, you must supply a value for Reply send timeout (sec).
سمت به دیتا انتقال به مربوط خطاهای که خواهید می اگربزنید تیک را گزینه این شود گرفته نادیده کالینت.
Reply send
timeout (sec)
120
Set the Reply send timeout (sec) value if you are not ignoring transport failures. This
property specifies the length of time, in seconds, that the node waits for an
acknowledgment that the client has received the reply.
ازا ، باشد خورده تیک قبلی خاصیت اگر .شود می استفاده دیتا ارسال انتظار زمان تعیین برای نود اینخاصیت ین
.شود نمی بررسی
Generate default
HTTP headers from
reply or response
Selected
Select Generate default HTTP headers from reply or response if you want the default
Web service headers to be created using values from the HTTPReplyHeader or the
HTTPResponseHeader. If the appropriate header is not present in the input message,
default values are used.
3) HTTPRequest:
https://www.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ac04595_.htm?lang=en
Use the HTTPRequest node to interact with a web service.
.شود مي استفاده سرويس وب يک فراخواني براي نود اين از
You can use this node in a message flow that does or does not contain an HTTPInput or HTTPReply node.
An HTTP request has two parts:
1. The URL of a service.
2. A stream of data that the remote server processes, then sends back a response, which is often a SOAP
or other web service message in XML.
26. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
Transformation:
Compute node:
https://www-01.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ac04660_.htm?cp=SSMKHH_9.0.0&lang=en
Use the Compute node to construct one or more new output messages. The output messages that you create
in the Compute node might be created by modifying the information that is provided in the input message, or
by using only new information which can be taken from a database or from other sources. Elements of the input
message (for example, headers, header fields, and body data), its associated environment, and its exception list
can be used to create the new output message.
You can configure the Compute node to do any of the following operations:
Insert,Update,Delete data from a database.
Update the environment tree.
Update the local environment tree.
Create one or more output messages, with none, some, or all the content of the input message, and propagate
these new messages to the next node in the message flow.
Note: To propagate the input LocalEnvironment to the output LocalEnvironment, remember to set the Compute node
property Compute mode to an appropriate value. The Environment is always propagated in the output message.
:نکتهخاصيت اگرData sourceکند برقرار ارتباط آن با نتواند اجرا هنگام و کنيم دهي مقدار را کامپوننت اين در،ابتدا همانخطا
کد حتي و دهد ميesql.شود نمي اجرا نيز آن داخل
Specify how the new messages are created by coding ESQL in the message flow ESQL resource file.
:است ذيل شرح به نود اين استفاده موارد
Build a new message using a set of assignment statements
Copy messages between parsers
Convert messages from one code set to another
Transform messages from one format to another
Data Source Property:
The ODBC data source name for the database that contains the tables to which you refer in the ESQL file that is associated
with this message flow (identified in the ESQL Module property). You can specify only one data source for the node. If
the ESQL that is associated with this node includes a PASSTHRU statement or SELECT function and a database reference,
you must specify a value for the Data Source property.
To configure access to a database from this node:
On the Basic tab, specify in Data Source the name by which the appropriate database is known on the system on which
this message flow is to run. The broker connects to this database with user ID and password information that you
have specified on the mqsicreatebroker, mqsichangebroker, or mqsisetdbparms command.
27. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
You can also automatically configure connectivity to a database by using the Database Service.
Compute Mode property:
The Compute Mode property controls which components are used by default in the output message. Select the property
to specify whether the Message, LocalEnvironment (previously specified as DestinationList), and Exception List
components that are either generated in the node or contained in the incoming message are used.
This default value is used when the transformed message is routed to the Out terminal when processing in the node is
completed. The default value is also used whenever a PROPAGATE statement does not specify the composition of its
output message.
If the Compute Mode property is set to All, you must code the following ESQL to allow the input trees to be propagated
to the output terminal:
SET OutputRoot = InputRoot;
SET OutputLocalEnvironment = InputLocalEnvironment;
SET OutputExceptionList = InputExceptionList;
Throw exception on database error: If you select this check box, database errors cause the broker to throw an
exception.
Terminals and properties
Terminal Description
In The input terminal that accepts a message for processing by the node.
Failure The output terminal to which the input message is routed if an unhandled exception occurs during
the computation.
Out The output terminal to which the transformed message is routed when processing in the node is
completed. The transformed message might also be routed to this terminal by a PROPAGATE
statement.
Out1, Out2,
Out3, Out4
The first, second,third,fourth alternative output terminal to which the transformed message might be
routed by a PROPAGATE statement.
28. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
ESQL (Extended Structured Query Language):
Case sensitivity of ESQL syntax: The case of ESQL statements is:
Case sensitive in field reference literals
Not case sensitive in ESQL language words
ESQL data types:
ESQL defines the following categories of data. Each category contains one or more data types.
ESQLانوع مورد در را زير های بندی دسته.باشد مي داده نوع چند يا يک شامل بندی دسته هر ،دارد داده
Boolean
Datetime(DATE,TIME,TIMESTAMP, GMTTIMESTAMP, INTERVAL)
Null
Numeric (DECIMAL, FLOAT, INTEGER)
Reference
String(BIT, BLOB,CHARACTER)
Numeric data types:
INTEGER: 64 bit, range between -9223372036854775808 and +9223372036854775807
DECIMAL: Decimals have precision, scale.
دارای دسيمال اعداددو:باشند مي بخش
Precision is the total number of digits of a number, the minimum precision is 1 and the
maximum precision is 34.
Precisionاز و باشد مي عدد صحيح قسمت1تا34.دهد جای خود در تواند مي رقم
Scale is the number of digits to the right of the decimal point:
The minimum scale (-exponent) is -999,999,999
The maximum scale (-exponent) is +999,999,999
Scaleاست شده ذکر باال در اعشاری قسمت مقدار بيشترين و کمترين ، باشد مي اعشاری قسمت.
Note: You cannot define precision and scale when declaring a DECIMAL, because they are assigned
automatically. It is only possible to specify precision and scale when casting to a DECIMAL.
هنگام تنها ،نيستند تعيين قابل دسيمال متغير تعريف هنگام اعداد اعشاری و صحيح قسمتCast.کرد تعيين را آنها توان مي
Float:
The FLOAT data type holds a 64-bit number with range of values between +-1.7E–308 and
+- 1.7E+308.
29. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
String Data types:
The following data types are collectively known as string data types:
BIT data type:
The BIT data type holds a variable length string of binary digits. It is commonly used to represent
arbitrary binary data that does not contain an exact number of bytes. A bit string literal consists of the
letter B, followed by a string of binary digits enclosed in single quotation marks.
Example:
B'0100101001'
BLOB data type:
The BLOB data type holds a variable length string of 8-bit bytes. It is commonly used to represent
arbitrary binary data. A BLOB literal consists of the letter X, followed by a string of hexadecimal digits
enclosed in single quotation marks.
Example:
X'0123456789ABCDEF'
CHARACTER data type:
The character data type holds a variable length string of Unicode characters. A character string literal
consists of any number of characters in single quotation marks.
Example:
SET X = 'hamid';
Note: If you want to include a single quotation mark within a character string literal, use another single
quotation mark as an escape character.
Example:
SET X='he''was''' puts the value he'was' into X.
https://www.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ak05190_.htm
STRING Operators and Functions:
CONCAT STRINGS WITH || Operator : A single string operator, concatenation, is supported in ESQL. The result
is the concatenation of the two operands. You can concatenate string values (CHARACTER, BIT, and BLOB). If
either operand is NULL, the result is NULL.
اپراتور از يکديگر به رشته دو اتصال برای||تابع همانند .ميکنيم استفادهConcatدرSQL.باشد مي
LENGTH:
The LENGTH function is used for string manipulation on all string data types (BIT, BLOB, and CHARACTER) and
returns an integer value giving the number of singletons in source_string.
It If the source_string is NULL, the result is the NULL value. The term singleton refers to a single part (BIT, BYTE,
or CHARACTER) within a string of that type.
Example:
LENGTH('Hello World!'); // returns 12.
LENGTH(''); // returns 0.
30. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
CONTAINS: The CONTAINS function searches a text search index using criteria that are specified in a search
argument and returns a result about whether or not a match was found.
The parameter strings for both SourceExpression and SearchExpression can be of the CHARACTER, BLOB, or BIT
data type, but must be of the same data type. If any parameter is NULL, the result is NULL.
.شود مي استفاده ديگر رشته يک درون رشته يک کردن پيدا برای تابع اين از
Examples:
CONTAINS('Hello World!', 'ello'); // returns TRUE.
CONTAINS('Hello World!', 'daisy'); // returns FALSE
POSITION:
POSITION returns an integer giving the position of one string (SearchExpression) in a second string
(SourceExpression). A position of one corresponds to the first character of the source string.
If present, the FROM clause gives a position within the search string at which the search commences. In the
absence of a FROM clause, the source string is searched from the beginning.
If present, the REPEAT clause gives a repeat count, returning the position returned to be that of the nth
occurrence of the search string within the source string. If the repeat count is negative, the source string is
searched from the end.
In the absence of a REPEAT clause, a repeat count of +1 is assumed; that is, the position of the first occurrence,
searching from the beginning is returned. If the search string has a length of zero, the result is one.
If the search string cannot be found, the result is zero: if the FROM clause is present, this applies only to the
section of the source string being searched; if the REPEAT clause is present this applies only if there are
insufficient occurrences of the string.
If any parameter is NULL, the result is NULL.
The search and source strings can be of the CHARACTER, BLOB, or BIT data types but they must be of the same
type.
موقعيت کردن پيدا برای تابع اين از)(ايندکسر در رشته يکبرگردانده تطابق اولين ايندکس .شود مي استفاده ديگر شته
کلمه .شود ميFROMمي مشخص را جستجو شروع نقطهکلمه اگر کندFROMرشته ابتدای از ،باشد نشده استفاده
.شود مي شروع جستجو
کلمهREPEAT.کند مي مشخص را جستجو تکرار دفعات تعدادمثالREPEAT 2که است اين معني بهايندکس اولين
.برگرداند را دوم شده پيدا ايندکس و کند رد را شده پيدا
انواع از هريک توانند مي جستجو عباراتString( يعنيCHARACTER, BLOB, or BITدو هرد بايد اما ،باشند )
.باشد يکي نوعشان قسمت
Example:
POSITION('Village' IN 'Hursley Village'); // returns 9
POSITION('Town' IN 'Hursley Village'); // returns 0
POSITION ('B' IN 'ABCABCABCABCABC'); // returns 2
POSITION ('D' IN 'ABCABCABCABCABC'); // returns 0
POSITION ('A' IN 'ABCABCABCABCABC' FROM 4); // returns 4
POSITION ('C' IN 'ABCABCABCABCABC' FROM 2); // returns 3
POSITION ('B' IN 'ABCABCABCABCABC' REPEAT 2); // returns 5
POSITION ('C' IN 'ABCABCABCABCABC' REPEAT 4); // returns 12
POSITION ('A' IN 'ABCABCABCABCABC' FROM 4 REPEAT 2); // returns 7
POSITION ('AB' IN 'ABCABCABCABCABC' FROM 2 REPEAT 3); // returns 10
POSITION ('A' IN 'ABCABCABCABCABC' REPEAT -2); // returns 10
POSITION ('BC' IN 'ABCABCABCABCABC' FROM 2 REPEAT -3); // returns 5
31. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
OVERLAY:
OVERLAY is a string manipulation function that manipulates all string data types (BIT, BLOB, and CHARACTER)
and replaces part of a string with a substring.
OVERLAY returns a new string of the same type as the source and is identical to source_string, except that a
given substring in the string, starting from the specified numeric position and of the given length, has been
replaced by source_string2. When the length of the substring is zero, nothing is replaced. If any parameter is
NULL, the result is NULL. If string_length is not specified, it is assumed to be equal to LENGTH(source_string2).
چيزی هيچ ، باشد خالي مجموعه زير رشته اگر .شود مي استفاده ديگر رشته يک درون رشته يک دادن قرار برای تابع اين از
پارامترها از هريک اگر .شود نمي اضافه اصلي رشته بهNullنيز خروجي باشدNull.بود خواهد
Example:
OVERLAY ('ABCDEFGHIJ' PLACING '1234' FROM 4 FOR 3) // returns the string 'ABC1234GHIJ'
ENDSWITH:
ENDSWITH returns TRUE if SourceExpression ends with SearchExpression, otherwise it returns FALSE.
The parameter strings for both SearchExpression and SourceExpression can be of the CHARACTER, BLOB, or BIT
data type, but must be of the same data type.
If any parameter is NULL, the result is NULL.
تابع برگشتي مقدار ،برسد پايان به جستجو مورد رشته با نظر مورد رشته اگر تابع اين درtrueاي غير در و بود خواهدنصورت
مقدارfalse.شود مي برگردانده
Examples:
ENDSWITH('Hello World!', 'World!'); // returns TRUE.
ENDSWITH('Hello World!', 'World'); // returns FALSE.
STARTSWITH:
STARTSWITH is a string manipulation function that manipulates all string data types (BIT, BLOB, and
CHARACTER), and returns a Boolean value to indicate whether one string begins with another. STARTSWITH
returns TRUE if SourceExpression begins with SearchExpression, otherwise it returns FALSE.
The parameter strings for both SearchExpression and SourceExpression can be of the CHARACTER, BLOB, or BIT
data type, but must be of the same data type.
If any parameter is NULL, the result is NULL.
Examples:
STARTSWITH('Hello World!', 'Hello'); // returns TRUE.
STARTSWITH('Hello World!', 'World'); // returns FALSE.
REPLICATE:
REPLICATE is a string manipulation function that manipulates all data types (BIT, BLOB, and CHARACTER) and
returns a string made up of multiple copies of a supplied string. If the count is negative or zero, a zero length
string is returned. If either parameter is NULL, the result is NULL.
ک کپي برای تابع اين ازاس رشته از مقداری يک چندباره ردنش مي تفادهو.د
Examples:
REPLICATE('0', 4) // returns '0000'
32. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
SUBSTRING:
Extracts characters from a string to create another string and manipulates all string data types (BIT, BLOB, and
CHARACTER)
Syntax:
SUBSTRING(<SourceExpression> FROM <StartPosition> BEFORE <BeforeExpression> AFTER <AfterExpression>
FOR <StringLength>);
کلمه با همراه .شود مي استفاده شده داده رشته از مجموعه زير يک گرفتن برا تابع اين ازFROMشروع ايندکسزير رشته
کلمات با همراه و شود مي مشخص مجموعهBEFOREوAFTERخواهد گرفته کمک آن از شروع نقطه برای که عبارتي
کلمه .آيد مي شدFORنيزبرایبکا شوند گرفته نظر در خروجي برای بايد که کاراکترهايي تعداد کردن مشخص.رود مي ر
Examples:
SUBSTRING('Hello World!' FROM 7 FOR 4) // returns 'Worl'.
SUBSTRING('Hello World!' BEFORE 'World'); // returns 'Hello '.
SUBSTRING('Hello World!' BEFORE 'World' FOR 3); // returns 'lo '.
SUBSTRING('Hello World!' BEFORE 'e'); // returns 'H'.
SUBSTRING('Hello World!' AFTER 'World'); // returns '!'.
SUBSTRING('Hello World!' AFTER 'W' FOR 2); // returns 'or'.
SUBSTRING('Hello World!' AFTER 'P'); // returns ''.
LOWER and LCASE:
The LOWER and LCASE functions are equivalent, and manipulate CHARACTER string data; they both return a new
character string, which is identical to source_string, except that all uppercase letters are replaced with the
corresponding lowercase letters.
.دارند يکساني عملکذد آنها دوی هر .کرد استفاده تابع دو اين از توان مي کوچ حروف به رشته يک کاراکترهای تبديل برای
Example:
LOWER('Mr Smith') // returns 'mr smith'.
LOWER('22 Railway Cuttings') // returns '22 railway cuttings'.
LCASE('ABCD') // returns 'abcd'.
UPPER and UCASE:
UPPER and UCASE are equivalent string manipulation functions that manipulate CHARACTER string data and
convert lowercase characters in a string to uppercase. UPPER and UCASE both return a new character string,
which is identical to source_string, except that all lowercase letters are replaced with the corresponding
uppercase letters.
Example:
UPPER('ABCD') // returns 'ABCD'.
UCASE('abc123') // returns 'ABC123'.
33. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
LEFT:
LEFT is a string manipulation function that returns a string consisting of the source string truncated to the LEFT
given by the length expression.The source string can be of the CHARACTER, BLOB or BIT data type and the length
must be of type INTEGER. The truncation discards the final characters of the source_string
The result is of the same type as the source string. If the length is negative or zero, a zero length string is
returned. If either parameter is NULL, the result is NULL
.کند مي چاپ خروجي عنوان به و برداشته شده اعالن تعداد به رشته چپ سمت از تابع اين
Example:
LEFT('ABCD',3); // returns 'ABC'.
RIGHT:
RIGHT returns a string consisting of the source string truncated to the length given by the length expression. The
truncation discards the initial characters of the source string.
The source string can be of the CHARACTER, BLOB, or BIT data type and the length must be of type INTEGER.
If the length is negative or zero, a zero length string is returned. If either parameter is NULL, the result is NULL
سمت از تابع اينراست.کند مي چاپ خروجي عنوان به و برداشته شده اعالن تعداد به رشته
Example:
RIGHT('w3resource',6); // returns 'source'.
SPACE:
SPACE returns a character string that consists of the number of blank spaces that are given by
NumericExpression. The parameter must be of type INTEGER; the result is of type CHARACTER.
Example:
SPACE(10);
34. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
REPLACE:
REPLACE returns a string consisting of the source string, with each occurrence of the search string replaced by
the replace string. The parameter strings can be of the CHARACTER, BLOB, or BIT data types, but all three must
be of the same type. If any parameter is NULL, the result is NULL. If you do not specify the replace string
expression, the replace string uses the default value of an empty string, and the behavior of the function is to
delete all occurrences of the search string from the result.
در ديگر ای رشته با را رشته يک تابع اينشده داده عبارت.کند مي جايگزين اصلي
Example:
REPLACE('ABCDABCDABCDA', 'A', 'AA') // returns 'AABCDAABCDAABCDAA'
TRIM:
TRIM returns a new string of the same type as source_string, in which the leading, trailing, or both
leading and trailing singletons have been removed. The term singleton refers to a single part (BIT,
BYTE, or CHARACTER) within a string of that type.
Example:
TRIM(' a ') // returns 'a'.
TRIM(LEADING FROM ' a ') // returns 'a '.
TRIM(TRAILING FROM ' a ') // returns ' a'.
LTRIM:
LTRIM is a string manipulation function, used for manipulating all data types (BIT, BLOB, and
CHARACTER), that returns a character string value of the same data type and content as source_string,
but with any leading default singletons removed.
فض حذف برای تابع اين ازاسمت بعد خالي یچپ.کنيم مي استفاده رشته يک
Example:
LTRIM(' a ') // returns 'a '.
NOTE: The LTRIM function is equivalent to TRIM(LEADING FROM source_string).
RTRIM:
RTRIM returns a string value of the same data type and content as source_string but with any trailing
default singletons removed. The term singleton refers to a single part (BIT, BLOB, or CHARACTER)
within a string of that type.
برا تابع اين ازفض حذف یا.کنيم مي استفاده رشته يک راست سمت بعد خالي ی
Example:
RTRIM(' a ') // returns ' a'.
NOTE: The RTRIM function is equivalent to TRIM(TRAILING FROM source_string).
35. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
Transforming from one data type to another:
You can use the CAST function to transform the data type of one value to match the data type of the
other. For example, you can use the CAST function when you process generic XML messages. All
fields in an XML message have character values, so if you want to perform arithmetic calculations or
datetime comparisons, for example, you must convert the string value of the field into a value of the
appropriate type using CAST.
Example:
1) IF CAST(Body.Invoice.InvoiceDate AS DATE) = CURRENT_DATE THEN
DO SOMETHING;
مقدار باال دستورInvoiceDateنوع به راDATE.ميکند تبديل
2) DECLARE I INTEGER 1;
DECLARE C CHARACTER;
-- The following statement generates an error
SET C = I;
دستورC = Iمتغيرهای اينکه علت بهIوC،هستند متفاوتي انواع ازنوشتن صحيح روش ،ميکند توليد خطاباال دستور
:باشد مي زير بصورت
-- The following statement is valid
SET C = CAST(I AS CHARACTER);
خروجي به دادن فرمت برایCAST:کنيم مي عمل زير بصورت
3) DECLARE now CHARACTER;
SET now = CAST(CURRENT_TIMESTAMP AS CHARACTER FORMAT 'yyyyMMdd-HHmmss');
4) DECLARE source CHARACTER '16:18:30';
DECLARE target TIME;
DECLARE pattern CHARACTER 'hh:mm:ss';
SET target = CAST(source AS TIME FORMAT pattern);
اعمال برایCodedCharSetId(CCSID)دستور بهCAST:ميکنيم عمل زير صورت به
5) SET target = CAST(source AS TIME FORMAT pattern CCSID 1256);
نود اگرف خروجيلوMQ،باشد ميتغيير برایencodingوCCSID:کنيم مي عمل زير بصورت آن
6) SET OutputRoot.MQMD.CodedCharSetId = 500;
SET OutputRoot.MQMD.Encoding = 785;
36. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
DateTime Data types:
DATE data type:
The DATE data type holds a Gregorian calendar date (year, month, and day). The format of
a DATE literal is the word DATE followed by a space, followed by a date in single quotation marks in the
form 'yyyy-MM-dd'.
Example:
DECLARE MyDate DATE;
SET MyDate = DATE '2000-02-29';
TIME data type
The TIME data type holds a time of day in hours, minutes, seconds, and fractions of a second.
The format of a TIME literal is the word TIME followed by a space, followed by a time in single quotation
marks in the form 'hh:mm:ss.ffffff'.
Example:
DECLARE MyTime TIME;
SET MyTime = TIME '11:49:23.656';
Each of the hour, minute, and second fields in a TIME literal must always be two digits; the optional
fractional seconds field can be up to 6 digits in length.
TIMESTAMP data type
The TIMESTAMP data type holds a DATE and a TIME in years, months, days, hours, minutes, seconds,
and fractions of a second.
The format of a TIMESTAMP literal is the word TIMESTAMP followed by a space, followed by a time
stamp in single quotation marks in the form 'yyyy-MM-dd HH:mm:ss.SSSSSS'.
Example:
DECLARE MyTimeStamp TIMESTAMP;
SET MyTimeStamp = TIMESTAMP '1999-12-31 23:59:59';
The year field must always be four digits in length. The month, day, hour, and minute fields must always
be two digits. (Do not omit leading zeros.) The optional fractional seconds field can be 0 - 6 digits long.
NULL Data types:
All ESQL data types (except REFERENCE) support the concept of the null value. A value of null means that
the value is unknown, undefined, or uninitialized. Null values can arise when you refer to message fields that do
not exist, access database columns for which no data has been supplied, or use the keyword NULL, which
supplies a null literal value.
Example:
SET OutputRoot.XMLNS.Msg.Data.Name = NULL; -- this deletes the field
مقدار صحيح روشNull:متغير يک به دادن
SET OutputRoot.XMLNS.Msg.Data.Name VALUE = NULL;
-- this assigns a NULL value to a field without deleting it
REFERENCE data type:
The REFERENCE data type holds the location of a field in a message. It cannot hold the location
of a constant, a database table, a database column, or another reference.
Note:
If you use a REFERENCE, you are able to modify any element, even if the element is part
of an input tree.
37. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
Variables: The names of ESQL variables are case sensitive.The simplest way to guarantee that you are using the
correct case is always to define variables using uppercase names. You can assign an initial value to the variable on the
DECLARE statement. If an initial value is not specified, scalar variables are initialized with the special value NULL, and ROW
variables are initialized to an empty state. Subsequently, you can change the variable's value using the SET statement.
Variable's scope: In the broker environment, the scope of variables is typically limited to the individual node.
محيط درIIBمتغير يک محدودهنودی همان به محدودشده تعريف آن در که است.
Variable's lifetime: is a measure of the time for which it retains its value. In the broker environment, the lifetime
of a variable varies but is typically restricted to the life of a thread within a node.
محيط درIIBعمر طولمتغيرکلي حالت در اما ،است مختلفبه محدودشده تعريف متغير نود آن در که است نودی ترد.
Types of variables:
درIIB:داريم متغير نوع سه
1) Normal 2) External 3) Shared
Normal variables:
Normal variables variables have a lifetime of just one message passing through a node. They are visible to that
message only. To define a normal variables, omit both the EXTERNAL and SHARED keywords.
باشد مي نود آن از پيغام يک عبور اندازه به فقط نرمال متغيرهای عمر طولاستفاده قابل نود همان محدوده در فقط نرمال متغيرهای .
تعري برای و هستندح به را متغير يک است کافي آنها فکنيم تعريف معمولي الت:
Example:
1) DECLARE var1 INTEGER 42;
2) DECLARE var2 INTEGER;
SET var2 = 38;
3) DECLARE mycolor CHARACTER 'blue';
External variables:
External variables (defined with the EXTERNAL keyword) are also known as user-defined properties. They exist
for the entire lifetime of a message flow and are visible to all messages passing through the flow. You can
define external variables only at the module and schema level. You can modify their initial values (optionally set
by the DECLARE statement) at design time, using the Message Flow editor, or at deployment time, using the
Broker Archive editor.
1. The SHARED keyword is not valid within a function or procedure.
2. You cannot specify SHARED with a DataType of REFERENCE TO. To store a message tree in a shared
variable, use the ROW data type.
3. EXTERNAL variables are implicitly constant.
4. When you use the NAMESPACE and NAME clauses, their values are implicitly constant and of type
CHARACTER.
38. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
عنوان به که خارجي متغيرهایuser-defined propertiesبرای و دارند وجود فلو عمر طول کل برای ،شوند مي شناخته نيز
.هستند استفاده قابل پيامها همه.شوند مي تعريف اسکيما يا ماژول سطح در خارجي متغيرهایآنها به دادن اوليه مقدار برای
دستور ازDECLAREمتغيردرزمانdesignزمان در يا فلوDeployاديتور از استفاده با و برنامهbroker Archive
را اوليه مقدارمي.دهيمهای متغيرExternalهمانند حقيقت درConstantها.هستند
Example 1:
DECLARE mycolor EXTERNAL CHARACTER 'blue';
Example 2:
DECLARE TODAYSCOLOR EXTERNAL CHARACTER;
SET COLOR = TODAYSCOLOR;
Shared variables:
Shared variables can be used to implement an in-memory cache in the message flow. Shared variables have a
long lifetime and are visible to multiple messages passing through a flow. Use SHARED to define a shared
variable. Shared variables are private to the flow (if declared within a schema) or node (if declared within a
module), but are shared between instances of the flow (threads). No type of variable is visible beyond the flow
level; for example, you cannot share variables across integration servers. Shared variables are initialized when the
first message passes through the flow or node after each broker startup.
عنوان به استفاده برای اشتراکي متغيرهایCacheم دراولين ، برنامه استارت از بعد که هنگامي آنها .دارند کاربرد فلو سيج
کند مي عبور فلو از مسيج،.شوند مي دهي مقدارسطح در اشتراکي متغير يک اگرschema،شود تعريفآبرای نگاهيک فلو
متغيرprivateسطح در اگر و ايد مي حساب بهmoduleشودف تعريفآنبرای گاهNodeمتغير يکprivateمي حساب به
بين اما ،آيدinstance(فلو يک هایها ترد يعني).هستند مشترک
Example 1:
DECLARE RequestCounter SHARED DECIMAL 0;
Example 2:
متغير زير مثال درCacheQueueTableب در کهيرونشده تعريف ماژول،،شوند مي تعريف که فلو از هايي نمونه بوسيله
.است استفاده قابل
-- a shared variable that can be used by instances of a flow
DECLARE CacheQueueTable SHARED ROW;
CREATE COMPUTE MODULE Routing_using_database_and_memory_cache_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
…….
END;
END MODULE;
39. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
Accessing elements With ESQL:
Input Messages:
If you are referring to the input message tree to interrogate its content in a Compute node, use correlation name
InputRoot followed by the path to the element to which you are referring.
داريد قصد اگردرComputeNodeنام از کنيد پيدا دسترسي ورودی های داده بهInputRootديتا درخت به دسترسي برای
استفاده.کنيد:است شده گرفته نظر در زير ساختار با ورودی ديتای که است اين بر فرض زير مثالهای در
Example:
1) InputRoot.XMLNS.Data.Invoice
فيلد به فوق دستورInvoiceشاخه زير ازDataشاخه زير در کهXMLNSشاخه در نيز آن وInputRoot.کند مي اشاره دارد قرار
2) InputRoot.XMLNS."Customer Data".Invoice
شاخه سر چون فوق دستور درInvoiceفيلدCustomer Dataعبارت و شده فرضCustomer Dataبه اشاره برای ،باشد مي فاصله دارایآن
از بايد".کرد استفاده
3) InputRoot.XMLNS.*.Invoice.Value
اي درش سر که است اين معني به * مثال ناخهinvoiceديگر عبارت به .نيست مهمInvoiceاز ای شاخه زير هر درXMLNS،باشد کهشده پيدا
.شود مي برگردانده و
4) InputRoot.XMLNS."Customer Data".{'Customer-' || CurrentCustomer}.Invoice
فوق مثال درInvoiceهای شاخه سر از کردام هر درCustomerياCurrentCustomerباشد که.شود مي برگردانده
5) InputRoot.XMLNS.Data.Invoice[1]
InputRoot.XMLNS.Data.Invoice
فيلد فرضا اگر مثال اين درInvoiceفيلد يعني ،باشد مورد يک از بيشDataفيلد يک از بيشInvoiceداشته خود مجموعه زير درمي باشد
بصورت آرايه همانند توانIndex.کرد اشاره آن بهدايندکس به اگر حالت اين رinvoiceاول خانه همان به باز هم نکنيم اشاره،شود مي اشاره
.است اول دستور مثل هم دوم دستور خروجي يعني
:نکتههای عالمت از استفاده با>)شود محاسبه اول به آخر از گذاری ايندکس (يعنيو<)آخر به اول از گذاری (ايندکست ميوانبهفيلدمورد
نظرکرد اشاره زير شکل بهکنيد فرض زير مثالهای در ،4تاinvoiceداريم:
40. قرباني حميد : کننده تهيهn to IIBIntroductiohttps://ir.linkedin.com/in/ghorbanihamid
6) InputRoot.*[]
فوق مثالشاخه زير در موجود فرزندان تمام بهInputRoot.کند مي اشاره
7) InputRoot.*[<]
فرزند آخرين به دستور اينInputRootاينجا در که ميکند اشارههمانم ورودی پيام بدنه.شود ي
8) WHILE count < 32 DO
SET TOTAL = TOTAL + InputRoot.XMLNS.Data.Invoice[count].Amount;
SET COUNT = COUNT + 1
END WHILE;
حلقه از استفاده با مثال اين درWhileآيتم روی برInvoice.ايم کرده ايجاد حلقه
Example:
DECLARE InputValue CHARACTER '';
SET InputValue = CAST (InputRoot.BLOB.BLOB AS CHARACTER CCSID 1256);
بصورت ورودی ديتای است اين بر فرض فوق مثال درBLOBدستور با و دريافت را آن فوق دستور که باشد ميCASTنوع به
STRINGمتغير در و تبديلInputValueقرا.شود مي داده ر
Output Messages:
If you are referring to the output message tree to set or modify its content in the Compute node, use correlation name
OutputRoot followed by the parser name
خروجي روی بر را ديتايي داريد قصد اگر همچنينComputeNodeده قرارنام از ،يدOutputRoot.کنيد استفاده
Example:
SET OutputRoot.BLOB.BLOB = CAST( 'Hi IIB Developer' AS BLOB CCSID 1256 );
عبارت دستور اين'Hi IIB Developer'نوع به تبديل راBLOB.دهد مي قرار خروجي در و نموده
درختي بصورت ديتا ساختار اينکه بر فرض با : مثالشکل به: باشد مي زير
IF InputRoot.XMLNS.Invoice.InvoiceNo IS NULL THEN
DO;
-- more ESQL --
END IF;
SET OutputRoot.XMLNS.Invoice.Customer.FirstName = UPPER(InputRoot.Invoice.Customer.FirstName);
SET OutputRoot.XMLNS.Invoice.InvoiceNo = InputRoot.Invoice.InvoiceNo + 1000;
SET OutputRoot.MRM.Invoice.TillNumber = 26;
SET OutputRoot.MRM.BooleanElement1 = true;
باال مثال دراگ:داد انجام را کار اين توان مي زير دستورات با دهيم تغيير را خروجي مقدار بخواهيم ر
0) SET FullName = UPPER(FirstName) || ' ' || UPPER(LastName);
1) SET OutputRoot = InputRoot;
2) SET OutputRoot.XMLNSC.Invoice.Customer.FullName = FullName;