Introduction:
This article walks you through
the steps to integrate external services into IBM® Business Process Manager
applications using Process Designer. It covers integration with Java and
describes best practices for achieving the integration.
Overview
There are two ways for
Business Process Manager to integrate with external services, one is the
component bindings way, the other is the out-of-box connectors way. The
component binding’s method enables the system to invoke external systems with
various bindings such as SCA bindings, EJB bindings, HTTP bindings, JMS
bindings, and so on. This is the most powerful method, but it is only possible
with Business Process Manager Advanced. The out-of-box connector’s method
provides basic integration capabilities with external systems. It's simpler
than the binding’s way and can be used for all Business Process Manager
Editions. This article will focus on how to use the out-of-box connector’s
method to integrate with external systems.
The IBM Process Designer is
the authoring tool used to enable integration with out-of-box connectors. It
provides capabilities for lifecycle management of business processes, and also
provides a set of out-of-box connectors to integrate with external systems.
There are four different ways to integrate with external systems using Process
Designer:
v Java integration.
v Web service integration.
v ILOG integration.
v Enterprise Content Management (ECM) integration.
In his article we are
describing Java Integration with IBM BPM.
Java Integration
Java integration calls methods
from a Java class and interfaces with most third-party Java APIs, thus
supporting a variety of integration scenarios and giving you access to Java
features, including published Java libraries and APIs. You should build a Java
integration service when you want to integrate with an external system to
retrieve, update, or insert data in order to complete a task.
In this section, we'll use a
sample to illustrate how to use Java integration to call a method from a Java
class. For the purposes of our sample, let's assume we have a JAR file
containing a Java method that can output Country Names based on Input of
country code. We'll import that file into Process Designer, then use the Java
Integration component to invoke the Java method, as described in detail in this
section.
Import external files
External files are images,
style sheets, JAR files, or other assets that are part of Business Process
Manager Implementation, but developed outside of Business Process Manager. You
can add these external files to your process application or toolkit in the
Designer view so that all project assets are included in the Process Center
repository. Adding these files to your process application ensures that all
required assets are available and installed when your project is ready for
testing or production.
Before adding managed files,
be aware of the following requirements:
ü You must have write access to the current process
application or toolkit to add external files as assets.
ü The files that you add cannot be larger than 100MB.
You can add Hello CountryDetails.jar to the process
application by doing the following:
From the project tree, select
the + icon next to Files and select Server File, as shown in below.
In the Server File window,
click Browse and select CountryDetails.jar
in your file system. CountryDetails.jar
is now part of your process application. When you deploy this process
application, this server file will be deployed as part of the application.
Save the server file.
Create an
integration service and add a Java Integration component
To create an integration
service, do the following:
From the project tree, select Implementation, click the + icon, then
click Integration Service.
Specify the name as Java Integration Service as shown in below,
and click Finish.
To diagram the integration,
click the Diagram tab and drag the Java Integration component onto the canvas,
then change its name to Invoke Country
Details Service, drag a Server script name to Log and wire the components together, as shown in below.
To configure the Java
Integration component to invoke a Java method, click Hello World - JIC.
Under Properties, click the Definition tab, and under Discovery, set the Java Class by doing
the following, as shown in Figure:
a)
Click Select and
select the class.
b)
Select CountryDetails java class.
c)
Select the method
String getCountryName(String) from the list.
To set up the service
variables, click the Variables tab, and add an input variable CountryCode of type string, and set the
default value to “IN”, as shown in Figure. Add an output variable CountryName of type string.
Define the data mapping for CountryDetails. Click Invoke CountryDetails Service. Under Properties, click the Data Mapping
tab. To set the Input Mapping, select the variable tw.local.CountryCode, as
shown in Figure. Do the same to set the Return Value.
To test the integration, click
the debug icon in Process Designer, click Step, as shown in Figure, several
times until you see a message saying "The service has finished."
Conclusion
In this article, you've
learned about Java Integration with external systems in Process Designer. You
learned some best practices for using the integration components to communicate
with external systems. These integration components exist as services, so they
can be reused in toolkits shared across process applications, making Business
Process Manager Systems easier and more efficient for business process
designers.
Download
0 comments :
Post a Comment