Additional Patterns

As discussed previously, the P4 patterns are oriented towards control flow. Control flow is only one aspect of process design; the designer can also benefit from patterns describing how to communicate with external partners (communication patterns), and how to manage recurring human workflow scenarios (human workflow patterns).

Communication Patterns

Figure 4-32 illustrates a variety of common communication scenarios in a process.

Various communication patterns
Figure 4-32. Various communication patterns

The diagram reveals a number of common patterns:

Receive Request

A process triggered by an inbound service request, as indicated by A in the figure. In BPEL, the pattern is implemented with the receive activity. If the caller expects a synchronous response, use the reply activity.

Call Partner Service

A process sends a message to the partner’s service. In BPEL, the pattern is implemented in with the invoke activity. Synchronous and asynchronous variants are supported, as in the two steps labeled B in the diagram.

Wait for Response

A process explicitly waits for a specific event or set of events, as in the step labeled C in the diagram. In BPEL, implement using an intermediate receive or pick.

Unsolicited Event

A process responds to an unexpected event (e.g., cancellation request), as in the step labeled D of the diagram. In BPEL, implement using an eventHandler.

Correlate Request and Response

A process filters an inbound service request to match conversational identifiers, as indicated by E in the diagram. Implement using correlation or WS-Addressing.

Dynamic Partner

A process determines the endpoint of a partner at runtime, such as the partner indicated by F in the diagram. In BPEL, implement using assign to declare endpoint information at runtime.

In addition to these patterns, the Publish to Multiple Subscribers pattern (also known as Publish/Subscribe, or Pub/sub) is another common communication pattern. In this model, a process routes an event to all known subscriber services that have registered an interest. Although this pattern is not built in to any of the process languages, Figure 4-33 shows one possible implementation, in which a process queries a subscriber repository to get a list of endpoints of interested parties.

The Publish/Subscribe process
Figure 4-33. The Publish/Subscribe process

Human Workflow

Three common patterns emerge when integrating human workflow into a BPM system: Prioritization, Escalation, and Roles Compete For Task.

Note

A more comprehensive classification of enterprise communication patterns is provided in the book Enterprise Application Patterns, by Gregor Hohpe and Bobby Woolf (Addison Wesley, 2003).

In the Prioritization pattern , a manual activity is assigned an initial priority, and is reprioritized as it ages (or based on other conditions). In Escalation, a manual activity is reassigned when conditions dictate that another person or role work on it. The two patterns often occur together, as Figure 4-34 shows.

Prioritization and Escalation activities
Figure 4-34. Prioritization and Escalation activities

In the example, an approval activity is assigned to the role manager with an initial priority of P. When the manager completes the activity, the process transitions to Next step. However, if after a certain duration the manager has not completed the activity, the priority is increased to P + 1, and the activity is escalated to the director role. Directors will spot the activity in the queue, notice its high priority level, and hopefully take quick action.

The second human workflow pattern, Roles Compete For Task, assigns the same task to multiple roles. The task is completed when the first role completes the task. Implementation uses the discriminator pattern, as shown in Figure 4-35. In a high-priority software support case, support, engineering, and the client account manager are assigned to the case. As soon as one resolves it, the case is closed.

Competitive task resolution
Figure 4-35. Competitive task resolution

Get Essential Business Process Modeling now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.