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

Allow more advanced conditions on triggers #88

Closed
dickmanp opened this issue Mar 18, 2016 · 2 comments
Closed

Allow more advanced conditions on triggers #88

dickmanp opened this issue Mar 18, 2016 · 2 comments

Comments

@dickmanp
Copy link

Need to be able to support both AND and OR operators on triggers (and possibly more advanced combinations). Currently if I want to run a recipe on 2 different data types, I have to create 2 different recipes that are exactly the same.

@dickmanp
Copy link
Author

dickmanp commented Jul 6, 2016

NOT operations would also be useful. Jared could also use this functionality.

@dfaller
Copy link
Contributor

dfaller commented Aug 1, 2017

Update both trigger JSONs (ingest and parse) to version 1.1 and accept two new fields under "condition":

"any_of_data_types" - optional array of strings that match the condition if the file has at least one of the data types in this array (must still match the "media_type" and "data_types" fields if provided for condition to match)
"not_data_types" - optional array of strings where the condition does not match if the file has at least one of the data types in this array

New JSON:

{
   "version": "1.1",
   "condition": {
      "media_type": "text/plain",
      "data_types": [
         "foo",
         "bar"
      ],
      "any_of_data_types": [
         "this_one",
         "or_this_one"
      ],
      "not_data_types": [
         "not_this_one",
         "nor_this_one"
      ]
   },
   "data": {
      "input_data_name": "my_file",
      "workspace_name": "my_workspace"
   }
}

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

No branches or pull requests

3 participants