Is it possible to map an input variable to a constant ? I mean, when doing the mapping we have to set the source which is a variable of the workflow instance and the target. Is it possible to put a constant value instead of the source variable ? For example, I want to add a variable ExceptionMessage to my workflow instance so I want to be able to set the source as the constant “Exception xxxx” and the target as ExceptionMessage.
Hi @nizare, I’m not sure about that, but I don’t think so. I usually do this using custom headers, which can be set to string constants. See the section “Building a Transactional Email Microservice” in this article: https://zeebe.io/blog/2019/10/nestjs-tx-email/
Hi @jwulf, thank you for your advice. Unfortunately setting the header won`t solve my problem. What I did to solve the day was to set some constants in my workflow instances, and later when I call my microservice using the http worker, I just map the constants to my target variables. This solved my problem. My workflow is very complicated
Happy that you found a solution that works for you!
We’re aware of the need of constants and will address them by introducing a new and more powerful expression language soon. Stay tuned
Great !! Looking forward to seeing new release and new features
Is this problem has been solved in any latest release?? i.e. any constant value mapping to a target variables.
Yes! Since 0.23.0, the
source of a variable mapping is an expression and expressions can also be literals (i.e. static values).
Thanks philipp for the update.
Maybe Zeebe modeler also needs to be updated to handle constants? I am on 0.9.1 (latest at the moment) and see this when trying to use a string literal:
Yes. There is an open issue for the modeler: https://github.com/zeebe-io/zeebe-modeler/issues/223