Nov 28

In some specific circumstances, for example when testing high availability and failover scenarios, it may be desirable to make a BPEL process wait for a random amount of time, not exceeding some maximum duration, before continuing.

This Note describes the JavaScript Codelet which, given a maximum duration in Milliseconds, will return a random time up to that maximum duration, as an ISO8601 Duration Literal, suitable for use in the BPEL Wait activity. An example process that uses this Codelet is also developed and discussed.

This Note relies on the material presented in the Blog Entry “GlassFish ESB v2.1 – Using JavaScript Codelets to Extend BPEL 2.0 Functionality”, at http://blogs.czapski.id.au/?p=17.

The document is to be found at http://blogs.czapski.id.au/wp-content/uploads/2010/03/BPEL_WaitRandomDuration_v1.0.1.pdf.

The example project is to be found at http://blogs.czapski.id.au/wp-content/uploads/2010/03/ISO8601DurWait.zip

Leave a Reply

preload preload preload