Chaffelson / nipyapi

A convenient Python wrapper for Apache NiFi
Other
244 stars 76 forks source link

Prevent processors from overlapping #248

Open omkaringale opened 3 years ago

omkaringale commented 3 years ago

Description

Trying to prevent processors from overlapping when I run the code. I want the code to detect if there is already a processor in the location.

What I Did

processor_list = ['GetHTTP','EvaluateJsonPath','AttributesToJSON','PutMongo']
for key,proc in enumerate(processor_list):
            location_y = 300*i
            location_x = 500*(key+1)
            location = (location_x,location_y)

Urgency

Trying to automate a process flow which is still in development phase, so not that urgent

Chaffelson commented 3 years ago

Quite a while back I made a function for this, but forgot to bring it into the main project - actually I'm glad you reminded me. https://github.com/Chaffelson/nipyapi/blob/e3f74d1650941d1011bd44a581c13a4e63763a1b/nipyapi/agents.py#L170 That's where it is on the current branch if you want to use it directly now, I'll make a note to pull it into the next feature release.

Chaffelson commented 3 years ago

@omkaringale do you have time to look at the implementation I have suggested here to see if it helps your usecase?