Variable expressions

I’m reading the part about Access Variables in the documentation and was thinking if it’s possible to map the count of items in the list to a variable?

Variable: order: {“items”: [“item-1”, “item-2”]}
Expression: count(order.items)
Value: 2

Not right now. You need to do this in a worker. All the expressions in the Access Variables section have no mutation or calculation.

If you want to PR it in (or just understand how it works), see here: https://github.com/zeebe-io/zeebe/tree/develop/json-path

and here: https://github.com/zeebe-io/zeebe/tree/develop/json-el

1 Like

Thanks for clarification. Adding support for such mediation will most likely introduce complexity in the solutions we build. But on the other hand, without it the need for supporting workers will be high and that will also drive solution complexity, right?

You have to put the complexity somewhere, right?

I do agree that you are adding technical metadata to the payload, and potentially technical tasks to the workflow - both related to the orchestration of the process, rather than the process itself.

Other users have commented that putting technical tasks in the process diagram disrupts the conversation with business about the actual process.

And, this is what we have to work with atm… PRs welcome, and you can also open an issue requesting this feature here: https://github.com/zeebe-io/zeebe/issues. That provides a place for others to +1, which can influence future feature prioritisation.