RSDConditionalRule
public protocol RSDConditionalRule
A conditional rule is appended to the navigable task to check a secondary source for whether or not the step should be displayed.
Note
ResearchSuite
does not currently implement any conditional rule objects. The conditional rule is
included here for future implementation of data tracking across runs of a task. (syoung 10/03/2017)
-
Should the given step be skipped, based on the current result set?
Declaration
Swift
func shouldSkip(step: RSDStep, with result: RSDTaskResult?) -> Bool
Parameters
step
The step about to be displayed.
result
The current task result.
Return Value
true
if the step should be skipped, otherwiseno
. -
Asks the conditional rule what the identifier is for the next step to display after the given step.
Declaration
Swift
func nextStepIdentifier(after step: RSDStep?, with result: RSDTaskResult?) -> String?
Parameters
step
The step that just finished.
result
The current task result.
Return Value
The identifier of the next step.
-
Allows the conditional rule to mutate or replace the step that the navigation rules determine should be the return step.
Declaration
Swift
func replacementStep(for step:RSDStep?, with result: RSDTaskResult?) -> RSDStep?
Parameters
step
The step that navigation has opted to return.
result
The current task result.
Return Value
The actual step to move to. If no action, then
step
should be returned.