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.





 













 


   

Monday, April 14, 2025

#1067 OIC 25.04 New Features - File Server Events

With the 25.04 release, OIC events have been augmented to support File Server. The following file server events are supported -

  • File created
  • File deleted
  • Folder created
  • Folder deleted

Subscribing to the Folder Created Event


Create a new integration - 


Activate and test, by adding a new folder via FileZilla - 

Subscribing to the File Created Event

Same as above, I just choose a different event - 

Activate and test, by adding a new file to the NewOrders folder via FileZilla - 

Check out the activity stream - 

Here is the payload received from File Server - 

{"action":"file_create","name":"700Orders.json","path":"/home/users/yourUser/NiallC/NewOrders","size":83791,"extension":"json","source":"urn://fs/sftp","type":"file","time":"2025-04-14T08:35:57.703Z","metadata":[{"key":"createdBy","value":"yourUser"}]}

All of the above fields are self-explanatory, at least I hope so.


Subscribing to the File Deleted Event




Subscribing to the Folder Deleted Event


Delete the NewOrders folder - 

Very easy to use - now to some filtering - 

Filtering Events


In this case, I am only interested in files with the format - ordersnnn.*.

The following filter should work - 

{"type":"jq_filter","filter-def":".data.name | startswith(\"orders\")"}



Let's test this out - 

Now I try with an orders file - 

The filter can be augmented to check for the folder - 

{"type":"jq_filter","filter-def":".data.path==\"/home/users/yourUser/NiallC/NewOrders\" and (.data.name | startswith(\"orders\")) "}

Summa Summarum

Many customers have been asking for this feature, with 25.04 you have it!