Unica Campaign integration with Callout Process Box

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)

Config parameters: Config parameters serve as inputs for the callout, allowing users to provide comma-separated key-value pairs. These parameters are integral to the external callout's implementation and can be accessed within the user's code. It's important to note that any addition or update of parameters necessitates restarting the callout application.

Example: value1=test, value2=demo, value3=300

In the above example, three parameters (value1, value2, and value3) are specified. These parameters become accessible in the callout's implementation, facilitating dynamic customization.
Note: As a good practice ensure each key has a unique name and avoid special characters.

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)

Mapping Fields : When creating a callout, you have an option to define a template for mapping fields. These fields serve as inputs to your callout's implementation and are accessible on the Callout PB for mapping.

The template has below fields:
  • New Category Name: Assign a category name for identification purposes in the configuration.
  • fieldName: Specify the field name that users expect in their callout. This field is case-sensitive and will be available for mapping in Callout PB.
  • fieldType: Define the data type of the field, which can be either "Text" or "Numeric."

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