Stop Job Activity Example

Hi All,

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”

Thanks,

Hi @mayank_26

Check this post

Thanks
Ashwin S

Hi @AshwinS2

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.

Hi ,

Is there any solution I can get to this issue ?

Or should I contact Technical Support ?

Thanks,

Hi @mayank_26

Please do raise a ticket to technical support

Thanks
Ashwin S

Hi @mayank_26,
Can yo please share if you found any solution for the same.
Thanks

Hi Aishwarya,

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.

I hope this helps. :slight_smile:

7 Likes

Does anyone have an example XAML of this activity?

what input provide in stop job activity in job field

Hi @Kirti123

Hi @mayank_26,

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!

@loginerror @Pablito

Any idea guys?

Thank you…

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.

Hi there,

I think I’m following what you suggest but now I’m getting a ‘Bad request’ error. Usually is something not spell in the right way I think.

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!

Regards,

Hi @loginerror,

This is what I’m getting on debug time:

OrchestratorJob {
EndTime=[10/13/2020 19:25:52],
EnvironmentName=null,
PackageName=“JobStop”,
ProcessName=“JobStop”,
Source=“Agent”,
StartTime=[10/13/2020 19:25:35],
State=Faulted
}

•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?

Regards,

Hi @loginerror,

Did you see the last 2 reply?
Any idea?

Regards,

Could you make sure that your Robot user has these permissions, as mentioned above by @mayank_26

@MARIODC Did you ever find a solution to this?

Hi @Jarzzz ,

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.

Stay Safe!

1 Like