Wednesday, September 6, 2023

#987 OIC Integration Dependencies - who calls what?

This is a question I often get asked by customers - "Can I have a report of my integrations, listing their dependencies?"

e.g. Integration 1 invokes ATP and then another integration via local invoke.

Simple with the OIC APIs - let's start with a simple integration flow - 


Here I have a REST Trigger as source and 2 targets - 

1. ATP - Write2ATP
2. LocalAsync3 - Local Invoke

I create an OIC integration that will use the OIC Factory apis to get this information.

Here is the integration I created to retrieve the information - 




This integration invokes the following factory apis - 

























Firstly, Retrieve Integrations - then I take the id returned and use it in Retrieve an Integration

I test the apis in Postman, before implementing the integration - 

Here is an extract from the Retrieve Integrations response - 

As you can see - the connection structure contains the salient info.




But let's use the 2nd api - the key is the id found here - 


So, with this id, I invoke the 2nd api - Retrieve Integration -  

/ic/api/integration/v1/integrations/AA_EF_ASYNC2|01.00.0000?integrationInstance=myOICInstance

Here we get more detail - note the connections structure - this lists the 2 connections explicitly used in the integration, namely the REST Trigger and the ATP invoke. But what about the local invoke? EF_ASYNC2 invokes EF_ASYNC3.

This info is in the endpoints section - 



  Here I see - 















In OIC, COLLOCATED always refers to Local Invoke. Note the name attribute - I set this in the integration to LocalAsync3 - I edit the integration AA_EF_ASYNC2 and change the name to that of the integration being invoked - 






Adhering to such a simple naming convention for local invokes allows me to plot the dependencies using the OIC factory apis. 

My integration simply logs this data, naturally, I could, also write this to a file.






Tuesday, September 5, 2023

#986 OIC3 Factory api - Confidential App Configuration

 I've covered the detailed setup of the IDCS confidential app for OIC in a previous post. You can check it out here.


There are two things that seem to trip people up, when trying out the factory api from Postman etc.

1. The url  - must be in the format - https://design.integration.region.ocp.oraclecloud.com/factoryApi?integrationInstance=yourOICInstanceName

So let's try out the factory api to retrieve OIC Projects - 


Looks good, now let's try the following factory api - 



2. Confidential App Setup 



















Friday, September 1, 2023

#985 Data Sync Strategies with the OIC SFDC Adapter

Back to the use case from the previous post - syncing users between SFDC and downstream apps. There are multiple approaches to getting the users from SFDC.


Scheduled Integration

This approach is useful if the business use case allows for changed user data to be collected on a regular basis. This could be daily, hourly etc. i.e. not real time.

1. Scheduled job using SOQL to retrieve users that have been changed since the last run. The field - LastModifiedDate - can be used or even the SOQL SystemModStamp field e.g. 

SELECT AboutMe, AccountId,Alias, BadgeText, BannerPhotoUrl, CallCenterId, City, CommunityNickname, CompanyName, ContactId, Country, Department,Division,Email, EmailEncodingKey, EmployeeNumber,Extension,Fax, FirstName,IndividualId,IsActive,  LanguageLocaleKey,LastLoginDate, LastName, ManagerId, MobilePhone, Phone, PostalCode, ProfileId,SenderEmail, SenderName, Signature, State,Street,Title, Username, UserRoleId, UserType, LastModifiedDate  
FROM USER
WHERE SystemModStamp >= LAST_N_DAYS:1

LAST_N_DAYS:1 - gives me any changes from yesterday.

I test this query in the adapter wizard - only Julius Martov, the user I was working on yesterday is returned.


I can, of course, add an integration parameter - 


and use this in the query - 














SOQL is - 

SELECT AboutMe, AccountId,Alias, BadgeText, BannerPhotoUrl, CallCenterId, City, CommunityNickname, CompanyName, ContactId, Country, Department,Division,Email, EmailEncodingKey, EmployeeNumber,Extension,Fax, FirstName,IndividualId,IsActive,  LanguageLocaleKey,LastLoginDate, LastName, ManagerId, MobilePhone, Phone, PostalCode, ProfileId,SenderEmail, SenderName, Signature, State,Street,Title, Username, UserRoleId, UserType, LastModifiedDate   FROM USER WHERE LastModifiedDate >= &dateLastRun

The query parameter appears in the mapper and can be set to p_dateLastRun.











Final step in the integration would be to update p_dateLastRun.



 


App Driven Integration

This is appropriate for near real-time requirements. In this case, an event in SFDC will trigger the execution of an integration in OIC. The SFDC adapter supports the following Trigger capabilities - 


Outbound Messaging

Essentially send a message to a service when a record is created/updated in SFDC. Let's implement this for the User business object - 

The adapter in OIC tells us what to do -

So off to SFDC...



I just select a couple of the User object fields. Also note the dummy url I set for the Endpoint URL. This will be replaced later.



 
I now add a workflow rule to ensure the message is only sent on User update - 



 I add rule criteria - e.g. only fire if country = "Ireland" etc.


I click Add Workflow Action -





The Outbound Message definition has been updated accordingly - 


I retrieve the wsdl, this will be required by the integration trigger configuration - 


I save this file locally - 


Back in OIC, I upload the wsdl to the trigger - 
























The adapter configuration is completed and I'm advised of the next steps -


I just add a Log action so I can test immediately -


I activate and pickup the endpoint url - 

I replace the dummy url I set for the Outbound Message in SFDC - 


I activate the rule, then change the alias for user - Julius Martov - 

The OIC integration is triggered - 

Streaming API

Streaming api is probably the way to go when implementing push from SFDC. According to Salesforce - Streaming API enables streaming of events using push technology and provides a subscription mechanism for receiving events in near real time

Check out my post here for a step by step description on how to implement such -