Hello dear forum
Let me give you some context on the problem. I have a process that should check if a certain job is running, “ProcessA”, and according to some conditions (which are not relevant here) it should stop the orchestrator execution. Questions:
- In get Jobs use this filter
"State eq 'Running' and ReleaseName eq 'NameOfProcess'" - Output of get jobs is list of jobs…you can pass the output as listofjobs(0) to get the first matched matched job to stop using stop activity
cheers
Hi @jrmp
In the “Get Jobs” activity, use the “Filter” property to specify your conditions. For your case, you want to filter jobs where the process name is ‘ProcessA’ and the state is ‘Running’. You can set the filter like this:
“State eq ‘Running’ and ProcessName eq ‘ProcessA’”
This filter expression will retrieve jobs that match the specified conditions.
Use a “For Each” activity to loop through the filtered jobs obtained from the “Get Jobs” activity. In each iteration, you will have access to one job that matches the condition.
- Inside the “For Each” loop, use the “Stop Job” activity to stop the current job.
- Set the “Job” property of the “Stop Job” activity to the current job you are iterating over.
Thanks!!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.