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>.
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.
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:
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:
After that, we enter in the WSDL URI field:
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:
After that we can use the new configuration for our web service call:
In the Process Admin Console we can now see and change our environment variables:
… and the preconfigured servers:
I hope I gave you some useful points.
Schlagwörter: IBM BPM