Elena LucconeInnovation und Technologie

Integrating web services in a BPD with IBM BPM 8.5 dynamic address configuration

There are a lot of excellent examples and videos how to call a web service from a BPMN process in IBM BPM, so I am not going to explain this once more. But as I read all examples I noticed, they show the usage of static URLs for the called services and I missed a hint how to configure the URLs for usage in different environments easily. This article gives you some suggestions about this.

When we start thinking about dynamic URLs, the first idea is of course: we need a variable. But what kind of variable and how to use it in the WSDL URI field of the Process Designer?

For our purposes I suggest to use a process application environment variable. Environment variables can be changed in the Process Admin Console after application deployment. We can also specify different values for environment variables for different environments in Process Designer opening the Process App Settings / Environment.

We can address environment variables using tw.env.<variable name>.

The next problem we have to solve is that we cannot just put a variable name in the WSDL URI field for the web service. This will just don’t work. But the good news are, that we can use expressions using <# #> or JavaScript expressions using <#= #>.

Last but not least I would like to point you to a very nice new feature in IBM BPM 8.5. In IBM BPM 8.0 we had only the option to provide inline configuration for a web service. In IBM BPM 8.5 we can choose between inline configuration and configuration in the Process App Settings. In the Process App Settings we can now create “servers” and provide a configuration for each server. After that we can use the saved configuration when calling the web service.

I suggest to use preconfigured servers, because we have all web service descriptions in one place, so we can change them much easier than if they were hidden somewhere in the BPD. We can also access and change them in the Process Admin Console after application deployment in the same way as changing environment variables.

Example:

Let’s have a web service like this: http://abi185:9080/halloWeltWSWeb/sca/halloWeltWS/WEB-INF/wsdl/halloWeltWS_halloWeltWS.wsdl

We can define a Web service implementation in the IBM Process Designer using static URL inline like this:

Hallo Welt WS

To make the Web service address dynamic, we add a new environment variable wsserver.url in the Process App Settings by clicking on Add in the Environment tab:

Process App Setting

After that, we enter in the WSDL URI field:

<#=tw.env.wsserver.url +“/halloWeltWSWeb/sca/halloWeltWS/WEB-INF/wsdl/halloWeltWS_halloWeltWS.wsdl“#>

call Hello Welt WS

Or we can use the new IBM BPM 8.5 feature to define a server configuration for the application.

We do this by clicking on the Add button in the servers tab of the Process App Settings:

process app

After that we can use the new configuration for our web service call:

call hello Welt 2

In the Process Admin Console we can now see and change our environment variables:

process admin console

… and the preconfigured servers:

demo

I hope I gave you some useful points.

Schlagwörter: