Shreyas arya

Generation

generate functionMon, 23 Jan 2023

Currently, WorkflowExecutionValidator performs validation for different use cases. As a result, it is quite difficult to track positive or negative scenarios. The aim is to simplify code. We need to create validators for each status. The validator will check if transition from current state is allowed or not. All validators are injected into WorkflowExecutionValidator. private List<Validator> validators WorkflowExecutionValidator will pick up an appropriate validator from a list and check if transition is allowed.

public void validate(WorkflowExecutionRequest request, WorkflowExecution workflowExecution) { validators.forEach(validator -> validator.validate(request, workflowExecution)); }

Questions about programming?Chat with your personal AI assistant