Monday, August 13, 2018

#646 OIC Integration 101 Part IV - Error Notification

Let's look at error notification at 2 different levels -

1. The OIC Administrator - she needs to be informed about errors in flows. Maybe they could be due to some enterprise resource not being available e.g. Connectivity Agent is temporarily offline.

2. The OIC Developer - he builds error handling into his integration flows. Error handlers could be used to execute compensating transactions, in the case of multi-step flows.

OIC Administrator view

The Notification Service notifies interested parties the system status on a regular basis and alerts them to service failures. Detailed system status reports include metrics on instances and runs processed by the system, including failures. Service failure alerts provide notification of system conditions that may result in unavailable or degraded system functionality. Select the desired reports and specify the distribution list. Use the Send Now option available from the Actions menu to send a report for immediate review.

As you can imagine, these are system wide settings, i.e. set once.

Service Failure Alerts

As you can see - my Agent is unavailable.

I can now start the agent -

The next report reflects this -

Tracking Metrics Hourly Report -

It is early in the morning and nothing is happening, as yet - 

Here is the report, after I have run some tests -

Error Reports -

Daily Reports -

OIC Developer view

Here is a simple orchestration flow that creates a new organization in Service Cloud.
First check is to see if the org already exists -

If so - I return the orgId and a relevant message - Org already exists. 
Otherwise  - create a new Organization -

As you see below - I create a Scope for the Organization Creation Invoke -

I have mapped the LookupName field to generate an error -

As previously mentioned, the CreateNewOrg is contained in a Scope.

Also note that we get a Fault Handler at scope level.

I can handle each of the listed faults individually or else opt for the Default Handler.

Here I add a Notification Action -

Note the parameters I create - these are for the following -

Now to the Global Fault Handler -

Again, I can leverage any of the Invokes / Actions available to me in OIC.

However, for simplicity sake, I will use a Notification Action.

The email is essentially the same -

However, I just leverage one of the error fields -

I activate the integration and test -

Here is the result from a Monitoring perspective -

Here is the email I received -

The error is obvious -

   LookupName may not be set due to visibility restrictions while performing the operation: create
While processing Organization->LookupName(string)

Interesting to see that the integration flow is marked as successful, from a Monitoring perspective -

This is quite correct, the fault has been caught.
However, let's go back to the integration and add the following, to bubble up to the Global Fault Handler -

Note, I added a Raise Error action

I activate the integration and test -

I check Error Monitoring in OIC -

I check my email - and see the 2 emails
- one from the Scope Fault Handler
- one from the Global Fault Handler

No comments: