Steps

Introduction


A step is a particular action that the actor (user) takes to complete a Process in the larger scheme of things. A step cannot exist on its own but is instead attached to a Process. A sequence of steps make up a process.

Step Overview


Each step has a MongoDB generated ID that uniquely identifies the step. A step also has a description that can be displayed instead of a process description when the step is being executed. Steps can be referenced in calling processors arguments (this.args). Either using

this.args.$nextStep or this.args.$process.steps[index] or this.args.$description.steps[0]

this.args.$nextStep contains all the enumerable properties in the next step. It can be used to modify the next step as the process requires. A common use case is changing (adding or removing) the form elements in the nextStep.
this.args.$process.steps[index] can be used to access information about a particular step in the process.
this.args.$description.steps[0] accesses the first step in the process and can be used to modify the step before it is executed. The $description property is only accessible in fetch processors.

Step Type

There currently is only one type of step which is a CLIENT step. This option has been left open in the event that there arise a need for some other type of step.

Form

A form is the object containing the elements that a Step will have. This is a required property of steps as steps must have at least an element to be rendered when the step is executed. More on Forms can be found in Forms and Elements.

Mode

Step Mode ultimately determines the behaviour of a step. There are two modes that a step can be in:

A "VIEW" Step

A View step is a step that only displays information and cannot perform any other action after its view has been rendered. This type of step can only have processors that will run before the steps view is rendered. No processor will be run after the steps' view has been rendered.

A "PROCESS" Step

A Process step is a step that not only displays information but can be used to submit a forms data. This type of step also has a "Submit Processor" that runs when the actor clicks on a submit button. This means that the step will also have a procesor that will run after its view has been rendered.

Step Processors

A step can contain one or more arbitrary number of processors. These processors are either standalone or non-standalone processors.
Standalone processors are the processors that will be run asynchronously while the step is being loaded.
Non-standalone processors will only be run after the steps view has been rendered. That is they are only significant for PROCESS steps that have a submit button attached to their forms and will run only on click of the submit button.

STEP OBJECT

Property NameTypeDescription
_idMongo ObjectIDMongoDB generated ID for the Step
descriptionStringThe description for the Step. Used to override the process description that displays on the client.
stepTypeEnum values : ["CLIENT"]This option has been left open in the event that there arise a need for some other type of step.
modeEnum values : ["PROCESS", "VIEW"]This property determines if a Step will only have standalone processors or if the stemp will also have processors that should be run after the view has been rendered.
formObjectThis Object contains an elements property that is an array of all the elements that should be rendered when the step is executed.
processorsArrayAn array of processors including both standalone and non-standalone processors that can be executed within a particular step.
postprocessorsArrayWasn't really used.