Expand all

package mw.testKitchen.EventFactory

This class is used to create events for sending to the Event Platform.

mw.testKitchen.ContextualAttributesFactory is used to retrieve the values of contextual attributes from the application. Note well that ContextualAttributesFactory is only used when the first event is created, i.e. if no events are created during the request, then no contextual attribute values are retrieved.

This class is a combination of methods in the MetricsClient class in repos/data-engineering/metrics-platform, both of which were written and maintained by the authors of this extension.

Constructor

new mw.testKitchen.EventFactory(contextualAttributesFactory)package #

Parameters:

Name Type Description
contextualAttributesFactory mw.testKitchen.ContextualAttributesFactory
Source:

Methods

newEvent(streamName, schemaID, contextualAttributes, action, interactionData) → {Object} #

Creates a new event to be sent.

The event will contain the following fields:

  • action
  • $schema
  • meta.domain
  • meta.stream
  • dt, which will be set to the current time in ISO 8601 format (including milliseconds)

If $interactionData is set, then it will be added to the event. If contextual attributes are requested and they are available, then they will be added to the event.

Parameters:

Name Type Description
streamName string
schemaID string
contextualAttributes Array.<string>
action string
interactionData Object

Returns:

Type
Object
Source:
Creates a new event to be sent.