SK SKYVVA Documentation

68. Different ways to add custom logic for the inbound processing.

Learning Objective: After completing this unit, you’ll be able to:

Introduction

There are different possibilities for inbound custom processing. To process structured, unstructured,raw data we can use custom processing.

What are the different way to use custom processing?

Apex class is used for custom processing. There are four different ways to inbound custom processing:

Basic Processing Steps:

[aux_code language="javascript" theme="tomorrow" title="" extra_classes=""] Message   ->  Workflow   ->   Mapping   ->  Operation

[/aux_code] In Custom Processing with old way:  we always response to give back the message type structure which contain the Salesforce Id and SKYVVA message Id. Customer need to write the complete code for all processing steps Pass raw data to custom class for processing: When we get unstructured data which are not xml, csv or json at that time we need to create custom class . The data can be raw text and do not follow any format. Therefore we cannot parse and create messages. In this case, we pass the raw data to the customer class and the custom class will do everything itself e.g. parse the data, create and post messages. Operation type - apex class: In new version we added new Operation type = Apex class. which is to execute the posting processing after the mapping step Custom Processing with new way: This replace the old way completely and we are very flexible to add custom logic at any place. Customer has the possibility to plug-in between the step or replace the different SKYVVA step. Difference between processing ways:

1. Inbound custom processing implementation with apex class

To extend some functions of integrate inbound processing extends skyvvasolutions.IProcessCustomAbs and implements skyvvasolutions.GisOdbgIntegration.IProcess Methods are order process integration of custom processing and could be overridden if required

follow the given steps to use apex class: Step1: Create apex class

[su_box title="Warning" box_color="#F7DC6F" title_color="#000000"]“Custom Processing Class”: provide full name of your custom processing class (including namespace if any). Format: [namespace.]classname eg: namespaceX.ClassX (if there is namespace in the salesforce instance) or ClassX (if no namespace)[/su_box] Step 2: Create Integration Step3 : Create Interface

[su_box title="Note" box_color="#2a8af0" title_color="#000000"]“Custom Processing” checkbox: indicates if the interface uses the custom-processing implementation[/su_box] Step4 : Do mapping. Step5: upload data manually Step6: Check result on message board You can not see related to link here to check detail as this interface is used custom processing. Step7: Check uploaded record and its details on dev console.

2. Pass raw data to custom class for processing with custom code

When we get unstructured data which are not xml, csv or json at that time we need to create custom class . The data can be raw text and do not follow any format. Therefore we cannot parse and create messages. In this case, we pass the raw data to the customer class and the custom class will do everything itself e.g. parse the data, create and post messages. The unstructured data are for example binary data, windows ini file etc. Step1: Create Integration Step2: Create Interface

Step3. Create custom class

[aux_code language="javascript" theme="tomorrow" title="" extra_classes=""] **public with sharing class RawDataCustomProcessing extends AbstractIntegrationV3 { public override String messageProcessing(){ System.debug('>>>>>>RawDataCustomProcessing>messageProcessing>dtoRequestBody: '+dtoRequestBody); //do raw data in dtoRequestBody return 'ok'; } public override IServicesUtil.IMessageResult createMessage(AbstractIntegrationV3.DtoRequestBody dtoRequestBody, AbstractIntegrationV3.DtoStructure dtoStr){ return null; } } **[/aux_code]

4. Call Webservice:

3. How to use Operation type = Apex class to custom processing ?

In Apex, user can define top-level classes (also called outer classes) as well as inner classes, that is, a class defined within another class. You can only have inner classes one level deep. follow the given steps to use apex class: Step 1: Create Integration Step 2: Create interface

Step 3: Create this class is used for Apex Custom class on Interface and Click on wrench icon and click on Setup.

Step4: Upload data manually.

done
Open this article in the interactive viewer →