Creating a workflow class
All worklow definitions must specify a workflow class to use. For example, the workflow schema below specifies a class of pixl8.webflow
:
version: 1.0.0
workflow:
id: my-workflow
class: pixl8.webflow
# ...
What is a workflow class
A workflow class tells the engine which storage implementation to use for storing workflow state and which scheduler implementation to use for scheduling automatic actions using timers.
Registering a class
This class must be registered with the CfFlow engine in order to be usable. No pre-built classes or storage/scheduler implementations exist in the core engine as of the current version so you must implement your own and register them with the engine.
Registering a class is as follows:
// registering the storage class + scheduler
cfflow.registerStorageClass( "my.db.storage", myDbStorageImpl );
cfflow.registerScheduler( "my.cf.scheduler", mySchedulerImpl );
// registering the class
cfflow.registerWorkflowClass(
className = "my.cfflow.class"
, storageClass = "my.db.storage"
, scheduler = "my.cf.scheduler"
);