Powered By Blogger

Tuesday, November 13, 2012

Oracle BPEL 11g Best Practices



Oracle BPEL 11g Best Practices
  1. BPEL has to be primarily used for orchestrating the services. Do not add complex business logic here. It should belong to the service layer.
  2. Create scopes for each step of the flow in the process so as to make it modular.  This will help in creating local variables within that scope. Use Global variables when required(just like your java or C++ programming style). This will help in maintainability. Note : Adding too many scopes may affect the performance. In that case you may want top consider creating sequences.
  3. Adopt naming standards and comply to it. This should be part of the governance strategy. This looks trivial but is important if you want someone else to understand the code and make changes.
  4. It is good practice to have a Mediator in the Composite. Try to get most of the transformations done by the Mediator.
  5. Have all the business rules implemented by the Oracle Business Rules
  6. Handle all the exceptions
  7. Adopt test driven development. Create test cases with a tool like SoapUI for each process and make this part of your governance strategy.
  8. Instead of BPEL, you should consider implementing the process in BPM. This has the advantage of modeling it in BPMN so that it can be easily understood by the Business and also helps the model and implementation to be synchronized at all times. If you haven't considered it so far then it is time you take a look at 
  9. The flow of the BPEL process should be very intuitive.The reason enterprises are investing heavily in this to be agile to change. So, to make this happen , make the steps in the flow linear as much as possible so that a new step can be added/reordered easily by just drag and drop. I have seen very complex nested creation of the following flow which after refactoring looks as below.
  10. Use Assign activity instead of Transform Activity where ever possible since it take less memory.
  11. Do not import or add XSD files in a ZIP file into a BPEL project. Always extract the XSD files from a ZIP file before importing them.
  12. Do not include any special characters in the project name (such as periods). If you do include special characters, errors appear when you attempt to compile your project
  13. The bpel.xml file content is only read into memory when the file is opened. Therefore, if you change the content of bpel.xml after the file is opened, the changes are not made in memory. After changing the content of the BPEL file, close and reopen the file for the changes to take effect.
  14. Do not edit the bpel.xml file through a combination of Oracle JDeveloper and a text editor such as Notepad or Wordpad. Use only a single editing environment such as Oracle JDeveloper.
  15. Do not edit the bpel.xml file, BPEL files, and WSDL files while changing the
    design of the process. If you want to edit a file:
    Ensure that the BPEL files are not being edited in Oracle JDeveloper. If they are being edited (that is, a tab for that file is visible), close it and save changes as needed.
    2. Edit the required file and save the changes

  16. Oracle BPEL Process Manager does not support SOAP-encoded arrays.(soapenc:arrayType).
    Use one of the following workarounds:
    * Apache Axis supports document-literal style services. This means you can change the service to not use soapenc:arrayType.
    * A wrapper can be placed around the service (also using Apache Axis) so that the BPEL process talks to the document literal wrapper service, which in turn calls the underlying service with soapenc:arrayType.
    * Call a service with soapenc:arrayType from BPEL, but construct the XML message more manually in the BPEL code. This enables you to avoid changing or wrapping the service. However, each time you want to call that service from BPEL, you must take extra steps


  17. If you use large binary attachment files in SOAP messages with Oracle Database Lite, your BPEL process may not complete processing, which can cause you to run out of system memory. Oracle Database Lite is largely for testing purposes. To use large binary attachment files in SOAP messages, use an Oracle Database as your dehydration store


  18. Use TCP tunneling to view SOAP messages exchanged between the BPEL process flow and the Web service (including those containing the
    correlation ID). You can see the exact SOAP messages that are sent to, or received from, services with which a BPEL process flow communicates.

  19. Instead of manually entering an expression, you can press Ctrl and then the space bar in the Expression field. Scroll through the list of values that appears and double-click the value you want. Edit the value as necessary. As you enter information, a trailing slash can appear. This means you are being prompted for additional information. Either enter additional information, or press the Esc key and delete the trailing slash to complete the input of information.

  20. Do not copy and paste the expression syntax shown in this document into Oracle JDeveloper. This is because the single and double quotation marks are sometimes not compatible with Oracle JDeveloper. Instead, use the Expression Builder window or press Ctrl and then the space bar to use the XPath Building Assistant.

  21. When you deploy a process with the same name and version, you are prompted to overwrite the currently-deployed BPEL process or deploy to a new version number. The best practice is to always deploy to a new version (as described in this tutorial). Redeploying a process with the same version can have consequences, such as instances being marked as stale

2 comments: