CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
ctkWorkflowStep Class Reference

ctkWorkflowStep is the basis for a workflow step. More...

#include <Libs/Core/ctkWorkflowStep.h>

Inheritance diagram for ctkWorkflowStep:
Inheritance graph
[legend]

Public Member Functions

 ctkWorkflowStep ()
 
 ctkWorkflowStep (const QString &newId)
 
QObject * ctkWorkflowStepQObject ()
 Get QObject associated with this step, to connect signals/slots. More...
 
QString description () const
 Set/get description. More...
 
bool hasOnEntryCommand () const
 
bool hasOnExitCommand () const
 
bool hasValidateCommand () const
 
QString id () const
 Get id. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
QString name () const
 Set/get name. More...
 
void setDescription (const QString &newDescription)
 
void setHasOnEntryCommand (bool newHasOnEntryCommand)
 
void setHasOnExitCommand (bool newHasOnExitCommand)
 
void setHasValidateCommand (bool newHasValidateCommand)
 
void setId (const QString &newStepId)
 
void setName (const QString &newName)
 
QString statusText () const
 Get statusText. More...
 
ctkWorkflowworkflow () const
 Get the workflow associated with this step. More...
 
virtual ~ctkWorkflowStep ()
 

Protected Member Functions

 ctkWorkflowStep (ctkWorkflowStepPrivate *pimpl, const QString &newId)
 
void invokeOnEntryCommand (const ctkWorkflowStep *comingFrom, const ctkWorkflowInterstepTransition::InterstepTransitionType transitionType) const
 Signal (emitted by the private implementation) indicating that the step's 'onEntry' processing should be performed. More...
 
void invokeOnExitCommand (const ctkWorkflowStep *goingTo, const ctkWorkflowInterstepTransition::InterstepTransitionType transitionType) const
 Signal (emitted by the private implementation) indicating that the step's 'onExit' processing should be performed. More...
 
void invokeValidateCommand (const QString &desiredBranchId=QString()) const
 Signal (emitted by the private implementation) indicating that validation of this step's processing should be performed. More...
 
virtual void onEntry (const ctkWorkflowStep *comingFrom, const ctkWorkflowInterstepTransition::InterstepTransitionType transitionType)
 Reimplement this function for step-specific processing when entering a step. More...
 
void onEntryComplete () const
 Signal (emitted by the private implementation) indicating that the step's 'onEntry' processing has completed. More...
 
virtual void onExit (const ctkWorkflowStep *goingTo, const ctkWorkflowInterstepTransition::InterstepTransitionType transitionType)
 Reimplement this function for step-specific processing when exiting a step. More...
 
void onExitComplete () const
 Signal (emitted by the private implementation) indicating that the step's 'onExit' processing has completed. More...
 
QState * processingState () const
 Get the step's processing state. More...
 
void setStatusText (const QString &newText)
 
void setWorkflow (ctkWorkflow *newWorkflow)
 Set workflow. More...
 
virtual void validate (const QString &desiredBranchId=QString())
 Validates the computation performed in this step's processing state. More...
 
void validationComplete (bool validationSuceeded, const QString &branchId=QString()) const
 Signal (emitted by the private implementation) indicating that validation of this step's processing has completed. More...
 
ctkWorkflowIntrastepTransitionvalidationFailedTransition () const
 Get the step's validation failed transition. More...
 
QState * validationState () const
 Get the step's validation state. More...
 
ctkWorkflowIntrastepTransitionvalidationTransition () const
 Get the step's validation transition. More...
 

Protected Attributes

QScopedPointer< ctkWorkflowStepPrivate > d_ptr
 

Friends

class ctkWorkflow
 
class ctkWorkflowPrivate
 

Detailed Description

ctkWorkflowStep is the basis for a workflow step.

A workflow step is a placeholder for various states and transitions that are used in a typical workflow. Such steps can be added to instances of the ctkWorkflow class.

Definition at line 45 of file ctkWorkflowStep.h.

Constructor & Destructor Documentation

◆ ctkWorkflowStep() [1/3]

ctkWorkflowStep::ctkWorkflowStep ( )
explicit

◆ ctkWorkflowStep() [2/3]

ctkWorkflowStep::ctkWorkflowStep ( const QString &  newId)
explicit

◆ ~ctkWorkflowStep()

virtual ctkWorkflowStep::~ctkWorkflowStep ( )
virtual

◆ ctkWorkflowStep() [3/3]

ctkWorkflowStep::ctkWorkflowStep ( ctkWorkflowStepPrivate *  pimpl,
const QString &  newId 
)
explicitprotected

Member Function Documentation

◆ ctkWorkflowStepQObject()

QObject* ctkWorkflowStep::ctkWorkflowStepQObject ( )

Get QObject associated with this step, to connect signals/slots.

◆ description()

QString ctkWorkflowStep::description ( ) const

Set/get description.

◆ hasOnEntryCommand()

bool ctkWorkflowStep::hasOnEntryCommand ( ) const

Set/get whether an onEntryCommand has been provided in a separate QObject

Note
See method2 in onEntry()
See also
onEntry()

◆ hasOnExitCommand()

bool ctkWorkflowStep::hasOnExitCommand ( ) const

Set/get whether an onExitCommand has been provided in a separate QObject

Note
See method2 in onExit()
See also
onExit()

◆ hasValidateCommand()

bool ctkWorkflowStep::hasValidateCommand ( ) const

Set/get whether a validationCommand has been provided in a separate QObject

Note
see method 2 described for validation()
See also
validation()

◆ id()

QString ctkWorkflowStep::id ( ) const

Get id.

◆ invokeOnEntryCommand()

void ctkWorkflowStep::invokeOnEntryCommand ( const ctkWorkflowStep comingFrom,
const ctkWorkflowInterstepTransition::InterstepTransitionType  transitionType 
) const
protected

Signal (emitted by the private implementation) indicating that the step's 'onEntry' processing should be performed.

See also
onEntry()

◆ invokeOnExitCommand()

void ctkWorkflowStep::invokeOnExitCommand ( const ctkWorkflowStep goingTo,
const ctkWorkflowInterstepTransition::InterstepTransitionType  transitionType 
) const
protected

Signal (emitted by the private implementation) indicating that the step's 'onExit' processing should be performed.

See also
onExit()

◆ invokeValidateCommand()

void ctkWorkflowStep::invokeValidateCommand ( const QString &  desiredBranchId = QString()) const
protected

Signal (emitted by the private implementation) indicating that validation of this step's processing should be performed.

See also
validation()

◆ isWidgetType()

bool ctkWorkflowStep::isWidgetType ( ) const

Returns true if the object is a widget; otherwise returns false.

◆ name()

QString ctkWorkflowStep::name ( ) const

Set/get name.

◆ onEntry()

virtual void ctkWorkflowStep::onEntry ( const ctkWorkflowStep comingFrom,
const ctkWorkflowInterstepTransition::InterstepTransitionType  transitionType 
)
protectedvirtual

Reimplement this function for step-specific processing when entering a step.

To define a custom step, developers can either reimplement the onEntry() method in a subclass of ctkWorkflowStep, or create a ctkWorkflowStep instance and use signals and slots, as similarly as described for validate().

Each step should be self-contained, comingFrom and transitionType may be used only to decide on how processing should be done for the current step.

Parameters
comingFromgives the step that the state machine was in before transitioning to this step.
transitionTypegives the type of the transition used to get to this step.

◆ onEntryComplete()

void ctkWorkflowStep::onEntryComplete ( ) const
protected

Signal (emitted by the private implementation) indicating that the step's 'onEntry' processing has completed.

See also
onEntry()

◆ onExit()

virtual void ctkWorkflowStep::onExit ( const ctkWorkflowStep goingTo,
const ctkWorkflowInterstepTransition::InterstepTransitionType  transitionType 
)
protectedvirtual

Reimplement this function for step-specific processing when exiting a step.

To define a custom step, developers can either reimplement the onExit() method in a subclass of ctkWorkflowStep, or create a ctkWorkflowStep instance and use signals and slots, similarly as described for validate().

Each step should be self-contained, goingTo and transitionType may be used only to decide on how processing should be done for the current step.

Parameters
goingTogives the step that the state machine will go to after transitioning from this step.
transitionTypegives the type of the transition used to get to this step.

◆ onExitComplete()

void ctkWorkflowStep::onExitComplete ( ) const
protected

Signal (emitted by the private implementation) indicating that the step's 'onExit' processing has completed.

See also
onExit()

◆ processingState()

QState* ctkWorkflowStep::processingState ( ) const
protected

Get the step's processing state.

This state is used to perform the processing associated with this step.

◆ setDescription()

void ctkWorkflowStep::setDescription ( const QString &  newDescription)

◆ setHasOnEntryCommand()

void ctkWorkflowStep::setHasOnEntryCommand ( bool  newHasOnEntryCommand)

◆ setHasOnExitCommand()

void ctkWorkflowStep::setHasOnExitCommand ( bool  newHasOnExitCommand)

◆ setHasValidateCommand()

void ctkWorkflowStep::setHasValidateCommand ( bool  newHasValidateCommand)

◆ setId()

void ctkWorkflowStep::setId ( const QString &  newStepId)

Set step Id

Note
Setting the Id after the step had been added to a workflow is a no-op

◆ setName()

void ctkWorkflowStep::setName ( const QString &  newName)

◆ setStatusText()

void ctkWorkflowStep::setStatusText ( const QString &  newText)
protected

◆ setWorkflow()

void ctkWorkflowStep::setWorkflow ( ctkWorkflow newWorkflow)
protected

Set workflow.

◆ statusText()

QString ctkWorkflowStep::statusText ( ) const

Get statusText.

◆ validate()

virtual void ctkWorkflowStep::validate ( const QString &  desiredBranchId = QString())
protectedvirtual

Validates the computation performed in this step's processing state.

When creating a custom step, developers can create a validate(const QString&) method is one of two ways: 1) Reimplement the validate(const QString&) method in a subclass of ctkWorkflowStep, following these instructions:

  • invoke the superclass method ctkWorkflowStep::validateComplete(bool, const QString&) (true on successful validation, false on failure; the QString is the desired branchId to use with branching workflows)

OR:

2) Create an instance of a ctkWorkflowStep then:

  • Call setHasValidateCommand(1) on the step
  • Create a slot foo() associated with any QObject*, following these instructions:
    • Set the following connection:
      • QObject::connect(step, SIGNAL(invokeValidateCommand(const QString&)), object, SLOT(foo(const QString&)))

◆ validationComplete()

void ctkWorkflowStep::validationComplete ( bool  validationSuceeded,
const QString &  branchId = QString() 
) const
protected

Signal (emitted by the private implementation) indicating that validation of this step's processing has completed.

See also
validation()

◆ validationFailedTransition()

ctkWorkflowIntrastepTransition* ctkWorkflowStep::validationFailedTransition ( ) const
protected

Get the step's validation failed transition.

The validationFailed transition is used to bring the state machine from the step's validationState state back to its processingState, when validation of the processing step fails (i.e. validate(const QString&) returns false).

More specifically:

  • its origin state is the validatationState state
  • its destination state is the processingState state

The transition is of type ctkWorkflowTransition with the value ctkWorkflowTransitionType::ValidationFailedTransition.

◆ validationState()

QState* ctkWorkflowStep::validationState ( ) const
protected

Get the step's validation state.

This state is used to validate the processing associated with this step.

◆ validationTransition()

ctkWorkflowIntrastepTransition* ctkWorkflowStep::validationTransition ( ) const
protected

Get the step's validation transition.

The validation transition is used to bring the state machine from the step's processingState to its validationState. More specifically:

  • its origin state is the processingState state
  • its destination state is the validationState state

The transition is of type ctkWorkflowTransition with the value ctkWorkflowTransitionType::ValidationTransition.

◆ workflow()

ctkWorkflow* ctkWorkflowStep::workflow ( ) const

Get the workflow associated with this step.

Friends And Related Function Documentation

◆ ctkWorkflow

friend class ctkWorkflow
friend

Definition at line 249 of file ctkWorkflowStep.h.

◆ ctkWorkflowPrivate

friend class ctkWorkflowPrivate
friend

Definition at line 250 of file ctkWorkflowStep.h.

Member Data Documentation

◆ d_ptr

QScopedPointer<ctkWorkflowStepPrivate> ctkWorkflowStep::d_ptr
protected

Definition at line 244 of file ctkWorkflowStep.h.


The documentation for this class was generated from the following file: