Solved

Pass job_id from one workspace to another


Badge +1

I have a scheduled workspace running in FME Server. Upon success or failure, it posts to the same topic that runs another workspace. This workspace uses the FMEServerLogFileRetriever to pull the Feature Written Summary and then uses the FMEServerNotifier to run another topic that sends an email with the Feature Written Summary as the content. Right now, I'm querying the last job_id run in the fme_job_history to get the info. But, if more that one job runs at the same time, the logic gets a little fuzzy. It would be better if I could just pass the job_id from one workspace to the next. Is this possible?

icon

Best answer by hollyatsafe 10 May 2019, 17:26

View original

6 replies

Userlevel 5
Badge +25
If you have the opportunity to upgrade to FME 2019 I would highly recommend that, the new Automations support this kind of setup.

 

In FME 2018 I would store the $(FME_JOB_ID) parameter in an attribute and then output that to a temp file that's being read by your second workspace or alternatively pass it through the notification system, which will take a bit of hassle. The problem is you have to run the FMEServerNotifier from within the workspace but at that point you don't know yet whether it's failed or not. In fact, if you trigger the topic that way that may actually set the 2nd workspace in motion while the first one is still running.

 

Badge +1
If you have the opportunity to upgrade to FME 2019 I would highly recommend that, the new Automations support this kind of setup.

 

In FME 2018 I would store the $(FME_JOB_ID) parameter in an attribute and then output that to a temp file that's being read by your second workspace or alternatively pass it through the notification system, which will take a bit of hassle. The problem is you have to run the FMEServerNotifier from within the workspace but at that point you don't know yet whether it's failed or not. In fact, if you trigger the topic that way that may actually set the 2nd workspace in motion while the first one is still running.

 

I'd like to upgrade to 2019. But, I just upgraded to 2018, in a highly available failover setup, when 2019 came out and there's no in place upgrade. It makes upgrading a pain.

Badge +1

Initially, I tried to use the Notification Service to send an email and include the link to the log file. While, i'd prefer the recipient not have to scroll the log file to see the Feature Written Summary, I was going to try it. But, while inquiring the privileges needed to open the job log link, I was told admin rights would be needed to view the log link. I can't do that. So, I'm trying to come up with a work around.

Badge +2

Hi @dave29,

Another option would be rather than use the notification service to trigger the second job you could create a Parent Workspace to run on the schedule that contains two FMEServerJobSubmitter transformers. In the first JobSubmitter set Wait for Job to Complete = Yes so the second job isn't ran until the first one is complete. One of the output parameters from the Succeeded/Failed transformer is _job_id so you could pass this value through to a published parameter in your second JobSubmitter.

 

Badge +1

Hi @dave29,

Another option would be rather than use the notification service to trigger the second job you could create a Parent Workspace to run on the schedule that contains two FMEServerJobSubmitter transformers. In the first JobSubmitter set Wait for Job to Complete = Yes so the second job isn't ran until the first one is complete. One of the output parameters from the Succeeded/Failed transformer is _job_id so you could pass this value through to a published parameter in your second JobSubmitter.

 

OK. I'll try that. Thanks.

Badge +1

Hi @dave29,

Another option would be rather than use the notification service to trigger the second job you could create a Parent Workspace to run on the schedule that contains two FMEServerJobSubmitter transformers. In the first JobSubmitter set Wait for Job to Complete = Yes so the second job isn't ran until the first one is complete. One of the output parameters from the Succeeded/Failed transformer is _job_id so you could pass this value through to a published parameter in your second JobSubmitter.

 

The FMEServerJobSubmitter worked for what I was trying to do. I ended up adding the FMEServerJobSubmitter to my workspace that calls the FMEServerNotifier. It was easier to pass the Job_ID this way.

VDM_CrimeAnalysis_Master.fmw

Reply