Variable Empty in Optimize when deleting with Java API

Hello all
we are using Camunda in a Spring-boot App and have Optimize attached.
The problem we are facing is that variables of the process instances are empty in Optimize.

Here is what we are doing:
We have sync calls from outside to a Camunda process. We use variables of Camunda in the response. Since all variables (and not only specific ones) of Camunda get returned in the response (when enabled) we delete the variables not used anymore in the process to reduce the payload for the response.

According to another post in the forum, Optimze only collects the latest value of the variables from the history DB.
So is this the problem, that the value collected by Optimize is empty because we deleted the variable?

I think there is some potential for optimization regarding the handling of variables anyway…

Thank you for clarification.
Best Regards
Martin

Hey @martinstamm,

Thanks for reaching out! Before going into your request, are you actually a Camunda customer? In this case, you could also open a support case. This would allow you to share some sensitive data with us so we can better understand your problem.

According to another post in the forum, Optimize only collects the latest value of the variables from the history DB.

That’s correct. At least for now, but we already have it on our radar that different behavior is maybe desired. We created the following ticket for that: https://jira.camunda.com/browse/OPT-3552 However, so far we haven’t scheduled it to be implemented.

So is this the problem, that the value collected by Optimize is empty because we deleted the variable?

I don’t fully get your question. But if you mean that the variable won’t be available in Optimize because it has been deleted then there’s a bit more to it. Optimize does import the variable even if it has been deleted. However, it assigns a value of null in case of a deletion. Does that help you?

I think there is some potential for optimization regarding the handling of variables anyway…

We would love to hear your thoughts on this. Ideally, we could discuss this in a support case. Maybe @felix-mueller you have more to add here?

Best
Johannes

Hello Johannes
Thank you for your quick reply. Yes, the basic question is clarified with this.
Yes, we are a licenced customer, however, i thought this is such a basic question everyone can reply to :slight_smile:

Regarding potential for optimization:
We do sync calls to Camunda BPMN and get the results of the processing by adding “resultEnabled”:true in the REST request.
With this we get all available variables from Camunda.
To avoid getting too much, we delete some of the variables with Java API by calling execution.removeVariable("");
With this we do not get the content of the variable to Optimize though (as mentioned in your response)
So for us an improvement would be:

  • Define the variables in the response specifically
  • Delete variables also from history (in some cases we have big payloads we would like to totally remove to improve DB/Camunda performance)
    With this we could handle the variables for Optimize too.

Best Regards
Martin

Hey @martinstamm,

I’m glad that I was able to help :slight_smile:

Regarding potential for optimization: …

Thanks a lot for sharing your insights! That helps a lot. Especially our product manager @felix-mueller is interested in that and might reach out to you soon if that’s fine with you.

Have a nice week!

Best
Johannes

Hello @JoHeinem
of course we can give more details about our experiences to @felix-mueller any time.

Best Regards
Martin