Tags

, , , , , , , , ,

Domain Value Maps (DVM)

Basically the use of DVM serves to control values: Where can map values using keys, DVM is an option to use the properties files from Java or XMLCache the WLI (Weblogic Integration)

For our test we will create a DVM that has the names of some States to further we map these names through their acronyms.

:D

First we create our project, in my case I created with the name DVMBpel

Note: See I created an empty BPEL (Empty Composite)

Imagem

I created an XSD and WSDL with the operations that we will use, below the same if you want to also perform the same tests.

Name XSD  DVMBPELProcess.xsd     (Click on the name to download the file)

Imagem

Name WSDL  DVMBPELProcess.wsdl    (Click on the name to download the file)

Imagem

After creating them in your project we should have:

Imagem

Now let’s create a DVM, right click on the SOA Content folder and click New

Imagem

Where is the icon of a Binoculars” type DVM and select the checkbox next to Domain Value Map (DVM) and click OK

Imagem

Now for the name enter Siglas.dvm and Domain Name State place (This will be our key) and Domain Value place SAO PAULO (This will be a default value)

Again in domain name on the line below Acronym place (This will be our value) and put in place Domain Value SP (This will be our Acronym default) and should be as below:

Imagem

Now click OK, check that the state SAO PAULO and the Acronym SP were created as a default value, now let’s insert a few States with their respective acronyms.

To do this click on the + sign and Add Domain Values

Imagem

Below insert just a few more states to our tests:

Imagem

Now create a BPEL based on this WSDL:

Imagem

After created our BPEL, drag an Assign into it as follows:

Imagem

Within the Assign1 we will expand outputVariable on the right to client:SiglaEstado, after that click Expression and drag into client:SiglaEstado and the following display:

Imagem

Now in Advanced Functions select the DVM Functions option and click Insert Into Expression

Imagem

Within dvm:lookupValue() will put the necessary parameters as follows:

dvm:lookupValue(dvmMetadataURI as string, SourceColumnName as string,SourceValue as string, TargetColumnName as string, DefaultValue as string) as string.

In our case looks like this:

dvm:lookupValue(“Siglas.dvm”,”Estado”,($inputVariable.payload/client:NomeEstado),”Sigla”,””)

Imagem

Now perform local deploy and we test it:

In your browser go to http: http://localhost:10000/em

Note: The port 10000 is the number that I chose to create my Domain.

Login:

Imagem

Click your project: DVMBpel[1.0] and click Test

Imagem

Then place a State to accomplish the test, below AMAPA put that should return AP

Request:

Imagem

Response:

Imagem

Voalá” .. Our DVM has been successfully built.

However, suppose your project is already in production and now we want to add more states with more acronyms.

To do this make sure that your Composer is enabled consulting my Post: Enabling sounds Composer

After that, in your browser enter the URL http: // localhost: 10000 / sounds / composer

Click Open >> Open DVM

Imagem

Select DVMBpel_rev1.0 and click Open

Imagem

Click Edit

Imagem

Now click on the + sign to add another Estado and another Sigla

Imagem

In the screenshot below enter the name of the State and the Abbreviation (In my case, Estado TOCANTINS, Sigla: TO)

Imagem

Click OK and see below that we will have a state, now click Save and then click Commit:

Note: Pay close attention this time because you really have to first click Save and then click Commit, if you forget to click Save or Commit the DVM will not save the changes.

Imagem

After clicking Commit click Yes as follows to save your changes:

Imagem

Ready: Your new Estado with Sigla was successfully inserted.

Note: I have seen many problems where these changes are not added by any Bug own DVM, so I suggest you take a Logout and re-enter the screen to make sure your changes are there, if not repeat the steps for added them again.

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

 


Hugs and to the Next

/:-D