Interface StepElement
- All Superinterfaces:
- ChartElement<StepDefinition>
- Activate - Start execution
- Deactivate - A subsequent transition has activated. The step may choose to stop immediately, or finish its work.
- Pause - The step should stop work, expecting to resume later
- Resume - The step should continue from where pause left off
- Cancel - The chart or step has been cancelled, the step should stop execution and clean up.
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.
- 
Method SummaryModifier and TypeMethodDescriptiondefault voidactivateStep(StepController context) Activate this step.default voidCancel the step.default voidDeactivate this step.default voidPause this step.default voidresumeStep(StepController context) Resume this step.Methods inherited from interface com.inductiveautomation.sfc.api.elements.ChartElementgetDefinition
- 
Method Details- 
activateStepActivate this step. This method should block until activation is complete.
- 
deactivateStepdefault void deactivateStep()Deactivate this step. This method should block until deactivation is complete.
- 
pauseStepdefault void pauseStep()Pause this step. This method should block until pausing is complete.
- 
resumeStepResume this step. This method should block until resuming is complete.
- 
cancelStepdefault void cancelStep()Cancel the step. This method can block until cancellation is complete.
 
-