Unica Campaign integration with Callout Process Box

From V12.1.5 onwards, Callout process box will be available to users. Callout is a generic Process Box which enable users to plug in custom logic based on a pre-defined interface. The main purpose of Callout Process Box is to connect with any third-party custom logic written by customer, based on provided interface. Callout PB functionality comes with a light weight, secure and robust spring boot application which is used to keep track of multiple callouts across flowcharts.

Platform Configuration:

A new node named ExternalCallout has been introduced under Affinium|Campaign|partitions|partition

It consists of below properties:

CalloutApplicationURL : URL of the external-callout application (eg: http://localhost:9003)

AsmUserForCalloutSecret : User with which we would be configuring the data source

DataSourceWithCalloutSecret : Datasource name

Other than these properties ExternalCallout has a template named ExternalCalloutTemplate at child level. Admin needs to use this template to configure their custom callouts.

The template has below fields:

New category name : Callout Name (used to identify the callout further in Callout PB)

jarPath : JAR location of Customer's implentation of callout.

mainClass : Implementation class name (this is the class name inside JAR , which has implemented the ExternalModellerCallout interface)

dataFileLocation : Directory name where callout PB's input & output files would get created (Base location would be: InstallationDirectory\Campaign\partitions\partition\externalCallout\data)

So if user specifies SampleCallout as the dataFileLocation the files for this particular callout

will be created under (InstallationDirectory\Campaign\partitions\partition\externalCallout\data\SampleCallout)

Datasource Configuration

Go to users and select a user which was provided in property AsmUserForCalloutSecret. Add a new datasource to user as mentioned in property "DataSourceWithCalloutSecret" & use the secret key as password.

Format of Secret key should be like below :
  • Secret key size should be greater than or equal to 256 bits
  • Eg : A11cx@#g91@A91zN@@x103

The secret key should be provided for attribute "callout.campaign.key" later while running the command for starting callout application.

File System

After Campaign 12.1.5 is successfully installed, user can see a new folder named externalCallout created under InstallationDirectory\Campaign. User needs to manual copy this folder and place in the respective partitions, in which they want to use Callout PB's functionality. For example: If user intends to run Callout PB in partition1, they would need to copy the externalCallout folder to InstallationDirectory\Campaign\partitions\partition(1).

Samples: This folder consists of the interface ExternalModellerCallout which users need to implement. Also, this folder consists of some sample code for users to get an idea of how to implement the given interface. Users can also use the TestCallout.jar (which outputs card category based on salary) provided in samples folder to get an idea of the entire flow. testInput.csv is a sample file to be used as input while running TestCallout.jar.
Note: The sample codes are just for reference and not intended to be used in production.

external-callout.jar: The spring boot application responsible of handling and keeping track of status of multiple callouts at once.

To run external-callout.jar use below command:

java -Dcallout.campaign.key=<DatasourcePassword> -jar external-callout.jar

This command expects a system property named callout.campaign.key whose value should be similar to the password of the DataSource name (DataSourceWithCalloutSecret) we gave in the platform configuration (Affinium|Campaign|partitions|partition|).

application.properties. : This file is used to configure Campaign URL, port on which we need to run this spring boot app, and partition name Camapaign URL is what you configured under Affinium|Campaign|navigation|serverURL