Tags

,

In this post I will explain how we can enter values in a sequence in BPEL.

We will Insert process using DBAdapter and the Transformation add a function to set the sequence that should already be created in the database.

Our first step is to have created in our database SEQUENCE one, for it ran the following command to create it.

CREATE SEQUENCE EMPLOYEE_SEQ
START WITH     1
INCREMENT BY   1;

SEQUENCE will use this for the EMPLOYEE table where we will EMPNO field that will be the employee number and the Field filled by our sequence.

As in this post we focus on the configuration of the SEQUENCE will skip a few steps from the creation of our DBAdapter, but if you have any doubts as to create a click here e veja o passo a passo para a criação de um.

Create a project called SequenceBpel

Imagem Blog UansCarvalho

Create one now DataBase Adapter named InsertEmployeeDbAdapter

Imagem Blog UansCarvalho

Select only the option Insert Only

Imagem Blog UansCarvalho

Import the table EMPLOYEE

Imagem Blog UansCarvalho

Remove any relationship to this example is not necessary.

Imagem Blog UansCarvalho

Finalizing our DbAdapter then we will have the following screen:

Imagem Blog UansCarvalho

We will now make a small workaround” only for a WSDL is created to expose our service.

We will create a BPEL and then replace it by a MEDIATOR.

Then drag a BPEL Process with the information below:

Imagem Blog UansCarvalho

After that, we get the following screen:

Imagem Blog UansCarvalho

Go now in the XSD folder of your project and open the file SequenceBPELProcess.xsd

Imagem Blog UansCarvalho

Edit your XSD so that it has the input parameters required for inserting in our EMPLOYEE table, then you should be as follows:

Imagem Blog UansCarvalho

Now delete your BPEL and Drag a MEDIATOR with the specifications as below:

Imagem Blog UansCarvalho

Then connect your MEDIATOR your WSDL and the other end to your DBAdapter and should be as follows:

Imagem Blog UansCarvalho

Now open our MEDIATOR and click the icon as below:

Imagem Blog UansCarvalho

Below click Create New Mapper File for him to create our Transformation and then click OK.

Imagem Blog UansCarvalho

Open your Transformation and General guide your screen right type sequence as follows:

Imagem Blog UansCarvalho

Then drag this component so that it is between the transformation:

Imagem Blog UansCarvalho

Double-click on this component and in the following screen fill with the name of your SEQUENCE and the JNDI name of your datasource:

Note: Put the name of your SEQUENCE and the name of your JNDI with DOUBLE QUOTES

Imagem Blog UansCarvalho

Done that now connect the component to the empno field for your table:

Imagem Blog UansCarvalho

Connect the other fields now:

Imagem Blog UansCarvalho

Ready .. is now only allowed to deploy the project and test.

See below my input parameters:

Imagem Blog UansCarvalho

See below for the results in the table:

Imagem Blog UansCarvalho

Remembering that each execution of the payload up where I insert the information will be automatically generated another line in the database by increasing the code EMPNO field

Doubts? Leave your comment and download this Project  :-)

 

Hugs and see you next

/:-D