Flow should go in End Process after invalid credential

Hi Friends,
I have one small query.
First of all i am trying to log in on ACME using my credential.if the credential is wrong then i have to send email and exit from automation.so for that i am using businessrule exception.
in catch block of init state i am using send outlook mail message activity to send the email and then flow should go in End process.
But i am able to send the email and after that my flow goes in Get transaction data which should not be happen.
How to go in End Process.

Regards

Hi @Rup_1

As you know there are two types of exceptions mainly. Application exception and business rule exception.

What happens with business rule exception is, they relate with the business logic and the constraints that the business has put in to handle their tasks. So most probably business rule exception would be to check whether a particular value is something that falls into their requirement, if this has happened we should do this and something like that. Mostly related with the data we handle within the automation project. Business rule does not have any concern on how the application should work. It only focus on the data and its values to make sure they fall in line with the business process.

So the question here, if credential is wrong application should end. This is about how the application should work. No data is involved here to have a business exception. So, it should be a application exception. So in your workflow have a throw activity to throw an application exception in this scenario and it will work :slight_smile:

Let me know if my explanation is confusing :sweat_smile:

3 Likes

Wouldn’t an invalid password fall under the BusinessRule category since it’s an issue with input that keeps a process from completing? Application Exceptions are typically issues with systems or applications, which when retried, they typically succeed (not always). But, I think if it’s input that is wrong, like a password, it should throw the BRE.

Now, the question is “how do you get an invalid password end and not perform every transaction item?”, regarding @Rup_1’s question.

I think to solve this, you will need to check the BRE message and compare it to your global message for the invalid password. For example, if businessRuleException.Message = config("Message_InvalidPassword").ToString

Then, you can direct it to the End state based on that condition.

This is a good point, because I think many developers should consider this too, so their process can end the Robot effectively. There might also be times when you just want a section of the process skipped that accesses that application, though, and continue everything else. Then again, maybe you just want it to go ahead and end anyway.

Additionally, if you are doing Multi-bot processing, then you got a potential situation where that wrong password could lock up the account, since each Robot will try to log in. So, I suppose, that the Robots should perform in a way where they know the password is wrong. I don’t know the best solution for this. Maybe, if you’re like me and use Start Job to perform Multi-bots, you can start the added Robots after you know the passwords are good to go.

Regards.

2 Likes

Hello Guys @ClaytonM @Lahiru.Fernando
if we see in Re Framework From Init Section to End Process flow goes only when System error Occur
so I think we need to throw system error to goes End Process Section

@Rup_1 After Send Mail throw Exception new Exception(“Invalid username or password”)

Thanks

3 Likes

True, that’s assuming you put every login script in the Init state. I can’t say I agree with that methodology though, but it’s true that the Init state will end before any transactions start.

2 Likes

Hello guys @ClaytonM @sandeep13

I have being thinking of the point @ClaytonM mentioned. We most of the time consider login as a application exception. I believe many developers are considering it the same way. And the REFramework also gets into end state with application exceptions.

However, the point @ClaytonM mentioned on getting the account locked by retries is a very good valid point. However, since the account login info is stored in the credential manager or orchestrator credential asset, it will not be changed with the time. So getting it right first time there is a option that we as developers consider most of the time.

I know there can be pros and cons… it’s a good point and great that we have across this discussion. There is something to learn from @ClaytonM all the time I come across a conversation with him :slight_smile:

A true MVP :slight_smile:

Thanks bro for your thoughts… it’s very valuable…

3 Likes

yes I also agreed with point @ClaytonM mention

3 Likes

Yeah @sandeep13 … little bit of thought… thinking about business and application exceptions… in my first comment i mentioned that business exceptions mostly relate with the data we process. And application exceptions are mostly with application specific things. So if we relate that point with @ClaytonM’s point, it comes to the same conclusion. After all, credentials are also a set of data we process right :slight_smile: So it should go as a business exception.

It’s a good learning point :slight_smile:

2 Likes