Monday, August 6, 2018

#643 OIC Integration 101 Part II --> Orchestrations and Monitoring

In this post I will cover Orchestrations and the whole area of Monitoring.
This  post pre-supposes you are familiar with the basics of OIC, covered in the previous post.

So what do Orchestrations offer me?

More flexibility, when it comes to integration design.

Let's look at the 2 patterns currently available -

App Driven Integration - here is a simple scenario -
The API (Trigger) accepts in an Organization object.
The Integration logic is as follows -
1. Check if the Organization already exists
1.1. If Yes - then return a message with the existing Organization ID.
1.2. If No - then create the Organization and return a message with the new Organization ID.

Simple stuff - I will re-use the Service Cloud Connection from the previous post.

I create the new Orchestration -

I drag and drop my REST trigger (creation of this is covered in the previous post)

I define the API as follows -

My integration now looks like this -

We see the Trigger above, then a Map - to set the response and then, finally, the return.
Now to add some functionality.

I want to check of the Organization already exists in Service Cloud.The 
Service Cloud adapter supports both the standard SOAP APIs as well as ROQL - RightNow Object Query Language - think of this as SQL for Service Cloud (RightNow was the original name of the product).

I will use ROQL to check whether the Organization already exists.

I drag and drop my Service Cloud adapter after the Trigger, and configure as follows -  

Select Query Object -

My integration is now as follows -

Now I add a Switch after CheckIfOrgExists -

This switch essentially implements the IF condition.

I click on 1 -

The condition is simply a check of the count of organizations returned by the ROQL.
If it is greater than zero, then the organization already exists.

Note: I use the count function here

So what should happen here?

1.1. If Yes - then return a message with the existing Organization ID.

Ok, so let's do that. I add a MAP action in this path.

I map the Org Id -

I set the status message to the following text -

My integration now looks like this -

Now to the Otherwise path - the logic here is 
 If No - then create the Organization and return a message with the new Organization ID.

Again, I drop the Service Cloud adapter into this path and configure as follows -

Now I edit the Map to CreateNewOrganization -

Now I need to add a MAP to return the response from this path -
first the newly created Org Id.

Now the status message - again hardcoded -

Here is the integration now -

Note the 1 in the red circle top right. It is telling me I have 1 error.
Any idea what this is?

I need to do the following -
1. Implement the MAP before the existence check. Note how that MAP is still white.
The implemented maps turn to blue.

I can also delete the final map, as it is now superfluous.

Finally, I just need to set the Tracking value.
This value, usually from the request payload can be used for monitoring and auditing purposes -

I now close the model and then activate the integration -

I pick up the url and then test thru Postman -

Note: I have to specify my OIC user/pwd in the Authorisation tab (Basic)

a second test -


Top level Dashboard for the helicopter view -

Activity Stream - details on what is going on -

Tracking - integration flow by flow view -

Let's look at the top flow - design at runtime experience -

No comments: