com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links' is unknown.

Map Event Builder

Map Event Builder converts the events/streams from an input event adapter that supports Map input streams into an event stream that is compatible with the event processor. The event attributes are extracted using XPath expressions and converted to the type specified in the mapping before sent to the event processor.

You can configure through the management console as explained below or by manually adding an XML file as explained in step 5.

  1. Start the CEP, log in to its management console, select Event Streams and click In-Flows of the relevant stream.
  2. Enter details in the form that appears and click the Add Event Builder button at the end of the form. For example,
     
    The fields in the above configuration are as follows:

    • Event Builder Name : Property to uniquely identify an event formatter configuration
    • Input Event Adapter : The input event adapter used to publish events to the CEP. This drop-down list only displays the adapters that are already created. In this example, we select an Input JMS Event Adapter already created.
    • Topic : The topic to which event publishers send the events 
    • Input Mapping Type : Select map as the mapping type. This property changes based on the event adapter selected. It lists only the mapping types supported by a particular event adapter.
    • Advanced : Map the incoming events to the stream received by the event processor. Provide the necessary details in the input fields:
      • Enter the  Input Attribute Name , Mapped To  and  To Stream Data Type  under Properties

        For the correct properties to show, you must select an event adapter that supports Map mapping type.

        Here, If you not willing to add advanced mapping properties then map events needs to be in a format which can accepted by the CEP. Sample map event format accept by CEP is below. Corresponding stream definition which related to below sample event.

        StreamDefinition{
                streamId='loanRequestStream:1.0.0',
                name='loanRequestStream',
                version='1.0.0',
                nickName='loanRequest',
                description='Stream which contains events related to loan request',
                tags=null,
                metaData=[Attribute{name='tenant_id', type=INT}],
                correlationData=[Attribute{name='activity_id', type=STRING}],
                payloadData=[Attribute{name='clientPhoneNo', type=STRING}, Attribute{name='clientName', type=STRING}, Attribute{name='clientResidenceAddress', type=STRING}, Attribute{name='clientAccountNo', type=STRING}],
        }

        Here when sending map event, meta attributes need to prefixd with meta_ , correlation attribute needs to prefixed with correlation_ and payload attribute does not need any prefixes. For example,

        key : meta_tenant_id , value : 25

  3. After a builder is successfully created, you can change its configuration and redeploy it. To do this, click the Edit link associated with it. You can also click the other links associated with it to delete or enable statistics and tracing.
  4. An XML based editor opens allowing you to edit the event builder configuration from the UI itself, without having to edit the file in the file system. Do your modifications and click Update.
  5. Alternatively, y ou can specify an event builder configuration using an XML file and save it in <PRODUCT_HOME>/repository/deployment/server/eventbuilders directory, which is the event builder deployment directory. Since hot deployment is enabled, you can simply add/remove files to deploy/undeploy from the server.

    Create the XML file with the following Map based event builder configurations. Event builder implementation must start with <eventbuilder> root element and the namespace set to http://wso2.org/carbon/eventbuilder  as in the example below:

     <?xml version="1.0" encoding="UTF-8"?>
    <eventBuilder name="searchStatsMapBuilder" statistics="disable"
        trace="disable" xmlns="http://wso2.org/carbon/eventbuilder">
        <from eventAdaptorName="jmsAdaptor" eventAdaptorType="jms">
            <property name="transport.jms.Destination">SearchStats</property>
        </from>
        <mapping customMapping="enable" type="map">
            <property>
                <from name="ip"/>
                <to name="ip" type="string"/>
            </property>
            <property>
                <from name="username"/>
                <to name="username" type="string"/>
            </property>
            <property>
                <from name="searchKey"/>
                <to name="searchKey" type="string"/>
            </property>
        </mapping>
        <to streamName="searchStats" version="1.0.0"/>
    </eventBuilder>
com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.