camunda / feel-scala

FEEL parser and interpreter written in Scala
https://camunda.github.io/feel-scala/
Apache License 2.0
119 stars 46 forks source link

Add built-in function to generate an UUID #796

Closed michaelarnauts closed 2 months ago

michaelarnauts commented 5 months ago

Is your feature request related to a problem? Please describe. We use UUID's a lot in requests and match with them in replies, so being able to generate a UUID from within FEEL itself would be a huge benefit.

Alternatives are generating one with a Service Worker, or even requesting one from an online source with the REST connector, but these look like aweful alternatives.

As requested here: https://forum.camunda.io/t/built-in-function-for-uuid/35018/14

Describe the solution you'd like

Being able to do =UUID() to create an input variable with an UUID.

// function signature
uuid(): String

// usage
uuid()    // -> "7793aab1-d761-4d38-916b-b7270e309894"
uuid()    // -> "df09d5c2-e9f0-432d-9027-aaa5db56b8b5"

Related issues

saig0 commented 5 months ago

@michaelarnauts thank you for raising this issue. :+1:

I added a function signature and examples for the solution.

tiesebarrell commented 4 months ago

We have a similar situation, where we need to generate unique correlation information for outgoing calls from job workers and being able to generate a UUID from a FEEL function as an input variable would be ideal to support that instead of having to resort to other means as mentioned.