FORGEBOX Enterprise 🚀 - Take your ColdFusion (CFML) Development to Modern Times! Learn More...

CFFlow

v0.4.3.00040 Public

CfFlow

CfFlow is an open source workflow engine for the CFML language. It is inspired by the work and concepts of Open Symphony Workflow (OSWorkflow), an unmaintained Java workflow engine that is used in JIRA and many other java projects.

Build Status

Latest version

Getting started

The following code snippets demonstrate the overall gist of how the engine is designed to work. Full documentation can be found here: https://pixl8.github.io/cfflow.

// create a singleton instance of CfFlow i.e. only one instance for your application
application.cfflow = new cfflow.models.CfFlow();
// register workflow definitions (YAML file)
application.cfflow.registerWorkflow( "/workflows/my-product-workflow.yaml" );
application.cfflow.registerWorkflow( "/workflows/my-automatic-workflow.yaml" );
// get a workflow "instance"
var instance     = "";
var cfflow       = application.cfflow;
var workflowId   = "my-product-workflow";              // would be matched against YAML workflow definition
var instanceArgs = { user=userId, product=productId }; // up to you

if ( !cfflow.instanceExists( workflowId, instanceArgs ) ) {
	instance = cfflow.createInstance( workflowId, instanceArgs );
} else {
	instance = cfflow.getInstance( workflowId, instanceArgs );
}
// query the workflow instance
if ( instance.isComplete() ) {
	// do logic to tidy up, or show message, etc.
}

if ( instance.isSplit() ) {
	// do special logic when more than one step is active..
}

var steps       = instance.getSteps();         // e.g. [ "step-1", "step-2", "step-3" ];
var activeStep  = instance.getActiveStep();    // when not split, e.g. "step-2"
var activeSteps = instance.getActiveSteps();   // i.e. when split, [ "step-1", "step-2" ]
var actions     = instance.getManualActions(); // e.g. [ "next", "prev", "cancel" ]
var state       = instance.getState();         // the current state of the instance, a struct of data
// set state
instance.setState( completeStateOfInstance );
instance.appendState( { one="more thing" } );
// process a workflow action (conditionally moves the instance through 
// the workflow steps and functions)
instance.processAction( stepId, actionId, args );

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository. Project releases can also be found and installed from Forgebox

License

This project is licensed under the GPLv2 License - see the LICENSE.txt file for details.

Authors

The project is maintained by The Pixl8 Group. The lead developer is Dominic Watson.

Code of conduct

We are a small, friendly and professional community. For the eradication of doubt, we publish a simple code of conduct and expect all contributors, users and passers-by to observe it.

Here are all the versions for this package. Please note that you can leverage CommandBox package versioning to install any package you like. Please refer to our managing package version guide for more information.

Version Created Last Update Published By Stable Actions
Current
0.4.3.00040 Jan 10 2020 12:34 PM Jan 10 2020 12:34 PM
Version History
0.4.2.00038 Jan 10 2020 09:12 AM Jan 10 2020 09:12 AM
0.4.1.00036 Jan 10 2020 09:03 AM Jan 10 2020 09:03 AM
0.4.0.00034 Jan 10 2020 07:37 AM Jan 10 2020 07:37 AM
0.3.1.00022 Jan 09 2020 09:06 AM Jan 09 2020 09:06 AM
0.3.0.00020 Jan 09 2020 07:27 AM Jan 09 2020 07:27 AM
0.2.1.00014 Jan 08 2020 08:31 AM Jan 08 2020 08:31 AM
0.2.0.00012 Jan 08 2020 05:02 AM Jan 08 2020 05:02 AM

 

$ box install cfflow

No collaborators yet.
  • Jan 07 2020 05:38 AM
  • Jan 10 2020 12:34 PM
  • 105
  • 102
  • 23