The following Gosu statement is the Action part of a validation rule: It produces the following compilation error: Gosu compiler: Wrong number of arguments to function rejectField(java.lang.String, typekey.ValidationLevel, java.lang.String, typekey.ValidationLevel, java.lang.String). Expected 5, got 3 What needs to be added to or deleted from the statement to clear the error?
Visual content transcription:
claim.rejectField("State", TC_PAYMENT, DisplayKey.get("Rules.Validation.Claim.NotInDraft", null, null)

Visual content transcription:
claim.rejectField("State", TC_PAYMENT, DisplayKey.get("Rules.Validation.Claim.NotInDraft", null, null)

Show answerHide answer
Correct answer: A The two nulls must be replaced with a typekey and a string
Explanation
Answer Option (Which option is correct) A. The two nulls must be replaced with a typekey and a stringExplanation:
The displayed rejectField call supplies only three outer arguments because the two null values are inside DisplayKey.get. The compiler expects five arguments to rejectField. The parameter grouping and the outer call must be reviewed; merely changing the values inside DisplayKey.get does not by itself resolve the reported argument count.
Verification note: The screenshot puts the null values inside DisplayKey.get. Replacing them does not change rejectField from three outer arguments to five. The supplied key is not a confident compiler fix. The screenshot also shows only one closing parenthesis; its transcription preserves that incomplete expression.
Why the other options are incorrect:
B. A left parenthesis must be deleted:
Removing a parenthesis changes the grouping of arguments. That may also leave the expression syntactically invalid. The five-argument outer signature must be checked explicitly.
C. The word 'State' must be replaced with a DisplayKey:
State identifies the field being rejected. A display key supplies message text instead. Changing the field name does not repair the outer argument count.
D. A right parenthesis must be added:
The compiler complaint concerns missing outer arguments. Another closing parenthesis does not supply those values. Compare the entire call with the documented rejectField signature.
References:
Guidewire-authored PolicyCenter 10.1.2 - Rules and validation signatures
Gosu language project - Operators, loops, functions, and properties