Version Date Notes By
1.0 2025-05-07 Initial release ROB

Introduction

Master validations is the system that evaluates the entire process as it is being constructed. While it returns more than one error then the process is considered not viable and cannot be sent to testing / production.

This sub system contains multiple classes that are called recursivelly to validate the entire process (the BpmnProcessHolderRevisionValidator calls the ProcessValidator which calls the various object validators, etc ...). These object validators will emit their own errors and then all these errors are pooled together and displayed to the process creator while they edit the process, reminding the process creator of what is missing / what is required to complete the process.

Errors are set in a function called validate like this

// `$toReturn` collects all errors generated in a given `validate()` function call and returns all of them to the validate above
// until all errors are collated and sent to the frontend

// validate process existence
if (!isset($processHolderId)) {
    array_push($toReturn, $this->createErrorLine(
        // Name of wizard tab
        trans('form.title.bpmn-options'),

        // Name of object affected (array, because it can be a chain of names leading to the object)
        [
            $this->getNameForObject($backendModel)
        ],

        // error message (standard trans with replaces array if needed)
        trans('messages.validation.definition-required', [
            'property' => trans('form.field.process')
        ])
    ));
}

Note: This validation system does not handle warnings (non urgent events) so only validate that which would break execution of the process if not set correcly / missing (use for missing required properties for example).

This system is feature complete and probably requires no further improvement.