Workflow reference: CfFlow Conditions
CfFlow Conditions
Preside registers several conditions with the CfFlow library that can be used throughout both your CfFlow and webflow definitions, i.e.
steps:
- id: mystep
condition:
ref: preside.IsLoggedIn
This page gives details of all the conditions made available by Preside.
Conditions
Coldbox conditions
coldbox.Handler
The coldbox.Handler
condition allows you to run an arbitrary Coldbox handler that should return a boolean value indicating the success or failure of the condition.
In addition to the optionally provided args
, your handler will receive the wfInstance
on which the condition is operating.
Args
| Name | Description | |-------|--------| | event
| Required. The coldbox event
id to execute | | args
| Optional. The args
struct to send to the handler |
Example
condition:
ref: coldbox.Handler
args:
event: events.isPublic
args:
testmode: $testmode
// /handlers/Events.cfc
component {
// ...
private boolean function isPublic( event, rc, prc, args={}, wfInstance ) {
var state = wfInstance.getState();
return eventsService.eventIsPublic(
eventId = state.event_id
, testMode = IsTrue( args.testMode ?: "" )
);
}
}
Preside conditions
preside.IsLoggedIn
The preside.IsLoggedIn
condition returns whether or not the current website visitor is a logged in website user.
Args
This condition takes no arguments.
Example
steps:
## ...
- id: login
condition:
ref: preside.IsLoggedIn
not: true