Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# Pattern Matching Examples

Some pattern matching example helps to understand pattern matching better.

## Simple Correlation

Collects Order and Fulfillment events based on their Customer IDs.

    define pattern /OrderTracker
    using /Order as order and /Fulfillment as fulfillment
    with order.customerId and fulfillment.customerId
    starts with order then fulfillment

## Simple Temporal Correlation

Collects Order and Fulfillment events based on their Customer IDs such that Fulfillment occurs within 10 minutes of placing the order.

    define pattern /OrderFullfilmentSLA
    using /Order as order and /Fulfillment as fulfillment
    with order.customerId and fulfillment.customerId
    starts with order then within 10 minutes fulfillment

A pattern instance is created when the Order event arrives. If a corresponding Fulfillment event does not follow within 10 minutes of the Order event, then the Failure listener is triggered. If the event does arrive on time, then the Success listener is invoked.

## Duplicate Suppression – Store and Forward

Collects related events of the same type that share the same correlation ID.

    define pattern /ShipmentAggregator
    using /Shipment as shipment
    with shipment.destinationState
    starts with shipment
    then within 2 hours repeat 0 to 49 times shipment

This pattern aggregates at most 50 Shipment events within a span of two hours. it uses the event's `destinationStat`e as the correlation property. When the first shipment event arrives, the pattern instance is created. Then the timer starts and the pattern instance waits for two hours, accumulating a maximum of 49 more shipment events.

Did you find this helpful?

YesNo
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO BusinessEvents® Enterprise Edition

Copyright © 2004-2024. Cloud Software Group, Inc. All Rights Reserved.