Zeebe modeler input/output mapping

Hello,
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.
Thank you

1 Like

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/

HTH
Josh

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 :slight_smile:

3 Likes

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 :wink:

1 Like

Great !! Looking forward to seeing new release and new features :smiley:

Hi Philipp,
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).

For example:

  • ="foo"
  • =123
  • =[1,2,3]

https://docs.zeebe.io/reference/expressions.html#expressions-vs-static-values

1 Like

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:

image

Yes. There is an open issue for the modeler: https://github.com/zeebe-io/zeebe-modeler/issues/223