Bonita jackson Unrecognized token was expecting ('true', 'false' or 'null')

4.8k views Asked by At

i had created very simple flow i had attached the picture below.

flow description :

User sends the expense report and finally it gets reviewed and should be approved while i am clicking the approved button. but i was getting error as below :

com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'onAccept1': was expecting ('true', 'false' or 'null').

current json that i have on variable

onAccept1 : return {"comments1" : $data.comments1, "isApproved1":false};

can any body please what was the mistake in the json , that i have on the variable called "onAccept1".

my expense report flow

i got this error while submitting thtask , below was my contract def: enter image description here

1

There are 1 answers

0
Antoine Mottier On

Actually you got two different errors in the "Review report1" step form ("newForm12") that prevent successful submission of the form when clicking on "Accept" button.

First one is the way the onAccept1 form variable is bind with the "Accept" button. In your version "Data send on click" property is set with a constant value instead of an expression. So with the current value set to onAccept1 means that the value sent will actually be onAccept1. You need to switch from constant to expression by clicking on the "fx" icon on the right of the "Data sent on click" property.

You will switch from Constant
to expression

Second one is the definition of the onAccept1 value: you miss the return keyword and have quotes around $data value that should not be there. Here is the correct value: return {"comments1": $data.comments1, "isApproved1": true};