I’m trying to log messages depending on the situation and I’m currently using Terminate Workflow activity to end the process. However, this results in the process status to appear as faulted in Orchestrator, although the process has indeed been finished. How do I do the same but instead log it as a message and exit the sequence but without using a system exception error? Do I have to use a Try Catch or something similar?
Try Catch isn’t really the right way to do this. What you need is for your automation to reach the end and have no more activities to process. If you’re using Terminate then the job has not finished, it has terminated before it finished.
Why/where are you using Terminate that you want the automation to be done? Post screenshots of your flow.
But how do I end the process if the log message activity simply logs the message and continues downwards. There is no timeout option for it. I want to log the message and end the process without continuing the rest of the activities. It seems like there is no other option but to wrap around another activity. If you can show a demo, that’ll be perfect.
Again, you need your automation to reach a point where there aren’t more activities to process. If there are times where the rest of your activities should process, and times where they shouldn’t, then that’s the purpose of flow control activities like If, Switch, Else If, or Flowchart.
Inserting a log message inside an If, Switch, Else If, or Florchart won’t stop the rest of the activities from executing. What I want to do is the same like the Terminate Workflow but without showing a popup message. Simply to log it in the Output panel.
As I said, create a new project and select the Transactional Process template to see one way of doing this, using a Flowchart. Another is a simple If statement with the rest of the activities in the Then branch, and nothing in the Else branch. If some condition is true, process the rest of the activities, otherwise just end because there’s nothing else to do.
Have you done the free training on the UiPath Academy web site? It covers things like this.
I don’t like using Flowcharts. I’m more accustomed to process sequences.
The If and Else won’t stop the whole process no matter where the log message is placed. I said to provide a simple demo or video and you still can’t do that. No offense, but you’re NOT really much helping out. Thank you anyways for trying to help.
Flowcharts are how you organize your sequences into discrete sets of steps and control which ones are processed. It’s the correct way to do what you want to do, sorry you don’t like it.
Again, it’s not about the Log Message. It’s about all the activities that come after it. You put those in your Then, and nothing in your Else. The If condition controls whether you want those activities processed or not. When the condition is false, those activities aren’t processed and since there’s nothing in the Else, the job simply completes successfully.
I am, actually. You’re just being your usual stubborn self.
Sure did. For the third time, the Transactional Process template shows you.
I think you’re the one who’s stubborn dear. You can’t provide a simple demo file for download which almost everybody does here in the forum if things get complicated to understand or require debugging. But it seems like you like rejecting anybody who tries not to go your own ways. Believe it or not, I’m not trying to provoke a war here but I really do not quite get what you say sometimes which is very funny because from what I tried, nothing is working. And yes, I’m an experienced RPA developer. Thus, it is why I was asking for a sample demo.xaml. I don’t quite get it why you refuse to provide one when 99% of the community actually do which is an extremely basic thing to do. Anyways, since that’s what you call “help”, I’d like you to stir a different direction dear because you’re obviously not helping in any way possible. And I hope your next reply will be a descent one, else you can count on it that I’m blocking you off this time once and for all. You waste someone’s time more than you actually help lol.
But if you are still looking for other ways using sequences only…
Then did you try using the approach that was mentioned earlier of having try catch all around… or around the terminate activity…
One more way is use if condition and do all of your process in the then side and on the else side you can have your log message…for conditions you can use checking if previous steps are completed or not…so as ther eis no code after else it would be terminated…
I already tried the Try catch and If else activity to no avail. That still doesn’t prevent activities underneath it from executing. It would have been 100x much easier if a simple demo was provided but too bad no one bothered to show a real demo. The process should completely end as if pressing F12. Let me rephrase my title a bit more:
HOW TO TERMINATE A PROCESS WORKFLOW WITHOUT SHOWING AN ERROR MESSAGE? THROW AND RETHROW BOTH ARE USED FOR DISPLAYING SYSTEM ERRORS WHICH IS NOT WHAT I WANT.
Hope that clarifies what I’m trying to achieve here.
I agree with some of the earlier comments. Gaining a better understanding of flow control, whether that is flow charts, state machines, the REFramework or all of the above, is something I would also recommend. These tools will help you design and build better solutions.
Without going into that any further, from what you’ve said it sounds like we have a scenario something like this:
Where ‘No Code’ is where you want to Terminate your process. However, if you don’t use the terminate workflow activity at this point, the ‘Even More Code’ section is still executing. As one would expect.
There is no single activity that will ‘terminate’ your process and achieve what you want without an exception. To do that, the logical flow of your code needs to reach a point where this is no more code.
For example, if you wanted the sequence above to ‘terminate’ at the Else branch, then you would simply move the ‘Even More Code’ box into the Then branch like this:
This way, when the Then branch executes, your code would run as normal, but when the Else branch executes, that would be the end of the process.
Assuming your scenario is not as simple as these scribbles, and you may be invoking this sequence as part of a larger process, please share how you have built your process. Is it REFramework? Single .xaml file? Multiple .xaml files? Can you share a screenshot of your code where you’re currently trying to use the terminate workflow activity?
This really sounds more like a design question than anything else. How to redesign your process so that in this scenario you speak of, your process logically reaches its end (i.e. where no more code exists).
I completely 100% understand what you’re trying to explain in here and that’s a piece of cake thing that everybody knows. My project is 20x more complicated and I cannot share it in here unfortunately because it’s highly confidential. The only reason I asked is to check and see if there exists an activity similar to the Terminate Workflow that does the same thing by stopping the entire workflow, but instead of displaying an error popup box, it will instead log a regular message in the output panel. What you mentioned summarizes this entire post which is what I wanted to know.
So the real answer is that there isn’t any activity in UiPath that allows logging for a message without showing an error unless the sequence of all the activities have done executing. (which can be put inside an If).
Since that feature is unavailable and my workflow is more complicated than that, I’ll have to unfortunately stick to the Terminate Workflow for now because too much nesting inside IFs is not so practical for me. I wish people in the community read the initial main post carefully first prior to answering irrationally because the comments are off-subject from what I needed to know.
Any work around or a suggestion was provided based on the initial question itself…
And it is not about providing any workflow…if the previous post was not there in this post you would have see the same explanation…because that is what is being told from first… and you being a experienced developer is understood that you might know…but thw question asked was also this
You want to log a message depending on situation…now the question is how does bot know the situation …thw answer would be when you give two routes to it…how can you givw two routes …it can be done through a if condition or a flow chart…
Flow chart was proposed because that way it is easier but may be your complex workflow might be already build and it might be difficult to modify now…so you are looking for sequences only…and in sequqneces if you need to log mesaage based on situation ,then by definition…it is called as if condition…
I guess the line is pretty clear in saying have all your code on then side and only log mesaage on else…
But never the less…if this is the only ask …as you want an activity only to do it like terminate workl
Flow but to log sucess then yes you have no other activity as you already understood…
Yes I only use sequences as I personally prefer it more than flowcharts as a design structure. However, like you mentioned, the only way to achieve a log message and terminate the workflow without a system error exception in sequence structure is to put all the code in the Then side of the IF and have the log message on the Else side I do get it. However, I was hoping to see if it was possible to do it without the use of nesting as it would have been much easier to get to a specific place without opening many too sequences and activities. Hope you get what I mean. Cheers.