CommandValidationFailed event

Highlight

Event Description How to recover Flow Related

CommandValidationFailed

• Emitted when a command sent to the bulk aggregate fails validation (e.g., missing content, invalid path, parent doesn’t exist, unsupported in current state).

• Correct the command payload or sequencing (ensure parent exists, valid path, content provided).
• Send a different or corrected command appropriate to the current bulk state.

yes

Operating Questions

Question Answer Comments

Could happen in production?

Yes

Is it fatal?

No

But it will halt the progress of the Bulk; the desired command will not take effect until the issue is resolved.

Logs

There are no specific logs giving further information on this issue. The issue is flagged through the system event, and the bulk state is managed (i.e. it remains the same) until a command is retried following resolution (see a resolution steps section below).

Log level Log message Also logs underlying exception?

-

-

-

Resolution Notes

# Action Comments

1

Check system event error message

The CommandValidationFailed system event contains:

  1. error message

  2. bulk ID

  3. command (that caused the exception)

The error message will give further details as to the specific validation issue.

Some examples of validation issues are:

  • When adding a component, the 'path' field is not present in the Bulk Specification

  • When adding a component, the 'content' field is empty

  • When removing a component, the component doesn’t exist

  • When removing a component, the component has child components

2

Make corrections

This could be:

  1. correct the command to a valid command

  2. address the underlying issue (e.g. trying to remove a component that has child components would require first removing the child components)

3

Replay the command

Resubmit the command that caused this issue to be displayed (e.g. AddComponentCommand).

You can do this through the client system by hitting the appropriate methods in the aggregate interfaces (i.e. RecurringBulkAggregate, BulkAggregate).

For example, if the issue was displayed when submitting an AddComponentCommand, then once the underlying issue is fixed you can replay the command by hitting the BulkAggregate.addComponent method.