Here is how you can develop a new Condition.

Here is a simple condition example that validate the current flow:

You just need to extend Condition and implement the boolean test(ConditionContext conditionContext) method.

You can have any properties you want like for any task (validation, documentation, ...), everything works the same way.

The test will receive a ConditionContext that will expose:

  • conditionContext.getFlow(): the current flow.
  • conditionContext.getExecution(): the current execution that can be null for Triggers.
  • conditionContext.getRunContext(): a RunContext in order to render your properties.

This method must simply return a boolean in order to validate the condition.

Documentation

Remember to document your conditions. For this, we provide a set of annotations explained in the Document each plugin section.

Was this page helpful?