Introduction
The post covers the remaining Actions you can leverage, when creating your integrations.
Error handling
I covered error handling in an earlier lab, but just to recap - OIC integrations each have a Global Fault handler, to which you can add Scope fault handlers.The default action of the global fault handler is just to rethrow the fault - we saw this in the createOrder example, where the ORCL DB adapter was used to insert an order into a database. I generated a Primary Key error in the DB, by tying to insert an order with a duplicate order number. The Global Fault hander, did it's work and delivered the fault received from the adapter, back to the client. We also met Throw new fault, when the scope error handler handled the adapter error received from the DB and created a new app specific error, along with a more user friendly error message.
Logic
For each
This used for processing iterators e.g. an order with multiple order lines. We've met this action before -
Noe how this is configured - you specify the repeating element, in our case, the order lines. You then give a name for the current item e.g. currentLine.
Parallel
This allows one to process items in parallel e.g. an incoming order needs to undergo 2 checks - legal check and credit check. Each of these checks is implemented in a separate integration. From a business perspective, these checks can be done independently of each other, so we can use the parallel action here.
Scope
We have already used the Scope action in our order processing example.
Scopes allow us to organize related actions together, they can be collapsed, thus making our diagrams more readable. They can also be used to process faults thrown by actions within the scope itself.
Scopes know what they are invoking and know what type of errors the target apps can throw. Default error handlers are available for these. Here's a simple example where I use the Fusion adapter to get account details -
While
this enables the execution of a loop, while a condition is still met. Let's go back to our order lines example -My request payload contains an order with 2 order lines.
I create the following variables at the start of the orchestration -
The While logic is banal -
Call
The call actions allow you to call other services -
File Server
OIC comes with it's own sftp conform file server and this action makes it very easy for you to interact with it. You could, of course, use the OIC FTP adapter to do this, but why make more work for yourself? Some setup is required for this to work, that is discussed in a previous post.Let's check out which folders I have -
Note the minimum age setting, setting this can help you avoid picking up large file, before they have been fully written to the file server.
I hardcoded the input directory above, however, this can also be set via the map action -
I add the file server action again in the For Each -
Write File - allows us to write the file to another file server folder.
Move File - move file from folder A to B.
Get File Reference - allows us to get a reference to the file, in order to be able to read it and process it further.
Delete File - now I wonder what this does.
I will go into more detail about this action and how it works with the Stage File action in a future post in this series.
Integration
The Integration action allows us to call an integration e.g. integration A processOrder calls integration B shipOrder. These calls are internal, i.e. they do not go outside of OIC. Which integrations you can call is dependent on the following -
1. you can call integrations within the same project
2. you can call integrations from other projects that have been created as shareable
3. you can call integrations that are in the global space, i.e. not part of a project.
By global space, I mean integrations created via -
JavaScript
We have covered this action already, suffice to say - import your JS libraries into your project and then invoke their functions via this action.
OCI Object Storage
Object Storage can be used for a variety of purposes e.g. as inexpensive long-term storage for documents etc.Think of Buckets as directories and objects as docs you store in that directory. Naturally, you can store anything in a bucket.
End
Stop
Concludes a fire and forget (async) integration. The work is done, so stop.
No comments:
Post a Comment