How to set process variable type to Long instead of Int

Hi everyone! I calling rest api with http-connector and getting responce variable, which becomes process wide variable.
S(response).prop(“myVariable”).numberValue();
In some cases Its type is int, but in other cases - long. So, then I use this variable to correlate some message events with long type variable. And this causes problem when Its type is Int. Correlation doesn’t work.
How can I forced set the type of this variable to Long while saving It to camunda process?

Hey @Gennadich!
Can you share some more details about which Camunda version you are using?
Thanks a lot! :slight_smile:

camunda-bpm-run-7.16.0
camunda-modeler-4.12.0

I repeat the problem. When saving number value to camunda process from rest api, Its type is calculating from actual value of the number. So If my entity id type has Its origin type long, but I work with items with small Id, they would appear in camunda as Int. And they will never be correlated with Long variable.

Thanks for getting back to me with that information. :slight_smile:
I actually would not recommend using the http-connector in Camunda Platform 7. Rather, I would use an external-task to make the REST call. By doing so you can parse the response to the right datatype/object and send it back to Camunda 7.

Thanks. Recentry we started to refuse from using It in new cases in favour of external tasks. But, In general, I think Its more common problem. So, If I need to set variable in modeller using java script, I would do the same -
execution.setVariable(“myVariable”, 55);
and this will be Integer. Is there any way to force It to become Long in camunda process?

1 Like

Hello!
I am facing the same problem, have you found any solutions?

Hi. No. I replaced It with creating the variable at server side.
If you will solve the problem, please let me know. Thank you.