Triggering an Event with the SOAP, HTTP and REST services
If the client calls are coming from outside the cluster that is running Pega Customer Decision Hub, you can use the SOAP, REST and HTTP services to trigger Events.
Using the built-in SOAP and HTTP services
Pega Customer Decision Hub provides built-in support for triggering events with the SOAP and HTTP services. The following ryles are available:
- Rule set - PegaMKT-Engine
- Name - MKTKafkaEvents
- Value - true
The following URL provides the WSDL for your application's Event handling SOAP Service: http://<host>:<port>/prweb/PRSOAPServlet/SOAP/PegaMKTDataMktEvent/Services?WSDL
The following is an example request triggering the AccountOpened Event, passing in the Customer's ID, their location (latitude/longitude), and information about the Event:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:even="EventPayload" xmlns:urn="urn:PegaRULES:SOAP:PegaMKTDataMktEvent:Services"> <soapenv:Header> <even:EventPayload>?</even:EventPayload> </soapenv:Header> <soapenv:Body> <urn:EventPayload> <CustomerID>JR</CustomerID> <EventName>AccountOpened</EventName> <EventType>Branch</EventType> <Latitude>42.9613</Latitude> <Longitude>-71.4798</Longitude> </urn:EventPayload> </soapenv:Body> </soapenv:Envelope>
Using a REST service
Pega Customer Decision Hub does not provide a built-in REST service to trigger events. However, you can define one in your rule set layer and configure it to write to the Stream data set, similar to how the HTTP or SOAP services do it. For an example, see the entry point activity HandleHTTPEvent under PegaMKT-Data-Event.