concept output event in category software development

appears as: n output event, output events, output event, Output event, An output event
Event Processing in Action

This is an excerpt from Manning's book Event Processing in Action.

  • Aggregate agent— This takes a stream of incoming event objects and produces an output event that is a function of the incoming events. It performs a multiple events in, one event out operation.
  • Compose agent— This takes two streams of incoming event objects and operates on them to produce a stream of output events. This is similar to the join operator in relational algebra, except that it joins streams of events rather than tables of data.
  • The agent specification includes the mapping or derivation rules that describe how the output event’s attributes are to be derived from the input. We refer to this as the derivation expression.

    Figure 8.8. A Translate event processing agent can be used to insert new attributes into the output event.

    In this example the EPA inserts the new attribute orderType with a fixed value (“Low”). It adjusts the value of the price attribute from the value supplied in the input event, and it adds a new attribute called total, computed from two attributes of the input event. The derivation expression in this example is made up of simple arithmetic assignments where the left-hand side of an assignment identifies an attribute in the output event, and the right-hand side refers to attributes in the input event. The syntax we have used is just for illustration. In practice, an event processing language may implement such translations as part of the language itself, as shown in examples later in this chapter. In some cases event processing platforms allow transformations to be written using conventional languages such as the following:

    Listing 8.1 shows an XSLT stylesheet that can be used to transform this input event to the output event.

    Listing 8.1. XSLT stylesheet performing the transformation
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" > <xsl:template match="/event"> <event> <orderType> Low </orderType> <price> <xsl:value-of select="round (100*//price div 1.15) div 100" /> </price> <total> <xsl:value-of select="//price * //numItems" /> </total> </event> </xsl:template> </xsl:stylesheet>

    This stylesheet uses an XSLT template to construct the output event. The <orderType>, <price> and <total> tags insert the corresponding XML tags into the output. The <xsl:value-of> elements fill in the computed values. Note the computation of price includes a rounding operation, as otherwise it would be set to the value 14.782608695652176.