TIBCOmmunity navigation

Category: Choreography

Feb 02 2012

Modelling Choreography (with events, states and business rules)

This week the BCS SPA group held a fascinating session titled “Modelling Choreography” by requirements analyst Ashley McNeile.

Ashley described some of the past efforts to model and implement choreographies, using types of process algebra such as  Robert Millner’s Calculus of Communicating Systems (CCS) and its derivative Pi-Calculus. However, Ashley used sequences of events and states (i.e. a state diagram) which he also compared to Michael Jackson’s formalised object lifecycles (e.g. JSD  / Jackson Diagrams). Various W3C efforts have described choreographies too - e.g. WS-CDL. Of course the latest modelling construct for choreography is BPMN2!

As an example of his practice, Ashley described an example - modelling bank account transactions via Protocol Modelling (using simple state diagrams):

  • state model 1: defined the close and withdraw events on an active account
  • state model 2: defined the freeze and release account events
  • state model 3: this had no state transitions, but defined the state by the associated constraints (or business rules)
    • if balance < 0 then account state is overdrawn
    • one cannot close an account if it is overdrawn
  • all 3 state models operate in parallel.

To analyse these state models they can be combined into a single state models (with all combinations of states, and all events), and then the unreachable states can be filtered out. The interesting thing here is (1) the analysis of state models for completeness and (2) the use of incomplete state diagrams as a business notation for textual (policy or constraint) business rules.

Other observations:

  1. These types of business rule apply to states and data; they can be extracted and modified (by a developer, or state modeller) into event rules or guards in a state transition diagram. Is it interesting to specify these business rules up front before mapping to events and processes? Yes from a business perspective, as new events or states might affect or be affected by existing business rules.
  2. Using a state to specify a business rule (in terms of the state and output) is an interesting notation that lends itself well to mapping to appropriate events (or indeed processes). Could it catch on in the business rule community?
  3. The use of an explicit choreography language has not had  much success it seems. Google WS-CDL and most entries are dated 2009 or earlier. BPMN2’s choreography may yet prove useful but possibly the concepts are too difficult for business modellers yet imply a co-operative design process for developers that rarely occurs in practice (beyond “this is the interface”!).
  4. At the end of the day, the sequence of events in a business system is just a complex event - which maybe can tell you if the choreography is valid or not.

I’ll add a link to the slides to help explain all the above when they become available…

Annex: a Distributed System Choreography Development Process:

This process describes a development process of state diagrams for choreography purposes:

  1. Define participants and messages (/events) that interact between them
  2. Define states with events as messages from and to, with only 1 sender per state
  3. Project the states out to individual participants - i.e the parts of the state model for each participant - allowing ambiguous states but ensuring these have no sends
  4. Merge the states for each participant
  5. Enact - check each event at a time to prove feasibility of the interacting state models


VN:F [1.4.2_694]
Rating: 3.7/5 (3 votes cast)
  • Share/Save/Bookmark
Nov 23 2010

Do Businesses need 63 different types of event?

BPMN2 event typesOne of the drivers of success in the BPM world has been BPMN - the Business Process Modelling Notation - developed under BPMI before it got absorbed into OMG, and probably a bigger success than any other modelling standard - and now as BPMN 2.o (beta, at this time) slightly reconfigured in name as the Business Process Model And Notation. BPMN is used to provide a “process” perspective (versus, say, a data or an event perspective) of a system and shows the flow or orchestration of process tasks and activities. It is made up of (per the excellent bpme.de BPMN2 summary poster):

  • 2 flow subtypes: sequence is the normal flow, with default and conditional conditional subtypes
  • 7 task types: send, receive, user, manual, “business rule” (really decision), service, and script
  • 6 activity markers: sub-process, loop, parallel, sequential, ad-hoc and compensation
  • 7 gateways: exclusive, event-based, parallel, inclusive, exclusive event-based, parallel event-based, and complex
  • 6 types of data: input, output, object, collection, store, and message
    and
  • 63 types of event

OK, “63 types of event” needs a bit of explanation (and justification). These consist of:

  • 13 main event types: untyped, message, timer, escalation, conditional, link, error, cancel, compensation, signal, multiple, parallel multiple, and terminate

… across 8 situations classified by location in a process:

  • Start: top-level, event sub-process interrupting, and event sub-process non-interrupting
  • Intermediate: catching, boundary interrupting, boundary non-interrupting, and throwing
  • End

… but with some situations not requiring certain types of event (e.g. there is no “start cancel process” event) leaving 58 63 event types defined [*1].

Presumably BPMN tools will let the user specifiy the main event type and associate the correct symbol from the context in most cases, leaving us to consider just the 13 main event types.

So let us analyse these event types from an event processing perspective:

  • Message and timer events: these are probably most familiar with to those with an event processing perspective, with a message relating to what we consider either a source or a derived event.
  • Escalation: this is really a deferal to a different process (e.g. a supervisory process), and can be handled by some internal message in event processing.
  • Conditional: this is “reacting to conditions becoming true” - in other words equivalent to a rule-firing (or event query) success. In a rule system this might be handled just by setting some fact or data, which in an inferencing rule system will use some internal event to signal to the rule engine that other rules may “fire” - however there is no need to explicitly model this behavior. I may also of course create an event (or in a query system, insert / update some event), which is again is not explicitly modelled as “conditional” per se…
  • Link: some means of connecting models: this is more a “page break” than a business event!
  • Error: I prefer the term “exception” here, which of course is a local context - an error event in one process is a normal event in an error-handling process, etc.
  • Cancel: this is more a transaction-specific event: if dealing with transactions then some events may indeed be “cancel transaction X” requests, which may or may not be satisfiable, etc.
  • Compensation: this is where some process route may require some compensatory process - for example in relation to a “cancel” event.
  • Signal: signalling information across processes: this is might be used as a control event, such as in controlling a choreography.
  • Multiple: one of a set of events is “caught” or provides the cue to continue the process.
  • Parallel Multiple: all of a set of events is “caught” to continue the process.
  • Untyped events are used for start and state changes. Typically, though, a state change is the main event we are interested in (in event processing)!
  • Terminate event - process complete! From an event perspective this (process end) might never happen of course…

The extra detail might be explained by the fact that in BPMN you are detailing *how* to implement a process, and the “event symbol” is providing you with some specific context for that event. In event processing languages, you usually describing “what* is to be processed, and where all events contribute to some situation or context. It will be interesting to see how these 58 symbols work out in practice, as a hindrance or a help for process designers…

Note:

*1: the table of events above, from the BPMN2 poster from bpmb.de, has 63 event symbols, and is slightly re-organised from the equivalent table in the BPMN2 beta specification (Table 10.93 pp 269-270, in 10-06-04.pdf). Interestingly the specification document also includes a table to detail the event symbols (Table 12.23 ppp 405-411, in 10-06-04.pdf) but this shows only 58 symbols! Let’s just say “lots of event types” in BPMN2 then…

VN:F [1.4.2_694]
Rating: 4.0/5 (2 votes cast)
  • Share/Save/Bookmark
Mar 11 2008

OMG BPMN 2: comments for CEP

The 2 submitting teams’ proposals for version 2 of the BPM notation standard, BPMN, were presented at OMG this week. As CEP pundits know, BPM is used for simple event processing with manual workflow components, and BPMN provides a means of representing the simple event orchestrations [*1] ideal for representing business processes.

One of the interesting aspects of the BPMN 2 proposals [*2] is the inclusion of choreography modeling. This of course makes sense: many business processes are choreographed (i.e. require an ordered or partially-ordered sequence of messages or events). Having said that, describing complex choreographies in a flow diagram [*3] may not always make sense. When you think about it, a choreography is simply about having particular responses to patterns of events. And of course, CEP technology is one good way to model such event patterns…

A related issue in BPM(N) is exception handling (which could be viewed as a kind of process-oriented BAM). Modeling process exceptions can, in certain cases, cause complications in (or, some would say, pollution of) process flows. Especially in complex flows, such as exceptions to the choreographed message flows mentioned above. One way of mitigating this is to apply / define declarative exception rules alongside the process flow. And of course where your business process is dealing with real-time continuous events, a CEP engine may be the best bet to detect such exception patterns and/or drive the underlying workflow.

Notes:

[1] Some CEP tools use a process diagram notation to handle processing of event streams / sources. Usually these have a subtly different semantics over standard BPMN (for example, apply a pattern detection process over this timespan over this data feed). BPM is normally concerned with the event-as-an-invocation model of non-continuous processes. We’ll return to the topic of continuous event process flows / BPMN for CEP in a later blog…

[2] Note that as TIBCO is a major BPM vendor, our BPM team is closely tracking the “Extend BPMN” and “Merge BPDM and BPMN” proposals (earlier commentary here). Expect TIBCO iProcess and BusinessStudio to continue to provide full support for BPMN as it evolves.

[3] The same also holds true for representing complex / re-used business rules in BPMN process diagrams. Often these simply complicate the BPMN diagram and should be externalized into rulesets that can be shared across different parts of the process flow / processes.

VN:F [1.4.2_694]
Rating: 4.0/5 (1 vote cast)
  • Share/Save/Bookmark