Failed to execute a specific script in Modeler

I have a process with two activity. a ScriptTask and a UserTask. Two problems happened in Camunda 7 and I will explain them.

Problem 1

My process flow is this:


The script that I want to execute is here:


Then in UserTask I get the tenant with code and put it in an input variable:


So far so good until here and the code execute successfully. But when I add an input variable in ScriptTask, the code will not execute correctly.

Correct execution:

Wrong execution:

Note: This problem is just happened with the above code. I tested this problem with below code and executed successful.

execution.setVariable("varTest", "var1");

Problem 2

In desktop Modeler version 5.11.0, the code will execute correctly after removing added input variable in ScriptTask.

But in web Modeler that I run locally, even after removing added input variable, the code will not execute! After various reviews, I found that below code exists in xml of web modeler after removing input variable:

  <camunda:inputOutput />

By removing above lines from modeler xml, the code will execute successfully.