I am trying to handle exception and use Stop Job Activity of Orchestrator to stop a running Job if it finds an Exception.
Can anyone explain how Stop Job Activity works ? I have checked the Activity Details from Activity Section and also tried passing a Variable of OrchestratorJob Type but it still gives error that “The value for argument ‘Job’ is not set or is invalid”
I am aware of the difference between stopping an job and terminating it, killing it. I am not sure how this was marked as a solution there but this is not i am looking for.
I am not looking to stop job from orchestrator but i am seeking Robot to send this command to orchestrator when it finds the error.
Thus, if while running a process, an error is met, i have used stop job activity, which should stop that particular job in orchestrator.
First you have to use Get Jobs Activity to Get all jobs from Orchestrator. It will return an IEnumerable.
After that you can traverse through it so that it will get Orchestrator jobs and then you can use as Input for Stop Job Activity.
Also, the Robot role needs to have the create and edit rights on jobs, as well as view permissions on processes and environments.
As you suggested I got the IEnumerable and looping through it but not sure how to tell specifically to stop the Job I need it to stop. I ask because there could be many jobs with the same date and when I try to enter a name in the input property it states: value of type ‘String’ can not be converted into Orchestator job.
I wish the had given an example on the Documentation so one could know what/how name we need to enter!
You should use the job variable as input for another job related activities.
The way to do it would be to use a For Each activity, then set the type of the element to a job item, and then use the properties of that variable to find out what you want. With the right type of variable, the IntelliSense will give you suggestions of available properties.
JobRes: IEnumerable
jobCurrent: current job filtered by date and Process name which is a type of ‘Orchestrator Job’
used an an input in the ‘Stop Job’ property
FolderPath: current modern folder name
Not sure what else to use to let the ‘Stop job’ activity choose that specif job and make it stop!
•Now I’m using in the ‘job’ property the whole ‘item’ from the IEnumerable
•If I try to get the ‘Process Name’ from the ‘item’ it says you can use a ‘String’ with a IEnumerable
–Any ideas what/which/how one of these to use in the ‘Stop Job’ activity to make the same job currently running ‘stop’?
–What’s the deal then jeje?
Thanks for asking. I can’t recall at this point what happened then, either I went another direction or issue was not resolve. thank GOD! all my processes are running now and Orchestrator is good. The robots and users are configured the right way which in some cases may cause the situation, just general speaking.