The workflow type can be considered a template or a document definition. The workflow type acts like an umbrella for the associate workflow elements, such as approvals and tasks. When the designer starts to design a workflow, they actually select a workflow type, and the design surface will allow them to select workflow elements we have associated with it.
We create the workflow type first because the workflow type creation tooling will create elements used in other workflow elements. We just come back to this in order to add them to the list of supported types by the workflow type.
We will create a Base Enum to persist the workflow status. In this recipe, we will only use one of the status fields to handle the started and canceled events. The Base Enum was designed with the whole workflow in mind, which includes handling the status of the workflow approval.