Gopalan Suresh Raj's Web Cornucopia
An Oasis for the parched Enterprise Services Engineer/Developer

    WS-BPEL-How do I introduce intentional delays in a business process?

    WS-BPEL

    There may be cases where we may need to introduce an intentional delay for a specific duration, or delay execution until a specified time. For example, we may need to pause to instruct the business process to invoke a web service at a specified time. Or there may be cases where we may need to wait for some time before we can resume execution. The equivalent of Java’s Thread.sleep() method in BPEL is the activity.

    The wait activity provides a couple of attributes:

    • The for attribute: When we need to specify a time interval or a duration or a period of time to wait for, we use the for attribute. For example,
    <wait for=”‘PT37M46S’“/>
    

    instructs the business process to wait for a duration of 37 minutes, and 46 seconds. Look at this blog entry to understand what the value ‘PT37M46S’ means.

    • The until attribute: When we need to specify a certain specific date or time – in other words, specify a deadline, we use the until attribute. For example,
    <wait until=”‘2008-10-28T10:28:19’“/>
    

    instructs the business process to wait until the deadline 10:28:19am, 28th October 2008 before resuming execution. Look at this blog entry to understand what the value ‘2008-10-28T10:28:19’ means.

    Author Bibliography

    Gopalan Suresh Raj is a Senior Analyst, Software Architect, and Developer with expertise in multi-tiered systems development, enterprise service architectures, and distributed computing. He is also an active author, including contributions to Professional JMS Programming, Wrox Press, 2001, Enterprise Java Computing-Applications and Architecture, Cambridge University Press, 1999, and The Awesome Power of JavaBeans, Manning Publications Co., 1998. He has submitted papers at international fora, and his work has been published in numerous technical journals. Visit him at his Web Cornucopia© site (webcornucopia.com) or mail him at gopalan@webcornucopia.com.

    Back