Call Activity Variable Mapping with Modeler

Hi,
I use Camunda 7.17.
I have an main process with an embedded subprocess. I want to map a variable from the subprocess (companyprocess) to the main process (thesisprocess). But instead of the value of variable it maps the name of the variable. (currentCompanyDb_Id= “currentCompanyDb_Id” )

Here is a screenshot from the modeler:

I have one ejb (ThesisEJB) for the main process and one for the subprocess (CompanyEJB).
In the ejb of the subprocess there is a method called which saves a company and writes the id (long value) into the delegateExecutionObject
delegateExecution.setVariable("currentCompanyDb_Id", currentCompanyDb_Id);

In the next task of the main process (Firma als Thesisfirma speichern) I want to use the currentCompanyDb_Id, so I try to read it from delegateExecutionObject

Long currentCompanyDb_Id = (Long) variables.get("currentCompanyDb_Id");

but I get a number format exception and when I look in the variable store with the debugger I see, that the name “currentCompanyDb_Id” is saved instead of the value.
grafik

Can anybody help me?
Thanks a lot,
Nicole

Hello @NickiMueller ,

why are you combining out mapping and output mapping?

It should be sufficient to use an out mapping (without the local flag).

Also, I can see that your expression is incomplete as it misses the $ or # before the {}.

Could this be the cause of this behaviour?

Jonathan

Hi,

I found the error at another point. I gave an input at the next task und there I forgot the {}. Thank you for the hint!

Correct outmapping is:
grafik

Correct inmapping is:
grafik

Thanks!
Nicole

1 Like