I have a requirement to allow users a 2-minute delay before an email is sent. In the app, the user puts all the email info into a popup, clicks save, and fires off a process. The first step in the process waits 2 minutes by setting its start date property to AddMinutes(CurrDateTime(),2), then sending the email. After the process starts I create a join record for the table record and the process ID. All this is working as expected.
With that process ID available, how do I allow users to terminate the process with the click of a button?
Hi @Daniel Johnson ,
do you have a representation of the email in your database (when user hits save, is the desired mail / the entered data saved in some entity?) Maybe your process is triggered by the create ? This could be a place where you simply also have a status, normal progression would be
Your user could break into this by allowing an extra state of 'cancelled'. Your process after the wait would have a decision on this state to know if it still needed to continue.
I think that's the simplest solution
Alternatively, you could add a conditional start to the process that gets triggered by the cancellation of the user and ends the process immediately, you'd need to somehow retrieve the process id matching the mail you want to cancel, but I understand from your question that you already have that ? This is a fancier solution where one look at the process flow will show clearer what is going on, and also the process logs will show more clearly what happened. This is probably more in line with how it is intended to be done.
It's been a while since I done anything with BPT, so I might have some of the details wrong, if you share an oml, I'd be happy to try out what I'm saying here.
Dorine
Thanks @Dorine Boudry ! I eventually came to this same conclusion about the entity representation, and now there's just a simple filter to check the status of that record before it's sent, and the button the user has access to just changes that status.
Hi
Can you try with below forge component process extension. It have one method for kill the process.
https://www.outsystems.com/forge/component-reviews/62
Thanks
Cv