Monday 30 April 2012

How to Change DVM at Run Time



Oracle SOA Composer now offers support for editing domain value maps at runtime. Oracle SOA Composer is an EAR file, which is installed as part of Oracle SOA Suite installation. It enables to manage domain value maps at runtime.

1.   Access Oracle SOA Composer at the following location: 
http://hostname:port/soa/composer 

User must have the SOADesigner application role to access Oracle SOA Composer metadata. By default, all the users with Oracle Enterprise Manager Fusion Middleware Control administrator privileges have this role.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUhvI7dgWGAVmpJRrotmFYnq634Nfp1V3G1Ct9dEog6OsjMSt08KUEP0xOlTMFCNdS2wyCBfbVfmcO4jGXM87XTIQ32pqeChKlFjRMFhYOAf9kB6MtS4s-arghRnxZxludYWrpp3Tx7qM/s400/Pic.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBnSB495rdUvNgyokdrsMarJ83xrE7ZEFRdPUwB528IeB1J_zOGPFGDJYZHT_kXMBEKCA1TMZeW1gVYk_ulUD1VcJMB3QCxfXBuNFiLsuddQwanAiZCO-inrLGSgLqu-4U9YUErLnJP2s/s400/Pic.png

Saving Domain Value Maps at Runtime:- 
Every time a domain value map is opened in an edit session, a sandbox is created per domain value map, per user. After saving the changes, the changes are saved in current user sandbox.


Committing Changes at Runtime:-
Commit the changes for saving them permanently. Once changes will be commited, runtime picks up the changes and saves them in the MDS repository. In a session, If changes are saved  without committing them. In such a case, the domain value map remains in the saved state which can reopen the domain value map and commit the changes later.

Detecting Conflicts:-
Oracle SOA Composer detects conflicts that can occur among concurrent users. If we will open a domain value map that is being edited by another user, then one warning appear . However, if we still want to edit the domain value map, then click Yes and make the modifications.If the other user makes changes to the domain value map and commits the changes, one notification message will appear while trying to commit the changes.
If we click Yes and commit the changes, then the changes made by the other user are overwritten by our changes.

How To Work with Domain Value Map




In the below Example I will create one DVM file using four Column CityCode, CityName, CityLocation and Country. Where Country and CityLocation Column will act as qualifier. Mediator will lookup value from .dvm file and write result to local file system.

Step1:- Create .DVM FILE using  Right click on project -> Select SOA-> Transformation-> Domain Value Map . Give some name to domain value map file and give some name to the domain fields then click OK.
Now in .DVM file click on add button -> select the option add domain. In this example I am adding one more domain with name CityLocation with Qualifier as true and hierarchical order as 1 and another domain with name Country with Qualifier as true and hierarchical order as 2 to show the hierarchy weightage.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi51UGtJlswDqrx4B0N2CzhhJqyZ7_zedXMh8RCbr-rs2boXlOmdFZREDmMB9Rn3Jlsj9N2VBnUM7qhzbt92jPUkCbc8hoPYtIZ95WxsAipWmgGAEX5071DssA37ruDenyAcHyrpWoI8_Y/s320/Pic.png

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMBZHske9utFbOKmPPlxfjk7fEIzNkClZ6mRiajnMxCQPyVplVPGI1ZEaYLMGG-zVvLIeBYep1ER-nb8exCSSmbOVoVp0VJy7aYuKn_uU9q7VgxLo-u3qIRhFFgJYlyRWVJw7LmEFlXdM/s320/Pic.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrtjP7ZubWdzs6lpLV5fq-VXkBbRwrGP6wbY-LQyO4cOISdu19uA9Ye9zrIDB16jrWaCvOw-JOyJVkzi8mGOVZIUY8OgPGT3i6bfZRLiVskBBjR23YZwSzfMqTX_YOpKmIAGT4vKojMEE/s400/Pic.png

Step 2:- Now I am creating one Asynchronous Mediator in composite and exposing it as web Service and created one file Adapter which will be writing onto the local system. Wire the Mediator with write File adapter.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyCTV4y7BucgMVBzuzt88PSQUbIS3NV-QUA42sWnJtEgu-gYDfkaol5AtYflKvDMIbg0nRCk0GpDWblsrCGxhGd0cUczN7b3E5_jB0kiH1TBPihpFn6hULN0DZW0x1JQYAk5cmXhFwZ7w/s400/Pic.png

Step 3:- Now open the mediator and click on the transformation icon and select the Advance Function in XSLT Mapper file in Component Palette. Then select the DVM Funtion->lookupValue1M.
Drag this function onto the line connecting field from source to target. Open the function and select the following below values in respective field. In the sourceValue  column  click and press the ctrl+Shift to get the field from XSD. In my case I have taken XSD as Employee. The XSD can be anyone.
Whatever value will come from field EmployeeName will go to Source Column CityCode in .dvm file.
Target column is selected as CityName will show the value of output means full name of City and default value is selected as “Not Known”. If the passed value while testing will not be present in the CityCode column then the default value “Not Known” will come as output.
Qualifier columns will pick values from the EmployeeDetail and EmployeeSummary field passed while testing in Employee XSD.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCuTFKyBY4aK-GA6-kovYjEp7y2e4VtQWjoW8Kk19bc91EwDR6CdjBAC-lhn-KfgRdRfRVUD91DK2kfPKYqxnku6KRxZmRl12PEc88slINyctB8b-4EIUXTPywXf1_SdoeoTS30vG2FXM/s400/Pic.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW7pRxzYuuuKRKr9fPYi2oMKOUKsMuEdc46GMlCdOmtnB5UcaLJWpBbn3Ze-J7Bxwbiv_wubDLrQkXQCAi6fbx-8wLSM-PkT04aNJUOIsvovxRhtJlGYx8wGbvrZcLDHfgqBfly8YHuYg/s400/Pic.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4kXGPiVq-ap5zfflpkip3DuvBXvQMFSeytZDUPaB0Pccpo-Cok4RhSFXGwTuXxzPSFizIKmfRGHQ3FG5yTvjyecy04h0KRK6Spvs_wDBDD4QPHRUNfpe58-VNBk0WM56SFDDAOdAQEqE/s400/Pic.png
Step 4:- After  Mapping deploy the function on Application server and test the function.

A qualifier order is used to find the best match during lookup at runtime. The order of a qualifier varies from highest to lowest depending on the role of the qualifier in defining a more exact match. In the CityLocation qualifier(1) have a higher order  than the Country qualifier(2), as a matching CityLocation indicates a more exact match.

Domain value maps support hierarchical lookup. If we specify a qualifier value during a lookup and no exact match is found, then the lookup mechanism tries to find a more generalized match by setting the higher order qualifiers to a "".

First Test case in the Usecase:-
Pass value BO in all four field. Now the result will come as Boston1 because it picks value where the CityLocation and Country Value Column has no value entered.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjf6mIRL6PNdlq6_8H1VOLx9QXE_leZpT1TcZK30s7op01w1lpuvTgO5TKkhSg_p1YGzzbR1cU_zSUoGj8NnnwMmikeroms7YXUg6v3YTO0CCDpAZXqjCLmvyUsRIr3FAaKG4lb61ra014/s400/Pic.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBoO5HvluyzJUeF9M3LkjsCcBAE9oE0Lil8jaQVbWdOefvZeGXxU-gtT1iJTEprCwOfb58BoK4fvJPr4qUo-ruPkcTew4A-EGVRksTg85lR31WOcw_jJXj2abB-DkhpG2qx07cpR8Xdlg/s400/Pic.png
Second Test case in the Usecase:-
Pass value BO in all three field. Now the result will come as Boston1 because it picks value where the CityLocation is blank and Country is blank. It happens because CityLocation Column has hierarchy set 1 which is taking precedence over the Country Column. That’s why it did not pick value from the field where Country name is set as USA because in that case CityLocation is not set as BO.
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEido2kDeH6q6yPEFgSlXfD3ck1WIGnKf85aIU0bWH2_18ILp-PIO39OhkimkRifMxfQffdT-EOYjpwvRs13fytnUX_WK3qYmJHj6d3t9Ld0BcyxhObK8cjubq5tWqOahP1jsJbVOlIGMMY/s400/Pic.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1ur1tNlitk4GocN8IVvq10cD_HTkdMetA2CO9sGXTTMiNU3mMXzG7520Y0Gig4cgljsVmOKIEAXKxnFOfNMJY0tZc6GBOdTZjrDnbwV5RW_O_fWUQtvbDIti99VlHp05AAqcG8FK5OqA/s400/Pic.png
Third Test case in the Usecase:-
Pass value BO in all two field. Now the result will come as Boston because it picks value where the CityLocation is EastUSA and Country is USA.
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir1SCKVP5e5yS65WeW127cIYRE_CESoQ4Z4Z2Bzknk_NFcci6NLnlsur7dVc_ZqKe3kaf8UjtsSCD2HGsAOo4-tQlneu3yIPGYE6YN8SrZ1Nbe1jSxqshsMLz7y8SQRDn7WgjRy8vD1Io/s400/Pic.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0-gNvriWbksUfnKf01SYkrqgXY86xvNDkTv6SqDLFvqFOD8VBlVBknBnPsNhYVuF_PEPH03JpV97VxR43CymC8XtT_6nv5u9AnO0uHMOVbhKfBwZnofTe9imBy95aR5REN-sGoZgeqCw/s400/Pic.png

Hope this Example would help in understating DVM concept.

Domain Value Map Features:-
(i)                  Qualifier Support:- Qualifiers qualify mappings. A mapping may not be valid unless qualified with additional information. For example, a domain value map containing city code to city name mapping may have multiple mappings from KN to Kensington as Kensington is a city in Canada as well as USA. Hence this mapping requires a qualifier (USA or Canada) to qualify when the mapping becomes valid . You can also specify multiple qualifiers for a domain value map. Qualifiers are used only to qualify the mappings. Therefore, the qualifier values can not be looked up.
(ii)                Qualifier Order Support:- A qualifier order is used to find the best match during lookup at run time. Domain value maps support hierarchical lookup. If you specify a qualifier value during a lookup and no exact match is found, then the lookup mechanism tries to find a more generalized match by setting the higher order qualifiers to "". It proceeds until a match is found, or until a match is not found with all qualifiers set to "".
(iii)               One-to-Many Mapping Support:- You can map one value to a multiple values in a domain value map. For example, a domain value map for Payment Terms can contain mapping of payment terms to three values such as discount percentage, discount period, and total payment period.

Difference between concrete and abstract WSDL



Abstract WSDL:- 
Used on server side,contains request,response and type of operation performed.An abstract WSDL document describes what the web service does, but not how it does it or how to contact it. An abstract WSDL document defines the operations provided by the web service. the input, output and fault messages used by each operation to communicate with the web service, and their format. Including Abstract WSDL is reusable because there is no binding details in it.Abstract WSDL contains only messages and operations.Abstract WSDL is used by web Server.

Concrete wsdl:-
Used on client side,contains abstract wsdl and transport used.A concrete WSDL document adds the information about how the web service communicates and where you can reach it. A concrete WSDL document contains the abstract WSDL definitions, and also defines the communication protocols and data encodings used by the web service.The port address that must be used to contact the web service.Concrete WSDL has all the things that the abstract wsdl has in addition it has transport(http,jms) details.Concrete WSDL contains messages, operations and binding/transport specific information i.e. SOAP over Http/HTTPS/JMS having wsdl style i.e. RPC/DOC literal.

Difference between XA and non XA datasource


An XA transaction is a "global transaction" that may span multiple resources. A non-XA transaction always involves just one resource.

An XA transaction involves a coordinating transaction manager, with one or more databases (or other resources, like JMS) all involved in a single global transaction. Non-XA transactions have no transaction coordinator, and a single resource is doing all its transaction work itself (this is sometimes called local transactions).
XA transactions come from the X/Open group specification on distributed, global transactions. JTA includes the X/Open XA spec, in modified form.
Example of non-XA - a Servlet or EJB or plain old JDBC in a Java application talking to a single database. XA gets involved when you want to work with multiple resources - 2 or more databases, a database and a JMS connection, all of those plus maybe a JCA resource - all in a single transaction. In this scenario, you'll have an app server like Websphere or Weblogic or JBoss acting as the Transaction Manager, and your various resources (Oracle, Sybase, IBM MQ JMS, SAP, whatever) acting as transaction resources. Your code can then update/delete/publish/whatever across the many resources. When you say "commit", the results are commited across all of the resources. When you say "rollback", _everything_ is rolled back across all resources.

The Transaction Manager coordinates all of this through a protocol called Two Phase Commit (2PC). This protocol also has to be supported by the individual resources.
In terms of datasources, an XA datasource is a data source that can participate in an XA global transaction. A non-XA datasource generally can't participate in a global transaction.

xslt padding with characters call template for left pad and right pad

  Could a call-template be written that took two parameters ?   a string, and a   number) return the string with empty spaces appended t...