Skip to content

Allow processors in root PG, fix json literal block and controller service regex#25

Open
ghost wants to merge 2 commits into
masterfrom
unknown repository
Open

Allow processors in root PG, fix json literal block and controller service regex#25
ghost wants to merge 2 commits into
masterfrom
unknown repository

Conversation

@ghost

@ghost ghost commented May 17, 2016

Copy link
Copy Markdown

Trying to import this template results in a number of errors related to:

  • processors in the root process group. The import of templates with processors in the root process group fails because such a process group is internally know as 'NiFi Flow' but cannot be reached by that name through the API. This change fixes this issue by setting, depending on the pgName, the correct path in _changeProcessGroupState().
  • literal json blocks are not correctly accepted with toPrettyString(). I replaced those calls with toString(). Look for the '|-' string in sample_template.yml for examples of where this error occurs.
  • the controller service name regex lookup fails when a function name is used in the name. For instance a name like ${event_type:toLower():equals('ad')} cannot be looked up and will result in an error. I changed the regex to accept any name, except ones that hold :, ( or ) characters.

This is my first attempt at using Groovy, and my first ever pull request, so please let me know if there's anything missing/wrong :-).

- processors in the root process group. The import of templates with processors
in the root process group fails because such a process group is internally know
as 'NiFi Flow' but cannot be reached by that name through the API. This change ff
ixes this issue by setting, depending on the pgName, the correct path in _changee
ProcessGroupState().
- literal json blocks are not correctly accepted with toPrettyString(). I replacc
ed those calls with toString(). Look for the '|-' string in sample_template.yml
for examples of where this error occurs.
- the controller service name regex lookup fails when a function name is used inn
 the name. For instance a name like ${event_type:toLower():equals('ad')} cannot
be looked up and will result in an error. I changed the regex to accept any namee
, except ones that hold :, ( or ) characters.
@aperepel

Copy link
Copy Markdown
Owner

Hey @jvanbemmelen thanks for this PR! I will take a look at these in the next few days. Your groovy-fu is not bad at all, keep them coming :)

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

Successfully merging this pull request may close these issues.

1 participant