SK SKYVVA Documentation

4. Sending data in real-time

This concept is about outbound interface processing. The real-time outbound interface can be done in different ways i.e Using a button, Using trigger, Using the process builder.

What is real-time outbound processing?

For outbound processing, we have two categories:-

Synchronous interface mostly has a response which means that we will create a response interface to handle the response. An asynchronous interface mostly doesn't have a response. But this is not true for all cases. We could have an asynchronous interface which has a response interface. In this case, the apex code doesn't wait and get blocked. The response will come back at a later time. In this case, we have an asynchronous scenario with an asynchronous response. But for the synchronous interface, we should always expect to have a response and the apex code is waiting as long as it will take time until the response is coming back. If the response doesn't come back at the allowed time e.g. 120 sec. then we will get a governor limit exception time out.

For the asynchronous scenario, we need the outbound message to reprocess it again. For synchronous scenario, we normally and mostly do not need the outbound message to reprocess. If the call for example to Google web service fails the user will issue the call again. This is true when the end-user carries the action. But what is when the action is not carried by the user but for example from a trigger or process builder process? In this case, a background process is the trigger of the action and if something going failed there is no user to repeat the action again. Therefore, in this case, we need an outbound message so that the reprocessing job or the user can reprocess the call again. Technically we can handover the interface processing to the future, queueable or batch apex.

How to build a real-time outbound interface?

The realtime outbound interface we can do in a different way:-

How to create real-time outbound Interface using Button:-

This feature uses our invokeCallout2() method. This method support   SAP, SAP-PI, SAP-R/3, SFDC2SAPPI, SOAP, REST adapter types. The response could be a text of JSON, XML, List> based on given flag parameters in CallOutControl and Apex of each adapter handle setting when execute callout.  InvokeCallout2() method support different mode:

  1. SYNC
  2. FUTURE
  3. BATCH
  4. AUTO

We get a real-time response in SYNC mode only. Input Parameters: -Integration name:  Integration Name

-Interface name:  Interface name

-ids:  Collection of sObject id

-Mode:  SYNC, FUTURE, BATCH, AUTO

CallOutControl Flag CalloutResponse (Attributes) SAP SAP-PI SAP-R/3 SFDC2SAPPI SOAP REST

returnJSONComplete true String payloadJSON no no no no yes yes

returnXml true String payloadXML no no no yes yes yes

returnListRecord true List> records yes yes yes yes yes yes

returnIMessages true

no no no no no no

actionDoIntegrate false Does not process interface invoke call In/Out

actionDoMapping true Does nothing with this flag

isCreateMessage false Does not upsert message only in mode SYNC, Otherwise message will upsert.

isBypassDML true Does not upsert messages, interface, log file

Pre-Requisite:-

Steps to create USecase: Step 1:- Outbound Interface:

We have to select fields on which we have to build the query. For example, here we have selected three fields  AccountNumber, BillingCity, and Name. And mapping data. Click on the outbound  interface to show detail and do mapping data as shown below:

Step 2:- Execute Apex code in the developer console:-

"The code and the picture is shown below"

[aux_code language="javascript" theme="tomorrow" title="" extra_classes=""]skyvvasolutions.CallOutControl c=new skyvvasolutions.CallOutControl(); c.isBypassDML=false; ListmyList = new List(); myList.add('0012v00002jxEQHAA2'); skyvvasolutions.IServices.invokeCallout2('Test_41','Test_Outbound',myList,'SYNC', c);[/aux_code] [su_box title="Note" box_color="#2a8af0" title_color="#000000"]Invokecallout2 two lines with different account id in once execute it will show one message is fail and one more message is completed. And if we execute invokecallout2 two line with the same account id in one execute it will show only one message is fail because it is duplicate. [/su_box]

Check it on message monitoring:-

How to create real-time outbound Interface using Trigger

In integration admin, there is a new tab called "SKYVVA Trigger" which allows the user to configure in a graphical user interface the following settings:

SKYVVA Trigger tab uses to generate script trigger automatic for Button and Apex Trigger. Go to “Integration Admin” tab > click on the tab “SKYVVA Trigger”

It can generate two kinds of the script:-

   1. Generate Script Trigger Button

2. Generate Script Trigger Apex

At the last select with Trigger Mode, button “Generate Script” will visible.

How to create real-time outbound Interface using Process builder

Process Builder is a Salesforce’s point-and-click tool that lets you easily automate if/then business processes and see a graphical representation of your process as you build. Every process consists of a trigger, at least one criteria node, and at least one action. You can configure immediate actions or schedule actions to be executed at a specific time. To keep things simple, this unit focuses on the most common process type: Record Change, which means the process, will start when the records are created or edited.

Select SKYVVA apex API

Add input definition Setting apex variable values: integrationName: integration name Interface name: interface name: isCreateCPRecord: True (False, if the value is not specified) recordIds: salesforce sObject.Id (i.e Account.Id)

You can test modification account from the screen and Save. I have executed mass update 10 account in developer console then got 10 CP records

You can edit the account on screen the save, then check the message on message-monitoring.

Open this article in the interactive viewer →