flowElement.getJobs() and invalid job ID
Posted: Tue Jun 29, 2021 9:48 am
Hi,
I'm trying to use the new flowElement.getJobs() method, so I have code very similar to the one in the documentation (jobsIds are stored in globaldata during jobArrived, I'm calling getJobs() in timerFired() entry point).
My problem is : how to deal with invalid jobID ?
Freddy said during a recent webinar that this should not happen, otherwise it's is a logic error in our code.
But in fact, I'm exactly in this situation after that an user delete a job in the input folder, from the Switch Designer.
I have no way to know that the job is not in the input folder anymore, may I?
So I can't remove this particular job from the globalData list.
Do you have a way to prevent such situation?
I don't know if it is possible, but I think that the getJobs() method should not throw an error if one jobID is invalid in the list.
Maybe it should answers by putting a "placeholder job" with a special "invalid job" state ?
Or at least, we should have information about the invalid jobID in the error object so we can act upon the globalData list ?
I'm trying to use the new flowElement.getJobs() method, so I have code very similar to the one in the documentation (jobsIds are stored in globaldata during jobArrived, I'm calling getJobs() in timerFired() entry point).
My problem is : how to deal with invalid jobID ?
Freddy said during a recent webinar that this should not happen, otherwise it's is a logic error in our code.
But in fact, I'm exactly in this situation after that an user delete a job in the input folder, from the Switch Designer.
I have no way to know that the job is not in the input folder anymore, may I?
So I can't remove this particular job from the globalData list.
Do you have a way to prevent such situation?
I don't know if it is possible, but I think that the getJobs() method should not throw an error if one jobID is invalid in the list.
Maybe it should answers by putting a "placeholder job" with a special "invalid job" state ?
Or at least, we should have information about the invalid jobID in the error object so we can act upon the globalData list ?