Synchronization Pattern
3 Using the Blackboard Paradigm in the Context of a Workflow Engine
3.1 Introduction
This chapter uses the theoretical concepts surrounding workflows discussed in the previous chapter and maps them to the blackboard paradigm. The blackboard architecture is discussed in detail with each component in this architecture and its behaviour being examined. Petri-nets are used to conceptualize the behaviour of the internal components of a workflow process which is mapped to the different components of the blackboard paradigm. A general discussion on the advantages and disadvantages of using a blackboard paradigm to build a workflow engine is provided. Previous research done on the subject of the feasibility of building a workflow engine using the blackboard paradigm is investigated and the solutions proposed in existing research are compared with the solution proposed in this dissertation.
3.2 Blackboard Paradigm
A problem solving model entails the organization of reasoning steps and knowledge to construct a solution to a problem. There are several types of problem solving models. For instance, there is the backward reasoning model where the problem is solved reasoning backwards from the objective to be achieved towards an initial state. Conversely, the forward reasoning model has the problem solving logic steps from an initial state towards an objective [57]. Traditional workflow engines can be said to loosely adhere to the forward reasoning model. In an opportunistic reasoning model, a problem can be solved by applying pieces of knowledge either forward or backward at the most opportune time. Ultimately, problem solving models address the fundamental issue of the organization of knowledge and an approach to applying that knowledge to solve a problem [58].
The blackboard paradigm is used as a flexible problem solving approach and it utilizes the opportunistic problem solving model. Blackboard architectures support multiple problem solving techniques, multilevel abstraction of situations and control processes and responsive opportunistic control of workflow process activity [59].
Figure 1 depicts a simple view of the blackboard architecture. From Figure 1, it can be seen that the blackboard paradigm consists of two kinds of components namely a central data structure that embodies the current state (blackboard) and independent components (specialists) that operate on the blackboard. The next two sections will consider the specialists and blackboard in more detail.
3.2.1 Specialists
Specialists consist of two major components namely the condition and action. The condition component exists to initiate when the specialist can contribute to the blackboard. Also known as a precondition component, it stipulates when a specialist should execute its actions and more specifically which set of actions from the action component to execute contingent on what conditions in the condition component are satisfied. The action component consists of procedures to contribute to the blackboard. The procedures being executed insert new data or alter existing data on the blackboard. These changes made to the blackboard are explicit and can be understood by other specialists [60].
Specialists are autonomous components that require no assistance nor even need to acknowledge the existence of other specialists. However, the specialist must understand the existing information and contribute information to the blackboard that can be comprehended and used by other specialists.
3.2.2 The Blackboard
The blackboard is the global data structure that is monitored by specialists. The data could consist of raw data added by specialists and partial solutions to problems. Since specialists do not intercommunicate, the blackboard is also serves as a communication medium between the specialists. The blackboard is also important for specialist triggering. The very data on the blackboard can be used as a triggering mechanism for specialists [16].
Revisiting the blackboard metaphor, as more specialists contribute to the blackboard, the information on the blackboard grows making it harder for specialists to monitor or to look up pertinent information on the blackboard. A common way that this problem is solved is to divide the blackboard into zones that contain specific types of information [16]. Furthermore, each zone has some sort of positioning metrics for efficient retrieval of information. For instance, information can be arranged numerically, alphabetically, using key-value pairs, by importance, by last modified etc. There can also be dynamic or static regions on the blackboard where information that should not be changed should be put into the static region and information that can be changed can be put into the dynamic regions [61].
The blackboard does not restrict any type of information that can be put on it. This introduces a problem of how to represent information on the blackboard. From the blackboard metaphor, human specialists can doodle on the blackboard when trying to contribute to a problem. A specialist can add anything from pictures, lists, tables, equations etc. It is important that other specialists can understand what a particular specialist has added to the
blackboard. Since the blackboard does not restrict what type of information can be put on the blackboard, specialists have to interact with the blackboard responsibly and not leave incompatible information that may be misunderstood by other specialists. A common understanding of information on the blackboard information must be maintained. However, it might be desirable if a certain set of specialists have their own special jargon or a different language that cannot be understood by other specialists so only a single set of specialists can interact on the blackboard. Depending on the application, a trade-off between generalized and specialized representation of the blackboard has to be made by the application developer [62].
3.2.3 Need for Control
Opportunistic problem solving presents its own set of challenges. A circumstance can arise where two or more specialists operate on the same blackboard data at the same time which might comprise the integrity (data corruption) or security (read or write privileges) of this global data structure. Reverting back to the blackboard metaphor, a situation may arise of many human specialists responding to a particular change on the blackboard and all scuffle to get to the blackboard in a bid to provide their input. Civility must be established and human specialists should contribute to the blackboard one after the other in an orderly fashion. A simple control approach to accomplish this is to have only one piece of chalk. It can be given to only one human specialist at one time that can be passed around. This inevitably introduces the necessary control component back into the blackboard paradigm [63].
The control component is distinct to the individual specialists in the blackboard paradigm. It is responsible for synchronizing the specialists’ access to alter the blackboard. It can also monitor and alter the blackboard. It is imperative that the control component remains distinct to the specialists and is unable to assume control over any part of the specialists (execute the conditions or actions of the condition-action pairs of specialists). The control component should not be able to invoke specialist rules (condition-action pairs) or any other part of specialists. If this is neglected, the modularity of the specialists (independent components) will be forfeited thereby totally comprising the opportunistic problem solving model provided by the blackboard paradigm.
Depending on the application, the complexity of the control component can vary significantly [64]. Blackboard systems can support diverse types of control components or strategies. Application developers are unfettered to create any type of opportunistic control technique depending on the requirements of the application [64].
Generally in the literature that has been reviewed and the blackboard applications that have been investigated, this control component is simply termed as the ‘controller’. This term is deceptive as it leads one to believe that the controller completely takes possession of the specialists and turns them into passive drones submitting to the controller’s bidding. The author feels that the term ‘orchestrator’ better defines this control component. Just like a musician (orchestrator) who arranges voices and instruments for a musical performance, the control component in
the blackboard system arranges blackboard access for specialists to achieve an overall goal or to solve a problem. The complete view with all the components of the blackboard paradigm is shown in Figure 14 [65].
Simple control components employ a “first come first serve” strategy. The first or the swiftest specialist that requests access to the blackboard will be given access. In applications where specialists operate on the blackboard for long periods of time, the control component might consist of a queue where other specialists that require access to the blackboard will be queued that later can operate on the blackboard once the active specialist has completed its contribution to the blackboard. HASP/SIAP was a software system developed using the blackboard paradigm to interpret sonar signals emitted by the moving crafts in an ocean region [66]. The control component of HASP/SIAP employed this strategy where a change in the blackboard would occur which then prompted the control component to permit the specialists to access the blackboard in FIFO order [66].