Soa Suite 10.1.3.3 – ESB, BPEL – Nice-to-knows, pitfalls

I’ve been checking out the different capabilities and new features of the Adapter-framework in ESB and BPEL for some weeks now and came across some nasty pitfalls, nice-to-knows, … which I would like to share with you.

Of course I would like to share thoughts, opinions and start discussions on these topics.

ESB:

  • How to define xsd-validation on file-adapter (validate payload at runtime-option isn’t available in file adapter) : In the ESB console, select the routing service which is invoked after the inbound file adapter. See the “Definition” tab. The validation option is in the “Operation Details” section. (with thanks to Ronald)

BPEL:

  • Inserting master-detail data using DB Adapter functionality : Referring to my experiences so far it’s best best way to make use of stored procedures instead of the toplink mappings file. I am mainly using the stored procedures because the tooling support in Jdeveloper (wizards, toplink ui), I still miss a good ui for the toplink support. Also it is easy to give the task to create an PL/SQL api to the PL/SQL developers that are working on a certain application. (with thanks to Orjan)

  • [Error ORABPEL-10007]: unresolved messageType for “{http://schemas.oracle.com/bpel/extension}RuntimeFaultMessage”: When you’ve defined an empty bpel process (which is best practice to do the brain-work) you will face this issue when defining fault-handling inside your bpel-process. To solve this error you need to import the RuntimeFault.wsdl inside the adapter you’re using. Following import statement needs to be added:

  • Best practices when invoking Bpel Processes from different UI’s (Flex, JSF, …) : Many thanks to Hajo for his explanation: It is best practice to use the default ways to invoke a BPEL process – create a WSDL that maps to WSIF binding in a controlled environment and to a SOAP/HTTP binding in a more B2B type of scenario. A call to the BPEL API would be a “custom” solution that needs way more governance to communicate with fellow developers and to maintain properly, when compared to the straightforward standard way. . For more details see OTN Thread: http://forums.oracle.com/forums/thread.jspa?messageID=2329384&#2329384

  • Use multiple sources in transform-activity: In 11g a new feature has been added to be able to use multiple sources using bpel 2.0 (bpel:doXslTransform(string, node-set, (string, object)*)). The workaround in 10.1.3.3 is by using the params-approach => http://blogs.oracle.com/rammenon/2007/05/07. Or by using an assign-activity with append-functionality to add the variable inside your source-target and in the same assign-activity add the process-xslt functionality to call your xsl to populate the source with the target-information.

Invoking Web Services from Database:

  • Call an esb service using the UTL_HTTP package => ORA-29266: end-of-body reached => make sure to pass variables using String-notation instead of Character-notation

Interesting New Features in 10.1.3.3 :

  • Controlling the Size of a Rejected Message (10133technotes.pdf):
    You can now control the size of a rejected message by specifying the following
    endpoint property for the inbound File/FTP adapter partner link.
    In this example, you reject 100 lines from the file since the actual file is too large.
    oracle.tip.adapter.file.debatching.rejection.quantum=”100”

  • ESB Endpoint Properties : e.g. ability to add RejectedMessageHandler to file adapter services

Enhancement Requests:

  • Ability to validate xml payload at runtime on Adapter-level instead of on domain level or routing service level
  • Ability to add xsi:nil attribute using xsl-functionality in transform-activity
  • File-adapter: Ability to skip columns besides skipping rows + ability to use special characters in column headers

Well that’s it for now … feel free to share thoughts, comments, etc.

Tips & Tricks that’ll save you a lot of time regarding ODI, Flex, Soa Suite

Latelly I’ve been spending a lot of time regarding deployment and configuration of Adobe Flex applications integrated with Bpel on an OC4J-container.

On the other hand I’ve been experimenting a lot with ODI and how the tool will handle changing data models, changing datasources, …

Lastly I’ve been playing around with invocation of Bpel Processes using Web Service Proxy Clients instead of the Bpel Invocation API.

The question that’s still unanswered because no documentation or benchmarks or best practices are available yet is: ‘What’s the best practice in invoking bpel processes, the Bpel Invocation API or Web Service Proxy Clients?’

Tips & Tricks ODI:

  • Interesting Notes: 423740.1, 423817.1
  • Grant dba-privileges to your source-db-user, otherwise you’ll get ‘insufficient privileges’ exceptions when trying to execute your interfaces

Handling changing data models (new tables, deletion of existing attributes in tables, addition of new attributes, additional relationships, … ) :

  • Go to your datamodel and reverse engineer the changed tables again. New attributes are added, deleted attributes aren’t removed yet because they’re referenced in interfaces in your ODI Designer.
  • Go to your interfaces defined in the Designer-tab in ODI: remove all active mappings to the attributes that were deleted
  • Go back to the model-tab in designer and right-click the attribute in your tabel and choose delete. When all references are updated correctly (no active mapping), the attribute will be deleted from your datamodel

Tips & Tricks Flex:

  • When you’re getting weard errors regarding ‘conversion exception between java.util.Date and java.util.Calendar’ or exceptions regarding producer or consumer-errors => make sure you’ve defined ‘autocommit’-property to false on your data services (Using LCDS)
  • How to handle static data without usage of Value Object or Data Transfer Objects => use SQLAssembler without usage of java-classes or actionscript-classes in your data-management-config.
  • rtmp-host connection failure on OC4J => try to reset the connection-port to another value than the default one which is ‘2038’. I’ve defined the value to ‘2035’ and now no errors are thrown anymore
  • Use [managed] attribute to make sure all changes on objects are synced between 2 clients
  • Deploying data-management-config to different JEE Servers, e.g. Tomcat and OC4J. When you deploy to tomcat you have to define the full JNDI-location which would be for example: java:/comp/env/jdbc/flexDS. When you deploy to an OC4J, you need to define the short JNDI-descriptor: jdbc/flexDS.

The other exceptions, weard behaviour was already addressed in earlier posts:

  • You need to add an xsl-choose-when-otherwise xsl-node structure to you transform-activity in your bpel-process and in the otherwise-tag define the xsi:nil=true on your attribute to make sure the web service proxy won’t set this attribute to required.
  • You need to update the toplink-mapping file being generated in bpel when using the database adapter. Relationships aren’t defined properly, because the method accessor is checked for all one-to-many relationships whilst these aren’t defined in the java wrapper classes. Uncheck these ‘map to method accessors’ and these exceptions will disappear. You can uncheck these when drilling down in your toplink.mwp file into to your object on your mappedCollections.

A beautiful one were all newbees in SOA Suite spend ages and ages to figure out what the problem is … Oracle please fix this ???

You’ve installed SOA Suite (you can choose which version) and entered a custom password during installation for your oc4jadmin-password, not the ‘welcome1′ password. You can choose your own password wright ?

But when the newbee starts creating his first bpel and esb projects, there are weard errors poping up: ‘connection timed out’, ‘jndi-location for db-adapter isn’t properly defined’, …

Well, weard but true, the ‘welcome1′ password is defined hardcoded in different ‘oc4j-ra.xml’ files used in the jmsadapter-folder, dbadapter-folder, … Make sure to change the passwords correctly when you’re drilling through the different Oracle By Example-exercices or tutorials.

Integrating Flex and Data Management Services with a Bpel process – What about Typed Collections?

As you can remember we’re working out a flex application using Data Management Services and Flex for the client-side and Bpel at server side.

During development I ran into a blocking issue regarding using typed collections in my ActionScript objects.

Why would I use Typed Arguments, Typed Collections or Typed Arrays ?
My bpel process is using a Global Business Object (GBO), an XML Schema Definition, that defines the entire structure of the business objects I will need in the dossier management lifecycle. The bpel process will be cut pu into different sub processes which will define the needed process lifecycle for the dossier management system we’re building.

Of course this kind of business functionality will be handling master-detail data, e.g. a dossier has dossier_members and dossier_members have address_information.

If we create a web service proxy client for our bpel process, the different objects used in this process will be defined as Java Objects. The hierarchical structure of the dossier-element or – object will be defined in the following manner:

public class Dossier implements java.io.Serializable {
protected int id;
protected be.ws.proxy.types.DossierMembersCollection dosMembersCollection;

public class DossierMembersCollection implements java.io.Serializable
{
protected be.kg.ws.proxy.types.DossierMembers[] dossierMember;

The ActionScript Objects I defined for these server side objects :

[Managed]
[RemoteClass(alias="be.kg.ws.proxy.types.Dossier")]
public
class Dossier
{
public var id:int;
public var dosMembersCollection:DossierMembersCollection;

[Managed]
[RemoteClass(alias="be.kg.ws.proxy.types.DossierMembersCollection")]
public class DossierMembersCollection
{
public var dossierMembers:ArrayCollection;
}

The exception I run into :

ArgumentError: Error #2004: One of the parameters is invalid. at
flash.net::NetConnection/flash.net:NetConnection::invokeWithArgsArray()

What does this mean?
In order for this to work, you need to serialize, you’d need to override both the readExternal and writeExternal methods on both the client and server to take of the serialization of the typed collections yourself.

Practical Approach:

  • Implement the Externalizable Interface at Client- and Server-side
  • Overwrite the readExternal()- and writeExternal()-method in both your client and server classes which match (i.e. the read methods exactly match the write methods on both client and server). You need to serialize your fields as well as the source field of the ArrayCollection (it is an Array).

Take care of serialization and deserialization at server-side, use Externalizable Interface:

public class DossierMembersCollection implements java.io.Serializable ,
Externalizable { protected be.kg.ws.proxy.types.DossierMembers[] dossierMembers;

public DossierMembersCollection() { }

/*** Deserializes the client state of an instance of dossierMembers. */ public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
System.out.println(“Receiving array ———————–“);
Object[] obj2 = (Object[]) in.readObject();
System.out.println(“Read input array obj2 ———————–“);

if (obj2 != null) {
DossierMembers[] dossierMembers = new DossierMembers[obj2.length];
System.out.println(“Initialized dossierMembers———————–“);
loop over the object array and cast the Object-classes to your custom class.
System.out.println(“Looping over array ———————–“); dossierMembers[i] = (DossierMembers) obj2[i];

System.out.println(“DossierMembers: ” + dossierMembers[i].toString());
}}

System.out.println(“Receiving array DONE ————————“); }

/*** Serializes the server state of an instance of dossierMembers. */

public void writeExternal(ObjectOutput out) throws IOException { out.writeObject(dossierMembers); }

Take care of serialization and deserialization at client-side:

[Managed]

[RemoteClass alias="be.kg.ws.proxy.types.DossierMembersCollection")]

public class DossierMembersCollection implements IExternalizable {

public var dossierMembers:ArrayCollection;

public function readExternal(input:IDataInput):void {
trace(“***********Reading dossierMembers”);
var array:Array = input.readObject() as Array;
if (array!=null) {
trace(“****Array received”);
dossierMembers = new ArrayCollection();
Loop over the array and add the arrayElements as typed objects to your collection in the following way:

dossierMembers.addItem(array.pop() as DossierMembers);

trace(“**Number of dossierMembers : ” + dossierMembers.length); }

public function writeExternal(output:IDataOutput):void {

trace(“Write ArrayCollection dossierMembers to array”);

var array:Array = new Array();

loop over object-array and add array-items to the collection: {

array.push(dossierMembers.getItemAt(i));

trace(dossierMembers.getItemAt(i).toString()); }

output.writeObject(array); trace(“Done”); } }

If you get random errors there will propbably be a mismatch between server- and client-side objects. The two approaches you can use are: print statements or stopping in your read/write external methods in the debugger. Step through actionscript classes and Java classes using Flex Debugging mode, so you can ensure that you are reading exactly what you are writing.

Hopefully this will help a lot of people facing the same issues regarding typed objects in an Adobe Flex Environment.

Oracle Open World – Let’s present some Use Cases

One week to go until Oracle Open World kicks of and it will be my 1st attendance, and to be honnest I’m pretty nervous ;o)

The last few weeks I’ve been trying to integrate my oracle bpel processes with a Flex User Interface, and with success … which means I have new material to discuss with the SOA Community.

The case I would like to discuss with the different fusion regional directors, ace’s and of course the product team will hold following topics (already explained on this blog):
- Use Case: Migrate existing Excel data using Oracle Data Integrator
- Use Case: Analyse Business processes using BPA Suite and BPM processes and generate bpel blue print using bpa suite
- Use Case: integrate Flex User Interface with existing Bpel Processes using Web Service Proxy Clients for the middletier

These are the 3 different approaches I’ve used so far for an existing customer, trying to evaluate BPA Suite and ODI using a real-time case and implemting a business process driven application using bpel & flex.

I’m really looking forward to the discussions to exchange experience & expertise !

See you there!

Join Me at Oracle OpenWorld Connect!

Changing the default password ‘welcome1′ of Oracle Bpel Process Manager

When you’re installing Oracle Software you always need to specify username and password settings for the administrator-profile, such as for Oracle Application Server or Oracle Database.

The same applies when installing Oracle SOA Suite 10.1.3.1 or Oracle Bpel Process Manager Option on Oracle Application Server Entprise Edition.

But there’s a catch here, you need to use the default password ‘welcome1′ when installing Oracle Bpel Process Manager to make sure the default processes for the Worklist Application are deployed succesfully.

The samples provided with Oracle Bpel Process Manager still need to be updated to be able to run them, because the default password ‘welcome1′ is used in the configuration files.

After the Oracle Bpel Process Manager has been installed you can update the administrator-password by performing the following steps:

  • Go to Enterprise Manager of your Oracle SOA Suite or Application Server installation
  • Click on the setup-link on top of the Application Server Control to update the password of the IAS Administrator account, which is ‘oc4jadmin’

  • To change the password of the Bpel-admin users, you need to navigate back to the home page of your Enterprise Manager and click on the OC4J instance which is created for your Bpel Process Manager. Click on the ‘administration’ tab of your OC4J instance

  • Click on the ‘Security Providers’ Task in the Administration Tasks

  • Click on the ‘Instance Level Security’ Button to be able to identify the used realms by the oC4j instance and the defined users and roles in this realm.

  • Click on the Second Tab in this screen to have a look at the used realms by this OC4J instance. The default realm installed is the ‘jazn.com’ realm. You can add other realms or modify the existing one.

  • To change the passwords of the admin-users you need to click on the Users-link which is shown for the given realm ‘jazn.com’. In this screen you can then look-up the bpel-admin users and change the default passwords. The admin-users used by bpel are the ‘oc4jadmin’ and ‘bpeladmin’-user.

How to Integrate Bpel Processes with a User Interface

There are different ways to call/instantiate bpel processes from a front-end application.
Depending on the customers’ knowledge and expertise the choice between the different solutions can be made accordingly.

In this blog-post I will explain some of these options in short:

  • Call Bpel Process from Java-Code:

String input = “1450”;

// Here you need to define the request-operation of your bpel process

String xml =
“<asyncloanflowprocessrequest
xmlns=”http://xmlns.oracle.com/AsyncLoanFlow”&gt;
<input>”+input+”</input></asyncloanflowprocessrequest>”;

Locator Locator locator = new Locator(“default”,”bpel”);
IDeliveryService deliveryService = (IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME);

// construct the normalized message and send to Oracle BPEL Process Manager
NormalizedMessage nm = new NormalizedMessage();
nm.addPart(“payload”, xml );
deliveryService.post(“AsyncLoanFlow”, “initiate”, nm);

  • Call Bpel Process from your User Interface (JSP, JSPX, JSF, …):

This means you need to define the same code as defined in the above java-sample
in a jsp-script tag.

  • Use the Databinding layer of ADF Faces to integrate the Faces Application with your Bpel Process:
  1. Create BPEL WebService DataControl defined on the WSDL-endpoint of the BPEL Process


  2. Create new JSF JSP page
  3. Drag & Drop UI Components based on DataControl
  4. Run
  • Define a Web Service Proxy on your deployed Bpel process:

  1. Create WebService Proxy defined on the WSDL-endpoint of the BPEL Process

  2. Create new JSF JSP page
  3. Call the Web Service Proxy Service from your backing-bean code to initialize the deployed bpel process. Bind this method to the submit/invoke/initiate-button when you want to call the bpel process.
  4. Run

Other options can be explored as well, but these are the most common ones to think of.

Tips & Tricks when working with Oracle BPEL

Today I was planning to rapidly demo the features of the DB Adapters in Bpel with a small test-case where master-detail data needs to be inserted … But I already ran into strange behaviour.

In this blog-posts I want to give the audience some valuable tips & tricks for common ‘problems’ faced when designing and deploying bpel processes.

  • Problem: Soa Suite Crashes when instantiating Simple Oracle Bpel Process with following exception ‘java.lang.Exception: Failed to create “java:comp/env/ejb/local/CubeEngineLocalBean” bean; exception reported is: “javax.naming.NameNotFoundException: java:comp/env/ejb/local/CubeEngineLocalBean not found in DeliveryBean
  • Solution: In most cases this exception occurs when you’re desiging a bpel process with a newer version of Jdeveloper than the Oracle BPEL version you’re deploying to. In my case I was designing with Jdeveloper 10.1.3.3 and deploying to Oracle Soa Suite 10.1.3.1. The problem was solved when I worked with an earlier version of Jdeveloper, namely 10.1.3.2.
  • Problem: ‘ORABPEL-11627: Mapping Not Found Exception’, when using DB Adapter in Bpel Process. I’m trying to insert master-detail data using a synchronous bpel process and the toplink mappings where all set. When I instantiate the bpel process I’m always running into the ORABPEL-11627 exception.
  • Solution: In my case this exception was thrown because I tried to assign my person-element to a personCollection variable. When I removed the assign-activity and added a transform-activity to map the one-element xsd file to the collection-element xsd file, the exception wasn’t thrown anymore. Note: When you work with the DB Adapter, the payload of the operation is always a collection-element, so you need to map your request- or inputVariable accordoingly by using a transform-activity.
  • Problem: Toplink warnings are shown when Db Adapter-partnerlink has been defined for inserting master-detail data. Some of the warnings shown: ‘Method accessors have not been selected.’
  • Solution: This is due to a JDeveloper bug in generating toplink mapping files. You will need to change the Toplink Mapping file for those Objects that use a Collection-attribute for master-detail data. Go to your toplink-mapping file, it will show up in the Structure window. Go to the Object that holds collection-elements, the Mapping for the collection-element will show up in the main screen. You will find that Use Method Accessing is selected yet there is no Get or Set methods defineds. Just unselect Use Method Accessing, save and rebuild. Note: When doing this you need to go through the DBAdapter-wizard again so the changes are reflected properly in all needed xml- and wsdl-files. (Thanks to user: Hongdo on the Bpel-forum on OTN, for sharing this with the community !)
  • Problem: Use db-sequences when trying to insert master-detail data using one insert-operation defined through a DBAdapter-partnerlink.
  • Solution: Define the master- and detail-tables properly in the DB Adapter-wizard, make sure to define the master-table correctly so the relationships are properly read and defined by Toplink. In the generated Toplink Mapping File you need to define you want to use ‘native sequencing’ and you need to make sure the ‘pre-allocation’ size matches the increment of your DB Sequence. By default the pre-allocation size is set to 50, which probably needs to be updated to 1. The next step is to define sequencing option for both master- and detail-data on the different POJO’s. There you need to specify the database sequence to use for each primary key field you want to populate.

I’ll keep you posted when I encounter more issues in defining, deploying and running bpel processes.