Oracle® Fusion Middleware

Using Oracle Stream Analytics

12c (12.2.1.2.0)

E67758-01

October 2016

Describes how to use Oracle Stream Analytics to simplify the complex event processing.

Oracle Fusion Middleware Using Oracle Stream Analytics, 12c (12.2.1.2.0)

E67758-01

Copyright © 2015, 2016, Oracle and/or its affiliates. All rights reserved.

Primary Author: Oracle® Corporation

This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.

The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.

If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable:

U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government.

This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.

This software or hardware and documentation may provide access to or information about content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services, except as set forth in an applicable agreement between you and Oracle.

Contents

List of Figures

Preface

- Audience

- Documentation Accessibility

- Related Documents

- Conventions

What's New in This Guide?

1 Introduction to Oracle Stream Analytics

- 1.1 Oracle Stream Analytics User Interface

- 1.1.1 Sign In Page

- 1.1.2 Home Page

- 1.1.3 Catalog Page

- 1.1.4 Exploration Editor

- 1.1.4.1 Expression Editor

- 1.1.5 Streams Wizard

- 1.1.6 References Wizard

- 1.1.6.1 Working with Maps, Connections, Targets

- 1.1.6.1.1 Creating/Editing Maps

- 1.1.6.1.2 Creating/Editing Connections

- 1.1.6.1.3 Creating/Editing Targets

- 1.2 Components of Oracle Stream Analytics

- 1.2.1 Stream

- 1.2.2 Reference

- 1.2.3 Exploration

- 1.2.4 Topology Viewer

- 1.2.5 Pattern

- 1.2.6 Map

- 1.2.7 Shape

2 Runtime Environment

3 How to Set Oracle Stream Analytics Preferences

- 3.1 General Preferences

- 3.2 View Mode Preferences

- 3.3 Notifications Preferences

- 3.4 Catalog Preferences

- 3.5 Exploration Preferences

- 3.6 Exploration - Live Output Stream Preferences

4 Working with Streams

- 4.1 Understanding Streams

- 4.1.1 Metadata

- 4.2 Creating a Stream

- 4.3 Editing a Stream

- 4.4 Restoring a Stream

- 4.5 Marking a Stream as Favorite

- 4.6 Deleting a Stream

5 Working with Explorations

- 5.1 Understanding Explorations

- 5.1.1 Metadata

- 5.1.2 Correlations

- 5.1.3 Filters

- 5.1.4 Summaries

- 5.1.5 Business Rules

- 5.1.6 Expression Builder

- 5.2 Creating an Exploration

- 5.3 Editing an Exploration

- 5.4 Configuring a Target

- 5.5 Understanding a Draft Exploration

- 5.6 Publishing an Exploration

- 5.7 Unpublishing an Exploration

- 5.8 Exporting an Exploration

- 5.9 Reusing an Exploration

- 5.10 Marking an Exploration as Favorite

- 5.11 Deleting an Exploration

- 5.12 Restoring an Exploration

6 Working with References

- 6.1 Understanding References

- 6.2 Creating a Reference

- 6.3 Editing a Reference

- 6.4 Marking a Reference as Favorite

- 6.5 Deleting a Reference

7 Working with Patterns

- 7.1 Understanding Patterns

- 7.2 Creating a Pattern

- 7.3 Creating Top N Pattern

- 7.4 Creating Bottom N Pattern

- 7.5 Creating Up Trend Pattern

- 7.6 Creating Down Trend Pattern

- 7.7 Creating Fluctuation Pattern

- 7.8 Creating Eliminate Duplicates Pattern

- 7.9 Creating Detect Duplicates Pattern

- 7.10 Creating W Pattern

- 7.11 Creating Inverse W Pattern

- 7.12 Creating 'A' Not Followed by 'B' Pattern

- 7.13 Creating A Followed by B Pattern

- 7.14 Creating Standard Deviation Pattern

- 7.15 Creating Correlation Pattern

- 7.16 Creating Quantile Pattern

- 7.17 Creating Median Pattern

- 7.18 Creating Union Pattern

- 7.19 Creating Change Detector Pattern

- 7.20 Creating K-means.Anomaly Detection Pattern

- 7.21 Creating Spatial General Pattern

- 7.22 Creating Detect Missing Heartbeat Pattern

- 7.23 Creating Left Outer Pattern

8 Sign Out of Oracle Stream Analytics

- 8.1 Signing Out

List of Figures

- 1-1 Oracle Stream Analytics Sign in Page

- 1-2 Oracle Stream Analytics Home Page

- 1-3 Catalog Page

- 1-4 Catalog with Tag Applied

- 1-5 Create Map — Type Properties

- 1-6 Create Map — Connection Details

- 1-7 Create Map — Shape

- 1-8 Created Map

- 1-9 Create Connection — Type Properties

- 1-10 Create Connection — Connection Details

- 1-11 Create Target — Type Properties

- 1-12 Create Target — Target Details

- 1-13 Create Target — Shape

- 1-14 Show Topology Option in Catalog Actions Menu

- 1-15 Show Topology Option in Exploration Editor

- 1-16 Show Topology Option in Source Details Dialog

- 1-17 Topology Viewer in Immediate Family

- 1-18 Topology Viewer in Extended Family

- 2-1 Select Runtime

- 2-2 Catalog with OEP Runtime

- 2-3 Catalog with Spark Runtime

- 3-1 General Preferences

- 3-2 View Mode Preferences

- 3-3 Notifications Preferences

- 3-4 Catalog Preferences

- 3-5 Exploration User Assistance Preference

- 3-6 Live Output Stream Preferences

- 4-1 Create Stream - Source Details Dialog

- 4-2 Create Stream - Type Properties Dialog

- 4-3 Create Stream - Shape Dialog

- 4-4 Edit Source Dialog

- 4-5 Edit Stream — Loop the CSV File Feature

- 4-6 Restore Icon

- 4-7 Favorite Icon

- 5-1 Sample Live Output Stream

- 5-2 Sample Line Chart

- 5-3 Sample Scatter Chart

- 5-4 Exploration Metadata

- 5-5 Business Rules

- 5-6 Expression Builder Toolbar

- 5-7 Function Input Box

- 5-8 Create Exploration Dialog

- 5-9 Actions You Can perform on the Individual Columns in the Live Output Stream

- 5-10 Exploration Editor

- 5-11 Update Information of Exploration

- 5-12 Undo Changes Icon

- 5-13 Redo Changes Icon

- 5-14 User Assistant Icon

- 5-15 Configure a Target Dialog

- 5-16 Actions Menu

- 5-17 Published Exploration

- 5-18 Unpublished Exploration

- 5-19 Export Exploration

- 5-20 Export Exploration Dialog

- 5-21 Save Exported Exploration

- 5-22 Favorite Icon

- 5-23 Delete Icon

- 5-24 Exploration in Invalid State

- 5-25 Restore Icon

- 6-1 Create Reference - Source Details Dialog

- 6-2 Create Reference - Type Properties Dialog

- 6-3 Create Reference - Shape Dialog

- 6-4 Edit Reference Screen

- 6-5 Edit Reference - Source Details Dialog

- 6-6 Edit Reference - Type Properties Dialog

- 6-7 Edit Reference - Shape Dialog

- 6-8 Favorite Icon

- 6-9 Delete Icon

- 7-1 Select Patterns

- 7-2 Select a Pattern to Create Dialog

- 7-3 Create a <pattern> Exploration

- 7-4 Pattern Editor

- 7-5 Use this Pattern

- 7-6 Create Top N Pattern

- 7-7 Create Bottom N Pattern

- 7-8 Create Up Trend Pattern

- 7-9 Create Down Trend Pattern

- 7-10 Create Fluctuation Pattern

- 7-11 Create Eliminate Duplicates Pattern

- 7-12 Create Detect Duplicates Pattern

- 7-13 Create W Pattern

- 7-14 Create Inverse W Pattern

- 7-15 Create ‘A’ Not Followed by ‘B’

- 7-16 Create A Followed by B Pattern

- 7-17 Create Standard Deviation Pattern

- 7-18 Create Correlation Pattern

- 7-19 Create Quantile Pattern

- 7-20 Create Median Pattern

- 7-21 Create Union Pattern

- 7-22 Create Change Detector Pattern

- 7-23 Change Detector Pattern Example

- 7-24 Create K-means.Anomaly Detection Pattern

- 7-25 Spatial Pattern

- 7-26 Create Detect Missing Heartbeat Pattern

- 7-27 Create Left Outer Join Pattern

- 8-1 Signout

Preface

This document describes how to use Oracle Stream Analytics. The User Guide describes the various tasks that a user can perform using Oracle Stream Analytics.

Audience

This document is intended for all users of Oracle Stream Analytics and Event Processing.

Documentation Accessibility

For information about Oracle's commitment to accessibility, visit the Oracle Accessibility Program website at http://www.oracle.com/pls/topic/lookup?ctx=acc&id=docacc.

Access to Oracle Support

Oracle customers that have purchased support have access to electronic support through My Oracle Support. For information, visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=info or visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=trs if you are hearing impaired.

Related Documents

For more information, see the following documents:

- Known Issues for Oracle SOA and BPM Products at: http://www.oracle.com/technetwork/middleware/soasuite/documentation/soaknownissues122120-3111966.html.

- Administering Oracle Stream Analytics

- Developing Applications for Event Processing with Oracle Stream Analytics

- Getting Started with Event Processing for Oracle Stream Analytics

- Schema Reference for Oracle Stream Analytics

- Using Visualizer for Oracle Stream Analytics

- Customizing Oracle Stream Analytics

- Developing Applications with Oracle CQL Data Cartridges

- Java API Reference for Oracle Stream Analytics

- Oracle CQL Language Reference

- Getting Started with Oracle Stream Analytics

- Oracle Database SQL Language Reference at: http://docs.oracle.com/cd/E16655_01/server.121/e17209/toc.htm

- SQL99 Specifications (ISO/IEC 9075-1:1999, ISO/IEC 9075-2:1999, ISO/IEC 9075-3:1999, and ISO/IEC 9075-4:1999)

- Oracle Stream Analytics Forum: http://forums.oracle.com/forums/forum.jspa?forumID=820

Conventions

The following text conventions are used in this document:

Convention

Meaning

boldface

Boldface type indicates graphical user interface elements associated with an action, or terms defined in text or the glossary.

italic

Italic type indicates book titles, emphasis, or placeholder variables for which you supply particular values.

monospace

Monospace type indicates commands within a paragraph, URLs, code in examples, text that appears on the screen, or text that you enter.

What's New in This Guide?

This guide addresses the following changes in this release:

- Renamed from Oracle Stream Explorer to Oracle Stream Analytics

- Added new patterns. See Table 7-1.

- Creating Maps, Connections, and Targets

- Spark Integration

Screens shown in this guide may differ from your implementation, depending on the skin used. Any differences are cosmetic.

1 Introduction to Oracle Stream Analytics

Oracle Stream Analytics is very advanced, scalable, reliable, and flexible. Oracle Stream Analytics helps you in designing event processing applications with ease.

Oracle Stream Analytics is developed to simplify the complex event processing operations and make them available even to users without any technical background.

This chapter contains the following sections:

- Oracle Stream Analytics User Interface

- Components of Oracle Stream Analytics.

1.1 Oracle Stream Analytics User Interface

Oracle Stream Analytics user interface components are listed and explained at a high level in the sections that follow.

1.1.1 Sign In Page

Oracle Stream Analytics uses the same set of users and user roles configured in the Visualizer. Oracle Stream Analytics uses the same role-based authorization and authentication system provided by the Oracle Stream Analytics Event Processing Server.

Sign in to the Oracle Stream Analytics application using the following credentials:

- User Name: <the user name you have provided at the time of installation> (oepadmin is the default user)

- Password: <the password you have provided at the time of installation>

You can also sign in using any of the user accounts (with an administrator role) from the Oracle Stream Analytics Event Processing Server.

The Sign In page is as shown below:

Figure 1-1 Oracle Stream Analytics Sign in Page

1.1.2 Home Page

The Home page lists the industry verticals that Oracle Stream Analytics supports.

Each industry vertical has a tag associated with it and the tags are case-sensitive.

- Distributed Intelligence for IOT - Acquire, analyze, and act on high-volume, high-velocity data from sensors and devices both at the edge and in the data center in real-time. Tag for this vertical is IOT.

- Risk and Fraud Management - Leverage industry's best stream processing platform to assess risk and prevent financial fraud in real-time. Tag for this vertical is risk.

- Transportation and Logistics - Manage fleet, track assets, and improve supply chain efficiencies by combining streaming data with Oracle's advanced spatial functions. Tag for this vertical is transportation.

- Customer Experience and Consumer Analytics - Know the sentiment of your customers to reduce churn, improve loyalty, make offers, and attract customers in real-time. Tag for this vertical is customer.

- Telecommunications - Pro actively monitor your networks, predict network failures, and prevent distributed denial of service type attacks. Tag for this vertical is telecom.

- Retail — Understand and Apply instant Retail Shopping trends, instigate beneficial shelf life patterns and placements, be responsive to Customers cart utilization and interoperate with advanced Vending Machines. Tag for this vertical is retail.

The Home page is as shown below:

Figure 1-2 Oracle Stream Analytics Home Page

1.1.3 Catalog Page

The Catalog page is the location where resources including explorations, streams, references, maps, connections, and targets are listed. This is the go-to place for you to perform any tasks in Oracle Stream Analytics.

The resources you see in the Catalog vary depending on the runtime you are using for the application.

You can mark a resource as a favorite in the Catalog by clicking on the Star icon. Click the icon again to remove it from your favorites. You can also delete a resource or view its topology using the menu icon to the right of the favorite icon. The Catalog page is as shown below:

Figure 1-3 Catalog Page

The tags applied to items in the Catalog are also listed on the screen below the left navigational pane. You can click any of these tags to display only the items with that tag in the Catalog. The tag appears at the top of the screen. Click Clear All at the top of the screen to clear the Catalog and display all the items. The following screen shows the Catalog when you select a tag:

Figure 1-4 Catalog with Tag Applied

You can include or exclude explorations, streams, references, maps, connections, and targets using the View All link in the left panel under Show Me. When you click View All, a tick mark appears beside it and all the components are displayed in the catalog.

When you want to display or view only a few or selective items in the catalog, unselect View All and select the individual components. Only the selected components will be shown in the catalog.

1.1.4 Exploration Editor

Exploration Editor, also known as the Explorer, allows you to create or edit the explorations in Oracle Stream Analytics.

1.1.4.1 Expression Editor

The Expression Editor helps you to create expressions easily. Expression Editor supports various standard functions that allow you to perform operations on strings, numerical data, alphanumerical data, date-time, and many more data types. The Expression Editor is available within explorations to perform calculations and obtain certain data.

1.1.5 Streams Wizard

Streams Wizard allows you to create or edit the streams in Oracle Stream Analytics.

1.1.6 References Wizard

References Wizard allows you to create or edit the references in Oracle Stream Analytics.

1.1.6.1 Working with Maps, Connections, Targets

Maps, Connections, and Targets are new features added in this release.

See the following sections for more information:

- Creating/Editing Maps

- Creating/Editing Connections

- Creating/Editing Targets

1.1.6.1.1 Creating/Editing Maps

A map is a virtual fencing over a geographical area to define boundaries. The maps help you in defining boundaries over a specific area and then use it to analyze the data for your business. Based on the data you analyze, you can use the data to improve your business performance.

You can use the maps to set up triggers for your business. Whenever a device enters or exits the defined boundaries, the user is alerted through a text message or an e-mail.

To create a map:

1. Navigate to the Catalog.

2. Select Create New Item > Map.
The Create Map — Type Properties wizard opens.

Figure 1-5 Create Map — Type Properties

3. Enter details in the following fields of the Type Properties screen:

a. Enter a Name for the map. This is a mandatory field.

b. Enter a Description for the map. This is an optional field.

c. Enter Tags for the map. You can enter any tag you like. The tags help you in filtering the maps in the Catalog.

d. Select a Map Type. The available types are:

- None (Create manually) — this value indicates that you do not want to use any of the existing map types and would like to create a type manually. When you select this option you can only save the details but cannot complete creating the map.

- Database Table — the map will be based on the data stored in a database table.

Note:
Your database table must contain at least one field of the SDO_GEOMETRY type.

e. Click Save to commit the changes you have made or to save the details added so far.

f. Click Next.
The Create Map — Connection Details screen opens.

Figure 1-6 Create Map — Connection Details

4. Enter details in the following fields of the Connection Details screen:

a. Select a Data source name from the drop-down list. This data source name comes from the connections you have created earlier.

b. Click Back if you want to navigate to the previous screen in the wizard.

c. Click Save to commit the changes you have made or to save the details added so far.

d. Click Next.
The Create Map — Shape screen opens.

Figure 1-7 Create Map — Shape

5. Select a Name for the shape. You can change the id property, description property, name property, shape property. The selected shape displays the shape binding keys of the map and the connection.

6. Click Back to navigate to the previous screen in the wizard.

7. Click Save to save the details you have entered so far and complete creating a map.

A map is created with the details you have provided.

The created map appears as follows:

Figure 1-8 Created Map

You can click the Saved Geo-Fences to view the saved area on the map. You can use the zoom in and zoom out controls the view of the map. You can click Show Points to see the latitude and longitude of the selected Geo-Fence.

Click the Edit Info icon to edit the details of the map like name, description etc. The Undo icon can be used to revert the last made change and Redo icon can be used to repeat the last action performed.

1.1.6.1.2 Creating/Editing Connections

A connection is a collection of metadata required to connect to an external system, such as URLs, credential and the like. A connection is the basis for creation of streams and targets.

To create/edit a connection:

1. Navigate to the Catalog.

2. Select Create New Item > Connection.
The Create Connection — Type Properties wizard opens.

Figure 1-9 Create Connection — Type Properties

3. Enter details in the following fields of the Type Properties screen:

a. Enter a Name for the map. This is a mandatory field.

b. Enter a Description for the map. This is an optional field.

c. Enter Tags for the map. You can enter any tag you like. The tags help you in filtering the maps in the Catalog.

d. Select a Connection Type. The available types are:

- Kafka

- Twitter

- Coherence cache

- HTTP Pub-Sub

- MQTT

- WebLogic Server.

e. Click Next.
The Create Connection — Connection Details screen opens.

Figure 1-10 Create Connection — Connection Details

f. The fields available vary depend on the type of connection selected.

Table 1-1 Types of Connections

Field Name

Description

Kafka

Select this type when you want to use a Kafka connection.

Note:
Specifying a topic name for the Kafka connection is necessary for the connection to be used in a stream. A topic must exist for the deployment to be successful.

- Zookeepers

Enter zookeepers connection strings separated by commas.

- Kafka bootstrap

Enter Kafka connection strings separated by commas.

Twitter

Select this type when you want to use a Twitter connection.

- Consumer Key

Enter an API key to be used as the consumer key.

- Consumer Secret

Enter an API secret to be used as the consumer secret.

- Access Token

Enter an access token.

- Access Token Secret

Enter a secret access token.

- Http proxy host

Enter a host for the HTTP proxy.

- Http proxy port

Enter a port number for the HTTP proxy.

Coherence cache

Select this type when you want to use a Coherence cache connection.

- Tangosol config

Copy and paste the XML content (without the XML header) from the tangosol config.xml file in this field.

- Cache config

Copy and paste the XML content (without the XML header) from the cache config.xml file in this field.

HTTP Pub-Sub

Select this type when you want to use a HTTP Pub-Sub connection.

- Server URL

Enter a URL of the server.

- Username

Enter a username to be used for this connection.

- Password

Enter a password to be used for this connection.

MQTT

Select this type when you want to use a MQTT connection.

- Server URls

Enter a URL for the server.

WebLogic Server

Select this type when you want to use a WebLogic server connection.

- URL

Enter a URL for the server.

- Username

Enter a username to be used for the connection.

- Password

Enter a password to be used for the connection.

4. Click Back if you want to navigate to the previous screen in the wizard.

5. Click Save to commit the changes you have made or to save the details added so far.

A connection is created with the details you have provided.

1.1.6.1.3 Creating/Editing Targets

A target is an object that defines an interface with a downstream system. The list of target types is mostly the same as the list of stream types in terms of supported technologies and messaging systems. Targets are also typed in terms of event shape definitions.

To create/edit a target:

1. Navigate to the Catalog.

2. Select Create New Item > Connection.
The Create Connection — Type Properties wizard opens.

Figure 1-11 Create Target — Type Properties

3. Enter details in the following fields of the Type Properties screen:

a. Enter a Name for the map. This is a mandatory field.

b. Enter a Description for the map. This is an optional field.

c. Enter Tags for the map. You can enter any tag you like. The tags help you in filtering the maps in the Catalog.

d. Select a Connection Type. The available types are:

- HTTP Publisher

- Kafka

- JMS

- Coherence cache

- CSV File

- REST

- MQTT

- EDN.

e. Click Next.
The Create Connection — Connection Details screen opens.

Figure 1-12 Create Target — Target Details

f. The fields available vary depend on the type of target selected.

Table 1-2 Types of Targets

Field Name

Description

HTTP Publisher

Select this type when you want to use a HTTP Publisher target.

- Connection

Select a connection from the drop-down list which is of type HTTP Publisher.

- Channel

Enter a suitable channel for the HTTP Publisher.

Kafka

Select this type when you want to use a Kafka target.

- Connection

Select a connection from the drop-down list which is of type Kafka.

- Topic name

Enter a suitable topic name for the Kafka target.

JMS

Select this type when you want to use a JMS target.

- Connection

Select a connection from the drop-dwon list which is of type JMS.

- JNDI Name

Enter a suitable JNDI name for the JMS.

Coherence cache

Select this type when you want to use a Coherence cache target.

- Connection

Select a connection from the drop-down list which is of type coherence cache.

- Cache name

Enter a suitable name for the cache.

- Cache key

Enter a suitable key for the cache.

CSV File

Select this type when you want to use a CSV file as a target.

- File Name

Enter a file name and click Download to download the CSV file.

- Append

Select this check box if you wnat to append the CSV file to the target.

REST

Select this type when you want to use a REST target.

- Target URL

Enter a URL for the REST target.

MQTT

Select this type when you want to use a MQTT target.

- Connection

Select a connection from the drop-down list which is of type MQTT.

- Topic name

Enter a suitable name for the MQTT target. This topic name should have been defined in the MQTT connection.

- Quality of service

Enter a numerical value greater than zero. The values you can enter are:

- 0 - at the most once

- 1 - at least once

- 2 - exactly once.

Use the increment or decrement icons to increment or decrement the values.

EDN

Select this type when you want to use a EDN target.

- Connection

Select a connection from the drop-down list which is of type EDN.

g. Click Back if you want to navigate to the previous screen in the wizard.

h. Click Save to commit the changes you have made or to save the details added so far.

i. Click Next to navigate to the next screen in the wizard.
The Create Target — Shape screen opens.

Figure 1-13 Create Target — Shape

4. Select Select Existing Shape to do the mapping using an exiting shape.

5. Select Create New Shape to create a new shape for the mapping When you create a new shape, you must provide a name for the shape, add fields to the shape and select the type of the field.

6. Click Back if you want to navigate to the previous screen in the wizard.

7. Click Save to commit the changes you have made or to save the details added so far.

A target is created with the details you have provided.

1.2 Components of Oracle Stream Analytics

The components of Oracle Stream Analytics are listed in the sections that follow.

1.2.1 Stream

A stream is a source of dynamic data. The data is flowing, it is not static or frozen. For example, stock prices of a particular company can be considered as a stream as the data comes in every second. Stream can be from EDN Server, JMS Server, REST Service, HTTP Pubsub Server, simulated from a CSV file (data dump), Kafka Adapter, Twitter Adapter, MQTT Adapter, Coherence Cache Adapter, or Event Generator.

1.2.2 Reference

A reference is a source of static data that provides contextual information about the event data. The metadata and contextual information of event data is stored in a reference. In this release, the only supported reference type is Oracle Database table.

1.2.3 Exploration

An exploration allows you to define business criteria for managing data (filters, summaries, group by, or correlations). The exploration is a visual representation of streaming data, expressions, and business rules. It lets you see how the business criteria apply and manage the data. You can add or attach a target to an exploration. But the target must be already created and configured.

1.2.4 Topology Viewer

Topology is a graphical representation of the connected entities. The topology illustrates the dependencies and connections between the entities.

The Topology Viewer helps you in identifying the dependencies that a selected entity has on other entities. Understanding the dependencies helps you in being cautious while deleting or undeploying an entity. Oracle Stream Analytics supports 2 contexts for the topology — Immediate Family and Extended Family.

You can launch the Topology viewer in any of the following ways:

- Select Show topology from the Catalog Actions menu to launch the Topology Viewer for the selected entity

Figure 1-14 Show Topology Option in Catalog Actions Menu

- Click Show Topology icon from the Exploration Editor

Figure 1-15 Show Topology Option in Exploration Editor

- Click Show Topology icon from the Source Details dialog (view the stream).

Figure 1-16 Show Topology Option in Source Details Dialog

Click the Show Topology icon at the top-right corner of the editor to open the topology viewer. Topology is the graphical representation of dependencies and connections between entities. By default, the topology of the entity from which you launch the Topology Viewer is displayed. The context of this topology is Immediate Family, which indicates that only the immediate dependencies and connections between the entity and other entities are shown. You can switch the context of the topology to display the full topology of the entity from which you have launched the Topology Viewer. The topology in an Extended Family context displays all the dependencies and connections in the topology in a hierarchical manner.

Note:
The entity for which the topology is shown has a grey box surrounding it in the Topology Viewer.

Immediate Family

Immediate Family context displays the dependencies between the selected entity and its child or parent.

The following figure illustrates how a topology looks in the Immediate Family.

Figure 1-17 Topology Viewer in Immediate Family

Extended Family

Extended Family context displays the dependencies between the entities in a full context, i.e., if an entity has a child entity and a parent entity, and the parent entity has other dependencies, all the dependencies are shown in the Full context.

The following figure illustrates how a topology looks in the Extended Family.

Figure 1-18 Topology Viewer in Extended Family

1.2.5 Pattern

A pattern provides you with a simple way to explore event streams based on common business scenarios.

1.2.6 Map

Map is a collection of geo-fences. A geo-fence is a geographical area, a polygon on a geographical map. In Oracle Stream Analytics, maps are used as underlying references for streaming data containing geographical coordinates, such as GPS data.

This technology has many uses in day-to-day life. For example:

- In a Mall you can set up a boundary to identify and track if the devices owned by the Mall move out of that area. Such a tracking can help the management in disabling the device or in reporting the device as lost.

- A store can offer discounts to its customers located in a specific geographic location and send discount coupons. The customers who bring the discount coupon to the store can avail the discounts.

1.2.7 Shape

A shape is a representation of data definition within a stream (that is, an event type).

2 Runtime Environment

Oracle Stream Analytics provides an option to select the runtime environment on which you want to run the application.

The available runtimes are:

- OEP — this option provides all the event processing capabilities of Oracle Stream Analytics

- Spark — this option provides all the features related to Spark integration.

Click the arrow beside the username at the top-right corner of the screen and select a runtime from the options that appear.

Figure 2-1 Select Runtime

WARNING:
The Spark option may be disabled if the required configuration is not completed. Contact the system administrator.

Features in OEP Runtime

The OEP runtime provides the following features:

- Explorations

- Streams

- References

- Maps

- Connections

- Targets

- Patterns

When you select the OEP runtime, the Catalog page appears as shown in the below screen.

Figure 2-2 Catalog with OEP Runtime

Features in Spark Runtime

The Spark runtime provides the following features:

- Explorations

- Streams

- Connections

- Targets

In the Spark runtime environment:

- you cannot use more than one stream in an exploration

- you do not have business rules

- you cannot chain explorations. Instead, you can send events to a Kafka target and create a stream reading from that same kafka topic.

- you cannot create Patterns

- you cannot create maps

- you cannot create connections.

When you select the Spark runtime, the Catalog page appears as shown in the below screen.

Figure 2-3 Catalog with Spark Runtime

3 How to Set Oracle Stream Analytics Preferences

This chapter explains in detail about the Preferences that the user can set on the Oracle Stream Analytics. Based on the preferences the users set in this page, the characteristics of the Oracle Stream Analytics vary.

This chapter contains the following sections:

- General Preferences

- View Mode Preferences

- Notifications Preferences

- Catalog Preferences

- Exploration - Live Output Stream Preferences.

3.1 General Preferences

This section explains the general preferences that the user can set for Oracle Stream Analytics.

Figure 3-1 General Preferences

Start Page

Select if you want the Home page, the Catalog page, or the Patterns page to appear as the Start Page.

Note:
Patterns appears as an option only if the runtime is OEP.

Click Save to apply the changes you have made or click Restore To Default to retain the default settings.

3.2 View Mode Preferences

This section explains the view mode preferences that the user can set for Oracle Stream Analytics.

Figure 3-2 View Mode Preferences

Browser mode

Use this option to view the application in a browser mode, i.e., just like any other web application appears in a browser.

Presentation mode (projector)

Use this option to view the application in a presentation mode, i.e., as if the application is being viewed on a projector as a presentation. When you select the Presentation mode, a different color skin is applied to the application.

Click Save to apply the changes you have made or click Restore To Default to retain the default settings.

3.3 Notifications Preferences

This section explains the notifications preferences that the users can set for Oracle Stream Analytics.

Figure 3-3 Notifications Preferences

Show Information Notifications

Select this option if you want the information notifications to appear in the application. This option is selected by default.

Information Notification duration (in seconds)

Choose the number of seconds for which the notifications appear. 5 seconds is the default value.

Click Save to apply the changes you have made or click Restore To Default to retain the default settings.

3.4 Catalog Preferences

This section explains the catalog preferences that the user can set for Oracle Stream Analytics.

Figure 3-4 Catalog Preferences

Default Sorting Column

Select the column by which you want the columns to be sorted. This value will be used as the default for all columns until you change the value again.

Default Sorting Order

Select the sorting order by which you want the columns to be sorted. This value will be used as the default value for all columns until you change the value again.

Default Page Size

Select the value to be used as the default page size. Based on the value selected, the number of records that appear on a page vary. This value will be used as the default for all pages until you change the value again.

Click Save to apply the changes you have made or click Restore To Default to retain the default settings.

3.5 Exploration Preferences

This section explains the Exploration preferences that the user can set for Oracle Stream Analytics.

Figure 3-5 Exploration User Assistance Preference

Select Yes if you want to display the User Assistance text for the explorations in the Exploration Editor.

Click Restore To Default if you want to revert to the default option. Click Save to save the preference and Cancel to abort the operation at any point of time and navigate to Home page.

3.6 Exploration - Live Output Stream Preferences

This section explains the exploration preferences that the user can set for Oracle Stream Analytics.

Figure 3-6 Live Output Stream Preferences

Default Table Size

Select a value that you want to be applied as the default table size for the data in Live Output Stream of an exploration.

Click Save to apply the changes you have made or click Restore To Default to retain the default settings.

4 Working with Streams

This chapter explains the details about streams, creating streams, and editing streams.

This chapter contains the following sections:

- Understanding Streams

- Creating a Stream

- Editing a Stream

- Restoring a Stream

- Marking a Stream as Favorite

- Deleting a Stream.

4.1 Understanding Streams

An event stream is an Oracle Stream Analytics Event Processing adapter node producing events of a single type.

In Oracle Stream Analytics object taxonomy, an event stream is an entity responsible for receiving events from the outside world. There are different stream types based on different communications technology or messaging system, such as, for example, REST or JMS or Kafka.

4.1.1 Metadata

Every stream has the following set of metadata:

- Name

- Tags

- Description

- Created By

- Created At

- Updated By

- Updated At

- Is Favorite.

4.2 Creating a Stream

A stream is required for the users to create an exploration. This section explains how to create a stream. The Create Stream screen is shown below.

Figure 4-1 Create Stream - Source Details Dialog

To create a stream:

1. Navigate to Catalog.

2. Select Stream in the Create New Item menu.

3. Enter a name for the stream in the Name field. This is a mandatory field.

4. Provide a description that helps users understand about the stream in the Description field. This is an optional field.

5. Enter a tag with which you want to tag the stream in the Tag field. You can provide multiple tags. This is an optional field. You can separate the multiple tags by commas, Enter key, or a space.

Note:

The tags you enter must represent the industry verticals supported by Oracle Stream Analytics. For more information about pre-existing tags, see Home Page.

6. Select a stream type that you want to use for the stream from the Source Type field. This is a mandatory field.

Note:

If you select EDN as the source type, you can work only with an XML element that has a flat structure. The XML schema does not support any other schemas. The Stream wizard does not display all other types of EDN.

7. Select Create Exploration with this source (Launch Exploration Editor) if you want to launch the Exploration Editor utilizing this stream as the primary source.

8. Click Next. Based on the source type you have selected, you must enter data in the following fields on the Type Properties screen:

Figure 4-2 Create Stream - Type Properties Dialog

Table 4-1 Source Types for Streams

Source Type

Data Fields

CSV File

If the source type is CSV File, you must enter data in the following fields:

- Source Path - either upload a local CSV file or provide a URL to the location where the file resides. This is a mandatory field.

- Event Interval - the time interval at which the event refreshes. The time is in milliseconds. Default value is 1000 milliseconds, which is 1 second.

- Initial Delay (ms) - the time interval before which the data streaming starts. The time is in milliseconds. Default value is 0.

- Loop the CSV File - the option that allows you to keep the CSV source always running by automatically restarting it from the beginning of the file when the end of the file is reached.

HTTP Subscriber

If the source type is HTTP Subscriber, you must enter data in the following fields:

- Connections - the connection of the type HTTP Subscriber. This is a mandatory field.

- Password - password to access the HTTP Subscriber. This is a mandatory field.

EDN

If the source type is EDN, you must enter data in the following fields:

- Connections - a connection which is of type EDN. This is a mandatory field.

JMS

If the source type is JMS, you must enter data in the following fields:

- Connections - URL to access the JMS. This is a mandatory field.

- JNDI name - JNDI name (queue or topic) to access the JMS. This is a mandatory field.

REST

If the source type is REST, you must enter data in the following fields:

- Context Path - the context path of the REST Adapter. This is a mandatory field.

Coherence cache

If the source type is Coherence cache, you must enter data in the following fields:

- Connections - a connection which is of type coherence cache. This is mandatory field.

- Cache name — the name of the cache.

Kafka

If the source type is Kafka, you must enter data in the following fields:

- Connections - a connection which is of type Kafka. This is a mandatory field.

- Topic name — a topic name to be used in the stream. This topic name should have been defined at the time of creating the connection. This is a mandatory field.

- Group Id — a group id to be used for the stream. This id should have been defined at the time of creating the connection. This is an optional field.

MQTT

If the source type is MQTT, you must enter data in the following fields:

- Connections - a connection which is of type MQTT. This is a mandatory field.

Twitter

If the source type is Twitter, you must enter data in the following fields:

- Connections - connections of type Twitter. This is a mandatory field.

- Hashtags — the hashtags separated by commas that you want to include in your output stream. This is an optional field.

- Languages — the languages separated by commas you want to include in your output stream. This is an optional field.

- Users — list of Twitter user IDs separated by commas that you want to include in your output stream. This is an optional field.

At-least one of Hashtags or Users property needs to be specified.

Note:
The logical operator OR is used when you specify both Hashtags and Users. For more information, see https://dev.twitter.com/streaming/reference/post/statuses/filter.

Event generator

If the source type is Event generator, you must enter data in the following fields:

- Interval (ms) - the time interval between messages in milli seconds. This is an optional field.

- Lowest number — the lowest generated numeric value. This is an optional field.

- Highest number — the highest generated numeric value. This is an optional field.

- Precision — the number of decimal places. This is an optional field.

- Number of strings — the number of pre-generated strings. This is an optional field.

- Lowest number of words — the lowest number of words in the generated string. This is an optional field.

- Highest number of words — the highest number of words in the generated string. This is an optional field.

9. Click Next. The Create Stream - Shape screen appears.

Figure 4-3 Create Stream - Shape Dialog

10. Perform Manual Mapping or Select a Shape on the Shape screen.

When you perform manual mapping, you need to decide the best data type that is suitable for the value represented by each of the fields in the data source. The data types can be String, Byte, Integer, Big int, Float, Double, Big decimal, Boolean, Timestamp.

Note:

Providing a shape name is optional. If the shape is not specified, then this shape will not be available for reuse in the drop-down list.

If you Select Shape, the pre-existing configuration is used for your stream.

11. Click Create to create the stream. The new stream appears in the Catalog.

12. Click Cancel at any time to abort the operation.

4.3 Editing a Stream

After you create a stream, Oracle Stream Analytics provides you with an opportunity to edit the stream.

You cannot edit the stream when:

- there are published explorations using the stream

- you open the stream dialog from within the exploration.

To edit a stream:

1. Click the stream you want to edit from the Catalog.

2. Click Edit in the source dialog at the top.

Figure 4-4 Edit Source Dialog

Note:
The behavior of Edit at each section level in the current release is to launch the Edit Stream wizard. This implies that the Edit Stream - Source Details screen is the default screen you see.

3. Update the data you want to edit in the stream dialog.

Attention
A data type of Geometry for the fields in the data source is not available when you are using Spark runtime.

Note:
The logical operator OR is used when you specify both Hashtags and Users for a stream of type Twitter. For more information, see https://dev.twitter.com/streaming/reference/post/statuses/filter.

4. Select Loop the CSV file on the Edit Stream - Type Properties dialog. This feature allows you to keep the CSV source always running by automatically restarting it from the beginning of the file when the end of the file is reached.

Figure 4-5 Edit Stream — Loop the CSV File Feature

Note:
This feature is available only for the CSV source and not for any other type of source or target.

5. Click Save when you are done with updating or editing the stream.

6. Click Cancel at any point of time to abort the operation.

7. Click Done in the stream dialog to complete the edit operation.

4.4 Restoring a Stream

A stream goes to an invalid state if the stream or the corresponding Event Processing application is undeployed in the Visualizer. Oracle Stream Analytics allows you to restore a stream that is in an invalid state.

To restore an exploration:

1. Identify the stream that is in invalid state in the Catalog. The stream in invalid state is indicated by a red cross icon.

2. Click the Restore icon to the right of the stream to fix the deployment problems and restore the stream.

Figure 4-6 Restore Icon

A notification appears about the result of restore operation.

4.5 Marking a Stream as Favorite

You can mark a stream as Favorite. Marking a stream as Favorite allows you to locate and navigate such streams easily even if you have numerous items on the catalog.

To mark a stream as favorite:

1. Identify the stream you want to mark as favorite in the Catalog.

2. Click the Favorite icon to the right of the table row for that stream to mark it as a favorite. This icon acts as a toggle button.

Figure 4-7 Favorite Icon

3. Click the Favorite button again to remove the stream from favorites.

4.6 Deleting a Stream

You can delete a stream if you are sure you do not require the stream anymore. If a stream has dependencies, it cannot be deleted. A stream is said to have dependencies if it is part of a published exploration being used by any user.

To delete a stream with dependencies, you must delete the dependencies first.

To delete a stream:

1. Identify the stream you want to delete in the Catalog.

2. Click Delete Item option from the Actions menu to the right of the stream to delete it.

A confirmation dialog appears. If you select Delete, the stream will be deleted. Click Cancel if you do not want to delete the stream for any reason.

5 Working with Explorations

This chapter explains about explorations in Oracle Stream Analytics.

This chapter contains the following sections:

- Understanding Explorations

- Creating an Exploration

- Editing an Exploration

- Configuring a Target

- Understanding a Draft Exploration

- Publishing an Exploration

- Unpublishing an Exploration

- Exporting an Exploration

- Reusing an Exploration

- Marking an Exploration as Favorite

- Deleting an Exploration

- Restoring an Exploration.

5.1 Understanding Explorations

Explorations are Oracle Stream Analytics Event Processing applications that allow you to apply business logic to the event flows. Explorations are the visual representation of the data streamed from a source. The data in the exploration is represented visually in the form of:

- Live Output Stream - Live Output Stream shows the streaming data shapes in a tabular form.

Figure 5-1 Sample Live Output Stream

- Line Charts - Line charts are the primary way of visualizing time-series data. The X-axis is used to represent the time movement and allows natural scrolling of the data as time moves forward. The Y-axis is used to see the change of the dependent variable, that is, variable of interest, as time moves.

Figure 5-2 Sample Line Chart

- Scatter Charts - When the time dimension is not important, then data may be better understood by looking at a scatter plot. In this case, the user can assign distinct event properties to both the X-axis and Y-axis. However, values on both axes need to be numeric variables. Remember that the X-axis represents the explanatory variable and the Y-axis the response variable. Hence, the properties that indicate response or calculated field are better candidates to automatically assign to the Y-axis.
In the case of time-series, it is obvious that new values enter in the right side of the graph and old values exit in the left side. However, this behavior does not translate to scatter plots, as the new point may show up anywhere.

Figure 5-3 Sample Scatter Chart

Explorations allow you to:

- Use one or more streams and references as sources of events and data

- Correlate multiple event and data sources

- Filter events and data

- Group events and data

- Specify the time/event -based windows for aggregation functions

- Specify aggregation functions to be used in summaries

- Review incoming events (before you apply the logic) and resulting events (after you apply the logic) in tabular and graph forms

- Add targets

- Define or apply functions to the data in the live output stream

- Define Oracle Business Rules to the live data in the output stream

5.1.1 Metadata

Every exploration has the following set of metadata:

- Name

- Tags

- Description

- Created By

- Created At

- Updated By

- Updated At

- Is Favorite.

Tags, Description, and being Favorite are specified explicitly in the Exploration Editor. Creation and update information is persisted automatically.

Figure 5-4 Exploration Metadata

5.1.2 Correlations

When an exploration has more than one data source associated with it, a logical relation must be established between the data sources. This logical relation is known as correlation.

Oracle Stream Analytics allows the data sources to be joined using correlation rules. When all the sources are correlated, they provide a single event stream that can be further sent to a Target. Only fields of compatible types from different non-correlated sources may be used as operands in the correlation.

If your streams and references are not correlated, the exploration is in an invalid state and will remain so until you correlate the sources. The exploration will not be updated on the server until you correlate.

5.1.3 Filters

The conditions with which the output can be filtered are known as Filters. When you apply filters to the output, only the events that match ALL or ANY of the filters are displayed. You can filter events by comparing a left operand with a right operand using the following operators:

- equal to

- not equal to

- lower than

- lower than or equal to

- greater than

- greater than or equal to

- contains

- not contains

- is null

- not null.

Left operand can be any one of the following:

- a field of any source in the exploration

- a summary that is defined in the Summaries area.

Right operand can be any one of the following:

- a constant of a type that is compatible with the type of left operand

- a field or a summary of a field from a source of the left operand.

Add a Condition

To add a condition:

1. Click the Filter Field and select any field from the data source.

2. Click the Filter Operator and select the appropriate operator.

3. Enter a suitable value in the input field.

4. Select an appropriate datatype if the populated datatype is not correct.
A condition id added to the business rule.

5. Select match All or Match Any based on you requirement to filter.

Add a Group

Groups can be added to add nested queries.The events that match "AND" and "OR" conditions can be displayed:

To add a group:

1. Click the Filter Field and select any field from the data source.

2. Click the Filter Operator and select the appropriate operator.

3. Enter a suitable value in the input field.

4. Select an appropriate datatype if the populated datatype is not correct.
A group id added to the business rule applying the logical operator OR to added the condition..

5. Select match All or Match Any based on you requirement to filter.

5.1.4 Summaries

You can aggregate functions (Summaries) to fields and apply grouping by any combination of fields. The only exception is that a field cannot have both summary and be included in a Group. When you define summaries and/or grouping, all other non-aggregate and non-grouping fields will be automatically excluded from the results shape.

When you define a summary or grouping, the only fields allowed in the output are fields from Summaries and Group By area. When you define a summary, it is automatically shown in the results table and filters area is provided with an option to filter by this newly created Summary. When you remove or change the summary, if it is used in the filters and/or in output, you must confirm this action as it will affect the filter and/or output.

5.1.5 Business Rules

Business rules build conditional logic into the applications.

You can add business rules to an exploration. However, adding business rules is optional.

Remember
Business Rules are not available when you select Spark as the runtime environment.

To add a business rule:

1. Navigate to the Exploration Editor.

2. Click Add a Rule to add a business rule to the exploration.

a. Enter a suitable Rule Name. This is a mandatory field.

b. Enter a suitable Description for the business rule. This is an optional field.

c. Click Done.

Figure 5-5 Business Rules

3. Click IF block and select Match All or Match Any.

- Match All — matches all the conditions in the business rule.

- Match Any — matches any condition in the business rule.

4. Select a field from the Filter Field and select a suitable operator. The possible operators are:

- equals

- not equals

- lower than

- lower than or equals

- greater than

- greater than or equals

- is null

- is not null.

- Enter a numerical value for a numerical filter. You can use the increment or decrement icons to increase or decrease the values. The datatype is automatically determined as Double or Integer based on the type of the filter field you select.

- Enter a string for a text based filter. The datatype is automatically determined as String.

- Select a date and time using the calendar and clock widgets for a timestamp based filter. The datatype is automatically determined as Timestamp.

5. Click Add Action in the THEN block. This action further refines the data of the exploration based on the details you have added in the IF block.
You can also use expressions in this field when required.

A business rule is created with the data you have provided and is applied to the exploration.

Click the Edit Rule icon to edit/modify an existing business rule.

5.1.6 Expression Builder

You can define expressions using the pre-defined functions and operators available in the application using the Expression Builder.

To create expressions:

1. Click the Expression Builder icon.
The Expression Builder Toolbar opens.

Figure 5-6 Expression Builder Toolbar

2. Click List of CQL Functions icon to see a list of functions that you can use in the expressions.

3. Select the required type of functions.
The selected function appears in the function input box.

Figure 5-7 Function Input Box

Start typing in the input parameters for the function within the braces.

4. Click the Apply icon to apply the expression.

5. Click the Cancel icon to abort the operation and quit out of the Expression Builder.

The applied expressions take affect on the live output stream immediately and you can see the changes you have made.

5.2 Creating an Exploration

This section explains how to create an exploration.

To create an exploration:

1. Navigate to Catalog.

2. Select Exploration in the Create New Item menu.

3. Enter information in the Create Exploration dialog. The Create Exploration screen is as shown below.

Figure 5-8 Create Exploration Dialog

a. Enter a name for the exploration in the Name field. This is a mandatory field.

b. Provide a description that helps users understand about this exploration in the Description field. This is an optional field.

c. Enter a tag with which you want to tag the exploration in the Tags field. You can provide multiple tags. This is an optional field.

d. Select a stream as the source for the exploration in the Source field. This can be another exploration that is in published state. This is a mandatory field. You can select multiple streams.

Note:

You cannot create an exploration based only on a reference as the source. You must start with a stream and then add reference(s) as source later.

Attention
When you are using Spark as the runtime, you cannot select multiple streams for the exploration. Only a single stream is supported.

4. Click Create to complete the creation of an exploration. The new exploration opens in the Exploration Editor. The newly created exploration also appears in the Catalog.
You can continue to add further to the newly created exploration in this editor:

- Correlation — You must add correlations between sources if the exploration uses more than one source.

- Summaries — You can add summary of the exploration data and then group the data accordingly. This is optional. See Summaries.

- Filters — You can add filters to further filter the data based on the summaries you have added to the exploration. This is optional. See Filters.

- Business Rules — You can add business rules to the data of your exploration. Business rules build conditional logic into the applications. This is optional.

- Expressions — You can add expressions to the streaming exploration data. The expressions help you in populating new data fields in the stream by performing calculations on the existing data. Adding expressions is optional

5. You can perform the actions on the columns in the Live Output Stream.

- Hide — hide any selected column

- Remove — remove any selected column

- Rename — rename any selected column

- Function — add an expression to any selected columns

- Restore — restore any removed columns. This option appears only when you have removed any column.

Figure 5-9 Actions You Can perform on the Individual Columns in the Live Output Stream

6. Click Cancel at any point of time to abort the operation.

5.3 Editing an Exploration

When you create an exploration, the exploration opens up in the Exploration Editor. You have the option to edit the parameters of the exploration. You can edit or update existing explorations. You can add or modify the data sources for the exploration.

To edit an exploration:

1. Navigate to the Catalog.

2. Identify the exploration that you want to edit or update. Click the name string of the exploration or the exploration icon to open it for editing. The Exploration Editor is as shown below.

Figure 5-10 Exploration Editor

3. Click anywhere in the Sources field to add or remove data sources. If you have more than one data source, the sources must be correlated.

Important
You cannot have more than one stream when you are using the Spark runtime.

Remember
If you see an error similar to -ERROR: ../sxservices/webresources/v0.1/exploration/41 Empty exploration, check that you have at least one source in the exploration. When you remove all the data sources from the exploration, you see this kind of error message.

4. Define the Correlations if the exploration has more than one data source.

Note:
Your changes to the exploration are not applied until the sources are correlated. An error message is generated when you try to save the changes without correlating the sources.

5. Click Add Summary in the Summaries area to add a summary to the exploration.

Note:
You cannot use calculated fields in Group By feature.

6. Click Add a Filter in the Filters area to add filters to the output. The filters further filter the streaming data based on the summaries you have added.

7. Click Add Rule in the Business Rules area to add business rules to the exploration. Business rules build conditional logic into your applications.

8. Click Timestamp to display the timestamp in the Live Output Stream. The timestamp at which the streaming data was captured appears against each row of live output stream. This is a toggle button and you can use it to switch ON or OFF the timestamp in the live data.

9. You can pause the live data that is streaming using the Pause icon and resume the stream using the Resume icon.

10. Click Restore Columns to restore any of the columns that you have hidden earlier.

11. Click Detach to detach the Live Output Stream into a separate window. You can attach it later again.

12. You can click the header of any column and rename the columns. And also you can click and drag any of the columns in the live output stream to reorder the columns. You can resize the columns using the mouse. You can also hide or unhide the columns.

13. You can add expressions or functions to the live output stream to calculate certain data based on the data that is streaming. Use the Expression Editor to add a function or expression. Click the expression editor and enter = followed by the required function in the Enter your expression field. Click the Done icon to finish adding the expressions and save the added expressions or functions. Click Cancel icon to abort the operation at any time.

14. Configure the number of graphs you want to be displayed for the output stream in the Charts area.

15. Click Window Drawer icon, available to the right of the screen, to specify time and event based windows used in processing your stream.

a. Select a value in the Range drop-down list and specify a numerical value. This value specifies the range of time period for the stream of data. The range is defined in units like now, nanoseconds, microseconds, milliseconds, seconds, minutes, hours, or events.
Now indicates that the range is as narrow as 1 nanosecond and unbounded indicates a range since the server has started. When the range is anything other than Now, another field, Evaluation frequency appears.

b. Select a value in the Evaluation frequency drop-down list and specify a numerical value. This value defines how often the system produces the result events.

Note:

Evaluation frequency cannot be greater than Range.

16. Click the Show Topology icon to view the topology. For more information, see Topology Viewer.

17. Click the pencil icon at the top-right corner to view the information of the exploration.

a. Click Edit Info to update Name, Description, or Tags of the exploration.

Figure 5-11 Update Information of Exploration

b. Click Done after updating the information.

18. Click Undo Changes icon at the top-right corner to undo the changes you have made. Click Redo Changes icon at the top-right corner to re-apply the changes you have made. The Undo/Redo is applicable only on the following changes:

- add/edit/delete summary

- group by

- add/edit/delete filter

- specifying range

- renaming the property in Live Output Stream

- changes/updates in the Expression Editor.

Note:

Undo operation is not available for publish action. To undo a publish, you must un-publish the exploration.

Figure 5-12 Undo Changes Icon

Figure 5-13 Redo Changes Icon

Note:

Clicking Undo once, reverses only the last made change.

Note:

Clicking Redo once, re-applies only the last made change.

19. Click the User Assistant icon at the top-right corner to view explanation about the Exploration Editor. This icon acts as a toggle button.

Figure 5-14 User Assistant Icon

20. Click Configure a Target to configure a target for the exploration. See Configuring a Target.

Note:

Only the fields that appear in the live output stream can be sent to the target.

Note:

When you edit an exploration, you must publish it again for the changes to be implemented.

5.4 Configuring a Target

Every exploration must be configured with a target to send the details downstream. Unless the exploration is published, you cannot send the events downstream to the configured target.

To configure a target:

1. Click Configure a Target in the Exploration Editor. The Configure a Target dialog appears.

Figure 5-15 Configure a Target Dialog

2. Select the Target in the Configure a Target dialog.

3. Click Cancel at any point of time to abort the operation.

4. Click Finish in the Configure a Target screen to configure the exploration.

5.5 Understanding a Draft Exploration

When you create an exploration, it is in draft state by default. The draft exploration is not available to other users of the application. An exploration moves to a published state when it is published.

When a published exploration is deleted or unpublished, the exploration moves to a draft state.

A draft exploration has the following distinctive features:

- it gets undeployed from the runtime once the Exploration Editor is closed

- it is not sending events into the target even if there is a target. You have to publish the exploration before events appear in the target.

5.6 Publishing an Exploration

You must publish an exploration to make the exploration available for all the users of Oracle Stream Analytics. A published exploration:

- can be used as a source for another exploration

- will be visible to other users of the application

- is in running state until another user unpublishes or deletes the exploration

- can have targets applied.

To publish an exploration:

1. Navigate to the Catalog.

2. Identify the exploration you want to publish and click its name or icon.

3. Select Publish from the Actions menu.

Figure 5-16 Actions Menu

The exploration gets published and you can see a confirmation message. When the exploration is published, it is indicated in the Catalog as shown in the figure below.

Figure 5-17 Published Exploration

You can publish/re-publish an exploration when no consumers are using it, in the following scenarios:

- Re-publish a published exploration with no changes

- Publish a published exploration after modifying its details (a published exploration moves to Draft status when it is modified). After publishing, the draft status changes to published status.

- Re-publish an exploration that has a target configured.

When more than one user tries to publish the exploration after modifications, a conflict arises. The following conflict resolution actions help you in resolving the conflict:

a. Click Overwrite to overwrite the published version with the changes you have made.

b. Click Discard to discard your changes and go to the latest published version of the exploration.

c. Click Clone to publish the exploration under a different name, retaining changes from multiple users.

Note:
If there are any users using a published exploration, you cannot re-publish that exploration until you clear the dependencies.

5.7 Unpublishing an Exploration

You can unpublish an exploration that has already been published.

Note:
If there are users using a published exploration, you cannot un-publish that exploration until you clear all the dependencies.

To unpublish an exploration:

1. Navigate to the Catalog.

2. Identify the published exploration you want to configure and click it.

3. Select Unpublish from the Actions menu.

The exploration gets unpublished and you can see a confirmation message. When the exploration is unpublished, the Published status changes to Draft in the Catalog.

Figure 5-18 Unpublished Exploration

Note:

You cannot un-publish a published exploration when it is being used by any user.

5.8 Exporting an Exploration

Oracle Stream Analytics allows you to export an exploration as a JAR file and download it for reuse. If you try to export an exploration that is not published, you get an error message.

You can import the exported exploration into JDeveloper and develop the application. However, you cannot import an application or exploration into Oracle Stream Analytics.

Remember
You cannot export an exploration when you are using Spark as the runtime environment.

To export an exploration:

1. Navigate to the Catalog.

2. Identify the published exploration you want to export and click it.

3. Select Export from the Actions menu.

Figure 5-19 Export Exploration

The Export Exploration dialog is as shown below:

Figure 5-20 Export Exploration Dialog

4. Review the details of the exploration under Export List. Resource is the name of the exploration and its dependencies to be exported. Type is the type of the resource (exploration/source).

5. Edit/update the exploration bundle details under Advanced Options if required.

a. Enter a value in the Bundle ID field. This is an OSGI Bundle-SymbolicName parameter which is unique OSGI Bundle and will be the name of the exported JAR file.

b. Enter a value in the Bundle Name field. This is the name with which the exploration will be exported.

6. Click Export to complete exporting the exploration. The exploration is saved as a jar file. You can save the JAR file to any location.

Figure 5-21 Save Exported Exploration

7. Click Cancel at any point of time to abort the operation.

If an exploration uses any target or sources with specified user credentials (EDN, JMS, HTTP pubsub), then the exported exploration contains the credentials with encrypted passwords. Passwords are encrypted with the server encryption key. Usually, different servers use different encryption keys. As a result, you must update the encrypted passwords or convert them to plain text passwords before deploying the exploration to a server. If you do not do this, an encryption error appears.

5.9 Reusing an Exploration

You can re-use an existing exploration as a source for another exploration.

Remember
You cannot export an exploration when you are using Spark as the runtime environment.

5.10 Marking an Exploration as Favorite

You can mark an exploration as Favorite. Marking an exploration as Favorite allows you to locate and navigate such explorations easily even if you have numerous items on the catalog.

To mark an exploration as favorite:

1. Identify the exploration you want to mark as favorite in the Catalog.

2. Click the Favorite icon to the right of the exploration to mark it as a favorite. This icon acts as a toggle button.

Figure 5-22 Favorite Icon

3. Click the Favorite icon to remove the exploration from favorites.

5.11 Deleting an Exploration

You can delete an exploration if you are sure you do not require the exploration anymore. When you delete a published exploration, it moves into a draft state. When an exploration is available in both draft and published state, the delete operation first deletes the draft exploration. When you invoke delete operation for the second time on the same exploration, the exploration gets deleted.

To delete an exploration:

1. Identify the exploration you want to delete in the Catalog.

2. Click the Delete icon to the right of the exploration to delete it.

Figure 5-23 Delete Icon

A confirmation dialog appears. If you select OK, the exploration will be deleted.

5.12 Restoring an Exploration

An exploration goes to an invalid state in any of the following scenarios:

- if the deployment was removed from the Visualizer

- the EDN source could not start because of a network issue

- a CSV source could not start because of the file absence

- the corresponding Event Processing application was undeployed or paused on the Event Processing Server

The above stated scenarios are a few amongst the reasons why an exploration can go into an invalid state.

Invalid state indicates that there is no deployment for the object, either a source or a published exploration.

You can restore an exploration. The restore operation tries to deploy an object in invalid state with the information available in Oracle Stream Analytics. For example, there is an exploration E1 that uses the source S1, and both of them are in invalid state. When you invoke a restore operation on the exploration, the Oracle Stream Analytics tries to deploy both the stream and exploration in sequence.

To restore an exploration:

1. Identify the exploration that is in invalid state in the Catalog. The exploration in invalid state is indicated by a red cross icon.

Figure 5-24 Exploration in Invalid State

2. Click the Restore icon to the right of the exploration to fix the deployment problems and restore the exploration.

Figure 5-25 Restore Icon

A notification appears about the result of restore operation.

6 Working with References

This chapter explains about references in Oracle Stream Analytics.

This chapter contains the following sections:

- Understanding References

- Creating a Reference

- Editing a Reference

- Marking a Reference as Favorite

- Deleting a Reference

6.1 Understanding References

Oracle Stream Analytics allows you to create references to static data to enrich the event streams.

6.2 Creating a Reference

Steps required to create a reference are listed in this section.

To create a reference:

1. Navigate to Catalog.

2. Select Reference in the Create New Item menu.

3. Enter information in the Create Reference dialog. The Create Reference - Source Details screen is as shown below.

Figure 6-1 Create Reference - Source Details Dialog

a. Enter a name for the reference in the Name field. This is a mandatory field.

b. Provide a description that helps users understand about this reference in the Description field. This is an optional field.

c. Enter a tag with which you want to tag the reference in the Tags field. You can provide multiple tags. This is an optional field.

d. Select a source type from the Source Type drop down list. The source must be defined in Oracle Stream Analytics Visualizer. This is a mandatory field.

Note:

In this release, only Database Table (Oracle Database) is supported. The driver oracle.jdbc.driver.OracleDriver is deprecated and not supported. Use oracle.jdbc.OracleDriver instead in the config.xml file.

4. Click Next to go to the Type Properties screen. The Create Reference - Type Properties screen is as shown below.

Figure 6-2 Create Reference - Type Properties Dialog

a. Select a Data source name.

b. Click Back at any point if you want to change any of the details.

5. Click Next to go to the Shape screen. The Create Reference - Shape screen is as shown below.

Figure 6-3 Create Reference - Shape Dialog

a. Select a Shape for the reference.
The shape is applied on based on the pre-existing shape you choose.

6. Click Create to complete the creation of a reference. The new reference appears in the catalog.

7. Click Cancel at any point of time to abort the operation.

6.3 Editing a Reference

Oracle Stream Analytics allows you edit or update an existing reference. This section explains how to edit a reference.

To edit a reference:

1. Navigate to Catalog.

2. Identify the reference you that want to edit. Click the name string of the reference or the reference icon to open it for editing. The reference details screen appears and it is as shown below.

Figure 6-4 Edit Reference Screen

3. Click Edit in the top-right corner of the screen. The Edit Reference - Source Details screen is as shown below.

Figure 6-5 Edit Reference - Source Details Dialog

a. Update the name of the reference, if required.

b. Update the description of the reference, if required.

c. Add or update the tags with which you want to tag the reference. You can provide multiple tags.

d. The Source Type cannot be modified in this release. Hence, it is disabled.

4. Click Next to go to the Type Properties screen. The Edit Reference - Type Properties screen is as shown below.

Figure 6-6 Edit Reference - Type Properties Dialog

a. Select a different Data source name if you want to update the source.

b. Click Back at any point if you want to change any of the details.

5. Click Next to go to the Shape screen. The Edit Reference - Shape screen is as shown below.

Figure 6-7 Edit Reference - Shape Dialog

a. Select a different Shape if you want to update the shape of the reference.

6. Click Save to complete the editing of a reference.

7. Click Cancel at any point of time to abort the operation.

8. Click Done on the reference details page to complete the operation. The update reference appears in the catalog.

6.4 Marking a Reference as Favorite

You can mark a reference as Favorite. Marking a reference as Favorite allows you to locate and navigate such reference easily even if you have numerous items on the catalog.

To mark a reference as favorite:

1. Identify the reference you want to mark as favorite in the Catalog.

2. Click the Favorite icon to the right of the reference to mark it as a favorite. This icon acts as a toggle button. Click this button again to remove the reference from favorites.

Figure 6-8 Favorite Icon

6.5 Deleting a Reference

You can delete a reference if you are sure yo do not require the reference anymore. If a reference has dependencies, it cannot be deleted. A reference is said to have dependencies if it is part of a published exploration being used by any user. To delete a reference with dependencies, you must delete the dependencies first.

To delete a reference:

1. Identify the reference you want to delete in the Catalog.

2. Click the Delete icon to the right of the reference to delete it.

Figure 6-9 Delete Icon

A confirmation dialog appears. If you select OK, the reference will be deleted.

7 Working with Patterns

Patterns are much simpler than standard explorations. When working from a pattern, you need to specify a few key fields to discover an interesting result. Once you have created a pattern, it will appear in the Catalog just like any other exploration. You can use the patterns to create new explorations.

A pattern is a template of an Oracle Stream Analytics application that already has the business logic built into it. The visual representation of the event stream varies from one pattern type to another based on the key fields you choose. A pattern provides you with a simple way to explore event Streams based on common business scenarios. Use the filters at left to view different categories of pattern and then click on Use this pattern to create an exploration. You can see full descriptions and learn more about each pattern by clicking the box that contains it. Click again to hide the extra information.

A pattern provides you with the results displayed in a live output stream based on common business scenarios.

Note:
While entering data in the fields for a specific pattern, ensure that the data you enter corresponds to the datatype of the field. If there is a mismatch between the entered data and the datatype, the pattern yields incorrect results.

You can include or exclude patterns based on their categories using the View All link in the left panel under Show Me. When you click View All, a tick mark appears beside it and all the patterns are displayed in the page.

When you want to display/view only a few/selective patterns, unselect View All and select the individual patterns. Only the selected patterns will be shown in the catalog.

Figure 7-1 Select Patterns

The following table categorizes the patterns.

Table 7-1 Categories of Patterns

Category

Pattern

New/Existing

General

Change Detector

New

‘A’ Followed by ‘B’

New

‘A’ Not Followed by ‘B’

New

Bottom N

Existing

Detect Duplicates

Existing

Down Trend

Existing

Eliminate Duplicates

Existing

Fluctuation

Existing

Inverse W

Existing

Detect Missing Heartbeat

New

Top N

Existing

Up Trend

Existing

W

Existing

Union

New

Left Outer Join

New

Machine Learning

K-Means. Anomaly Detection

New

Spatial

Spatial General

New

Statistical

Median

New

Correlation

New

Quantile

New

Standard Deviation

New

7.1 Understanding Patterns

Oracle Stream Analytics provides a feature known as patterns. A pattern provides you with the results displayed in a live output stream based on common business scenarios. A pattern is a template of an Oracle Stream Analytics application that already has the business logic built into it. The visual representation of the event stream varies from one pattern type to another based on the key fields you choose.

7.2 Creating a Pattern

Oracle Stream Analytics provides various patterns.

The various types or categories of patterns available are:

- General

- Machine Learning

- Spatial

- Statistical.

The entire list of patterns is displayed category-wise on this dialog. Hover over each of the patterns to see its description.

To create a pattern:

1. Navigate to the Catalog.

2. Click Create New Item > Pattern.
The Select a Pattern to Create dialog opens.

Figure 7-2 Select a Pattern to Create Dialog

3. Click the pattern that you want to create.

Figure 7-3 Create a <pattern> Exploration

4. Enter a Name for the exploration. This is a mandatory field.

5. Enter a Description for the exploration. This is an optional field.

6. Enter suitable Tags for the exploration. This is an optional field.

7. Click Create. An editor to create a pattern with the exploration you just created appears.

Figure 7-4 Pattern Editor

The selected pattern is created.
An alternate way to create a pattern is to Click Patterns and select Use this pattern on the required pattern tile.

Figure 7-5 Use this Pattern

7.3 Creating Top N Pattern

Use this pattern to obtain the first N events in a window range.

To create a Top N pattern:

1. Navigate to the Catalog.

2. Select Create New Item >Pattern > Top N. You can also click Patterns and select Top N.The create pattern screen appears as shown below:

Figure 7-6 Create Top N Pattern

3. Select an Event Stream.

4. Enter a value for Window Range and select its unit (one of nanoseconds, milliseconds, microseconds, seconds, minutes, and hours). This number must be greater than or equal to 1.

A Window range is the range from which the output is generated.

5. Enter a value for Window Slide and select its unit (one of nanoseconds, milliseconds, microseconds, seconds, minutes, and hours). This is the frequency at which you want to refresh the data.

6. Select a value in the Order by Criteria field. You can select multiple fields.

7. Enter a value in the Number of Events field. This number must be greater than or equal to 1. This is the number that indicates the number of events to be considered for the pattern.

The pattern is visually represented based on the data you have entered/selected.

7.4 Creating Bottom N Pattern

Use the Bottom N pattern to obtain the last N events in a window range.

This section explains how to create a Bottom N pattern.

To create a Bottom N pattern:

1. Navigate to the Catalog.

2. Select Create New Item >Pattern > Bottom N. You can also click Patterns and select Bottom N.The create pattern screen appears as shown below:

Figure 7-7 Create Bottom N Pattern

3. Select an Event Stream.

4. Enter a value for Window Range and select its unit (one of nanoseconds, milliseconds, seconds, minutes, and hours). This number must be greater than or equal to 1.

A Window range is the range from which the output is generated.

5. Enter a value for Window Slide and select its unit (one of nanoseconds, milliseconds, seconds, minutes, and hours). This is the frequency at which you want to refresh the data.

6. Select a value in the Order by Criteria field. You can select multiple fields.

7. Enter a value in the Number of Events field. This number must be greater than or equal to 1. This is the number that indicates the number of events to be considered for the pattern.

The pattern is visually represented based on the data you have entered/selected.

7.5 Creating Up Trend Pattern

Use this pattern to detect when a numeric event field shows a specified trend change higher in value. For example, use this pattern to identify when the temperature value from a sensor device starts continuously increasing.

To create an Up Trend pattern:

1. Navigate to the Catalog.

2. Select Create New Item >Pattern > Up Trend. You can also click Patterns and select Up Trend.The create pattern screen appears as shown below:

Figure 7-8 Create Up Trend Pattern

3. Select an Event Stream.

4. Enter a value for Partition Criteria. This value is used for partitioning the data in the event stream.

These are the fields in which you want to track the trend.

5. Enter a value for Duration and select its unit (one of nanoseconds, milliseconds, seconds, minutes, and hours). This is the interval within which the application looks for a pattern match.

6. Select a value in the Tracking Field drop-down. You can select only 1 item.

This is a source field whose behavior follows the trend for the pattern to emit the event.

The pattern is visually represented based on the data you have entered/selected.

7.6 Creating Down Trend Pattern

Use this pattern to detect when a numeric event field shows a specified trend change lower in value. For example, use this pattern to identify when the temperature value from a sensor device starts continuously decreasing.

To create a Down Trend pattern:

1. Navigate to the Catalog.

2. Select Create New Item > Pattern > Down Trend. You can also click Patterns and select Down Trend. The create pattern screen appears as shown below:

Figure 7-9 Create Down Trend Pattern

3. Select an Event Stream.

4. Enter a value for Partition Criteria. This filed can be used to partition the data in the event stream.

These are the fields in which you want to track the trend.

5. Enter a value for Duration and select its unit (one of nanoseconds, milliseconds, seconds, minutes, and hours). This is the interval within which the application looks for a pattern match.

6. Select a value in the Tracking Value field. You can select only 1 item.

This is a source field whose behavior follows the trend for the pattern to emit the event.

The pattern is visually represented based on the data you have entered/selected.

7.7 Creating Fluctuation Pattern

Use this pattern to detect when an event data field value changes in a specific upward or downward fashion within a specific time window. For example, use this pattern to identify the variable changes in an Oil Pressure value are maintained within acceptable ranges.

To create a Fluctuation pattern:

1. Navigate to the Catalog.

2. Select Create New Item > Pattern > Fluctuation. You can also click Patterns and select Fluctuation. The create pattern screen appears as shown below:

Figure 7-10 Create Fluctuation Pattern

3. Select an Event Stream.

4. Enter a value for Partition Criteria. This field can be used to partition the data in the event stream.

These are the fields in which you want to track the trend.

5. Enter a value in the Tracking Field. This value is used to track the event data and create a pattern in the live output stream.

6. Enter a value for Window and select its unit (one of nanoseconds, milliseconds, seconds, minutes, and hours). This is the frequency at which you want to refresh the data.

7. Enter a value for Deviation Threshold %. This value indicates the percentage of deviation you want to be included in the pattern.

This is the interval in which the application looks for a matching pattern.

The pattern is visually represented based on the data you have entered/selected.

7.8 Creating Eliminate Duplicates Pattern

Use this pattern to build an exploration that eliminates duplicate events in your event stream.

To create an Eliminate Duplicates pattern:

1. Navigate to the Catalog.

2. Select Create New Item > Pattern > Eliminate Duplicates. You can also click Patterns and select Eliminate Duplicates. The create pattern screen appears as shown below:

Figure 7-11 Create Eliminate Duplicates Pattern

3. Select an Event Stream.

4. Enter a value for Duplicate Criteria.

This is the field that you want to eliminate for duplicate keys.

5. Enter a value for Window and select its unit (one of nanoseconds, milliseconds, seconds, minutes, and hours). This is the range within which the application searches for duplicates.

The pattern is visually represented based on the data you have entered/selected.

7.9 Creating Detect Duplicates Pattern

Use this pattern to detect when an event data field has duplicate values within a specified period of time. For example, use this pattern when the same order is placed twice within a day.

To create a Detect Duplicates pattern:

1. Navigate to the Catalog.

2. Select Create New Item > Pattern > Detect Duplicates. You can also click Patterns and select Detect Duplicates. The create pattern screen appears as shown below:

Figure 7-12 Create Detect Duplicates Pattern

3. Select an Event Stream.

4. Enter a value for Duplicate Criteria.

This is the field that you want to look for duplicate keys.

5. Enter a value for Window and select its unit (one of nanoseconds, milliseconds, seconds, minutes, and hours). This is the interval in which the application looks for duplicates.

The pattern is visually represented based on the data you have entered/selected.

7.10 Creating W Pattern

Use this pattern to detect when an event data field value rises and falls in “W” fashion over a specified time window. For example, use this pattern when monitoring a market data feed stock price movement to determine a buy/sell/hold evaluation.

To create a W pattern:

1. Navigate to the Catalog.

2. Select Create New Item > Pattern > W. You can also click Patterns and select W. The create pattern screen appears as shown below:

Figure 7-13 Create W Pattern

3. Select an Event Stream.

4. Enter a value for Partition Criteria. You can select multiple fields.

These are the fields by which the data is partitioned to form a W.

5. Enter a value for Window and select its unit (one of nanoseconds, milliseconds, seconds, minutes, and hours). This is the interval in which the application looks for a matching pattern.

6. Select a numeric value for Tracking Value based on which variation constitutes a W-shape for the pattern-based exploration to produce event.

The pattern is visually represented based on the data you have entered/selected.

7.11 Creating Inverse W Pattern

Use this pattern to detect an inverse W pattern with live output stream.

To create an Inverse W pattern:

1. Navigate to the Catalog.

2. Select Create New Item > Pattern > Inverse W. You can also click Patterns and select Inverse W. The create pattern screen appears as shown below:

Figure 7-14 Create Inverse W Pattern

3. Select an Event stream.

4. Enter a value for Partition Criteria.

This is the field by which the data is partitioned to form an inverse W.

5. Enter a value for Window and select its unit (one of nanoseconds, milliseconds, seconds, minutes, and hours). This is the interval in which the application looks for a matching pattern.

6. Select a numeric value for Tracking Value based on which variation constitutes an inverse W-shape for the pattern-based exploration to produce event.

The pattern is visually represented based on the data you have entered/selected.

7.12 Creating 'A' Not Followed by 'B' Pattern

Use this pattern to pattern to detect when 'B' doesn't occur within a specified period of time after 'A'.

To create a ‘A’ Not Followed by ‘B’ pattern:

1. Navigate to the Catalog.

2. Select Create New Item > Pattern > ‘A’ Not Followed by ‘B’. You can also click Patterns and select ‘A’ Not Followed by ‘B’. The create pattern screen appears as shown below:

Figure 7-15 Create ‘A’ Not Followed by ‘B’

3. Select an Event Stream.

4. Select a field for Partition Criteria.
These are the fields based on which the pattern is formed to illustrate that A is not followed by B.

5. Select a field for State A: Field.

6. Select a field for State A: Value. This is the value for State A: Field.

7. Select a field for State B: Field.

8. Select a field for State B: Value. This is the value for State B: Field.

9. Enter a numerical value for the Duration which is greater than zero. You can use the increment and decrement icons to increase or decrease the values. This field is used to observe the pattern for specified duration.

The pattern is visually represented based on the data you have entered/selected.

7.13 Creating A Followed by B Pattern

Use this pattern to detect when an 'A' event is followed by a 'B' event within a specified period of time. Intermediate events are also allowed.

To create a ‘A’ Followed by ‘B’ pattern:

1. Navigate to the Catalog.

2. Select Create New Item > Pattern > ‘A’ Followed by ‘B’. You can also click Patterns and select ‘A’ Followed by ‘B’. The create pattern screen appears as shown below:

Figure 7-16 Create A Followed by B Pattern

3. Select an Event Stream.

4. Select a field for Partition Criteria.
These are the fields based on which the pattern is formed to illustrate that A is followed by B.

5. Select a field for State A: Field.

6. Select a field for State A: Value. This is the value for State A: Field.

7. Select a field for State B: Field.

8. Select a field for State B: Value. This is the value for State B: Field.

9. Enter a numerical value for the Duration which is greater than zero. You can use the increment and decrement icons to increase or decrease the values. This field is used to observe the pattern for specified duration.

The pattern is visually represented based on the data you have entered/selected.

7.14 Creating Standard Deviation Pattern

Use this pattern to calculate the standard deviation of the selected values with the expected values.

To create a Standard Deviation pattern:

1. Navigate to the Catalog.

2. Select Create New Item > Pattern > Standard Deviation. You can also select Patterns and click Standard Deviation. The create pattern screen appears as shown below:

Figure 7-17 Create Standard Deviation Pattern

3. Select an Event Stream.

4. Select a field for the Partition Criteria. This field decide the partition criteria in the standard deviation pattern.

5. Select an Observable Parameter. The standard deviation is calculated based on this parameter.

6. Enter a numerical value greater than zero for Window. You can use the increment and decrement icons to increase or decrease the values. Remember to select a suitable time unit for the Window. This value indicates the window within which you are tracking the standard deviation.

7. Enter a numerical value greater than zero for Slide. You can use the increment and decrement icons to increase or decrease the values. Remember to select a suitable time unit for the Window. This value indicates the value by which you can slide the window for calculating the standard deviation.

The pattern is visually represented based on the data you have entered/selected.

7.15 Creating Correlation Pattern

Use this pattern to calculate a correlation between two observable parameters of the live output stream.

To create a Correlation pattern:

1. Navigate to the Catalog.

2. Select Create New Item > Patterns > Correlation. You can also click Patterns and select Correlation. The create pattern screen appears as shown below:

Figure 7-18 Create Correlation Pattern

3. Select an Event Stream.

4. Select a field for Partition Criteria. This field is used as the criteria for partition.

5. Select a parameter for Observable Parameter 1. This is the first parameter to observe.

6. Select a parameter for Observable Parameter 2. This is the second parameter. These parameters are used to calculate a correlation between them.

7. Enter a numerical value greater than zero for Window. Use increment or decrement icons to increase or decrease the values. Select a suitable time unit. This is the window duration for which the correlation is calculated.

8. Enter a numerical value greater than zero to be used for the Slide duration. Use the increment or decrement values to increase or decrease the values.

The pattern is visually represented based on the data you have entered/selected.

7.16 Creating Quantile Pattern

Use this pattern to calculate the quantile of the event stream.

To create a Quantile pattern:

1. Navigate to the Catalog.

2. Select Create New Item > Pattern > Quantile. You can also click Patterns and select Quantile. The create pattern screen appears as shown below:

Figure 7-19 Create Quantile Pattern

3. Select an Event Stream.

4. Select a field for Partition Criteria. This field is used as the criteria for partition.

5. Select a field as the Observable Parameter 1.

6. Enter a numerical value greater than zero for the Phi-quantile. This value is used to calculate the quantile of the selected event stream.

7. Enter a numerical value for the Window which is greater than zero. You can use the increment and decrement icons to increase or decrease the values. Select a suitable time unit. This field determines the window within which the quantile is calculated.

8. Enter a numerical value greater than zero for the Slide. You can use the increment and decrement icons to increase or decrease the values. Select a suitable time unit. This field determines the slide duration.

The pattern is visually represented based on the data you have entered/selected.

7.17 Creating Median Pattern

Use this pattern to calculate the median of an event stream with respect to a specific parameter.

To create a Median pattern:

1. Navigate to the Catalog.

2. Select Create New Item > Pattern > Median. You can also click Patterns and select Median. The create pattern screen appears as shown below:

Figure 7-20 Create Median Pattern

3. Select an Event Stream.

4. Select a field for Partition Criteria. This field acts as the criteria for the partition.

5. Select an Observable Parameter. This is the parameter with respect to which the median of the stream is calculated.

6. Enter a numerical value greater than zero for Window. You can use the increment or decrement icons to increase or decrease the values. Select a suitable time unit. This field indicates the window within which you want to calculate the median.

7. Enter a numerical value greater than zero for Slide. You can use the increment or decrement icons to increase or decrease the values. Select a suitable time unit. This field indicates the slide of the pattern.

The pattern is visually represented based on the data you have entered/selected.

7.18 Creating Union Pattern

Use this pattern to create a union of events from two streams. The event shape of both the streams must be the same.

To create a Union pattern:

1. Navigate to the Catalog.

2. Select Create New Item > Pattern > Union. You can also click Patterns and select Union. The create pattern screen appears as shown below:

Figure 7-21 Create Union Pattern

3. Select the First event Stream.

4. Select the Second event Stream. A union of these event stream is created.

Remember
The shape must be the same for both the event streams.

The pattern is visually represented based on the data you have entered/selected.

7.19 Creating Change Detector Pattern

Use this pattern to detect when one or more parameters are changed within specified period of time.

To create a Change Detector pattern:

1. Navigate to the Catalog.

2. Select Create New Item > Pattern > Change Detector. You can also click Patterns and select Change Detector. The create pattern screen appears as shown below:

Figure 7-22 Create Change Detector Pattern

3. Select an Event Stream.

4. Select a field for Partition Criteria. This field acts as the criteria for the partition.

5. Enter a numerical value greater than zero for the Window Range. You can use the increment or decrement icons to increase or decrease the values. Select a suitable time unit.

This field is used to specify the window within which the change needs to be detected.

6. Select a field for which you to detect the change in Change Criteria (s). You can select multiple fields.

7. Select Alert on Group Changes if you want to be alerted for all observable parameters are changed together within a specified period of time. Deselect it if you want to be alerted for any one of observable parameters are changed within a specified period of time.

The pattern is visually represented based on the data you have entered/selected.

Oracle Stream Analytics detects changes within the specified period of time and sends output event (alert) either at the end of this period or either at the moment when changes do not happen any more. Let us consider the following graph for example.

Figure 7-23 Change Detector Pattern Example

Assume you specified duration equal to A-C interval. In "green" case you have values continuously changing from A to B within A-C interval. But, after the point B values do not change any more. So, you will receive alert at the moment B1.

In "blue" case you have values continuously changing during the whole interval - A-C. You will receive alert at the end of specified duration A-C, at the moment C.

Sometimes, you need to get alert immediately after any changes happen. That is in both cases "green" and "blue" cases, you will receive alert at the moment A1 because value had changed and continue receiving alerts until the point B in "green" case and point C in "blue" case.

As a workaround, you can minimize the window value to receive events just after the changes happen.

7.20 Creating K-means.Anomaly Detection Pattern

Use this pattern to explore data clusters and detect anomalies. K-Means is a widely used unsupervised machine learning algorithm for data exploration. K-Means is used in anomaly detection by identifying low density clusters (clusters with very few members), which equates to being less common. Oracle Stream Analytics supports 2 dimensional (2D) space of observations.

To create a K-means.Anomaly Detection pattern:

1. Navigate to the Catalog.

2. Select Create New Item > Pattern > K-means.Anomaly Detection. You can also click Patterns and select K-means.Anomaly Detection. The create pattern screen appears as shown below:

Figure 7-24 Create K-means.Anomaly Detection Pattern

3. Select an Event Stream.

4. Select a Value 1. This value is used to detect anomalies.

5. Select a Value 2. This value is used to detect anomalies.

6. Enter a numerical value greater than zero for N-clusters. You can use the increment or decrement icons to increase or decrease the values. This value indicates the number of clusters to be considered for detecting the anomalies.

The pattern is visually represented based on the data you have entered/selected.

7.21 Creating Spatial General Pattern

Use this pattern to analyze streams containing geo-location data and determine how events relate to pre-defined geo-fences in your maps.

To create a Spatial General pattern:

1. Navigate to the Catalog.

2. Select Create New Item > Pattern > Spatial General. You can also click Patterns and select Spatial General. The create pattern screen appears as shown below:

Figure 7-25 Spatial Pattern

The color coded on the map denote that:

- Black - indicates that no event is missed

- Orange - indicates that an event has entered the specified range

- Blue - indicates that an event has is near a specified range

- Purple - indicates that an event is within the stay range

- Green - indicates that an event has exited the specified range.

3. Select a Map. Maps that you have created earlier appear in this list.

4. Select an Event Stream.

5. Select a field to be used as the Latitude for the spatial.

6. Select a field to be used as the Longitude for the spatial.

7. Select a field to be used as the Object for the spatial. The object, latitude, and longitude determine the way a spatial map is displayed.

8. Select the options for Tracking Events. This field determines the proximity of the location for the pattern. The possible values are:

- Near — whenever a new event occurs in the defined spatial region defined by the specified latitude and longitude.

- Enter — whenever an existing event enters the spatial region defined by the specified latitude and longitude.

- Exit — whenever an event exits the spatial region defined by the specified latitude and longitude.

- Stay — when an event stays (the duration is specified in step 11) in the spatial region defined by the specified latitude and longitude.

9. Select an ID of the Coordinate System. The possible values are:

- 3857 — also known as WGS 84/Pseudo-Mercator - is a geodetic projected Cartesian 2d coordinate system

- 8307 — also known as Longitude/Latitude (WGS 84) - is an Elipsoidal 2d coordinate system. This coordinate system is introduced by Oracle and is used by default.

10. Enter a numerical value greater than zero for the Distance Buffer. Use the increment or decrement icons to increase or decrease the values. Select a suitable unit for the distance. This value determines the buffer range for calculating the spatial distance when you are tracking an even with a Near parameter.

A buffer usually defines the +/- range for the base value.

Note:
This field is enabled only when you select Near in Tracking Events.

11. Enter a numerical value greater than zero for the Stay Duration. Use the increment or decrement icons to increase or decrease the values. Select a suitable time unit. This value is used when you select the Stay option in Tracking Events. An event that stays for the specified Stay Duration will be detected.

Note:
This field is enabled only when you select Stay in Tracking Events.

The pattern is visually represented in the form of a map based on the data you have entered/selected.

7.22 Creating Detect Missing Heartbeat Pattern

Use this pattern to detect when an expected event does not occur within a specific time window. For example, use this pattern in circumstances when the next heartbeat event is missing.

To create a Detect Missing Heartbeat pattern:

1. Navigate to the Catalog.

2. Select Create New Item > Patterns > Detect Missing Heartbeat. You can also click Patterns and select Detect Missing Heartbeat. The create pattern screen appears as shown below:

Figure 7-26 Create Detect Missing Heartbeat Pattern

3. Select an Event Stream.

4. Select a field for Partition Criteria.

5. Enter a numerical value greater than zero for Heartbeat Interval. Use the increment or decrement icons to increase or decrease the value. Select a suitable time unit.

This value indicates the interval within which you want to detect a missing heartbeat.

The pattern is visually represented based on the data you have entered/selected.

7.23 Creating Left Outer Pattern

Use this pattern to enrich original stream events with the data from external reference or another stream. If there are no records in the reference/stream then stream shows null values as the output.

To create Left Outer Join pattern:

1. Navigate to the Catalog.

2. Select Create New Item > Pattern > Left Outer Join. You can also click Patterns and select Left Outer Join. The create pattern screen appears as shown below:

Figure 7-27 Create Left Outer Join Pattern

3. Select a Primary Stream.

4. Select an Enriching Reference/Stream for the Primary Stream.

5. Select a Primary Stream Correlation Criteria. This value acts as the correlation criteria for the primary stream.

6. Select an Enriching Reference/Stream Correlation Criteria for the Primary Stream Correlation Criteria.

7. Enter a numerical value greater than zero for the Window Range of the Primary Stream. You can use the increment or decrement icons to increase or decrease the value. Select a suitable time unit. This value indicates the window for the primary stream.

8. Enter a numerical value greater than zero for the Window Slide of the Primary Stream. You can use the increment or decrement icons to increase or decrease the value. Select a suitable time unit. This value indicates the slide for the primary stream.

9. Enter a numerical value greater than zero for the Window Range of the Enriching Stream. You can use the increment or decrement icons to increase or decrease the value. Select a suitable time unit. This value indicates the window for the enriching/secondary stream.

10. Enter a numerical value greater than zero for the Window Slide of the Enriching Stream. You can use the increment or decrement icons to increase or decrease the value. Select a suitable time unit. This value indicates the slide for the enriching/secondary stream.

The pattern is visually represented based on the data you have entered/selected.

8 Sign Out of Oracle Stream Analytics

This chapter explains the details about signing out of the Oracle Stream Analytics application.

8.1 Signing Out

After you are done with using the Oracle Stream Analytics application, you must sign out of the application.

To sign out:

1. Click the username at the top-right corner of the screen.

2. Select Sign Out in the drop-down list.

Figure 8-1 Signout

You are signed out of the application and taken back to the Sign In page. Sign In again to use the Oracle Stream Analytics application. For more information about signing in, see Sign In Page.

Oracle Legal Notices

Copyright Notice

Copyright © 1994-2018, Oracle and/or its affiliates. All rights reserved.

License Restrictions Warranty/Consequential Damages Disclaimer

This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.

Warranty Disclaimer

The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.

Restricted Rights Notice

If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable:

U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government.

Hazardous Applications Notice

This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.

Trademark Notice

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.

Third-Party Content, Products, and Services Disclaimer

This software or hardware and documentation may provide access to or information about content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services, except as set forth in an applicable agreement between you and Oracle.

Pre-General Availability Draft Documentation Notice

If this document is in public or private pre-General Availability status:

This documentation is in pre-General Availability status and is intended for demonstration and preliminary use only. It may not be specific to the hardware on which you are using the software. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to this documentation and will not be responsible for any loss, costs, or damages incurred due to the use of this documentation.

Private Pre-General Availability Draft Documentation Notice

If this document is in private pre-General Availability status:

The information contained in this document is for informational sharing purposes only and should be considered in your capacity as a customer advisory board member or pursuant to your pre-General Availability trial agreement only. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described in this document remains at the sole discretion of Oracle.

This document in any form, software or printed matter, contains proprietary information that is the exclusive property of Oracle. Your access to and use of this confidential material is subject to the terms and conditions of your Oracle Master Agreement, Oracle License and Services Agreement, Oracle PartnerNetwork Agreement, Oracle distribution agreement, or other license agreement which has been executed by you and Oracle and with which you agree to comply. This document and information contained herein may not be disclosed, copied, reproduced, or distributed to anyone outside Oracle without prior written consent of Oracle. This document is not part of your license agreement nor can it be incorporated into any contractual agreement with Oracle or its subsidiaries or affiliates.

Documentation Accessibility

For information about Oracle's commitment to accessibility, visit the Oracle Accessibility Program website at http://www.oracle.com/pls/topic/lookup?ctx=acc&id=docacc.

Access to Oracle Support

Oracle customers that have purchased support have access to electronic support through My Oracle Support. For information, visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=info or visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=trs if you are hearing impaired.