Hi l.simonet,
Have you tried using a throw message event?
I think maybe it can be easier to achieve what you're trying to: you throw a message with a value you have defined there and you catch it on another process and you retrieve that value. You would simply need to configure on your throw message event your target process and element and the content of your message.
On the diagram side, it would be more explicit like this:
Hope this helps,
- Thalía