Process Instance having variable value long is not getting fetched

Hi Team,

I am using a rest endpoint to find out the process Instance through its variable value.
https://docs.camunda.org/manual/7.11/reference/rest/process-instance/get-query/

But when I am using variable having long value - I don’t get the process Instance while same is working through cockpit filter.

My endpoint is-
http://localhost:6063/rest/process-instance?variables=leadId_eq_5014122643456

resolveValue:77, ConditionQueryParameterDto (org.camunda.bpm.engine.rest.dto)
resolveValue:46, VariableQueryParameterDto (org.camunda.bpm.engine.rest.dto)
applyFilters:410, ProcessInstanceQueryDto (org.camunda.bpm.engine.rest.dto.runtime)
applyFilters:42, ProcessInstanceQueryDto (org.camunda.bpm.engine.rest.dto.runtime)
toQuery:104, AbstractQueryDto (org.camunda.bpm.engine.rest.dto)
queryProcessInstances:70, ProcessInstanceRestServiceImpl (org.camunda.bpm.engine.rest.impl)
getProcessInstances:62, ProcessInstanceRestServiceImpl (org.camunda.bpm.engine.rest.impl)

This resolveValue method is giving String type for my long variable as well.
So the query is getting formed incorrectly.

select distinct RES.*
from ACT_RU_EXECUTION RES
inner join ACT_RE_PROCDEF P on RES.PROC_DEF_ID_ = P.ID_
WHERE RES.PARENT_ID_ is null
and EXISTS (
select
ID_
from
ACT_RU_VARIABLE
WHERE
NAME_= ‘leadId’ and RES.ID_ = EXECUTION_ID_
and
(
( TYPE_ is not null and TYPE_ = ‘String’
and TEXT_ is not null and
TEXT_
=‘5014122643456’ )
)
)
order by RES.ID_ asc

Any kind of help will be highly appreciated.
Thanks in advance.

Any help or path forward?

The GET query treats all variable values as String. With the POST query, the JSON request body can define the type of the variable as a Number, which should then return the value.

Cheers,
Thorben

2 Likes