Graph-based execution model
A graph describes the routes that a process allows. A session follows one of those routes, one choice at a time. ExecKernel keeps the definition of the process separate from the progress of each execution, so many sessions can use the same graph without changing it.
The graph contains nodes, which represent positions in the process, and edges, which connect those positions in a particular direction. To move a session, your application chooses an edge from its current node. The engine checks that choice and, if it accepts it, moves the session to the edge’s destination.
One definition, different journeys
Section titled “One definition, different journeys”Consider an application that helps someone choose how to attend a workshop. They can attend online or in person. The in-person route also asks them to choose a venue; this small example offers Valencia.
The diagram shows the complete graph and two sessions that have followed different routes through it. The terminal nodes mark the end of this selection process.
Session A chose the in-person edge and then the Valencia edge. Its recorded path includes the venue-selection step. Session B chose online attendance and reached its terminal directly. Each session has its own current node, data and history.
Both sessions used the same definition. Choosing online did not remove the venue-selection step, and choosing Valencia did not add it. Those possibilities were already in the graph; each session records which ones it took.
This separation lets you define a process once and use it for many individual cases. A new session starts at the graph’s designated starting node, its root, regardless of how far another session has progressed.
Your application makes each choice
Section titled “Your application makes each choice”ExecKernel advances when your application asks it to follow a particular edge. In an interactive application, that request might come from a button the user presses. Your application’s own logic can also make the choice.
For the workshop example, selecting “In person” requests the edge that leads from the attendance step to the venue step. After accepting it, the engine returns the session at the venue-selection node. Your application can use the returned data to show the venue choices.
Reaching that node does not automatically select Valencia, even though it is the only venue in this example. Your application must request that edge as a separate choice. This makes the point at which the process advances explicit.
Data affects which routes can be followed
Section titled “Data affects which routes can be followed”An edge can have conditions that must pass before the engine accepts it. Your application supplies relevant values in the session’s context, the data used during execution.
For example, the Valencia edge could require a placesAvailable value to be true. The same edge would then be usable for a session whose context satisfies that condition and blocked for one whose context does not. The graph still contains the Valencia route in both cases.
Your application obtains that value and supplies it to ExecKernel. The engine evaluates the condition against the data it receives. When the application later requests an edge, the engine checks the choice again; an option shown earlier is not a promise that a later request will succeed.
Conditions therefore let the same process respond to different data without rebuilding its structure. Condition evaluation and edge availability explains that evaluation in more detail.
Explore the model in the Showcase
Section titled “Explore the model in the Showcase”The Graph basics demo provides a small graph with numbered nodes and edges. If the demo opens in Spanish, select EN in its header. Follow edge 101 and then 201, observe the completed path, and press Reset. On the new run, choose edge 102.
The two runs finish at different terminals. Watch how the recorded path changes while the graph itself stays the same. You can also pause at the intermediate node: it waits for your next choice, including when a terminal is just one edge away.
For a closer look at each structural element, continue with Nodes, edges and terminals.