I have been working on utilizing the Get Jobs activity, currently I have it filtering looking for jobs that have the Stopped state in the last 30 mins then afterwards it will Start the job with the Start Job activity. There are specific errors that happen when an Citrix Environment is running slower than usual, causing an error to occur. What I would like to do is filter for those errors and then take start the job with this process I have been working on creating.
Thanks
I suggest looking over some of these posts: Search results for 'filter get jobs' - UiPath Community Forum
Also, check here for getting the logs through API: Possible to get the Job Log URL?
Iām not sure how to get the Logs from Robots or Job runs.
Here is what an OrchestratorJob variable can access, but probably wonāt help get the logs.
Iāve explored those options, Iām trying to get to the Indexof(Info,āAction failed to execute as expectedā) Jobs. Iāve tried putting that into the filter, but since itās not an option I can not access. I just did a query with swagger and I keep getting an error.
{
āmessageā: āAn organization unit is required for this action.ā,
āerrorCodeā: 1101,
āresourceIdsā: null
}
I know what my Organization Unit is, but I donāt know how to incorporate that value into the odata query? Would you know by chance?
Iām thinking that I may have to do a web api odata query to get the āinfoā and do some web scraping to find specific errors. Be a pain, unless I can filter through the Get Jobs activity lol
I appreciate your help again ClaytonM!!
1 Like
Iām not really familiar with API, enough to comment on this
Check this solution: Error 1101 in HTTP request - #10 by Andrei_Oprea
No worries, Iāve only seen one other post on here on this error, the original poster just need their Organizational Unit # and then they were good to go. I replied to that post to ask if they could put up a sample of how they āplugged inā the OU #. But the post is from January, weāll see I may hear back.
Another direction Iāve thought of is do you how to get the running job to identify itself? My thought is if there is a way that the job that is running throughās the specific error Iām looking out for I could put a Start Job activity in the Tryā¦Catch that the job is wrapped in. So if the specific error occurs it will start itself But Iām not sure how to make the job identify itself. I could plug in the name in an argument but we have like 85 jobs and have naming conventions for different environments, schedules etcā¦ It would have too many possibilities of failure.
Yeah, so there are some ideas I can share that you might think about.
Best approach is a Framework concept where you have retry attempts when certain errors occur. You can look at the ReFramework that is a template found in Studio. A robust process should catch errors and clean up the environment, then re-attempt to process the item. So, with this approach, you technically donāt need a robot manager to rerun the jobs. However, at the same time, this doesnāt prevent items from failing if all retry attempts failed for the job run.
Alongside this concept, you can utilize Queues that have built-in retry attempts for items. However, like I mentioned, an item could fail all its retries still. Which in that case, you would need to build in a postpone method somehow to change the Failed items back to New, so they can be processed on the next job run.
Additionally, you can get the ProcessName from the project.json file located in the same directory as the job run. So if you use Read Text File, then Deserialize json to an object, where you can get the name of process (ie jsonObj(ānameā).ToString). Then, you have the ProcessName. But, you also need the Environment if you plan on using Start Job. For Environment, I suppose you can use Get Jobs and filter it down to the job that is running or last ranā¦ alternatively, you can use a hardcoded value or Asset to store the Environment name to be used.
So those are some ideas also.
Regards.
1 Like
ClaytonM,
Appreciate your feedback! Iām working taking one of our common jobs that weāve cloned 40 times now and building it into a RE Framework. Iām working on making it easy to adapt, so that cloning will be easy to do for the client. My contract is up in a couple of months so I want to have something easy for them to modify.
Iām also still looking into figuring out how to use a web api odata query to get information about processes. I see possible benefits to still being able to use it at some point. I started looking into the HTTP Orchestrator activity. Seems like that might work for me to achieve what Iām after also.
Thanks again for your help!!
1 Like