 |
CTK
0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
|
Go to the documentation of this file.
21 #ifndef __ctkWorkflow_h
22 #define __ctkWorkflow_h
29 #include "ctkCoreExport.h"
32 class ctkWorkflowPrivate;
43 Q_PROPERTY(
bool isRunning READ isRunning DESIGNABLE
false)
44 Q_PROPERTY(
bool goBackToOriginStepUponSuccess READ goBackToOriginStepUponSuccess WRITE setGoBackToOriginStepUponSuccess)
56 Q_INVOKABLE
virtual void start();
63 Q_INVOKABLE
virtual void stop();
91 const QString& branchId = QString(),
105 const QString& branchId = QString(),
121 Q_INVOKABLE
bool hasStep(
const QString&
id)
const;
196 virtual void goForward(
const QString& desiredBranchId = QString());
199 virtual void goBackward(
const QString& desiredBranchId = QString());
247 QScopedPointer<ctkWorkflowPrivate>
d_ptr;
virtual void goForward(const QString &desiredBranchId=QString())
void stepRegistered(ctkWorkflowStep *step)
Q_INVOKABLE bool canGoForward(ctkWorkflowStep *step=0) const
Q_INVOKABLE ctkWorkflowStep * currentStep() const
Q_INVOKABLE ctkWorkflowStep * initialStep() const
Set/get the initial step.
void goToNextStepAfterSuccessfulValidation(const QString &branchId)
virtual void goBackward(const QString &desiredBranchId=QString())
Use this to trigger transition to the previous step (does not require validation)
virtual Q_INVOKABLE void setInitialStep(ctkWorkflowStep *step)
Q_INVOKABLE QList< ctkWorkflowStep * > forwardSteps(ctkWorkflowStep *step=0) const
ctkWorkflowStep is the basis for a workflow step.
virtual void evaluateValidationResults(bool validationSucceeded, const QString &branchId)
Receives the result of a step's validate(const QString&) function.
Q_INVOKABLE bool canGoBackward(ctkWorkflowStep *step=0) const
virtual Q_INVOKABLE void stop()
Stops the workflow.
void attemptToGoToNextStep()
virtual void goToStepFailed()
Processing that occurs after the attempt to go to a 'goTo' step fails.
ctkWorkflow is the basis for a workflow engine, i.e. a state machine with enhancements to support ctk...
void goFromGoToStepToStartingStep()
Goes to the step from which the attempt to go to the 'goTo' step was initiated.
virtual Q_INVOKABLE void start()
Start the workflow. The workflow will always start in the initial step, even if it is stopped and res...
bool goBackToOriginStepUponSuccess() const
ctkWorkflow(QObject *parent=0)
bool isRunning() const
Returns whether the workflow is currently running.
void goToProcessingStateAfterValidationFailed()
Q_INVOKABLE bool canGoToStep(const QString &targetId, ctkWorkflowStep *step=0) const
void setGoBackToOriginStepUponSuccess(bool flag)
Q_INVOKABLE bool hasTransition(ctkWorkflowStep *origin, ctkWorkflowStep *destination, const QString &branchId=QString(), const ctkWorkflow::TransitionDirectionality directionality=ctkWorkflow::Bidirectional)
Determine whether a transition has already been added.
QScopedPointer< ctkWorkflowPrivate > d_ptr
Q_INVOKABLE QList< ctkWorkflowStep * > backwardSteps(ctkWorkflowStep *step=0) const
virtual void goToStepSucceeded()
Processing that occurs after the attempt to go to a 'goTo' step succeeds.
void currentStepChanged(ctkWorkflowStep *currentStep)
bool verbose() const
If set debug messages will be displayed on standard output.
void performTransitionBetweenSteps()
Called when transitioning to the next step upon successful validation, or when transitioning to the p...
Q_INVOKABLE ctkWorkflowStep * step(const QString &id) const
Q_INVOKABLE int backwardDistanceToStep(ctkWorkflowStep *fromStep=0, ctkWorkflowStep *origin=0) const
Q_INVOKABLE QList< ctkWorkflowStep * > steps() const
Returns list of steps managed by the workflow.
TransitionDirectionality
Transition directionalities.
Q_INVOKABLE bool hasStep(const QString &id) const
Q_INVOKABLE QList< ctkWorkflowStep * > finishSteps() const
Get the steps that are 'finish' steps (i.e. have no step following them)
void setVerbose(bool value)
virtual void goToStep(const QString &targetId)
Go to the given step by iteratively calling goForward() until we reach it.
virtual Q_INVOKABLE bool addTransition(ctkWorkflowStep *origin, ctkWorkflowStep *destination, const QString &branchId=QString(), const ctkWorkflow::TransitionDirectionality directionality=ctkWorkflow::Bidirectional)
Creates a transition between two steps, and adds the two steps to the workflow if they have not been ...