IBM WebSphere Enterprise Service Bus has grown to be a widely used integration Bus in corporate installations.
Bizagi integrates with IBM WebSphere ESB, through its generic connector called the WS connector.
What you need to do
In order to configure in Bizagi, that processes invoke services directly marshaled by IBM WebSphere ESB, you will need to use Bizagi Web services connector.
Bizagi Web services connector allows you to configure input and output parameters by using graphical mapping and built-in transformation functions, without the need of programming.
The required configuration follows the same steps presented at Invoking Web Services (SOAP).
In order to illustrate the process of consuming services marshaled by IBM WebSphere Enterprise Service Bus, we will use as an example, a simple process to register Clients and addresses.
Furthermore, we will use an IBM bus having a service called AddressBookService, containing two methods:
•SaveAddress which is responsible to save or update an address in a database.
•FindAddress which is responsible to load an address based on a name.
What we will do is create a client and review if it has a registered address.
If there is an address associated to the client, the user can use it or update it, otherwise, the user can create it.
The modeled process is as follows:
In the task called Register Address, we will validate the existence of an address associated with the client using the method FindAddress, and in task Save Address we are going to save the update or registry of an address associated with the client using the method SaveAddress.
The data model for this process is displayed below:
The entity Address is going to be updated with the result of the web service.
Note that the City entity is a parameter entity.
Since our service sends and receives only the code of a city, we will define that code as the business key defining uniqueness of records at the City entity (each city has its own, unique code).
To define business keys at entities in Bizagi, refer to Business Keys.
To find the address, we have defined our form having a button that executes the interface.
Once the service sends back the response, Bizagi will display the updated fields having that information.
If a new address should be registered, then the Save address task gets involved to execute the other service.
We will illustrate the steps carried out to configure the FindAddress, service invocation.
1.Open the Web Service connector.
For this case in which the web service is invoked from a button, the Web services connector is opened by using the Actions & Validation within the form of the Register Address task.
2.Configure the service general information.
Select SOAP as service type, type the URL of the service and click on Go to display the available Methods.
Recall that the URL you type should not contain extra blank spaces.
Select the method and click on Next.
3.Map the input parameters.
Use drag and drop features to graphically map what information in Bizagi should be sent as parameters for the FindAddress service.
In our example, we are sending the id of the customer set as name of the address for the Name parameter of the service.
Notice that the name parameter has an XML attribute called Value, in which we need to send the information.
4.Map the output parameters.
Similarly to the previous step, use drag and drop features to graphically map what information from the service's response, should be updated in Bizagi data model.
In our example, we are storing all information regarding the address into our Address entity (Username has Address as a related entity).
Notice that the incoming information of the address' city, is sent as a string code.
We map the City value to our Code attribute in Bizagi's City entity, and what this does is to link that City record we already have in Bizagi to the one matching the Code.
In this way, we don't create new cities.
5.Define the error handling.
This step is optional.
You may define error handling for this service and click Finish.
In our example, we are not defining error handling.
For information on how to define error handling, refer to Interfaces error handling.
At this point we have configured the invocation of IBM WebSphere Enterprise Service Bus services from processes in Bizagi.
The same steps are carried out for the SaveAddress, service invocation but instead of using the Web service connector from a button, we set it to the Save Address asynchronous task.
Once we have configured the service invocation, we execute the process:
•When working in the Register Address task, that invokes the FindAddress service.
•When working in the Save Address task, that invokes the SaveAddress service.
•Both service methods are consumed from the published WSDL marshaled by IBM WebSphere ESB:
Web services available in IBM WebSphere Enterprise Service Bus must be defined with HTTP endpoints.
Other endpoints such as JMS are not supported.