Information Technology Reference
In-Depth Information
Event subtypes
Events, as we saw earlier in this chapter, trigger or capture situations of special interest to
our process, depending on their type (start, end, or intermediate catch or throw). Depending
on what the situation is, we need to define specific subtypes of events that define different
situations. There are too many subtypes to explain them all in this topic. In the following
diagram, we see a few of the most commonly used event subtypes:
Among the subtypes that we can distinguish in the previous diagram, the following events
are present:
Signal events : These events are used to send and receive signals. Signals are gen-
eric, simple forms of communication. They can be sent between activities and even
be shared between different process definitions. They don't have a specific recipi-
ent, so any other component in the same runtime can receive a signal by just defin-
ing that they are listening. The jBPM6 API can send signals to a process from out-
side its scope using the signalEvent method:
KieSession ksession = ...;
ksession.signalEvent("signalName", null);
Timer events : These events are triggered by a defined timer. They must have ex-
actly one element of the type timeDate (to determine the specific date at which
the event should be triggered), timeDuration (to specify after how much time
it should trigger the event), or timeCycle (to specify intervals at which the event
should repeatedly fire). All three are supported by jBPM6.
Message events : They are similar to a signal event, except they are directed to a
single receiver. It has an attribute called messageRef that defines a message to
be sent. From the jBPM6 perspective, however, it can be received by any number
of listeners, and handles itself through the signalEvent method as well. The
code is as follows:
Search WWH ::




Custom Search