postEvent
postEvent(String
sessionID, String
eventName, NameValuePairImpl[]
eventParameters)

The postEvent method enables you to execute any event defined in the interactive channel.

*
sessionID—a string identifying the session id.
*
eventName—a string identifying the name of the event.
*
*
eventParameters—NameValuePairImpl objects identifying any parameters that need to be passed with the event. These values are stored in the session data.
If this event triggers re-segmentation, you must ensure that all data required by the interactive flowcharts is available in the session data. If any of these values have not been populated by prior actions (for example, from startSession or setAudience, or loading the profile table) you must include an eventParameter for every missing value. For example, if you have configured all profile tables to load into memory, you must include a NameValuePair for temporal data required for the interactive flowcharts.
If you are using more than one audience level, you most likely have different sets of eventParameters for each audience level. You should include some logic to ensure you are selecting the correct set of parameters for the audience level.
*
You can only pass one treatment code per event. If you do not pass the treatment code for an offer contact, Interact logs an offer contact for every offer in the last recommended list of offers. If you do not pass the treatment code for a response, Interact returns an error.
*
There are several other reserved parameters used with postEvent and other methods and are discussed later in this section.

Any request for re-segmentation or writing to contact or response history does not wait for a response.

Unless specified with the UACIExecuteFlowchartByName parameter, re-segmentation runs all interactive flowcharts associated with this interactive channel for the current audience level. The getOffers method waits for re-segmentation to finish before running. Therefore, if you call a postEvent method which triggers a re-segmentation immediately before a getOffers call, there may be a delay.

Return value

The runtime server responds to postEvent with a Response object with the following attributes populated:

*
*
*
*
Example

The following postEvent example shows sending new parameters for an event which triggers re-segmentation, and a way to handle the response.

sessionId is the same string to identify the session used by the startSession call which started this session.

String eventName = "SearchExecution";

NameValuePair parmB1 = new NameValuePairImpl();
parmB1.setName("SearchString");
parmB1.setValueAsString("mortgage");
parmB1.setValueDataType(NameValuePair.DATA_TYPE_STRING);

NameValuePair parmB2 = new NameValuePairImpl();
parmB2.setName("TimeStamp");
parmB2.setValueAsDate(new Date());
parmB2.setValueDataType(NameValuePair.DATA_TYPE_DATETIME);

NameValuePair parmB3 = new NameValuePairImpl();
parmB3.setName("Browser");
parmB3.setValueAsString("IE6");
parmB3.setValueDataType(NameValuePair.DATA_TYPE_STRING);

NameValuePair parmB4 = new NameValuePairImpl();
parmB4.setName("FlashEnabled");
parmB4.setValueAsNumeric(1.0);
parmB4.setValueDataType(NameValuePair.DATA_TYPE_NUMERIC);

NameValuePair parmB5 = new NameValuePairImpl();
parmB5.setName("TxAcctValueChange");
parmB5.setValueAsNumeric(0.0);
parmB5.setValueDataType(NameValuePair.DATA_TYPE_NUMERIC);

NameValuePair parmB6 = new NameValuePairImpl();
parmB6.setName("PageTopic");
parmB6.setValueAsString("");
parmB6.setValueDataType(NameValuePair.DATA_TYPE_STRING);


NameValuePair[] postEventParameters = { parmB1, parmB2, parmB3, parmB4, parmB5, parmB6 };

/** Make the call */
response = api.postEvent(sessionId, eventName, postEventParameters);

/** Process the response appropriately */
// check if response is successful or not
if(response.getStatusCode() == Response.STATUS_SUCCESS)
{
System.out.println("postEvent call processed with no warnings or errors");
}
else if(response.getStatusCode() == Response.STATUS_WARNING)
{
System.out.println("postEvent call processed with a warning");
}
else
{
System.out.println("postEvent call processed with an error");
}

// For any non-successes, there should be advisory messages explaining why
if(response.getStatusCode() != Response.STATUS_SUCCESS)
printDetailMessageOfWarningOrError("postEvent",
response.getAdvisoryMessages());


IBM Unica Interact
 
8.5.0
For more information, see our support and community site: Customer Central