There seems to be a good amount of interest in dynamic composition (orchestration) of webservices using BPEL. There are also a lot of users who don't know that this feature exists and also users who know about this and are interested in using this seems to scramble around for more information. This blog entry is to help users to make use of the dynamic composition feature of BPEL point them to the right resources. Refer to the wiki information on this feature from openESB BPEL engine, also refer the feature implementation details.
There are two variations of this feature. The partner address is not known at the design time (and variation of this use case, like, the partner address changes at runtime based on some business rules). Along with the dynamic partner address, the number of partners is also unknown. Users have asked for use cases when the number of partners the service orchestrates. Current version of BPEL engine supports all this functionality. Users would like to invoke their partners asynchronously and this can be done using the BPEL's Flow construct. But if the number of partner links is dynamic as well, then Flow construct falls short of the requirement. Fortunately BPEL spec defines ForEach 'parallel' to solve this, unfortunately current version of BPEL engine doesn't support ForEach 'parallel'. Not to worry there is a good work around, the work around makes use of the BPEL's asynchronous service invocation feature. Here is a blog that explains in very good detail with a working example of how to do this.
I will post another entry on this subject with a simple sample project that would help the users of dynamic partner link to avoid the common pitfalls I noticed thus far in it's usage.





