Handling different retry parameters

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2016 01:01 PM
Hello,
I have to implement my process taking into account that some services can be retried (example : timeout while calling web services). The maximum number of retries and the delay can be different from a service to another one.
One designer suggested that we design this using the modeler and adding trivial branching/looping/exit. I disagreed because that was just going to make the diagram less readable because of non-business concern. Also Activiti is supposed to provide a retry mechanism, let's just re-use and not re-do.
1) Whats do you think about that ? Better to design it on the diagram or rather handle/hide on in the java side ?
2) How to actually use the retry mechanism provided by Activiti ? By default, there are 3 retries hardcoded. How to make a diffrent number of retries for each of my services ?
Best,
John
I have to implement my process taking into account that some services can be retried (example : timeout while calling web services). The maximum number of retries and the delay can be different from a service to another one.
One designer suggested that we design this using the modeler and adding trivial branching/looping/exit. I disagreed because that was just going to make the diagram less readable because of non-business concern. Also Activiti is supposed to provide a retry mechanism, let's just re-use and not re-do.
1) Whats do you think about that ? Better to design it on the diagram or rather handle/hide on in the java side ?
2) How to actually use the retry mechanism provided by Activiti ? By default, there are 3 retries hardcoded. How to make a diffrent number of retries for each of my services ?
Best,
John
Labels:
- Labels:
-
Archive
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2016 02:59 AM
Hi John,
After that you can hook into process parsing (see doc) to be able to use extension elements from the model during the execution.
Regards
Martin
1) Whats do you think about that ? Better to design it on the diagram or rather handle/hide on in the java side ?I do not know all requirements, but I would vote for now adding additional complexity to process model.
2) How to actually use the retry mechanism provided by Activiti ? By default, there are 3 retries hardcoded.See job executor configuration
How to make a diffrent number of retries for each of my services ?In that case you have to add it to the model (I would say as an extensionElement (see examples in the activiti source)).
After that you can hook into process parsing (see doc) to be able to use extension elements from the model during the execution.
Regards
Martin

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2016 09:02 AM
After that you can hook into process parsing (see doc) to be able to use extension elements from the model during the execution.
Im able to implements a new Parser (extending ServiceTaskParseHandler). I can see the retry values in "ServiceTask.fieldExtensions" then dont know what to do from there…
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2016 02:52 AM
Hi John,
I would say that the easiest way how to achieve is to change the behaviour where async tasks are executed. On this place new job is created
and retries are taken from the default values. Instead of default values you can replace them with the values from extension element.
Regards
Martin
I would say that the easiest way how to achieve is to change the behaviour where async tasks are executed. On this place new job is created
and retries are taken from the default values. Instead of default values you can replace them with the values from extension element.
Regards
Martin

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2016 12:39 PM
I would say that the easiest way how to achieve is to change the behaviour where async tasks are executedThat's what I ended implementing. For the record : it's about writing custom implementation of DefaultFailedJobCommandFactory.
Then after taking a new look, I realized that I could simply set the "failedJobRetryTimeCycleValue" property from a custom parse handler with no need to modify any async task behaviour. That custom handler has been set to the "customDefaultBpmnParseHandlers" conf property. Not sure if "postBpmnParseHandlers" would have been better a better choise. Do you know the purpose of the later ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2016 05:58 AM
no … historical reasons most likely…
