IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Developing business processes > Building BPEL processes > Defining BPEL process logic

Defining timer-driven behavior in a BPEL process

You can set timer values in a number of places in the business process editor, and for several different activities or elements. Timer values can be configured to trigger processing or expiration after a specific period of time has either elapsed or been reached.

When the expiration setting on the activity is triggered in the runtime environment, the engine will throw a wpc:timeout fault that can then be dealt with in a fault handler. In addition, if the continueOnError flag of the activity is cleared, the activity will stop, thus enabling manual repair.

To set a timer value, proceed as follows:


Procedure

  1. In the Properties area for the activity or element, click either the Details or the Expiration tab.

  2. To create an expiration condition using the process' default expression language, click Create a New Condition. Otherwise, choose an appropriate language from the drop down menu.

    You will have the following choices:
    Option Description
    Java™ If you choose this, then you will be able to compose the expiration expression in the Java programming language using either the visual snippet editor, or a text editor. With this option, you will be able to configure either a date or a duration expression.
    No Expression This is the default, empty setting.
    Same as Process This is automatically set to be the same as the expression language that is being used by the BPEL process (it will either be Java or XPath 1.0).
    Timeout If you choose this, then you will be able to simply enter a duration value, and expiration will occur the moment this period has passed.
    XPath 1.0 Choose this to compose the expressions in the XPath 1.0 programming language, using either the XPath Expression Builder, or a text editor. With this option, you will be able to configure either a date or a duration expression.

  3. If you choose Timeout, you will have the following options to configure the period of time that the activity should hold.
    Option Description
    Simple calendar This is, as the name suggests, is a simple arithmetic calendar. Use the Timeout Duration fields to select the amount of time that this activity should wait for an action to occur before it expires.

    How the value of a time duration is consumed depends on the calendar runtime that you use, which applies for directly entered values for the simple and business calendars or indirectly through the user interface. Usually values such as months or longer are calculated differently for non-Gregorian calendars like the Hijri calendar.

    WebSphere CRON calendar This is a built-in calendar that uses a list of term expressions representing elements of time to calculate the interval. Examples of this type of calendar can be found in Interface UserCalendar
    User-Defined calendar Use this option to select a calendar other than those provided.

    You can use the fields to name the calendar, and point to a valid Java Naming and Directory Interface (JNDI) location.

    Business calendar In addition to the three regular options in the Calendar Type field, more options will appear if a business calendar is available. A business calendar can be used to model duration values for time-sensitive aspects of your BPEL process in order to account for such variables as regular working hours, weekends, and holidays. See Use business calendars within a BPEL process for more information.

  4. For all other expression language choices, you will be presented with the following two options:
    Option Description
    Date Choose this when you want the expiration to occur when a specific time and date has been reached.
    Duration Choose this when you want expiration to occur after a certain period of time has elapsed.
  5. Depending on the expression language that you are using, you can choose from any of the following expression types:
    Option Description
    Visual Choose this to use the visual snippet editor to graphically compose Java code.
    Java Choose this to write a Java expression yourself.
    Literal Choose this to enter values directly into customized fields. Calendar values are represented in Coordinated Universal Time (UTC).
    Text Choose this to compose an XPath expression.


Results

Work with basic activities

Defining BPEL process logic

Building BPEL processes

Building human tasks


Related concepts:
The building blocks of the BPEL process editor
Dealing with faults in your BPEL process
Work with XPath in the BPEL process editor
Work with micropatterns
Locked activities


Related tasks:
Configure the wait activity
Setting duration values for your human task
Adding an interface or a reference to a business state machine
Adding a variable to a business state machine
Adding a process application as an activity
Adding an activity to a BPEL process
Defining transactional behavior
Enabling SCA events to be emitted
Calling other BPEL processes
Calling business services
Use business calendars within a BPEL process
Create an escalation for your human task
Selecting a calendar type for your escalation
Setting duration values for your human task
Use business calendars within human tasks
Notifying an event handler of an escalation


Related reference:
Expiration tab: BPEL process editor
Details tab: business state machine editor
Duration tab: Human Task editor


Related information:

Interface UserCalendar
Interface UserCalendar
Interface UserCalendar