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)
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)
Name WSDL DVMBPELProcess.wsdl (Click on the name to download the file)
After creating them in your project we should have:
Now let’s create a DVM, right click on the SOA Content folder and click New …
Where is the icon of a “Binoculars” type DVM and select the checkbox next to Domain Value Map (DVM) and click OK
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:
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
Below insert just a few more states to our tests:
Now create a BPEL based on this WSDL:
After created our BPEL, drag an Assign into it as follows:
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:
Now in Advanced Functions select the DVM Functions option and click Insert Into Expression
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”,””)
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:
Click your project: DVMBpel[1.0] and click Test
Then place a State to accomplish the test, below AMAPA put that should return AP
Request:
Response:
“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
Select DVMBpel_rev1.0 and click Open
Click Edit
Now click on the + sign to add another Estado and another Sigla
In the screenshot below enter the name of the State and the Abbreviation (In my case, Estado TOCANTINS, Sigla: TO)
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.
After clicking Commit click Yes as follows to save your changes:
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