public interface StepElement extends ChartElement<StepDefinition>
It is important to understand how chart threading works: Each chart (or branch of a parallel block) has a single control thread. Messages are passed on this thread, and are translated into events that end up calling these functions. In other words, all of these functions are called on the control thread. Therefore, blocking in these functions will block the processing of additional messages on the control thread. This may be desirable, but might also have unintended consequences. For example, if an implementation blocks in activateStep, there is no way that a pauseStep or cancelStep can be called.
To handle this, the implementation can use its own thread management, or take advantage of the StepController passed in to activate and resume. The StepController provides an execute() function that will execute a task in a new thread, without blocking the control thread, while still not allowing the chart flow to continue until the work is finished.
Modifier and Type | Method and Description |
---|---|
default void |
activateStep(StepController context)
Activate this step.
|
default void |
cancelStep()
Cancel the step.
|
default void |
deactivateStep()
Deactivate this step.
|
default void |
pauseStep()
Pause this step.
|
default void |
resumeStep(StepController context)
Resume this step.
|
getDefinition
default void activateStep(StepController context)
default void deactivateStep()
default void pauseStep()
default void resumeStep(StepController context)
default void cancelStep()