Best practice to code dispatcher bot

Hi experts
Need your consultation to design dispatcher bot. I have a scenario where bot read system generated e mail body and scrape aprox 25 data from that body e mail body is structured format but sometime data line is up and down
And the data come like this format
key1: value1
Key2: value2

Can you please suggest me how to design dispatcher bot ?

Should i add validation part in dispatcher also like numeric and null check ?

Hi @Aleem_Khan ,

If the data is in structured format taking out data from the body should not be a challenge(Regex/Scrapping/Substring can be used based upon scenario). As you are designing a Dispatcher Bot you can perform the actions and add the data to queue in the init state itself. You can specify if you are facing any challenge.

Thanks

Can i add validate the data in dispatcher code ?

@Aleem_Khan

You can add as many validations by using IF condition to maintain data quality before adding to the Queues

Hope this may help you

Thanks

1 Like

As I made custom re framework where dispatcher and perform in same flow. i just create another state machine to keep dispatcher flow and connected init to dispatcher by using boolean flag my question is here if bot have any system exception my transection move to end flow and if any business exception occur what should i do ?
How business notify that have business error.
Can you suggest me how to design custom re framework i really appreciate

Hi

Let’s go one by one

The approach that your using is absolutely fine
And there is no template written on stone and it’s all how we keep the code as simple as possible

And to have condition in dispatcher is highly recommended because right input has to be processed
So you can have validation part in that

Usually business exception if occurs there are two ways to handle

One of you want to retry that transaction again then route back in a way to process that again
Or
If you don’t want to retry and just notify business users on that transaction failure then I would suggest to keep track of all inputs in a excel with a column named STATUS
If any business exception occurs mark as Failed(Business Exception) under that Status column and continue with the next transaction

This will not stop the bot if any business exception occurs and you can also let know business users by sending this report via mail
So that they can resubmit or process them manually

This is applicable even if you retry that transaction and if it fails on retry as well

Hope this would help you

Cheers @Aleem_Khan

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.