I have a use case where , robot need to download the attachment from email at 4pm sharp.
Sender , subject is fixed .
I have already set up o365 email to get email and download attachment .
Now business team wants bot should wait till 4.10pm … if no email then send business exception to them.
If email exist then check attachment ,if no attachment send business exception.mail.
If attachment exist then … do further manipulation …
My ques ~
Can I use file path as transaction ?
I mean I know the name of the attachment . Which will be fixed.
So I will add in queue that path of local folder file…
For that 1 path…In process part I wil read email … and future things.
Use Retry Scope and put your Get Mail activity inside it. Configure the Retry Scope Number of retries property to 10 and Retry Interval to 00:01:00.
This will keep checking for 10 minutes and if still not found the email it will throw system exception. Surround this retry scope with Try Catch and in Catch catch section catch this exception and throw it as Business rule exception.
As per business team , mail wil definitely will come at 4am . But if not bot should check 10more min.
Sooner is better as they have sla for that process if bot didn’t run they will manually do so they want notification …
Yes linear but then when they pull report of queue for some dashboard , that’s why without q process again will not come in reort n it has to always treated separate so…Adding 1 transaction…Also I will make use of default retry mechanism also if in middle it fails with SE.
I m more comfortable with q process.
Easy to send BE mails too …
So, please once again guide me . Is it fine to add transaction or still u suggest linear.
You can add one more state in process
Name it as wait or delay state
Now if your get transition data reciived nothing got to this state and here add condition to check the time
If it is 4.10 and the is email retry is false go to load queue again or connect to steps where u will check email and set the flag value to true
If not 4.10 wait for give delay if 10 min again check time and if 4.10 and flag is false
Connect to check email and set the flag value to true
Now have one flag in process as is email retry
Now this flag will be false by default and now when u will wait for 10 min
Now the transition which is going back to load e-mail there check this flag if it’s true in transition condition
Now if again data is not there it will go this delay state where this flag is true so it won’t go inside the delay or retry logic from there it should go to end state
You need to manage the transition condition correctly for this and it will solve your problem !
to retry after 10 minutes you can go for retry scope and add 00:10:00 as time interval property of retry scope and inside the retry you can use get mail activity filter mail with subject and get the output variable of mailmessage and in condition section you can use check true to check if the mail message output is >0
you can also simply get mail and if not found use delay activity for 10 minutes and get mail again if found process it , if not throw business rule exception and sent notification to business unit or the user.
sure you can use the queue and use the attachment path where you save your attachment as queue item, which can be processed by other performer process and this is best approach.
I would suggest you to use reframework and adapt the reframework to handle that queue item even if it is one item this is best way to have exception handling and logging and many benefits of reframework
What you can do is if mail is not found xan add one more new queue otem with postpone as 10 mins or directly postpone the current item to 10 mins so that t can trigger the bot in 10 mins witg quwue trigger…if auccessful add an item for next day 4am and have queue triggers enabled
This way the bot need not wait but will start again after 10 mins as the item in wueue will be available