Custom outcome flow condition expression for REST API

I have a process created that uses a form with custom outcomes (“APPROVED” and “DECLINED”). In order to the form outcome in a flow condition, I have the condition set to this:

${form_myform_outcome == ‘APPROVED’}

When I run this process through the Flowable UI, it runs with no issues. When I try to run this process using only the REST APIs, when I submit the form with the desired outcome (endpoint used is http://localhost:8282/flowable-rest/service/runtime/tasks/{taskid}), I get this error message:

org.flowable.common.engine.api.FlowableException: Unknown property used in expression: ${form_myform_outcome == ‘APPROVED’}

I had found this thread that says the form outcome is stored internally as “form__outcome” but that doesn’t work in the flow condition expression either.
Can anyone help with how to use a custom form outcome in a flow condition when using the REST API?

How are you passing the form outcome as a variable into the REST request? Can you share what you are POSTing?

I am posting this as raw JSON in the body of the API call:

“action”: “complete”,
“outcome”: “DECLINED”

I have a form that comes before this step in the process and I am able to submit that form okay using JSON as here. The difference with that form is that it just uses the standard Complete so I do not have “outcome” defined in that request.

I also tried different variations such as this and got the same error:

“action”: “complete”,
“form_myform_outcome”: “DECLINED”

It appears to me that the evaluation of the flow condition isn’t working the same through the API call as it does when using the UI to run the process.

Note that if I go into the UI to submit the form, it does complete successfully.