Giter Site home page Giter Site logo

Expression Resolver about amplication HOT 7 CLOSED

yuval-hazaz avatar yuval-hazaz commented on May 1, 2024
Expression Resolver

from amplication.

Comments (7)

yuval-hazaz avatar yuval-hazaz commented on May 1, 2024 1

Can you provide 3 example use cases?

All uses cases (currently) are in a workflow.
Some background:
During the flow, several data objects may be available in the context - a customer record that was
fetched from the DB, a result of a sub process, some values that were provided as an input and so on.
The creator of the flow should be able to make decisions based on the context, and also be able to use the data in context.

example 1:
Check if the customer age based on his data of birth is larger then a given input.
Return @DataDiff(Years, Context.Customer.DateOfBirth, Now()) > Context.Input.AgeToCompare
Example 2:
Use two separate input parameters to set the customer phone number
Return Context.Input.AreaCode + "-" + Contxt.Input.PhoneNumber
Example3:
Check the returned value of a sub process to determine what to do next
Return Context.SubProcessResults > 5

Some of the basic decisions and data manipulation can be done using other tools like the "Decision Table" but for more complex scenarios the developer will need the Expression Resolver

from amplication.

yuval-hazaz avatar yuval-hazaz commented on May 1, 2024

Which language should we use?
Should we resolve on the client with the existing context or on the server? (probably server)
Should we allow full language features (e.g. if, then) or just expressions that resolve to a value?

see this: https://github.com/TechnologyAdvice/Jexl

from amplication.

yuval-hazaz avatar yuval-hazaz commented on May 1, 2024

@iddan please see if you have any input for the discussion

from amplication.

iddan avatar iddan commented on May 1, 2024

Can you provide 3 example use cases?

from amplication.

iddan avatar iddan commented on May 1, 2024

Other option I'm familiar with: https://www.npmjs.com/package/@axa-ch/json-logic-js

from amplication.

iddan avatar iddan commented on May 1, 2024

And: https://www.npmjs.com/package/@briza/illogical

from amplication.

iddan avatar iddan commented on May 1, 2024

This is a great discussion. We'll reopen it once this feature is getting more relevant but for now, I'm closing it.

from amplication.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.