Skip Headers
Oracle® BPEL Process Analytics User's Guide
10g Release 2 (10.1.2)
Part No. B15597-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

8 Simulating Events

The Oracle BPEL Process Analytics event simulator enables you to generate events without connecting to an actual event source. This can be useful in designing and testing your data modeling and Dashboard configuration before implementing it with a production event source.

To use the event simulator, you must be familiar with the concept of a composite event and how the events you intend to simulate can be grouped as composite events.


Note:

This chapter uses the files provided for Sample 2: LoanFlow with Hierarchical Dimension Demo to demonstrate how to use the event simulator. If you have previously set up this demonstration, remove the loanFlowHDim event source from your Oracle BPEL Process Analytics configuration, by following these steps:
  1. Start Oracle BPEL Process Analytics, and open the Oracle BPEL Process Analytics Console as described in "Getting Started with the Admin Console".

  2. Click Admin.

  3. Click Event Source.

  4. Under BPA Event Simulator Sources, click the trash can icon associated with loanFlowHDim.

  5. Click Yes, on the Are You Sure? page.


This chapter includes the following topics:


Note:

The directory paths shown in this chapter follow Microsoft Windows conventions (using backslashes (\)). If you are running Unix, modify the directory paths as required (using slashes (/)).

Overview of Steps for Using the Event Simulator

To use the event simulator, the basic process is as follows:

  1. Create the files and directory structure required by the event simulator. For more information, see "Files Required for Using the Event Simulator".

  2. Open the Oracle BPEL Process Analytics Admin Console, and specify the event simulator as an Oracle BPEL Process Analytics Event Simulator event source.

  3. Model the event (by creating composite events, KPIs, and metrics, as desired).

  4. Open the Oracle BPEL Process Analytics Dashboard, and view the events, KPIs, and metrics in the Dashboard.

Files Required for Using the Event Simulator

To generate events, the event simulator requires the following files for each composite event for which you want to generate events. These files must reside in a single directory:

This chapter uses the Loan Provider demonstration (with hierarchical dimensions) to demonstrate the structure and contents of each of these files. The files for the demo are located in the following directory (where OAS_HOME is the Oracle Application Server home into which you installed Oracle BPEL Process Analytics).

OAS_HOME\integration\bam\test\data\loadGen\loanFlowHDim\loanFlowHDim

The following topics provide details about these required files and their location in the directory structure:

Setting Up the Directory Structure for the Required Files

The Oracle BPEL Process Analytics event simulator requires a parent directory that contains one or more subdirectories. Each subdirectory corresponds to a single composite event. The name of a subdirectory is the name of the composite event.

In the directory for the Loan Provider demonstration (with hierarchical dimensions), there is a parent directory named loanFlowHDim and a single subdirectory, also named loanFlowHDim. This subdirectory holds the .xml and .xsd files required to generate events for the loanFlowHDim composite event. If you want to create additional composite events for the Loan Provider demonstration, then create additional subdirectories in the following directory, where OAS_HOME is the Oracle Application Server home in which you installed Oracle BPEL Process Analytics:

OAS_HOME\integration\bam\test\data\loadGen\loanFlowHDim\loanFlowHDim

Required .xsd Files

The event simulator requires an .xsd file to specify the event attribute metadata. You can specify one .xsd file for all of the events in the composite event, or you can specify an .xsd file for each event. The .xsd file for the loanFlowHDim composite event is named LoanFlowPlus.xsd. The contents of LoanFlowPlus.xsd, as shown in Example 8-1, shows that an .xsd file for the event simulator contains the following elements to define the schema:

  • A declaration of the XML version.

  • A schema declaration that includes attributes to describe the namespace.

  • For each event, a parent element declaration that names each event and contains child element declarations that specify the name and type of each of the event attributes. (Note that the parent element names in the .xsd file are used to specify the rootElement values in the events.xml file.)

Providing a full description of how an .xsd file should be formed is beyond the scope of this guide. See standard texts on XML schema for detailed information.

Example 8-1 Contents of LoanFlowPlus.xsd

<?xml version="1.0"?>
<schema attributeFormDefault="qualified" 
        elementFormDefault="qualified" 
targetNamespace="http://www.autoloan.com/ns/autoloan" 
xmlns="http://www.w3.org/2001/XMLSchema">
 
 <element name="loanOffer">          
  <complexType>
   <sequence>
    <element name="id" type="string"/>
    <element name="providerName" type="string"/>
    <element name="selected" type="boolean"/>
    <element name="approved" type="boolean"/>
    <element name="APR" type="double"/>
   </sequence>
  </complexType>
 </element>
 
 <element name="loanApplication">
  <complexType>
   <sequence>
    <element name="id" type="string"/>
    <element name="SSN" type="string"/>
    <element name="email" type="string"/>
    <element name="customerName" type="string"/>
    <element name="loanAmount" type="double"/>
    <element name="carModel" type="string"/>
    <element name="carYear" type="string"/>
    <element name="creditRating" type="int"/>
   </sequence>
  </complexType>
 </element>
 
 <element name="task">
   <complexType>
     <sequence>
      <element name="taskId" type="string" minOccurs="0"/>
      <element name="title" type="string" minOccurs="0"/>
      <element name="creationDate" type="dateTime" minOccurs="0"/>
      <element name="creator" type="string" minOccurs="0"/>
      <element name="modifyDate" type="dateTime" minOccurs="0"/>
      <element name="modifier" type="string" minOccurs="0"/>
      <element name="assignee" type="string" minOccurs="0"/>
      <element name="status" minOccurs="0">
       <simpleType>
        <restriction base="string">
          <enumeration value="active"/>
          <enumeration value="completed"/>
        </restriction>
       </simpleType>
      </element>
      <element name="expired" type="boolean" minOccurs="0"/>
      <element name="expirationDate" type="dateTime" minOccurs="0"/>
      <element name="duration" type="duration" minOccurs="0"/>
      <element name="priority" type="int" minOccurs="0"/>
      <element name="template" type="string" minOccurs="0"/>
      <element name="customKey" type="string" minOccurs="0"/>
      <element name="conclusion" type="string" minOccurs="0"/>
      <element name="attachment" type="anyType"/>
     </sequence>
   </complexType>
 </element>
</schema>

Required .xml Files

The event simulator requires an .xml file for each event it is to generate. See the LoanOfferResponse.xml file specified for the loanFlowHDim composite event, shown in Example 8-2, for an example.

The .xml file for a simulated event contains the following:

  • A declaration of the XML version.

  • An instance of the event – the element name (loanOffer, in this example) must match the name of the event in the .xsd file.

Be aware that the namespace attribute values must match the namespace attribute values specified in the .xsd file.

Example 8-2 Contents of the LoanOfferResponse.xml File

<?xml version='1.0' ?>
<loanOffer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
           xmlns="http://www.autoloan.com/ns/autoloan">
         <id>123456</id>
         <providerName>Star Loan Provider</providerName>
         <selected>true</selected>
         <approved>true</approved>
         <APR>450</APR>
</loanOffer>

Required events.xml File

The event simulator requires an events.xml file that minimally provides references to the .xsd and event instance .xml files, the root element for the event, how attribute values should be correlated, and which values should be used in generating events. If desired, you can specify the frequency at which each event should be generated and the time delay between events.

The parent elements in the events.xml file (in addition to the XML version declaration) are the following:

Although code examples are presented with each element description, you may find it helpful to view the events.xml file for the sample LoanFlow with Hierarchical Dimension Demo as you read this section.

<EventMap> Element

The <EventMap> element contains all of the other elements contained within the events.xml document. This element is required. Specify one <EventMap> element in the events.xml file.

<Paths> Element

The <Paths> element specifies how often a given instance of a composite event is to be generated. Within the <Paths> element are two or more <Path> elements. Each <Path> element represents one full set of events in a process flow, from the start event to an end event.

The <Paths> element is optional. If used, specify one <Paths> element in the events.xml file. If the <Paths> element is not specified, the distribution of events generated for a composite event instance is uniform across all events specified.

The <Paths> element in the events.xml file for the Loan Provider demonstration (with hierarchical dimensions) appears as follows:

<Paths>
  <Path percent="20">
    <Event>LoanRequest</Event>
    <Event>LoanStatus4BadCredit</Event>
  </Path>
  <Path percent="80">
    <Event>LoanRequest</Event>
    <Event>LoanRequestApproved</Event>
    <Event>LoanOfferSelected</Event>
    <Event>LoanOfferResponse</Event>
  </Path>
</Paths> 

This <Paths> declaration specifies that for each loan requested, the composite event ending with the LoanStatus4BadCredit event should be generated 20 percent of the time, whereas the composite event ending with the LoanOfferResponse event should be generated 80 percent of the time.

<Events> Element

The <Events> element specifies an <Event> element for each event to be generated. This element is required. Specify one <Events> element in the events.xml file. You can specify multiple <Event> elements within the <Events> element.

The <Event> element for the LoanStatus4BadCredit event in the events.xml file for the Loan Provider demonstration (with hierarchical dimensions) appears as follows:

<Event name="LoanStatus4BadCredit" endEvent="true">  <schema>LoanFlowPlus.xsd</schema>  <delay>6</delay>  <rootElement>task</rootElement>  <Attribute correlateAttr="true">     <XPath>/task/taskiId</XPath>     <MappedType>Number</MappedType>     <Alias>LoanApplicationId</Alias>  </Attribute>  <Attribute>     <XPath>/task/conclusion</XPath>     <MappedType>Text</MappedType>     <Alias>Status</Alias>  </Attribute>  <instance>   <file>LoanStatus4BadCredit.xml</file>   <correlate attr="LoanApplicationId">     <with event="LoanRequest" attr="LoanApplicationId"/>   </correlate>   <randomize attr="Status">     <values generator="loanStatus"/>   </randomize>  </instance> </Event>

For each event that you want to generate, specify an <Event> element, as follows. Unless otherwise noted, each element is required.

  • <Event > – Specify a name for the event.

  • <schema> – Specify the schema (.xsd) file for the event.

  • <delay> – Specify the amount of time (in milliseconds) between the time that the previous event in the process flow is generated and this event is generated. This element is optional.

  • <rootElement> – Specify the root element for the event. The root element for an event must be the same as the corresponding <element> name attribute in the .xsd file.

  • <Attribute> – Specify an <Attribute> element for each event attribute to be included when the event is generated. For each event attribute, specify the following:

    • If the event attribute is the correlation attribute for the composite event, specify the correlateAttr=True attribute. By default, an event attribute is not a correlation attribute for the composite event.

    • <XPath> – Specify the XPath for the event attribute.

    • <MappedType> – Specify the data type of the event attribute.

    • <Alias> – Specify an alias to serve as an abbreviation for the XPath.

  • <instance> – Specify the following details about the event instance to be generated:

    • <file> – Specify the .xml file that corresponds to the event instance.

    • <correlate> – Specify the event attribute that you want to use to correlate this event with another event by using the <Alias> value. Within the <correlate> element, specify the <with> element to indicate the event and event attribute to which this event will be correlated.

      In the <Event> element for the LoanStatus4BadCredit event in the events.xml file, the LoanApplicationID for the LoanApplication4BadCredit event is correlated with the LoanApplicationID for the LoanRequest event. This correlation enables you see which events are associated with a given loan request.

    • <randomize> – Specify the alias for the event attribute for which you want to generate random events. Within the <randomize> element, specify the <values> element with the generator attribute to indicate which of the load generators to use to generate the events. (The load generators are specified by the <LoadGenerator> elements at the end of the file.)

<Load Generator> Element

The <Load Generator> element allows you to replace event attribute values with randomly generated values. Multiple <Load Generator> elements can be specified in a single events.xml file. This element is optional, but only one instance of each event will be generated if you do not specify this element for each event you want to generate.

Two types of generator are available:

  • String

    For a string generator, you specify the list of strings from which the event simulator can randomly choose for each event instance it simulates. One of the <Load Generator> elements in the events.xml file for the Loan Provider demonstration (with hierarchical dimensions) is as follows:

    <LoadGenerator name="providerName" type="string">
     <value>Star Loan Provider</value>
     <value>United Loan Provider</value>
    </LoadGenerator>
    
    

    This specifies that the event simulator can use Star Loan Provider or United Loan Provider as a value for the providerName event attribute.

  • Integer

    For an integer generator, you specify a range of values from which the event simulator can randomly choose for each event instance it simulates. One of the <Load Generator> elements in the events.xml file for the Loan Provider demonstration (with hierarchical dimensions) is as follows:

    <LoadGenerator name="crRating" type="integer">
     <value begin="200" end="800"/>
    </LoadGenerator>
    
    

    This specifies that the event simulator can use any value between 200 and 800 (inclusive) as a value for the crRating (credit rating) event attribute.

Using the Admin Console to Model the Simulated Events

Once you have created the events.xml, .xsd file (or files), and the event instance .xml files for each composite event within a single directory, you are ready to use the Admin Console to specify the event simulator as the event source and model the events, as described in the following topics:

Specifying the Event Simulator as the Event Source

You specify the event simulator as the event source using the Admin section of the Admin Console, as follows:

  1. Open and log in to the Admin Console as the Administrator, as described in "Getting Started with the Admin Console".

  2. Click Admin.

  3. Click Event Source.

  4. Click the Create button associated with the BPA Event Simulator Sources table. The Add Event Source page opens.

  5. Specify the values for the event simulator as described in the table that follows this list and as shown in Figure 8-1. If you want to follow the steps described in this chapter, specify the values listed in the Example Values column, where OAS_HOME is the Oracle Application Server home where you installed Oracle BPEL Process Analytics.

  6. Click Finish.

Page Element Description Example Values
Name Enter an alphanumeric name by which you want to refer to the event simulator. LoanFlowSim
Description Enter a description of the event simulator. Event simulator for the Loan Provider demonstration
Event Simulator Event Source Data Directory Enter the specification for the parent directory that holds the composite event directory (or directories) for your event simulator files. Do not specify a composite event directory name.
OAS_HOME\integration\bam\test\data\loadGen\loanFlowHDim

The directory path shown follows Microsoft Windows conventions (using backslashes (\)). If you are using Unix, modify the directory path as required (using slashes (/))

Figure 8-1 Event Source Page for Sample Event Simulator

Description of event_sim_spec.gif follows
Description of the illustration event_sim_spec.gif

Creating a Composite Event and Dimensions for Simulated Events

Creating a composite event for simulated events is similar to creating a composite event for actual events. The main differences arise because the composite event details for a simulated event are specified in the events.xml document.

Creating a dimension for simulated events is the same as it is for actual events.

The following two topics step you through the process of defining a dimension and composite event using the Loan Provider demonstration (with hierarchical dimensions).

Creating the ProviderName Dimension

To create the ProviderName dimension:

  1. In the Admin Console, click Modeling.

  2. Click Dimensions.

  3. Click the Create button.

  4. In the Name field, enter ProviderName.

  5. Click Next.

  6. In the Data Type field, select varchar2.

  7. In the Column size field, enter 25.

  8. Click Finish.

Creating the loanFlowHDim Composite Event

To create the loanFlowHDim composite event:

  1. In the Admin Console, click Modeling.

  2. Click Composite Events.

  3. Click the Add Composite Event button.

  4. Click the Create button associated with the LoanFlowSim event source. The Properties page of the Add Composite Event Wizard opens.

  5. In the Description field, enter a description for the composite event.

  6. Leave the Timeout field values as they are.

  7. Click Next.

  8. Select the loanFlowHDim composite event, then click Next.

  9. The values for this page are prefilled, based on the <Event> elements specified in the events.xml file. Click Next.

  10. Move the ProviderName dimension from the Available Dimensions box to the Selected Dimensions box, and click Next.

  11. Expand the navigation tree and select the LoanOfferSelected/ProviderName (as shown in Figure 8-2) and the LoanOfferResponse/ProviderName attributes.

    Figure 8-2 Navigation Tree for LoanFlowHDim Dimension Mapping

    Description of event_sim_map.gif follows
    Description of the illustration event_sim_map.gif

  12. Click Finish.

Creating Metrics and Key Performance Indicators for Simulated Events

You create metrics and KPIs for simulated events as described for actual events. See "Creating Metrics" and "Creating Key Performance Indicators" for more information.

Viewing the Simulated Events in the Dashboard

When you have created all the files required for the event simulator, have specified the event simulator as an event source, and have created a composite event, then you can use the Real-Time Viewer in the Dashboard to view the events as they are simulated.

To view simulated events in the Dashboard:

  1. Open the Dashboard in the Oracle BPEL Process Analytics Console.

  2. In the Switch View box, select Real-Time Viewer.

  3. Select 15 minutes.

  4. In the Composite Event field, select the composite event you want to view. If you are following this chapter using the Loan Provider demonstration, select loanFlowHDim. The Real-Time Viewer should appear similar to Figure 8-3.

  5. Click a data point within the Real-Time Viewer to display details about that event instance. A Composite Event Details page opens, similar to Figure 8-4.

Figure 8-3 Simulated Events in Real-Time Viewer

Description of event_sim_rtv.gif follows
Description of the illustration event_sim_rtv.gif

Figure 8-4 Sample Composite Event Details Page

Description of event_sim_cedetails.gif follows
Description of the illustration event_sim_cedetails.gif

If you created KPIs or metrics, you can view them in the Dashboard by selecting Default KPI View or Default Metric View in the Switch View box.

Adjusting the Speed at Which Events Are Generated

You can adjust the speed at which events are generated by adjusting the values for the following entries in the bam.properties file and restarting the Oracle BPEL Process Analytics server:

See "Setting Log File, Dashboard, and Other Properties" for information about the location of the bam.properties file and how to set the values for these properties.