GithubHelp home page GithubHelp logo

Comments (4)

gregeinfrank avatar gregeinfrank commented on July 28, 2024

@thomasWajs You can give an example of what you're trying to accomplish? You can pass in options to the select type like this:

@select_rule_variable(options=[1,2,3])
def some_number(self):
    return 2

Also - if you found a bug in business-rules-ui, we'd appreciate a pull request for a bug fix!

from business-rules.

thomasWajs avatar thomasWajs commented on July 28, 2024

It's not about select type for rule variables for conditions, it's about select parameter for actions :

@rule_action(params={"target_folder": FIELD_SELECT})
def classify(self, target_folder):
    target_folder.add_document(self.document)

In business-rules-ui, this case were handled in the original project, but not in your fork anymore. Before submitting any pull-request for the UI, it would be necessary to enable this feature in business-rules.

from business-rules.

gregeinfrank avatar gregeinfrank commented on July 28, 2024

Ah I see. Do you wanna take a stab at implementing it?

from business-rules.

thomasWajs avatar thomasWajs commented on July 28, 2024

I could take the time to contribute, but I'm concerned about the way to pass around these options.

The original business-rules-ui expected a dictionnary in the form

{'fields': [{label: "Email Template", name: "template", fieldType: "select", options: [
    {label: "Welcome Email", name: "welcomeEmail"},
    {label: "Followup Email", name: "followupEmail"},
    ...
]}

Which is not possible anymore since you modified the expected format to

'params': {'template': 'select'}}],

Which is way more restrictive. There's no way to specify distinct name/label, and there is no way to specify the options.
Any thought on reverting back to the original format ?

from business-rules.

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.