Time for action – adding an alarm event for callback

To add an alarm event to our <pick> activity, we will do the following:

  1. Add an <onAlarm> branch to the <pick> activity. We will achieve this by clicking on the Add OnAlarm icon next to the <pick> activity icon. We should see the following:
    Time for action – adding an alarm event for callback
  2. By double-clicking on the OnAlarm icon, we will specify the deadline to 1 day:
    Time for action – adding an alarm event for callback
  3. Next, we need to add the activity that will perform if the deadline is reached. In our example, we will simply throw a fault. We will name the fault Timeout. We should see the following:
    Time for action – adding an alarm event for callback

What just happened?

We have added the <onAlarm> branch of the <pick> activity for the timeout, which we have set to 1 day. This way we have limited the time our process waits for the book warehousing success confirmation callback. The following BPEL code has been generated:

What just happened?

With this, we have concluded our discussion of the <pick> activity. We now understand how to handle events with asynchronous callbacks in BPEL processes.

Have a go hero – deploying and testing the example

It's your turn now. You should deploy and test the example. To deploy the example, proceed the same way as in the previous example. Then, invoke the BPEL process instance and wait for the message or alarm event to occur.

Pop quiz: events and event handlers

Q1. What type of events can a BPEL process react on?

  1. Business events
  2. Operation events
  3. Alarm events
  4. Callback events
  5. Message events

Q2. Alarm events can be:

  1. Deadlines
  2. Durations
  3. Stopwatches
  4. Internet time

Q3. An event handler can be added to:

  1. A scope
  2. An individual activity
  3. A process

Q4. A business event is declared by:

  1. An event name
  2. An event type
  3. An XML element
  4. A variable

Q5. What does the PT4H10M expression mean?

  1. A duration expression of 4 hours and 10 months
  2. A deadline expression of 4 hours and 10 months
  3. A duration expression of 4 hours and 10 minutes
  4. A deadline expression of 4 hours and 10 minutes

Q6. A <pick> activity can have:

  1. Multiple <onMessage> activities and no <onAlarm> activities
  2. One <onMessage> activity and no <onAlarm> activities
  3. Multiple <onMessage> activities and multiple <onAlarm> activities
  4. Multiple <onAlarm> activities and no <onMessage> activities
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.60.251