Welcome!

Weblogic Authors: Yeshim Deniz, Elizabeth White, Michael Meiner, Michael Bushong, Avi Rosenthal

Related Topics: Weblogic

Weblogic: Article

Integration: Not Just Aggregation

Integration: Not Just Aggregation

When talking about enterprise application integration, we tend to think of using Web services technologies such as SOAP and UDDI to virtualize a data model across a large enterprise. The thinking is that with a consistent interface, the data stores of the company can be abstracted behind a Web services layer and reported in XML, which can then be kneaded to the particular needs of your application.

In an ideal world, this would be simple. However, we don't live in an ideal world, so there are a number of problems. The first problem is that we often want to take data from one service and use it as a parameter to call another, take returned data from that service and use it to call another, and so forth. We would then want to take pieces of data from each and aggregate them together to form our response to the original call.

In addition, data-type conversion may be necessary to map parameters to each other. For example, service 1 may return a double that is required by service 2 as an index, but service 2 expects it as a float. Interoperability is more than just being able to parse WSDL to create a proxy - operations such as data-type conversion are paramount.

Finally, you cannot expect all the services to run on the same platform. There may be .NET Web services, COM, DCOM, or other J2EE Web services that need to be integrated, to name a few. This is far more complicated than simple data aggregation, but is a real-world requirement; and with Web services development platforms alone it would require a lot of hand coding, defeating the purpose.

Here's where a tool such as BEA WebLogic Workshop 8.1 and a platform such as BEA WebLogic Integration 8.1 come into play.

A Real-World Use Case
A fictional company, The Pension Source (TPS), provides pension administration for their customers. Their pension plans have always been based on funds based in the U.S. but they want to branch into international funds. Their offices in Europe have a Web service that provides foreign exchange information, and these offices are standardized on Oracle as an application server. In addition, they have a domestic database that contains the recent price history and currency code for each fund. They would like to integrate these Web services to provide a new application. What will this entail?
1.  Exposing an interface that allows the user to query the dollar price of a particular fund
2.  Pulling the price of the fund from the database
3.  Pulling the currency code of the fund from the database
4.  Converting the price to U.S. dollars
5.  Returning the converted price to the user

In step 2, the fund price is returned to the user as a float. In step 4, the distant Web service requires the price to be passed to it as a double.

We'll see how straightforward the design and implementation of such a workflow and orchestration is with BEA WebLogic Workshop.

Building the Integrated Application
The downloads for this article (located at www.sys-con.com/weblogic/sourcec.cfm) include a zip file (CurrencyConv.zip) containing an emulation of the currency conversion Web service as an Oracle JDeveloper project that may be installed on Oracle JDeveloper and run on OC4J. Please check the readme file included with the download for instruction. In addition, PensionAPI.zip contains a WebLogic Workshop 8.1 application that emulates a service that retrieves data from the pension fund's database, and exposes it as an API. For simplicity, neither application is tied to a back-end database; they simply emulate a real-world scenario where they would.

Once both services are up and running, start WebLogic Workshop 8.1.

Getting Started with the Workflow and Adding a Client Request

  • Create a new empty application called TPSReport. For the server, make sure that you select the "Integration" server on the dropdown list.
  • Create a new empty workflow project called GetFundInformation.
  • Within the workflow folder you will see a file called workflow.jwf. Double-click it to open the designer.
  • Double-click the "Starting Event" and select "Invoked By a Client Request"
  • Double-click the Client Request node, select "String", and click Apply.
  • Select the "Receive Data" tab. This is where you will assign the parameter that has been passed by the user to a variable that is internal to your workflow. That variable does not yet exist, so in the next steps you can add it.
    - On the right side of your screen, you should see the Data Palette. Click "Add" besides the Variables tab, and then call the variable strSymbol and make it a string.
    - On the "Receive Data" tab of the Client Request node, click "Select Variable", variable strSymbol is now on the list.
  • Click "Apply" and then "Close" to update the Client Request node.

    You've finished the first step of the workflow, taking the data in from a client request. Your screen should look something like Figure 1.

    Consuming the Fund Price Web Service
    Now that you have the Client Input, as a string denoting the symbol of the fund you are interested in, the next step is to consume the Web service that exposes the Fund Price History and Currency Code.
    Consuming the Price History:

  • From the palette on the bottom left side of the screen, select "Control Send With Return" and drag it onto the green line between the Client Request node and the Finish.
  • Double-click the node that appears.
  • You can see that this node requires a control to continue. With the designer you can add a new one on the fly as follows:
    - On the right side of the screen (use Figure 1 as a guide) the Data Palette contains a Controls tab. On it, click "Add" and select "Web Service".
    - In the ensuing dialog, on step 1, call the control ctlPensionDetails
  • In step 2, select "Create a New Web Services Control to Use" and call it ctlPensionsAPI
    - In step 3, enter the URL to the WSDL of the Pensions API Web service that you downloaded and installed earlier.
    - Click "Create" and you will return to the node designer.
  • You can now select "ctlPensionDetails" as the control implementing the Web service, and when selected, the methods list box is populated.
  • Select the method "getPrice" and click "Apply".
  • Select the "Send Data" tab. This is where you set up the parameters that you are passing to the Web service and where they come from.
  • Click "Select Variable" and select "strSymbol". This will take the variable created by the User Call in the previous node and dispatch it as a parameter to the PensionsAPI Web service. Click "Apply".
  • Select the "Receive Data tab". This is where you specify what to do with the data that comes back from the Web service.
  • We don't have a variable to hold this data, so create a new one as before. Make it a Java float, and call it nAmount.
  • It will now be available on the "Select Variable" list, so select it and click "Apply".
  • Click "Close". You now have a node in your workflow that dispatches the client request to a Web service and gets a value back.

    Repeat these steps to add another node, calling the same control, but this time calling the "getCurrency" method. Map the returned value to a new integer called nCurrency.

    Your screen should now look like Figure 2.

    Orchestrating the Change Currency Web Service
    Now it gets interesting. At this point you have a workflow using all WebLogic Web services. You are going to integrate the service running on another platform - in this case the Currency Conversion service running on Oracle OC4J.

    As before, drag a "Control Send with Return" node onto the workflow, dropping it just above the "Finish" node.

  • Double-click it to configure it.
  • You do not yet have a control for the Web service, so click "Add" near "Controls" on the Data Palette.
  • Select Web Service". - Step 1: Call the instance ChangeCurrency - Step 2: Select "Create a new Control". Call it ctlChangeCurrency. - Step 3: Enter the WSDL of the running Web service. If you followed the instructions in the download it should look something like: http://machinename:8888/WebLogicArticle- CurrencyConv-contextroot/mypackage1.Change Currency?WSDL
    - Click "Close".
  • Return to configuring the node.
    - On "General Settings" select the Control "ChangeCurrency" and the node "ChangeCurrency" and click "Apply"
    - On "Send Data" select nAmount and nCurrency in step 1.
    - You'll notice on the dialog that the input variables are a "double" and an "int", whereas the values you are about to pass are a "float" and an "int". To transform them, on step 2a in the dialog do the following:
  • Click "New". In step 1 set the Variable Name to "TransformForCurrency" and in step 2, set the control name to dtfTransformCurrency
  • Enter "TransformAmount" in the Method box and click "Create Transformation" in step 2b.
  • The Map Variables dialog appears. Drag the float to arg1 and the int to arg 2.
  • Click OK when you're done.
    - Click Apply to update the "Send Data" settings
    - On the "Return Data" node, the double needs to be mapped to a variable. Create a new double variable as before, and call it nReturn. Select it, click "Apply" and then click close.

    You have now integrated the distant Web service, and it was done as seamlessly as the Web services running on the same WebLogic platform.

    Returning the Data to the User
    The user has now passed a string containing the fund that they are interested in to your workflow, and the workflow has pulled the details out, and translated the currency to US dollars. The last step is to return the currency-translated value back to the user.

    This is very simple. On the Palette, select a "Client Response" node and drop it just above the "Finish" node.

  • Double-click the "Client Response" node and select a "Double" on the "General Settings" tab.
  • On the "Send Data" tab, select the variable called "nReturn", click "Apply", and then click "Close".

    Your finished workflow should now look like Figure 3.

    Testing the Workflow
    Build the application and run it. The test harness will run and display the screen shown in Figure 4.

    Enter "ABC" in the textbox and click "clientRequest". Wait a few seconds and click "Refresh" on the Message Log. Keep doing this until you see a callback.clientResponse entry on the Message Log.

    By clicking on the nodes within the harness, you can see the calls and the data being passed around the different Web services.

    In the case of "ABC" the amount was being reported in currency code 1 (dollars) so no conversion was required. As an exercise, try to amend the workflow so that it doesn't bother to call the Currency Conversion Web service in this case. (Hint: Use a decision node.)

    By trying the symbols "BBC" and "CBC" you can investigate the currency conversion as it is happening.

    One really great thing about this is that this compiled workflow is actually running as a Web service, so it in turn could become a node in another, more complex orchestration!

    Conclusion
    In this example you built a simple orchestration. You have barely touched on the features that are available in BEA WebLogic Workshop 8.1 for orchestrations. Other nodes can have Java code associated with them, be conditional, loop, or be asynchronous. The goals of true application integration - data aggregation, service chaining, and orchestration - are now in your hands.

  • More Stories By Laurence Moroney

    Laurence Moroney is a senior Technology Evangelist at Microsoft and the author of 'Introducing Microsoft Silverlight' as well as several more books on .NET, J2EE, Web Services and Security. Prior to working for Microsoft, his career spanned many different domains, including interoperability and architecture for financial services systems, airports, casinos and professional sports.

    Comments (0)

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


    @ThingsExpo Stories
    With tough new regulations coming to Europe on data privacy in May 2018, Calligo will explain why in reality the effect is global and transforms how you consider critical data. EU GDPR fundamentally rewrites the rules for cloud, Big Data and IoT. In his session at 21st Cloud Expo, Adam Ryan, Vice President and General Manager EMEA at Calligo, examined the regulations and provided insight on how it affects technology, challenges the established rules and will usher in new levels of diligence arou...
    SYS-CON Events announced today that Evatronix will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Evatronix SA offers comprehensive solutions in the design and implementation of electronic systems, in CAD / CAM deployment, and also is a designer and manufacturer of advanced 3D scanners for professional applications.
    SYS-CON Events announced today that Synametrics Technologies will exhibit at SYS-CON's 22nd International Cloud Expo®, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Synametrics Technologies is a privately held company based in Plainsboro, New Jersey that has been providing solutions for the developer community since 1997. Based on the success of its initial product offerings such as WinSQL, Xeams, SynaMan and Syncrify, Synametrics continues to create and hone inn...
    Cloud Expo | DXWorld Expo have announced the conference tracks for Cloud Expo 2018. Cloud Expo will be held June 5-7, 2018, at the Javits Center in New York City, and November 6-8, 2018, at the Santa Clara Convention Center, Santa Clara, CA. Digital Transformation (DX) is a major focus with the introduction of DX Expo within the program. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive ov...
    A strange thing is happening along the way to the Internet of Things, namely far too many devices to work with and manage. It has become clear that we'll need much higher efficiency user experiences that can allow us to more easily and scalably work with the thousands of devices that will soon be in each of our lives. Enter the conversational interface revolution, combining bots we can literally talk with, gesture to, and even direct with our thoughts, with embedded artificial intelligence, whic...
    To get the most out of their data, successful companies are not focusing on queries and data lakes, they are actively integrating analytics into their operations with a data-first application development approach. Real-time adjustments to improve revenues, reduce costs, or mitigate risk rely on applications that minimize latency on a variety of data sources. In his session at @BigDataExpo, Jack Norris, Senior Vice President, Data and Applications at MapR Technologies, reviewed best practices to ...
    Smart cities have the potential to change our lives at so many levels for citizens: less pollution, reduced parking obstacles, better health, education and more energy savings. Real-time data streaming and the Internet of Things (IoT) possess the power to turn this vision into a reality. However, most organizations today are building their data infrastructure to focus solely on addressing immediate business needs vs. a platform capable of quickly adapting emerging technologies to address future ...
    In his session at 21st Cloud Expo, Raju Shreewastava, founder of Big Data Trunk, provided a fun and simple way to introduce Machine Leaning to anyone and everyone. He solved a machine learning problem and demonstrated an easy way to be able to do machine learning without even coding. Raju Shreewastava is the founder of Big Data Trunk (www.BigDataTrunk.com), a Big Data Training and consulting firm with offices in the United States. He previously led the data warehouse/business intelligence and B...
    "Digital transformation - what we knew about it in the past has been redefined. Automation is going to play such a huge role in that because the culture, the technology, and the business operations are being shifted now," stated Brian Boeggeman, VP of Alliances & Partnerships at Ayehu, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
    "Evatronix provides design services to companies that need to integrate the IoT technology in their products but they don't necessarily have the expertise, knowledge and design team to do so," explained Adam Morawiec, VP of Business Development at Evatronix, in this SYS-CON.tv interview at @ThingsExpo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
    The 22nd International Cloud Expo | 1st DXWorld Expo has announced that its Call for Papers is open. Cloud Expo | DXWorld Expo, to be held June 5-7, 2018, at the Javits Center in New York, NY, brings together Cloud Computing, Digital Transformation, Big Data, Internet of Things, DevOps, Machine Learning and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding busin...
    In his Opening Keynote at 21st Cloud Expo, John Considine, General Manager of IBM Cloud Infrastructure, led attendees through the exciting evolution of the cloud. He looked at this major disruption from the perspective of technology, business models, and what this means for enterprises of all sizes. John Considine is General Manager of Cloud Infrastructure Services at IBM. In that role he is responsible for leading IBM’s public cloud infrastructure including strategy, development, and offering m...
    Nordstrom is transforming the way that they do business and the cloud is the key to enabling speed and hyper personalized customer experiences. In his session at 21st Cloud Expo, Ken Schow, VP of Engineering at Nordstrom, discussed some of the key learnings and common pitfalls of large enterprises moving to the cloud. This includes strategies around choosing a cloud provider(s), architecture, and lessons learned. In addition, he covered some of the best practices for structured team migration an...
    No hype cycles or predictions of a gazillion things here. IoT is here. You get it. You know your business and have great ideas for a business transformation strategy. What comes next? Time to make it happen. In his session at @ThingsExpo, Jay Mason, an Associate Partner of Analytics, IoT & Cybersecurity at M&S Consulting, presented a step-by-step plan to develop your technology implementation strategy. He also discussed the evaluation of communication standards and IoT messaging protocols, data...
    Recently, REAN Cloud built a digital concierge for a North Carolina hospital that had observed that most patient call button questions were repetitive. In addition, the paper-based process used to measure patient health metrics was laborious, not in real-time and sometimes error-prone. In their session at 21st Cloud Expo, Sean Finnerty, Executive Director, Practice Lead, Health Care & Life Science at REAN Cloud, and Dr. S.P.T. Krishnan, Principal Architect at REAN Cloud, discussed how they built...
    22nd International Cloud Expo, taking place June 5-7, 2018, at the Javits Center in New York City, NY, and co-located with the 1st DXWorld Expo will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud ...
    22nd International Cloud Expo, taking place June 5-7, 2018, at the Javits Center in New York City, NY, and co-located with the 1st DXWorld Expo will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud ...
    DevOps at Cloud Expo – being held June 5-7, 2018, at the Javits Center in New York, NY – announces that its Call for Papers is open. Born out of proven success in agile development, cloud computing, and process automation, DevOps is a macro trend you cannot afford to miss. From showcase success stories from early adopters and web-scale businesses, DevOps is expanding to organizations of all sizes, including the world's largest enterprises – and delivering real results. Among the proven benefits,...
    @DevOpsSummit at Cloud Expo, taking place June 5-7, 2018, at the Javits Center in New York City, NY, is co-located with 22nd Cloud Expo | 1st DXWorld Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The widespread success of cloud computing is driving the DevOps revolution in enterprise IT. Now as never before, development teams must communicate and collaborate in a dynamic, 24/7/365 environment. There is no time to wait...
    SYS-CON Events announced today that T-Mobile exhibited at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. As America's Un-carrier, T-Mobile US, Inc., is redefining the way consumers and businesses buy wireless services through leading product and service innovation. The Company's advanced nationwide 4G LTE network delivers outstanding wireless experiences to 67.4 million customers who are unwilling to compromise on qua...