Monday, April 21, 2025

#1068 - OIC 25.04 New Features - Auto Retry actions generation in detail

Introduction

This post covers the details of leveraging the above, what it does, and what it doesn't do.

Here's a very simple example, based on the following integration, which, incidentally, uses a couple of the other new 25.04 features -

As you can see, the integration invokes a decision service to get the discount to be applied to this order. It also checks if the order is large, e.g. greater than €5000.

Our store is selling Samuel Beckett t-shirts, so a €5k order is definitely suspicious. Large orders need to be approved, by a sales manager, thus the Process invoke.


Let's do a dry run, with a large order - 

Looks good, behaving as it should - 

Now let's try with a smaller order - this should return an error from Netsuite, as I have set the Sales Order status to an invalid value.


I will now add the retry logic, although it won't help us fix this invalid data issue. However, I just want to detail what will be generated and what you may need to do afterwards to complete error handling. Begin by adding the retry logic - 

The basics of what's generated are discussed in my previous post.  

Net, net - default is to retry 3 times -

let's test this out - 

So what happened here? Well the first action in the integration is setting a return status - 


Checking the activity stream - I see 3 attempts to insert the new sales order into Netsuite - 

The logic is simple - the error is thrown back to the Fault Handler that has been generated for you. It checks if the max number of retries has been reached. If so, the integration just continues processing.

Naturally, that is not what I want, so I add supplementary error handling here in the Otherwise branch -

The mapping is as follows -

Type and Title are hardcoded. The other fields get their data from the following source - 

I could also have rethrown the fault to a global fault handler, so it's up to you how to handle this.


Net, net - the auto generation of retry actions, does just that. You may need to augment what has been generated, with your own fault handling logic.


Summa Summarum

This is a very valuable new feature in 25.04, so do check it out, it will save you time and effort. For those interested - Samuel Beckett, probably the most unread winner of the Nobel Prize for Literature, was born in Dublin, Ireland in 1906 and died in Paris in 1989. I can highly recommend him to those of you who appreciate Kafka and my own good self (check out my works on Amazon). Try his book, Murphy, to start with; written in the 1930s, it may appear dated to begin with, but it does deal with the meanings of lives in a very humorous manner.





 













 


   

No comments: