I know that Automatic Activities already have retry mechanisms (for when exceptions are raised inside, and that is exactly my scenario). However, I need to allow the user to retry the execution of this activity whenever it wants.
I've tried using conditional starts to execute the AA by using ActivityStart, but it creates another instance of the AA, leaving behind the other one that contains the error status executing the retries (and I can't stop it).
How can I explicit execute an Automatic Activity in a action flow?
Unfortunatly (as far as I know) there is no current api that allows that. But it looks like a nice addition for the BPT_API extension.
Can you detail a bit the use case for having to retry an activity?
The main question here is: the process is being designed in a way that failures are common? Or they are rare ocasions but you need to retry them faster than the normal tries?
If you are designing a process where its usual to have a fail point that usually needs reties, a good alternative is to use a Wait instead of a Automatic Activity. If you end the OnClose callback with an "Abort Activity Change Exception". When that happens the expression in the Timeout property is recalculated and if that date is in the future the Wait is re-scheduled to the new timeout.Waits are a bit more flexible than automatic activities (since you can call explicitly the ActivityClose action) but behave just like them, you just have to implement your logic on the OnClose and play a bit with the Timeout property.