Skip to content
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

Calculate variables from an api response? #46

Open
jelordreygulle opened this issue Sep 19, 2018 · 1 comment
Open

Calculate variables from an api response? #46

jelordreygulle opened this issue Sep 19, 2018 · 1 comment

Comments

@jelordreygulle
Copy link

Variables represent values in the system , but what if i wanted to compute the data not direct coming from the database but the data that came from an Api end point? where in i will just call the endpoint and parse the values and then do calculations based on the response result .Is the business rule capable for that?
Thank You.

@msscaroso
Copy link

You could call the api inside the variable definitation

class MyVars(BaseVariable)
    @numeric_rule_variable
    def variable_from_api(self):
        response = api_call()
        return compute_variable(response)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants