Sample Match Script Failing - Cannot access field: getOperation

Document ID : KB000095107
Last Modified Date : 15/05/2018
Show Technical Document Details
A specific VSM is using the sample match script delivered with DevTest.
During playback mode the following exception is being logged in the VSE log files:
javax.script.ScriptException: bsh.EvalError: Sourced file: inline evaluation of: ``// Right-click to insert a sample match script // The scripting language defaul . . . '' : Cannot access field: getOperation, on object: Request {id=0, operation={id=0, operation="METHOD /abc/123/abcdef"...
DevTest on release 10.2.
The exception "Cannot access field: getOperation, on object: Request” is a syntax error. getOperation requires parenthesis after it.
This is how it is:
if (!incomingRequest.getOperation.equals("OperationName")) { return defaultMatcher .matches(); }

This is how it needs to be:
if (!incomingRequest.getOperation().equals("OperationName")) { return defaultMatcher .matches(); }
The workaround:
To stop with these exceptions modify the Match Script in the VSI transactions and add parenthesis after getOperation.
if (!incomingRequest.getOperation().equals("OperationName")) { return defaultMatcher .matches(); }

Since the sample match script delivered with DevTest is not using parenthesis after the getOperation, there is a patch to fix this behavior.

If you would like to apply this patch to your environment, please open a support ticket and reference the number DE359908. We will be happy to provide you the patch if it matches your issue.