The Sequencing Graph

The Sequencing Graph is derived from all the operations within a mix folder. It decides the sequence in which the services implement the operations.

The Sequencing Graph is built once per mix and is used for all transactions on that mix.

The Sequencing Graph is made up of:

Vertices might be seen as stages of sequence. They are generated by certain operations.
Note: Labels are added to vertices. A label identifies the operations that generated the vertex by listing the fields associated with the operations.
Edges are connecting the vertices. They are generated by request/reply operations.

Table 1 groups operations by their functions in generating the Sequencing Graph.

Table 1. Operation functions
Operation type Generates vertex Generates edge Description
Notify Yes No A notify operation generates a vertex. A notify is a starting point of a transaction.
Consume No No A consume operation does not generate anything. This operation is invoked on the first vertex where SPARKL manages to collect the input the consume is expecting.
Solicit/response Yes No A solicit/response generates a vertex. A solicit is a starting point of a transaction. A response to the solicit is sent on the first vertex where SPARKL manages to collect the input the response is expecting.
Request/reply Yes Yes A request/reply generates a new vertex and an edge connecting this vertex with one or more other vertices.

The sample mix, as shown in Figure 1, has the following operations:

  • Order/Ok - solicit/response
  • AddGin/Ok - request/reply
  • AddTonic/Ok - request/reply

Figure: The Sequencing Graph - Sample mix

Note: The sample mix was taken from the Drink with Style tutorial.

The Sequencing Graph comprises four vertices and edges connecting them.

Take a closer look at Figure 2.

Figure: The Sequencing Graph - Sample graph

The vertices are generated by the solicit/response and the request/reply operations, whilst the edges are generated by the request/reply operations only.

The rightmost vertex happens to contain all fields necessary to send the Ok response to the Order solicit.

When we say a solicit, we actually mean a solicit event. The runtime equivalent of an operation subject, such as a solicit or response, is a data event.