If an error is to be raised before saving or before submitting then use a validation formula, the text in bold below is the condition that can be replaced with the condition to be tested.

example:

if(//SUPPLIER_RATING_SCORE_SUB_SCORE/text()) = '' and (//SYS_FIELDS/SYS_COMMAND_PARAMETERS = 'SAVE_DOCUMENT' or //SYS_FIELDS/SYS_COMMAND_PARAMETERS = 'SUBMIT_DOCUMENT')) then false() else true()