Does anyone have an example of using the MonitorJobflow or MonitorGraph components where multiple jobs/graphs are being scheduled or otherwise executed in parallel and then monitored for completion by another job?
I’d appreciate any concrete example as I have the need to implement the same ASAP.
I probably should have mention this when I started the topic…
We have 2 jobflows that are executed independently from 2 separate scheduled and we’d like to find a way to start a third job to monitor them, i.e. the monitoring job is not the parent of either schedlued job so that pretty much rules out using the MonitorJobflow component. Then, we want the third job to execute a certain jobflow only when both of the 2 original scheduled jobs have completed successfully. The difficult requirement I have is that I can’t modify either of the 2 original schedules or the jobflows that they execute.
I see two possible solutions to this situation. Let’s say that the JobFlows you want to know the completion status are JF1 and JF2 and the one you want to execute is JF3.
First solution:
For both JF1 and JF2 make listeners L1 and L2 to write their completion status to a file, external DB or something similar. Then make a scheduler S1 to execute a graph G1 that checks the file for the completion statuses and based on this executes JF3.
Second solution:
Make a scheduler S1 that executes a graph G1 which gets execution history of both graphs using HTTP API and executes JF3 based on the result.