-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stringify JSON objects #602
Comments
@aleksander-dytko please provide more input for this issue. What is the actual use case? What should the function do? In Zeebe, all variables are stored as JSON objects. In FEEL, we can access these JSON objects naturally as FEEL context objects. The result of a FEEL expression is always a FEEL type, for example, a FEEL context. |
given I talked to @aleksander-dytko about this, I should chime in here: in a BPMN task, we needed to convert a string into an object to subsequently access its' properties. This all in FEEL. task1: job worker executes and produces a task2: gets |
@aleksander-dytko: Another use case would be if a JSON string (coming from some database) is being passed to a DMN decision, e.g.
We are interested to evaluate some DMN rules on the jsonPayloadAsString values, so we need to transform it into a JSON object first. |
@vobu / @McAlm Thank you for providing your input. 👍 It seems that we need a new built-in function to parse a stringified JSON into a FEEL context/value. Do we need the parsing only for JSON documents (i.e. Note that this is different from the original requirement:
|
Hi, I also have a use case wher I'm calling the OpenAI REST API and ask to return a proper JSON string as a response. Then I need to turn that into a FEEL context. I think a new built-in FEEL function would be good. |
Related open OMG issues: |
Based on the previous comments, I suggest the following new built-in functions: Signature Parses a string into a FEEL value:
Serializes a FEEL value into a JSON string:
Examples
In the OMG issue, there is an interesting comment about time/date and time values with a timezone id:
@vobu / @McAlm / @vincentgiraud would this suggestion work for you? |
Hi @saig0 , that would work indeed. Thanks. |
@saig0 Have you considered using the |
@korthout good hint. But, I think that the In this TCK test case, a context is returned as
Yes. There is an open issue here: #650 I fixed this issue in the version |
I updated the issue description to focus on producing a JSON string of a FEEL value. I moved the parsing part into the issue #825. |
Is your feature request related to a problem? Please describe.
During a conversation with a customer, they mentioned that it would be great to be able to structuralize JSON object with FEEL expression to stringify it.
Describe the solution you'd like
A new built-in function to return a JSON string of a FEEL value, like
JSON.stringify()
.Related issues
EDIT: I updated the description to focus on producing a JSON string and to propose a new built-in function with examples.
The text was updated successfully, but these errors were encountered: