Inbound requests from on-premise systems


Typically, data integration scenarios are run on a schedule, such as after business hours each day, to synchronize changes in data. These runs are planned to support large data sets but sometimes certain data is required to be sent to Salesforce when a change occurs in a backend system. Backend systems generally allow user code to run to perform custom business logic when data changes. This code can send a notification to another system so it can respond, also. 

Overcast supports receiving notifications from backend systems to trigger a scenario run.

Backend system triggers a data integration scenario

The operation flow for a triggering a run is:

  1. A user in the backend system makes a change to data.
  2. A data change event occurs and the system runs custom code to handle the change.
  3. The custom code will build a JSON payload with the parameters to match the scenario in Overcast for Salesforce. 
  4. The custom code sends the payload to the Overcast Execution Proxy.
  5. The execution proxy logs into Salesforce using the credentials in the payload. (Session caching is enabled.)
  6. The execution proxy inserts the parameters from the payload and runs the specified scenario.
  7. The operation result is returned to the backend system's call.
  8. The backend system should log the result of the operation. Any errors should be sent to an administrator. 
  9. The scenario runs and is logged in Salesforce.

Security

The Execution Proxy is firewalled off from the public internet. Send Vigience the public IP of the backend system (or the IP from which the request from the backend system will appear on the public internet.)

The service is secured with a CA-signed TLS certificate but backend systems may not recognize the root certificate. In this case, contact us and we can help you download the root certificate from the CA to install in your system.

There is no authentication with the proxy service itself. Instead, authentication is delegated to Salesforce.

Salesforce network security will block requests from unknown locations. Append a security token to the end of the password or add the Execution Proxy IP to your Salesforce network access list.

The Execution Proxy supports session caching to avoid hitting the Salesforce login rate limiter, the governor limit.

Service and API Details

URL: https://epgw.vigience.com:8443/Proxy/execute

Request/Response formats: JSON

Requires authentication: No
HTTP Method: POST

Firewalled: Yes, requires registration.

 

Request Header

POST https://epgw.vigience.com:8443/Proxy/execute HTTP/1.1

Content-Type: application/json

 

Example Request

a) for BAPI/RFC scenario

Example JSON is to run an SAP scenario for BAPI_CUSTOMER_GETLIST.

{
    "credentials": {
        "LoginUrl": "https://login.salesforce.com/",
        "Username": "salesforce user id",
        "Password": "salesforce password + security token"
    },
    "namespace":"overcast",
    "scenarioName": "MyCustomers",
    "inputs": [
        {
            "ObjectName": "MyCustomers_IDRANGE__c",
            "Fields": [
                {
                    "FieldName": "Sign__c",
                    "Value": "I"
                },
                {
                    "FieldName": "Option__c",
                    "Value": "EQ"
                },
                {
                    "FieldName": "Low__c",
                    "Value": "0000002002"
                }
            ]
        }
    ]
}


Example JSON is to run an SAP scenario for TABLE "KNA1".

{
    "credentials": {
        "LoginUrl": "https://login.salesforce.com/",
        "Username": "salesforce user id",
        "Password": "salesforce password + security token"
    },
    "namespace":"overcast",
    "scenarioName": "MyKNA1",
    "wherePredicate": {
        "ColumnName": "kunnr__c",
        "ColumnValue": "0000002002",
        "TypeString": "EQUALS"
    }
}

 

Example Response

a. for success

{
    "ErrorMessage": null,
    "InputSetName": "ExecutionProxy 20XX-06-06 14:51:31Z0",
    "ScenarioExecutionId": "a092800000WQ5xx",
    "Success": true
}

 

b. for error

{
    "ErrorMessage": "Login failed for user test@test.overcast.com",
    "InputSetName": "ExecutionProxy 20XX-06-06 14:52:54Z1",
    "ScenarioExecutionId": null,
    "Success": false
}

 

Limitations

This service supports running data synchronization scenarios only.

Real-time integration and Salesforce Connect scenarios are not supported.

 

Example: How to access from SAP

This sample scenario describes how to synchronize customer data by using an SAP trigger.

 

Step1.  Setup SSL Certification on SAP

 

  Download SSL Certification of the Overcast service from Browser. 

  URL:  https://epgw.vigience.com:8443/Proxy/test/hello

 

 Import SSL Certification to SAP

 Transaction code: STRUST

 

 

Step2. Create a scenario in the Overcast application. 

 

   Scenario name: MyCustomers

   Integration scenario type: Data synchronization

   BAPI/RFC:  BAPI_CUSTOMER_GETLIST

 

Step3. Create ABAP Code (Reporting program)

 

REPORT ZV_EXECUTE_SFDC_ASYNC_REST.

data:   lo_http_client    type ref to if_http_client,
        lo_rest_client    type ref to cl_rest_http_client,
        lo_response       type ref to if_rest_entity,
        lv_url            type string,
        lv_body           type string,
        lv_error_text     type string,
        lo_root           type ref to cx_root,
        lv_http_status    type string,
        lv_reason         type string,
        lv_content_length type string,
        lv_location       type string,
        lv_content_type   type string,
        lv_response       type string,
        lo_request        type ref to if_rest_entity.

  lv_url = 'https://epgw.vigience.com:8443/Proxy/execute'.
  concatenate '{"credentials":{"LoginUrl":"https://login.salesforce.com/","Username":"your Salesforce user id",
"Password":"your password + security token"},'
              '"scenarioName":"MyCustomers",'
              '"namespace":"overcast",'
              '"inputs":[{"ObjectName":"MyCustomers_IDRANGE__c","Fields":[{"FieldName":"Sign__c","Value":"I"},
{"FieldName":"Option__c","Value":"EQ"},{"FieldName":"Low__c","Value":"0000002002"}]}]}'
              into lv_body.

  try.
      cl_http_client=>create_by_url(
      exporting
        url                = lv_url
      importing
        client             = lo_http_client
      exceptions
        argument_not_found = 1
        plugin_not_active  = 2
        internal_error     = 3
        others             = 4
    ).
    catch cx_root into lo_root.
*      cs_response-log = lo_root->get_text( ).
  endtry.

  try.
      create object lo_rest_client
        exporting
          io_http_client = lo_http_client.
    catch cx_root into lo_root.
*      cs_response-log = lo_root->get_text( ).
  endtry.

  lo_http_client->request->set_version( if_http_request=>co_protocol_version_1_1 ).

  if lo_http_client is bound and lo_rest_client is bound.
    "Set Payload
    lo_request = lo_rest_client->if_rest_client~create_request_entity( ).
    lo_request->set_content_type( iv_media_type = if_rest_media_type=>gc_appl_json ).
    lo_request->set_string_data( lv_body ).

    try.
        lo_rest_client->if_rest_resource~post( lo_request ).
      catch cx_root into lo_root.
        lv_error_text = lo_root->get_longtext( ).
    endtry.

    lo_response = lo_rest_client->if_rest_client~get_response_entity( ).
    lv_http_status = lo_response->get_header_field( '~status_code' ).
    lv_reason = lo_response->get_header_field( '~status_reason' ).
    lv_content_length = lo_response->get_header_field( 'content-length' ).
    lv_location = lo_response->get_header_field( 'location' ).
    lv_content_type = lo_response->get_header_field( 'content-type' ).
    lv_response = lo_response->get_string_data( ).
  endif.


if sy-subrc <> 0.
    write: / sy-subrc.
    write:  'error'.
else.
    write: / 'SUCCESS'.
    write: / 'HTTP Status: ', lv_http_status, ' ', lv_reason.
    write: / lv_response.
endif.

 

Step 4. Trigger the ABAP program and view logging in Overcast Monitoring tab.