Vous êtes sur la page 1sur 75

7

VEE - Creating New VEE Rules

Copyright 2010, Oracle. All rights reserved.

Creating New VEE Rules


The previous section described the base-package VEE rules
These rules may suffice for some implementations; other implementations may require additional rules
The upcoming chapter describes how to introduce new rules
A few important rules of thumb before beginning:

It is very important that new VEE rules be written as efficiently as possible as the impact of inefficient
logic is magnified due to the volumes of IMDs. For example, consider an implementation with
5,000,000 devices where each device has 2 channels that measure consumption in 15 minute
intervals and each device sends an IMD 3 times each day. A VEE rule applied to such a rule will be
applied to ~ 30 million IMDs with ~ 3 billion measurements each day.

Use the base-package services to do the "heavy lifting" when possible as they are efficient
The upcoming section will explain several of these services
However, even these services can be slow if supplied with "wide" date ranges
If a rule is used exclusively by low volume IMDs (e.g., an industrial-only rule), it can be written in
Java or scripting / xpath2 (the script overhead won't be significant)
If a rule is used by the mass market, it must be written in Java (every millisecond matters)
Avoid retrieving large numbers of individual final measurements

30 million IMDs * .1 second is 833 HOURS


30 million IMDs * .01 second is 83 hours
30 million IMDs * .001 second is 8 hours
All of the above times are NOT acceptable; any new rules must be constructed with efficiency as the
paramount criterion

It is much better to invoke base-package services that use the database to calculate sums / averages
/ maximums from final measurements

If you develop a rule using scripting / xpath, it is far better to move group nodes rather than move
individual measurements

7 (part II) - 2

If your rule does not requires xpath2 functions, xpath1 is faster

Copyright 2010, Oracle. All rights reserved.

The Apply Formula Service May Be Useful If


You Develop New VEE Rules

Copyright 2010, Oracle. All rights reserved.

The Apply Formula Service Performs Vector Mathematics


The apply formula service performs numerous vector math functions very efficiently

The underlying logic uses sophisticated techniques to optimize the calculations


It is invoked from many parts of the system, including many VEE rules
If you author a VEE rule that requires vector mathematics, it may prove useful
The upcoming slides describe its many functions through a series of examples

Interval

7 (part II) - 4

IV1
Interval
Value
Channel 1
(kwh)

IV2
Interval
Value
Channel 2
(kwh)

IV1 + IV2
Final Value

10:00 AM

1.2

0.23

1.43

11:00 AM

1.234

1.321

2.555

12:00 PM

2.0121

2.12

4.1321

1:00 PM

1.456

1.12

2.576

2:00 PM

1.2345

0.12

1.3545

3:00 PM

1.0012

2.1212

3.1224

4:00 PM

0.012

2.65

2.662

5:00 PM

0.121

0.121

0.242

Copyright 2010, Oracle. All rights reserved.

For example, the service can


calculate a Final Values vector
that is the sum of two vectors

Apply Formula: Basic Inputs and Outputs


The following can be supplied to the service:

Vector Values

Formula

The adjacent example has a Vector Value of kWh


measurements (IV1)
A formula that is applied to each entry in the
Vector Values

Definitions of the variables referenced in the


formula:

Vx references a value that is derived by the


service

The adjacent example's formula references a


variable, V1, where V1 is the value of the
LINELOSS factor

The service returns:

Final Values (FV) Vector

This is the result of the Formula being calculated


for each row in the supplied Vector Values

7 (part II) - 5

In this example, the caller supplies:


The interval measurements: IV1
The definition that V1 is calculated using
factor='LINELOSS'.
Formula: IV1*V1

Interval

IV1
kWh

IV1*V1
Final Value (FV)

10:00 AM

1.2

1.212

11:00 AM

1.234

1.24634

12:00 PM

2.0121

2.03222

1:00 PM

1.456

1.47056

2:00 PM

1.2345

1.24685

3:00 PM

1.0012

1.01121

4:00 PM

0.012

0.01212

5:00 PM

0.121

0.12221

Copyright 2010, Oracle. All rights reserved.

In this example, the value of


the Line Loss Factor is 1.01
for the period being
calculated

Variables Can Reference Set Functions


The prior slide illustrated a formula with a variable whose value
is retrieved from a factor and multiplied by each value in the
first interval value vector (IV1*V1)
A variable can also be defined as a value that is derived from
the vector values; this type of variable is referred to as a set
function
The adjacent example uses a set function to calculate each
channel's share of a scalar measurement

Note, the scalar value is supplied by the caller in a scalar


variable (SV1). An unlimited number of scalar variables
can referenced in a formula.
The following set functions can be referenced in defined
variables:

MIN (to get the minimum value of intervals)

MAX (to get the maximum value of intervals)

TOT (to get the total of intervals)

ACC (to get the running total of intervals)

CNT (to get the count of intervals)

AVG (to get the average of all intervals)

7 (part II) - 6

In this example, the caller supplies:


The interval measurements: IV1
The scalar measurement for the entire
period: SV1
The definition that V1 is calculated using
setFunct=TOT(IV1). This means that V1
contains the total of IV1.
Formula: (IV1/V1)*SV1
SV1

20

V1

TOT(IV1)

Interval

IV1 kWh

FV (IV1/V1)*SV1

10:00 AM

1.2

2.90177

11:00 AM

1.234

2.98399

12:00 PM

2.0121

4.86555

1:00 PM

1.456

3.52082

2:00 PM

1.2345

2.9852

3:00 PM

1.0012

2.42105

4:00 PM

0.012

0.02902

5:00 PM

0.121

0.2926

Copyright 2010, Oracle. All rights reserved.

The final value is each interval's


proportion of the scalar amount

A Formula Can Be Applied To The Final Value


Vector
In this example, the caller supplies:
The interval measurements: IV1, IV2
Vector Formula: (IV1+IV2)/2
The definition that V1 is calculated using
setFunct=MAX(FV). This means that V1 contains the
maximum of the FV vector.
The definition that V2 is calculated using factor='LINELOSS'.
Final Formula: V1*V2

In addition to supplying a formula that's


applied to each vector value, the caller can
supply a different formula to be applied to the
final value vector

The results of this Final Formula are


returned along with the final value
IV1
Interval
KW
vector
10:00 AM
1.2
The adjacent example calculates the average
11:00 AM
1.234
of two channels and then applies a line loss to
12:00 PM
2.0121
the maximum of the average values
1:00 PM
1.456
2:00 PM
1.2345
Notice how the defined variables (V1 and V2)
3:00 PM
1.0012
are used in the Final Formula
4:00 PM
0.012

If a defined variable references a set


5:00 PM
0.121
function applied to the FV, this variable
can only be used in the final formula
Where V1 is the max value in
(otherwise recursion would exist)
the final value vector and V2 is
the line loss value (1.01)

7 (part II) - 7

Copyright 2010, Oracle. All rights reserved.

FV
(IV1 + IV2) /
2

IV2
KW
0.23

0.715

1.321

1.2775

2.12

2.06605

1.12

1.288

0.12

0.67725

2.1212

1.5612

2.65

1.331

0.121

0.121

Final
Value
(V1*V2)

2.086711

Formulas May Contain More Sophisticated


Operators
A formula can reference the following
operators:

*, /, -, +, ABS, NEGATE, ROUND,


FLOOR (meaning to round down),
CEILING (meaning to round up),
SIN, ASIN, COS, ACOS, TAN,
ATAN, LOG, LOG10, EXP,
EXP10, SQRT, **

In this example, the caller supplies:


The interval measurements: IV1, IV2
Vector Formula: COS(ATAN(IV1/IV2))
The definition that V1 is calculated using setFunct=MAX(FV)
Final Formula: V1

Interval

IV1
kVARh

IV2
kWh

10:00 AM

1.2

0.23

0.188240

11:00 AM

1.234

1.321

0.730760

12:00 PM

2.0121

2.12

0.725323

1:00 PM

1.456

1.12

0.609710

2:00 PM

1.2345

0.12

0.096749

3:00 PM

1.0012

2.1212

0.904328

4:00 PM

0.012

2.65

0.999989

5:00 PM

0.121

0.121

0.707106

Final
Value

7 (part II) - 8

FV
COS(ATAN(IV1/IV2))

Copyright 2010, Oracle. All rights reserved.

0.999989

Conditional Formulas Are Possible


Instead of supplying a single formula that's
applied to every vector value, the caller can
indicate formulas are conditionally applied
For example, to calculate a final value vector
that is the greater of two channels, the caller
can use a Conditional Formula that does the
following:

If IV1 > IV2

Final Value = IV1

Else

7 (part II) - 9

Final Value = IV2

In this example, the caller supplies:


The interval measurements: IV1, IV2
Conditional Formula 1:

Operand 1: IV1

Operator: >

Operand 2: IV2

True Action: IV1

False Action: IV2


Interval

IV1

IV2

FV

10:00 AM

1.2

0.23

1.2

11:00 AM

1.234

1.321

1.321

12:00 PM

2.0121

2.12

2.12

1:00 PM

1.456

1.12

1.288

2:00 PM

1.2345

0.12

1.2345

3:00 PM

1.0012

2.1212

2.1212

4:00 PM

0.012

2.65

2.65

5:00 PM

0.121

0.121

0.121

Copyright 2010, Oracle. All rights reserved.

Conditional Formulas Can Compare Strings


In addition to supplying value vectors, the caller can
also supply vectors containing interval conditions
(IC); this would be done to allow a formula to
reference each interval's condition code
Conditional formulas can have a variety of operators:
=, !=, >, >=, <=, <, in, between

in requires the list of "in values"

These can be literals, defined variables, scalar


strings, scalar values

between requires the definition of the from /


through values

These can be literals, defined variables, scalar


strings, scalar values

For example, to calculate a final value vector that


contains estimated consumption:

If IC1 between ('300000','499999')

Final Value = IV1

Else

Final Value = '0'

In this example, the caller supplies:


The interval measurement and its condition: IV1, IC1
Conditional Formula:

Operand 1: IC1

Operator: between

Operand 2: '300000', '499999'

True Action: IV1

False Action: 0
The definition that V1 is setFunct=TOT(FV)
Final Formula: V1
Interval

IV1

IC1

FV

10:00 AM

1.2

501000

11:00 AM

1.234

501000

12:00 PM

2.0121

501000

1:00 PM

1.456

301000

1.4560

2:00 PM

1.2345

301000

1.2345

3:00 PM

1.0012

501000

4:00 PM

0.012

501000

5:00 PM

0.121

501000

Final
Value

7 (part II) - 10

Copyright 2010, Oracle. All rights reserved.

2.6905

Conditional Formula Can Calculate Percentages


Another example to help put this all
together - the adjacent configuration
will return the percent of intervals that
are considered missing (missing
intervals have condition codes in the
range of '000000' to '299999')

In this example, the caller supplies:


The interval condition: IC1
Conditional Formula:

Operand 1: IC1

Operator: between

Operand 2: '000000', '299999'

True Action: 1

False Action: 0
The definition that V1 is setFunct=TOT(FV)
The definition that V2 is setFunct=CNT(FV)
Final Formula: V1/V2*100
Interval

IV1

IC1

FV

10:00 AM

1.2

501000

11:00 AM

1.234

501000

12:00 PM

2.0121

501000

1:00 PM

1.456

201000

2:00 PM

1.2345

201000

3:00 PM

1.0012

501000

4:00 PM

0.012

501000

5:00 PM

0.121

501000

Final
Value

7 (part II) - 11

Copyright 2010, Oracle. All rights reserved.

25

Conditional Formula Are Much More


Sophisticated
The syntax of conditional formulas is more
powerful than the earlier examples
The actual syntax is

if operand1 operator operand2


trueAction

else
falseAction
operand1 is a formula

This means that you can compare a computed


value (e.g., COS(ATAN(IV1/IV2)))

operator was described earlier


operand2 can be a formula, an in list, or a between
range
trueAction and falseAction can be a formula or an
indication that the next conditional formula should
be checked

It is possible to supply multiple conditional


formulas and the service will stop at the first one
that results in a trueAction or falseAction
executing a formula

7 (part II) - 12

In this example, the caller supplies:


The interval measurements: IV1, IV2
Conditional Formula 1:

Operator 1: IV1

Operand: >

Operator 2: IV2

True Action: IV1

False Action: check next


Conditional Formula 2:

Operator 1: IV2

Operand: >

Operator 2: 2.5

True Action: 0

False Action: IV2


Interval

IV1

IV2

FV

10:00 AM

1.2

0.23

1.2

11:00 AM

1.234

1.321

1.321

12:00 PM

2.0121

2.12

2.12

1:00 PM

1.456

1.12

1.288

2:00 PM

1.2345

0.12

1.2345

3:00 PM

1.0012

2.1212

2.1212

4:00 PM

0.012

2.65

5:00 PM

0.121

0.121

0.121

Copyright 2010, Oracle. All rights reserved.

Invoking The Apply Formula Service From A


Script
To invoke the apply formula service from a script, set up a business service
with the variable definitions defined as default values in its schema
This is an example of a simple apply formula
configuration that will add a supplied scalar
value to every supplied interval value

Notice how the supplied


scalarValue is mapped to the
first entry in the scalar value list
(SC_LIST)
Notice how the supplied mL
(measurement list) is
mapped to the first interval
consumption list (IC_LIST1)

Notice how the


simpleFormula is mapped
Notice the standard mL is
returned. Note, the fc node is
populated with the condition
codes from the first vector (if
supplied)
7 (part II) - 13

Copyright 2010, Oracle. All rights reserved.

Invoking The Apply Formula Service With A


Notice the 2 defined variables
Conditional Formula
that are set functions
The following is an example of a
business service that invokes the apply
formula service with a single conditional
formula
Notice how the supplied
scalarValue is mapped to the
first entry in the scalar value list
(SC_LIST)
Notice how the supplied mL
(measurement list) is
mapped to the first interval
consumption list (IC_LIST1)
Read the Detailed Description for
what this invocation calculates
Notice how the
simpleFormula is mapped
Notice the definition of the
conditional formula

7 (part II) - 14

Copyright 2010, Oracle. All rights reserved.

Notice the standard mL is


returned ??? Not sure how "fc" is
populated

In Summary: Inputs and Outputs


The following can be supplied to the service:

Vector Values

Vector Formula

or

Simple Formula
1 to many Conditional Formulas

Final Formula

Up to 5 interval value vectors that contain numeric values


Up to 5 interval condition vectors that contain strings

A formula that is applied to the vector that results from the


vector formula

Definitions of the variables referenced in the formulas:

IVx references one of the 5 interval value vectors


ICx references one of the 5 interval condition codes
SVx references a numeric constant supplied by the caller
Vx references a value that is derived by the service

These can be defined as set functions, factor values, or elements


on objects related to the MC or IMD

SSx references a string constant supplied by the caller

The service returns:

Final Values Vector

This is the result of the Vector Formula (either simple or


conditionals) being calculated for each row in the supplied
Vector Values

Final Value

In this example, the caller supplies:


The interval condition: IC1
Conditional Formula:

Operand 1: IC1

Operator: between

Operand 2: '000000', '299999'

True Action: 1

False Action: 0
The definition that V1 is setFunct=TOT(FV)
The definition that V2 is setFunct=CNT(FV)
Final Formula: V1/V2*100
Interval

IC1

FV

10:00 AM

1.2

501000

11:00 AM

1.234

501000

12:00 PM

2.0121

501000

1:00 PM

1.456

201000

2:00 PM

1.2345

201000

3:00 PM

1.0012

501000

4:00 PM

0.012

501000

5:00 PM

0.121

501000

This is the result of the Final Formula applied to the


calculated Final Values Vector

7 (part II) - 15

IV1

Copyright 2010, Oracle. All rights reserved.

Final
Value

25

Practice 7-3 (30 Minutes)


In this practice, you will create a custom VEE rule that
applies to both electric and water interval MCs
If any existing final measurements during the period of
the IMD have been marked with a condition
corresponding to super, those individual measurements
should be preserved
Please break up into teams and design the admin data
necessary to add the new VEE rule and the lifecycle
algorithm. Before adding the rules, please check your
configuration using the upcoming slides.
After the admin data is in place, continue following the
instructions to create IMDs for your water MCs

7 (part II) - 16

Copyright 2010, Oracle. All rights reserved.

7-3 Data Overview


Device

MC Type
Device Config.

Fallback Vee
Group

Fallback

MC

VEE Group

Initial Meas.
Data (IMD)

Business Object

VEE Rule

Exception Type

2
BO / Algorithm

Measurement

Legend

2
System Event

2
Algorithm

Trans. Data

Algorithm Type

Script

Admin Data
Master Data

Apply VEE Rule

Script Step

FW Data
MO Boundary

7 (part II) - 17

Business
Service

Copyright 2010, Oracle. All rights reserved.

Described
elsewhere
ST - Status
CH - Characteristics
X - CLOB

7-3 Solution
Business Object - Define Parent BO
1.1

Navigate to Admin / B / Business Object and find D1-GenericVEERule (the BO you will use as the parent).
Click Duplicate to duplicate this BO. When prompted, please prefix your new BO with your initials (in real life, this
would be prefixed with CM).

Change the description to include your initials


Keep Super Measurements

Change the parent to the BO you are


extending - you're creating a child BO

7 (part II) - 18

Copyright 2010, Oracle. All rights reserved.

7-3 Solution
Business Object - Define BO Schema
1.2

Navigate to Business Object - Schema tab and define the schema

Your BO's schema should include the


schema of the parent BO
Note that we're not adding any elements to
this BO
2

Click the Create Algorithm button to


initiate the wizard that sets up a new
algorithm type, algorithm, script, and
then plugs the algorithm into a
designated plug-in spot. The next slide
shows how this works

7 (part II) - 19

Copyright 2010, Oracle. All rights reserved.

7-3 Solution
Supply The Wizard's Parameters
2

Define the Name and


Description of the algorithm,
algorithm type and script
Define the BO System Event and
Sequence into which the
algorithm will be plugged

Click Save to set up these objects and


be transferred to the Script page
where the logic can be defined.

7 (part II) - 20

Copyright 2010, Oracle. All rights reserved.

7-3 Solution
Script - Set Up The Plug-In Script's Data Areas
3.1

Notice how the Data Area Name has been


changed to be easier to read. This is
purely subjective and optional.

To preserve final measurements with a particular


condition value during the IMD period, this rule will
retrieve final measurements for the IMD period (if they
exist), and replace any interval in the IMD's post-VEE
list with the corresponding final measurement value IF
the final measurement has a condition of super

What about the link between the final measurement


and its original IMD? Can it be preserved along with
the value if the final measurement has a condition of
super? Yes - the IMD lifecycle algorithm that creates
final measurements can be configured not to replace
a final measurement if its value is the same as the
interval being finalized

7 (part II) - 21

This means we'll need data areas to hold the final


measurements for the period as well as the IMD
We will use the Apply Formula service to pick either
initial or final measurements for each interval, and
we need a data area to store the input and output
of the Apply Formula service call - BUT we're going
to create new business service for this purpose and
come back to add the data area to the script later

Copyright 2010, Oracle. All rights reserved.

7-3 Solution
Configuring Apply Formula to Choose Super Intervals
4.1

First, let's look at the input needed to call


the Apply Formula service to satisfy the
following:

If the final measurement has a


condition of super (condition values
are configured using an extendable
lookup, and the value of super is
901000), its value will be used in the
final values curve; otherwise the
initial measurement's value will be
used in the final values curve
We will use the post-VEE list of the IMD
as input to the second interval vector

7 (part II) - 22

In this example, the business service should supply


the Apply Formula service with the following:
The final interval measurements and conditions:
IV1, IC1
The initial interval measurements: IV2
The definition of SS1 as '901000'
Conditional Formula:

Operand 1: IC1

Operator: =

Operand 2: '901000'

True Action: IV1

False Action: IV2


Interval

IV1

IC1

IV2

FV

10:00 AM

1.2

901000

0.23

1.2

11:00 AM

1.234

501000

1.321

1.321

12:00 PM

2.0121

501000

2.12

2.12

1:00 PM

1.456

301000

1.12

1.12

2:00 PM

1.2345

901000

0.12

1.2345

3:00 PM

1.0012

501000

2.1212

2.1212

4:00 PM

0.012

501000

2.65

2.65

5:00 PM

0.121

901000

0.121

0.121

Copyright 2010, Oracle. All rights reserved.

7-3 Solution
Business Service - Duplicate
4.2

Next, we will configure a new business service using the Apply Formula service to produce an
interval curve according to the formula we just designed
Note: Creating a new business service is one option to create this curve, and supplying inputs
to call the existing Apply Formula business service is a second option

Recall the distinction between a business service and its underlying service; both an
Apply Formula service AND an Apply Formula business service exist

We save a few scripting move statements (a performance gain) by creating a business


service with default values rather than populating those inputs individually from scripting

We'll use the Adjust Intervals business


service as a starting point as it has
elements flattened for a single conditional
formula - and we happen to need just one
conditional formula

Duplicate and rename, using your initials as a prefix

We could also have used the Apply


Formula business service as a starting
point - it's a subjective call

7 (part II) - 23

Copyright 2010, Oracle. All rights reserved.

7-3 Solution
Business Service - Duplicate
4.2

Notice the underlying service

7 (part II) - 24

Copyright 2010, Oracle. All rights reserved.

7-3 Solution
Business Service - Define The Schema
The schema we're starting with
accommodates only one measurement list,
so we need to alter the schema to 1) add a
second measurement list and 2) put an
encapsulating group node around each list

4.3

The second list references IC_LIST2

We're flattening the condition


value into the first scalar string
list (SS_LIST) entry, and
defaulting its value (but we're
not making it private, so a
different value can be supplied
as input from the caller)

7 (part II) - 25

Copyright 2010, Oracle. All rights reserved.

Hint: you can grab the


schema element flattening
syntax from our schema
starting point

7-3 Solution
Business Service - Define The Schema
4.3

This is the easy part: replace the defaulted


values from the schema starting point with
the values we determined for the formula

Remove these extraneous


inputs from the schema

The output structure can remain the same


as the schema starting point

7 (part II) - 26

Copyright 2010, Oracle. All rights reserved.

7-3 Solution
Script - Add To The Plug-In Script's Data Areas
3.2

Navigate back to your plug-in script and


add your business service as a data area

7 (part II) - 27

Copyright 2010, Oracle. All rights reserved.

7-3 Solution
Script - Steps
3.3

In the first three script steps, we'll retrieve the final


measurements that fall between the IMD's start
and end date/times
Whatever the IMD BO might be, the Apply VEE
Rule plug-in spot receives its full content in a raw
element - which is also passed as output

We start out by moving the content of the raw element


into our IMD data area (with explicit elements)

The business service to invoke in this step


is D1-IntvConsumptionRetriever
7 (part II) - 28

Copyright 2010, Oracle. All rights reserved.

7-3 Solution
Script - Steps
3.3

Its a good idea to prevent VEE rules from performing work that's
unnecessary for the majority of the executions of the rule

In this step, move the interval output of the


Retrieve Interval Consumption service into the
finals node of your business service (interval
list 1) and the IMD's post-VEE list into the
initials node of your business service
(interval list 2)
Invoke the business service you created
7 (part II) - 29

Copyright 2010, Oracle. All rights reserved.

7-3 Solution
Script - Steps
3.3

Move the output of your business service back into the post VEE list of the local
IMD, and move the entire local IMD into the output of the plug-in spot
At the end of this algorithm, we will have replaced any intervals in the current
IMD with final values having a condition of super, but the IMD's pre-VEE list
retains the initial values that came in with the IMD (remember that we create
final measurements using the post-VEE measurement list from the IMD)

7 (part II) - 30

Copyright 2010, Oracle. All rights reserved.

7-3 Solution
Add Common Interval VEE Group
5

Navigate to Admin / V / VEE Group +


to add a new VEE Group.

We'll incorporate this new group into both


the electric and water VEE groups

7 (part II) - 31

Copyright 2010, Oracle. All rights reserved.

7-3 Solution
Add Preserve Super Measurements VEE Rule
6

Click the Add Rule link in the VEE Rules List zone
to add a VEE rule to your VEE group, and select
the VEE rule you just added
VEE Rule

Description

Identifying BO

RW-PRSM

RW - Preserve Super
Measurements

RW - Keep Super
Measurements

You will need to enter an exception type and


severity because the parent BO requires
these elements, BUT the script we've written
does not use them (note that exceptions are
created explicitly by VEE rules, not directly
by the rules processor)
7 (part II) - 32

Copyright 2010, Oracle. All rights reserved.

7-3 Solution
Insert Common Interval VEE Into Other Groups
VEE Rule

Description

Identifying BO

RW-CIV

RW - Execute Common
Interval Validations

Execute VEE
Group

Navigate to Admin / V / + VEE Group and select


your Water VEE Group to navigate to the VEE
Group portal. Once there, click the Add link in the
VEE Rules List zone to add a VEE rule to your VEE
group.

Find your Common Interval VEE group

If the referenced VEE group is not found, an


exception of this type will be created (notice
that it has a Severity of Information)
7 (part II) - 33

Copyright 2010, Oracle. All rights reserved.

7-3 Solution
Insert Common Interval VEE Into Other Groups
VEE Rule

Description

Identifying BO

RW-CIV-E

RW - Execute Common
Interval Validations

Execute VEE
Group

Navigate to Admin / V / + VEE Group and select


your Electric VEE Group to navigate to the VEE
Group portal. Once there, click the Add link in the
VEE Rules List zone to add a VEE rule to your VEE
group.
In this case, we would like the common interval
VEE rules to be executed ahead of other rules in
this group (consider that this group contains a
rule that will replace some intervals with existing
final measurements - we should do this first)

Find your Common Interval VEE group

7 (part II) - 34

Copyright 2010, Oracle. All rights reserved.

7-3 Solution
Add IMD With Super Measurements
8.1

<preVEE>
<stDt>2010-01-01-00.00.00</stDt>
<enDt>2010-01-02-00.00.00</enDt>
<msrs>
<mL>
<s>1</s>
<q>0</q>
<fc>501000</fc>
</mL>

<mL>
<s>8</s>
<q>750</q>
<fc>901000</fc>
</mL>

The super condition


</msrs>
</preVEE>

Load the data using the New IMD


from XML function on 360 View Measuring Component - with your
interval water MC in context

7 (part II) - 35

We will first create a manual IMD containing


intervals with super condition values

INSTRUCTOR: give this to the students, it's the XML for


a day's worth of measurements for the interval water
MC. Several measurements are marked with a
condition of super.
Because we will use this data to create a manual IMD,
no changes to the data are required.

<preVEE>
<stDt> 2010-01-01-00.00.00</stDt>
<enDt>2010-01-02-00.00.00</enDt>
<msrs>
<mL>
<s>1</s>
<q>0</q>
<fc>501000</fc>
</mL>
<mL>
<s>2</s>
<q>0</q>
<fc>501000</fc>
</mL>
<mL>
<s>3</s>
<q>0</q>
<fc>501000</fc>
</mL>
<mL>
<s>4</s>
<q>10< /q>
<fc>501000</fc>
</mL>
<mL>
<s>5</s>
<q>0</q>
<fc>501000</fc>
</mL>
<mL>
<s>6</s>
<q>500</q>
<fc>501000</fc>
</mL>
<mL>
<s>7</s>
<q>1000</q>
<fc>501000</fc>
</mL>
<mL>
<s>8</s>
<q>750</q>
<fc>901000</fc>
</mL>
<mL>
<s>9</s>
<q>650</q>
<fc>901000</fc>
</mL>
<mL>
<s>10</s>
<q>100</q>
<fc>901000</fc>
</mL>
<mL>
<s>11</s>
<q>300</q>
<fc>901000</fc>
</mL>
<mL>
<s>12</s>
<q>50< /q>
<fc>501000</fc>
</mL>
<mL>
<s>13</s>
<q>100</q>
<fc>501000</fc>
</mL>
<mL>
<s>14</s>
<q>50< /q>
<fc>501000</fc>
</mL>
<mL>
<s>15</s>
<q>75< /q>
<fc>501000</fc>
</mL>
<mL>
<s>16</s>
<q>90< /q>
<fc>501000</fc>
</mL>
<mL>
<s>17</s>
<q>250</q>
<fc>501000</fc>
</mL>
<mL>
<s>18</s>
<q>100</q>
<fc>501000</fc>
</mL>
<mL>
<s>19</s>
<q>125</q>
<fc>501000</fc>
</mL>
<mL>
<s>20</s>
<q>175</q>
<fc>501000</fc>
</mL>
<mL>
<s>21</s>
<q>100</q>
<fc>501000</fc>
</mL>
<mL>
<s>22</s>
<q>0</q>
<fc>501000</fc>
</mL>
<mL>
<s>23</s>
<q>50< /q>
<fc>501000</fc>
</mL>
<mL>
<s>24</s>
<q>0</q>
<fc>501000</fc>
</mL>
</msrs>
</preVEE>

Note the measurements flagged as


super in the IMD you loaded
Transition the manual IMD to
finalize its measurements

Copyright 2010, Oracle. All rights reserved.

7-3 Solution
Add Replacement IMD
8.2

<preVEE>
<stDt>2010-01-01-00.00.00</stDt>
<enDt>2010-01-02-00.00.00</enDt>
<msrs>
<mL>
<s>1</s>
<q>0</q>
<fc>501000</fc>
</mL>

<mL>
<s>8</s>
<q>500</q>
<fc>501000</fc>
</mL>

The regular condition


</msrs>
</preVEE>

Next, we will create a replacement manual


IMD for the same time period

INSTRUCTOR: this is the XML for the replacement IMD


containing a day's worth of measurements for the
interval water MC. No measurements are marked as
super, and some quantities differ from the original IMD.
Because we will use this data to create a manual IMD,
no changes to the data are required.
Follow the same procedure to load and finalize the data
as shown on the previous slide.

<preVEE>
<stDt> 2010-01-01-00.00.00</stDt>
<enDt>2010-01-02-00.00.00</enDt>
<msrs>
<mL>
<s>1</s>
<q>0</q>
<fc>501000</fc>
</mL>
<mL>
<s>2</s>
<q>9</q>
<fc>501000</fc>
</mL>
<mL>
<s>3</s>
<q>0</q>
<fc>501000</fc>
</mL>
<mL>
<s>4</s>
<q>0</q>
<fc>501000</fc>
</mL>
<mL>
<s>5</s>
<q>0</q>
<fc>501000</fc>
</mL>
<mL>
<s>6</s>
<q>0</q>
<fc>501000</fc>
</mL>
<mL>
<s>7</s>
<q>200</q>
<fc>501000</fc>
</mL>
<mL>
<s>8</s>
<q>500</q>
<fc>501000</fc>
</mL>
<mL>
<s>9</s>
<q>400</q>
<fc>501000</fc>
</mL>
<mL>
<s>10</s>
<q>450</q>
<fc>501000</fc>
</mL>
<mL>
<s>11</s>
<q>600</q>
<fc>501000</fc>
</mL>
<mL>
<s>12</s>
<q>520</q>
<fc>501000</fc>
</mL>
<mL>
<s>13</s>
<q>90< /q>
<fc>501000</fc>
</mL>
<mL>
<s>14</s>
<q>50< /q>
<fc>501000</fc>
</mL>
<mL>
<s>15</s>
<q>75< /q>
<fc>501000</fc>
</mL>
<mL>
<s>16</s>
<q>90< /q>
<fc>501000</fc>
</mL>
<mL>
<s>17</s>
<q>250</q>
<fc>501000</fc>
</mL>
<mL>
<s>18</s>
<q>100</q>
<fc>501000</fc>
</mL>
<mL>
<s>19</s>
<q>125</q>
<fc>501000</fc>
</mL>
<mL>
<s>20</s>
<q>175</q>
<fc>501000</fc>
</mL>
<mL>
<s>21</s>
<q>100</q>
<fc>501000</fc>
</mL>
<mL>
<s>22</s>
<q>0</q>
<fc>501000</fc>
</mL>
<mL>
<s>23</s>
<q>50< /q>
<fc>501000</fc>
</mL>
<mL>
<s>24</s>
<q>0</q>
<fc>501000</fc>
</mL>
</msrs>
</preVEE>

Before you finalize, use


the IMD Lens zone to
verify the highlighted
differences between the
replacement IMD and final
measurement values &
conditions - and try to
predict what will happen to
each interval

7 (part II) - 36

Copyright 2010, Oracle. All rights reserved.

7-3 Solution
Verify Final Measurements
8.3

After youve finalized the IMD, note that


the post-VEE list of the replacement
IMD now contains measurement values
flagged as super that had been copied
from final measurements

The values originally received in


the replacement IMD remain in
the pre-VEE list

Also note that the replacement IMD is


not linked to any of the final
measurements marked as super because the normalization algorithm
used in the manual IMD lifecycle is
configured not to override identical
existing final measurements

7 (part II) - 37

Copyright 2010, Oracle. All rights reserved.

The final measurement values


are unchanged by the
replacement IMD

Practice 7-4 (30 Minutes)


In this practice, you will create a custom IMD BO lifecycle algorithm that
should be executed when processing IMDs for both electric and water
interval MCs
Categorize for reporting purposes those IMDs that arrived with
missing intervals, based upon the percentage of intervals marked
as missing
Use category ranges of 0, 0-5%, 5-10%, 10-20%, >20% missing
When designing your solution, keep in mind that missing intervals will
often be filled during VEE, and we need statistics that tell us how many
arrived as missing

Create a pie chart showing the counts of IMDs in each category for
the current measuring component (put this zone on a new portal
and give yourself access to it)
Please break up into teams and design the admin data necessary to add
the new VEE rule and the lifecycle algorithm. Before adding the rules,
please check your configuration using the upcoming slides.
After the admin data is in place, continue following the instructions to
create IMDs for your water MCs
7 (part II) - 38

Copyright 2010, Oracle. All rights reserved.

7-4a Data Overview

3
Business Object

Service Provider

Processing
Method

BO Schema

BO Status

Initial Meas.
Data (IMD)

4
BO Status /
Algorithm

Char Type

4
System Event

Algorithm

IMD / Char

Char Value
Field

Legend

Enter State

Trans. Data

Algorithm Type

Script

Admin Data

8
Script Step

Master Data
FW Data
MO Boundary

7 (part II) - 39

Business
Service

Copyright 2010, Oracle. All rights reserved.

Described
elsewhere
ST - Status
CH - Characteristics
X - CLOB

7-4 Solution
Characteristic Type
1

Navigate to Admin / C / + Characteristic Type to add a new char type that defines the
valid values for the percent missing flag. Please prefix your char type with your initials.

Indicate that your char type can be


referenced on an IMD

7 (part II) - 40

Copyright 2010, Oracle. All rights reserved.

7-4 Solution
Field
2

Navigate to Admin / F / + Field to add a new field that contains the label to be used
whenever the air conditioning element is referenced. Again, prefix it with your initials.

7 (part II) - 41

Copyright 2010, Oracle. All rights reserved.

7-4 Solution
Business Object - Create Child BO
3.1

Navigate to Admin / B / Business Object and add a new child business object of D1-InitialLoadIMDInterval.
Prefix your new BO with your initials (in real life, this would be prefixed with CM).

Note that to address this requirement, you could


also duplicate the D1-InitialLoadIMDInterval
business object to create a sibling rather than a
child BO, but given the nature of the extension
were making, a child BO works fine, keeping any
future upgrade intact moreso than the duplicate
approach (in which case you would need to apply
upgrade changes manually to your duplicate BO)

7 (part II) - 42

Copyright 2010, Oracle. All rights reserved.

7-4 Solution
Business Object - Define BO Schema
3.2

Navigate to Business Object - Schema tab for your SP BO and


update the schema to include the new element.

Add this element (remember, it's always faster to


cut and paste schema syntax from the Tips zone
in the Dashboard)

7 (part II) - 43

Copyright 2010, Oracle. All rights reserved.

7-4 Solution
Create A Script, Algorithm, & Algorithm Type
Note that these are the same
steps that would be done
automatically by the Create
BO Algorithm BPA script

Create a plug-in script for


the BO Status - Enter plugin spot, and select the IMD
child BO you just created
Recall that the fastest way to add a
plug-in to a BO is to use the Create a
BO Algorithm dashboard zone on the
Business Object page. This business
process creates an algorithm type, a
script, an algorithm, plugs the
algorithm into the designated spot,
and then transfers you to the script
page where you can define the logic.

7 (part II) - 44

Copyright 2010, Oracle. All rights reserved.

7-4 Solution
Plug In Your Algorithm
4

Plug in your algorithm on the


Finalized (COMPLETE) state
of your IMD business object

On the BO Summary tab, note the


Lifecycle Rules shown on the Finalized
state: the tree includes the algorithms
defined on the parent BO as well as the
child - with the algorithm you just added

7 (part II) - 45

Copyright 2010, Oracle. All rights reserved.

7-4 Solution
Update Service Provider's Processing Method
5

For now, update only your water service provider's


processing method for Initial Measurement Creation

Change the Default Processing Method to


reference the IMD child BO you just added

7 (part II) - 46

Copyright 2010, Oracle. All rights reserved.

7-4 Solution
Business Service - Duplicate
6.1

Next, we will configure a new business service using the Apply Formula service to produce an
interval curve according to the formula we discussed in earlier slides (so we wont repeat the
analytical process here)
Start by duplicating your existing Apply Formula business service

7 (part II) - 47

Copyright 2010, Oracle. All rights reserved.

7-4 Solution
Business Service - Define The Schema
6.2

Keep the initials group from your schema


starting point, changing the interval
consumption list to IC_LIST1

Change the first scalar string to contain the


bottom value of the condition range for
missing

Add a second scalar string to contain the top


value of the condition range for missing

7 (part II) - 48

Copyright 2010, Oracle. All rights reserved.

7-4 Solution
Business Service - Define The Schema
6.2

Replace the defaulted values from the


schema starting point with the values we
determined for the formula

7 (part II) - 49

Copyright 2010, Oracle. All rights reserved.

7-4 Solution
Business Service - Define The Schema
6.2

Set up additional flattened elements for the


variable definitions to find the count and
the total of the final values curve
The syntax here is no different than
flattening values into the scalar string list,
for example

Define the final values formula to take the


two variables and calculate a percentage

The output does not require an interval list (although


the service could pass the 1s and 0s curve as output),
but rather just a single final value result - so you will
need to modify your schema to accommodate it

7 (part II) - 50

Copyright 2010, Oracle. All rights reserved.

7-4 Solution
Business Object - Add A Mini BO
7.1

We know that assigning the IMD Category will require a BO update for each IMD we process
- which has the potential to be expensive in terms of performance (we're also inserting one
additional row per IMD)
Creating a mini BO that contains only the element being updated is a good idea especially
when performance is so critical; it minimizes the XML being read and processed by the
framework during the BO update

This parent BO (and including LITE in the


description) serves to categorize the BOs
visually when searching and displaying;
inheritance is not the motivation here

7 (part II) - 51

Copyright 2010, Oracle. All rights reserved.

7-4 Solution
Business Object - Define The Mini BO Schema
7.2

Include an element mapped to the prime key


of the MO using the same element name
thats used for this same field across all IMD
BOs to permit easy movement of data
between schemas
Also include the element that will be
updated, copying the schema syntax from
your Initial Load IMD child BO

7 (part II) - 52

Copyright 2010, Oracle. All rights reserved.

7-4 Solution
Script - Define The Plug-In Script's Data Areas
8.1

Navigate back to your plug-in script and add your


business service as well as your mini BO as data areas

In the Apply VEE Rule plug-in spot, we receive the entire


IMD as part of our input, obviating the need to read the BO
In the Enter State plug-in spot, we receive only the systemgenerated prime key, so we must read the IMD - which means
we should consider performance carefully once again
To minimize the amount of data recalled from the database and then
mapped into the BO XML structure by the framework, we will use a
mini BO to read the interval data from either the pre-VEE or the postVEE - and in this case, pre-VEE makes the most sense because its
data will not typically be touched during VEE processing, giving us
an accurate idea of the percentage of missing intervals
7 (part II) - 53

Copyright 2010, Oracle. All rights reserved.

7-4 Solution
Script - Define The Plug-In Script's Steps
8.2

7 (part II) - 54

Copyright 2010, Oracle. All rights reserved.

7-4 Solution
Script - Define The Plug-In Script's Steps
8.2

These values should match your


predefined characteristic values

7 (part II) - 55

Copyright 2010, Oracle. All rights reserved.

7-4b Data Overview


There are numerous approaches you could take to design the
pie chart to display counts of the missing percentage
categories of an MC's IMDs; this approach assumes you don't
know the XML schema structure that can be rendered into a
pie chart, and so you tackle the design of the UI Map first

4
1

Map Zone

Portal

Zone Parameter

Portal / Zone

MC

UI Map

UI Map Schema

6
Initial Meas.
Data (IMD)

Business
Service

Legend
BS Schema

2 Data Explorer
Zone

Trans. Data
Admin Data
Master Data
FW Data
MO Boundary
Described
elsewhere
ST - Status
CH - Characteristics
X - CLOB

7 (part II) - 56

Copyright 2010, Oracle. All rights reserved.

7-4b Solution
UI Map - Missing Interval Statistics
Create a new UI map to display a pie chart showing the
distribution of percent-missing categories among IMDs

Use the UI Map tips to find the oraChart


function syntax needed to produce a pie chart,
and take a look at the way the XML data
needs to be passed into the map
This should serve as a guideline for the design of the
schema of the UI map - so leave this empty for now
Click Test UI Map to
make sure the chart
is rendered properly
Use embedded XML to
see how your UI map
will look, making sure
the oraChartSeries
function input is
coordinated with these
element names

7 (part II) - 57

Copyright 2010, Oracle. All rights reserved.

7-4b Solution
Zone - Add Single-SQL Explorer
2.1

Now that we've seen that a repeating list of data is needed to produce a pie chart, we
need some way to produce that data
Explorer zones produce lists of data, and when wrapped with a business service, the
explorer zone output takes the form of the business service schema, which is almost
always a repeating XML list for each column defined
Create a new zone to select the count of IMDs falling
into each "percent missing" category for an input MC
No need for more than one SQL statement

One User Filter is


needed: the MC ID

7 (part II) - 58

Copyright 2010, Oracle. All rights reserved.

7-4b Solution
Zone - Configure Parameters
2.2

Select those IMDs with


your characteristic

We would like to display the description of the


characteristic value rather than the value
itself (as the value itself is much less
interesting - for example, "B" vs. "0-5%
Missing")
Recall that descriptions of admin data are
stored in language tables - and explorer
zones use the :LANGUAGE bind variable
to pick up the users language and return
the corresponding description

7 (part II) - 59

Copyright 2010, Oracle. All rights reserved.

7-4b Solution
Business Service - Create and Define Schema
3

The best starting point for defining the schema of a business


service for the data explorer service is to find a business
service for this service (there are many) and duplicate it

Reference the zone


you just added

The underlying service


is the data explorer
The three highlighted element names
are important, as they must match the
configuration of pie chart on the UI map
7 (part II) - 60

Copyright 2010, Oracle. All rights reserved.

7-4b Solution
Zone - Add Explicit Object Map
We can use an explicit object map
zone type, since we never need to
vary the UI map displayed

Inject the output of the business service


directly into your map
Your UI map with the pie chart
Take the measuring component ID
currently in context (click on the
parameter help to see how this
works) and pass it into the XPath
location of your display object your business service, in this case

7 (part II) - 61

Copyright 2010, Oracle. All rights reserved.

7-4b Solution
Portal
5
Add a standalone portal, and
reference the explicit object map
zone you just added

Add your portal to the main menu


Add a new user group called XXX-G1 where XXX are your initials
Prefix the user group's description with your initials
Add your portals application service to the user group
Add your user ID to the new user group
Flush the cache (using flushAll.jsp)

7 (part II) - 62

Copyright 2010, Oracle. All rights reserved.

<s>13</s>
<q>1.8</q>
<fc>501000</fc>
</mL>
<mL>
<s>14</s>
<q>2.2</q>
<fc>501000</fc>
</mL>
<mL>
<s>15</s>
<q>2.5</q>
<fc>501000</fc>
</mL>
<mL>
<s>16</s>
<q>2.3</q>
<fc>501000</fc>
</mL>
<mL>
<s>17</s>
<q>2.8</q>
<fc>501000</fc>
</mL>
<mL>
<s>18</s>
<q>2.9</q>
<fc>501000</fc>
</mL>
<mL>
<s>19</s>
<q>3.2</q>
<fc>501000</fc>
</mL>
<mL>
<s>20</s>
<q>3.1</q>
<fc>501000</fc>
</mL>
<mL>
<s>21</s>
<q>1.9</q>
<fc>501000</fc>
</mL>
<mL>
<s>22</s>
<q>1.8</q>
<fc>501000</fc>
</mL>
<mL>
<s>23</s>
<q>1.7</q>
<fc>501000</fc>
</mL>
<mL>
<s>24</s>
<q>1.6</q>
<fc>501000</fc>
</mL>
</msrs>
</preVEE>
</initialMeasurementData>
<initialMeasurementData>
<serviceProviderExternalId>DPSW</serviceProviderExternalId>
<preVEE>
<mcIdN>W3</mcIdN>
<stDt>2010-01-02-00.00.00</stDt>
<enDt>2010-01-03-00.00.00</enDt>
<msrs>
<mL>
<s>1</s>
<q>1.2</q>
<fc>501000</fc>
</mL>
<mL>
<s>2</s>
<q>1.6</q>
<fc>501000</fc>
</mL>
<mL>
<s>3</s>
<q>1.4</q>
<fc>501000</fc>
</mL>
<mL>
<s>4</s>
<q>1.7</q>
<fc>501000</fc>
</mL>
<mL>
<s>5</s>
<q>1.5</q>
<fc>501000</fc>
</mL>
<mL>
<s>6</s>
<q>1.7</q>
<fc>501000</fc>
</mL>
<mL>
<s>7</s>
<q>2.1</q>
<fc>501000</fc>
</mL>
<mL>
<s>8</s>
<q>2.4</q>
<fc>501000</fc>
</mL>
<mL>
<s>9</s>
<q>2.5</q>
<fc>501000</fc>
</mL>
<mL>
<s>10</s>
<q>2.2</q>
<fc>501000</fc>
</mL>
<mL>
<s>11</s>
<q>1.8</q>
<fc>501000</fc>
</mL>
<mL>
<s>12</s>
<q>2.0</q>
<fc>501000</fc>
</mL>
<mL>
<s>13</s>
<q>1.8</q>
<fc>501000</fc>
</mL>
<mL>
<s>14</s>
<q>2.2</q>
<fc>501000</fc>
</mL>
<mL>
<s>15</s>
<q>2.5</q>
<fc>501000</fc>
</mL>
<mL>
<s>16</s>
<q>2.3</q>
<fc>501000</fc>
</mL>
<mL>
<s>17</s>
<q>2.8</q>
<fc>501000</fc>
</mL>
<mL>
<s>18</s>
<q>2.9</q>
<fc>501000</fc>
</mL>
<mL>
<s>19</s>
<q>3.2</q>
<fc>501000</fc>
</mL>
<mL>
<s>20</s>
<q>3.1</q>
<fc>501000</fc>
</mL>
<mL>
<s>21</s>
<q>1.9</q>
<fc>501000</fc>
</mL>
<mL>
<s>22</s>
<q>1.8</q>
<fc>501000</fc>
</mL>
<mL>
<s>23</s>
<q>1.7</q>
<fc>501000</fc>
</mL>
<mL>
<s>24</s>
<q>1.6</q>
<fc>501000</fc>
</mL>
</msrs>
</preVEE>
</initialMeasurementData>
<initialMeasurementData>
<serviceProviderExternalId>DPSW</serviceProviderExternalId>
<preVEE>
<mcIdN>W3</mcIdN>
<stDt>2010-01-03-00.00.00</stDt>
<enDt>2010-01-04-00.00.00</enDt>
<msrs>
<mL>
<s>1</s>
<q>1.2</q>
<fc>501000</fc>
</mL>
<mL>
<s>2</s>
<q>1.6</q>
<fc>501000</fc>
</mL>
<mL>
<s>3</s>
<q>1.4</q>
<fc>501000</fc>
</mL>
<mL>
<s>4</s>
<q>1.7</q>
<fc>501000</fc>
</mL>
<mL>
<s>5</s>
<q>1.5</q>
<fc>501000</fc>
</mL>
<mL>
<s>6</s>
<q>1.7</q>
<fc>501000</fc>
</mL>
<mL>
<s>7</s>
<q>2.1</q>
<fc>501000</fc>
</mL>
<mL>
<s>8</s>
<q>2.4</q>
<fc>501000</fc>
</mL>
<mL>
<s>9</s>
<q>2.5</q>
<fc>501000</fc>
</mL>
<mL>
<s>10</s>
<q>2.2</q>
<fc>501000</fc>
</mL>
<mL>
<s>11</s>
<q>1.8</q>
<fc>501000</fc>
</mL>
<mL>
<s>12</s>
<q>0</q>
<fc>201000</fc>
</mL>
<mL>
<s>13</s>
<q>1.8</q>
<fc>501000</fc>
</mL>
<mL>
<s>14</s>
<q>2.2</q>
<fc>501000</fc>
</mL>
<mL>
<s>15</s>
<q>2.5</q>
<fc>501000</fc>
</mL>
<mL>
<s>16</s>
<q>2.3</q>
<fc>501000</fc>
</mL>
<mL>
<s>17</s>
<q>2.8</q>
<fc>501000</fc>
</mL>
<mL>
<s>18</s>
<q>2.9</q>
<fc>501000</fc>
</mL>
<mL>
<s>19</s>
<q>3.2</q>
<fc>501000</fc>
</mL>
<mL>
<s>20</s>
<q>3.1</q>
<fc>501000</fc>
</mL>
<mL>
<s>21</s>
<q>1.9</q>
<fc>501000</fc>
</mL>
<mL>
<s>22</s>
<q>1.8</q>
<fc>501000</fc>
</mL>
<mL>
<s>23</s>
<q>1.7</q>
<fc>501000</fc>
</mL>
<mL>
<s>24</s>
<q>1.6</q>
<fc>501000</fc>
</mL>
</msrs>
</preVEE>
</initialMeasurementData>
<initialMeasurementData>
<serviceProviderExternalId>DPSW</serviceProviderExternalId>
<preVEE>
<mcIdN>W3</mcIdN>
<stDt>2010-01-04-00.00.00</stDt>
<enDt>2010-01-05-00.00.00</enDt>
<msrs>
<mL>
<s>1</s>
<q>1.2</q>
<fc>501000</fc>
</mL>
<mL>
<s>2</s>
<q>1.6</q>
<fc>501000</fc>
</mL>
<mL>
<s>3</s>
<q>1.4</q>
<fc>501000</fc>
</mL>
<mL>
<s>4</s>
<q>1.7</q>
<fc>501000</fc>
</mL>
<mL>
<s>5</s>
<q>1.5</q>
<fc>501000</fc>
</mL>
<mL>
<s>6</s>
<q>1.7</q>
<fc>501000</fc>
</mL>
<mL>
<s>7</s>
<q>2.1</q>
<fc>501000</fc>
</mL>
<mL>
<s>8</s>
<q>2.4</q>
<fc>501000</fc>
</mL>
<mL>
<s>9</s>
<q>2.5</q>
<fc>501000</fc>
</mL>
<mL>
<s>10</s>
<q>2.2</q>
<fc>501000</fc>
</mL>
<mL>
<s>11</s>

7-4b Solution
Add Several Days' Worth of IMDs (With Missing Intervals)
Your water device's serial number
6

Your water head-end's external ID

<devices>
<deviceIdentifierNumber>RW-W-60</deviceIdentifierNumber>
<initialMeasurementData>
<serviceProviderExternalId>RWW</serviceProviderExternalId>
<preVEE>
Your MC's channel ID
<mcIdN>RWA</>
<stDt>2010-01-01-00.00.00</stDt>
<enDt>2010-01-02-00.00.00</enDt>
<msrs>
INSTRUCTOR: give this to the students, it's the XML for
<mL>
the four days' worth of measurements for the interval
<s>1</s>
water MC. Each day has a different percentage of
<q>12.12</q>
<fc>501000</fc>
intervals flagged as missing.
</mL>
<mL>
The students must change it to define their device
<s>8</s>
identifier number, measuring component identifier
<q>24</q>
(channel ID), and service provider external id.
<fc>501000</fc>
</mL>

</msrs>
</preVEE>
</initialMeasurementData>
</devices>

7 (part II) - 63

Copyright 2010, Oracle. All rights reserved.

7-4b Solution
Look At Your Statistics

Make sure your water (interval) MC is


in context, and navigate to your IMD
statistics portal on the main menu

7 (part II) - 64

Copyright 2010, Oracle. All rights reserved.

Practice 7-5 (45 Minutes)


An implementation wants to use the TOU map-based High / Low check. However,
if the SP has an air conditioner, the IMDs consumption should be weather
normalized before being compared to historic averages
For example, if it was hotter than normal during the IMDs period, the IMDs
consumption should be temporarily scaled down before it is compared to historic
average consumption
The degree of weather normalization is based on the type of air conditioner
installed at the SP; the valid values are:

Unknown
No air conditioning
Heat pump
Window unit
Central air conditioning built before 2008
Central air conditioning built 2008

A SP's type of air conditioning will reside in the SP's characteristic table
A Factor will be created to hold the weather normalization value for each type of air
conditioning
The next slide provides a summary of the data that should be designed
Please break up into teams and design the admin data necessary to add these
devices
7 (part II) - 65

Copyright 2010, Oracle. All rights reserved.

7-5 Data Overview


It's important to recall that an
element must reside in a
characteristic (as opposed to a
CLOB) if the element will be used to
vary the value of a factor

BO

3
BO Option

BO Schema

VEE Group

10

Service Point
ST, CH, X

Business Object

SP / Char

BO / Algorithm

1
2

4
UI Map

Initial Meas.
Data (IMD)

VEE Rule

11

9
Char Type

Field

The SP's Display UI Map and the


Maintenance UI Map need to be
updated with the new element

System Event

Factor

This factor holds the weather adjustment factor to


be used for each type of air conditioner. This factor
will be used to weather adjust the post VEE quantity
prior to the high-low check.
Note, the display UI map's service script does
not have to be changed as it includes the UI
map's schema and the UI map includes the BO's
schema (when a BO's schema is changed, it
ripples everywhere it is included)

Char Value

7 (part II) - 66

MC

Factor / Char
Value

7
Factor Value

Algorithm

Algorithm Type

Because only a new Apply VEE


algorithm will be developed, you
don't need to create a BO schema or
UI maps. In real-life, a new BO
would not be needed; you'd simply
create a new Apply VEE algorithm an
assign it a higher sequence number
on the base-package VEE rule BO
(the class has each student create a
child BO so they can develop the
rule themselves)

Copyright 2010, Oracle. All rights reserved.

9
Script

Legend
Trans. Data
Admin Data
Master Data
FW Data
MO Boundary
Described
elsewhere
ST - Status
CH - Characteristics
X - CLOB

7-5 Solution
Add a Characteristic Type
1

Navigate to Admin / C / + Characteristic Type to add a new char type that defines the
valid values for the air conditioning flag. Please prefix your char type with your initials.

Make sure to indicate that your char type can be


referenced on both a SP and a Factor (the factor
will hold a different weather normalization value for
each char value).

7 (part II) - 67

Copyright 2010, Oracle. All rights reserved.

7-5 Solution
Add a Field
2

Navigate to Admin / F / + Field to add a new field that contains the label to be used
whenever the air conditioning element is referenced. Again, prefix it with your initials.

7 (part II) - 68

Copyright 2010, Oracle. All rights reserved.

7-5 Solution
Update Your BO Schema
3

Navigate to Business Object - Schema tab for your SP BO and


update the schema to include the new element.

Add this element (remember, it's always faster to


cut and paste schema syntax from the Tips zone
in the Dashboard). Notice the use of required=
and default=.

7 (part II) - 69

Copyright 2010, Oracle. All rights reserved.

7-5 Solution
Update Your UI Map - Display Map
4.1

Return to the Business Object - Main tab and click on the info string of the Display UI Map
option (this will navigate to the UI Map page with your SP's display UI map).
Navigate to UI Map - Schema tab and define the HTML for the new element

Remember, it's faster to copy from


the Tips or from another part of the
HTML

Test your UI map - you should see


your new element
The Air Conditioning field will go at
the bottom of the first section
7 (part II) - 70

Copyright 2010, Oracle. All rights reserved.

7-5 Solution
Update Your UI Map - Maintenance Map
4.2

Return to the Business Object - Main tab and click on the info string of the Maintenance UI
Map option (this will navigate to the UI Map page with your service point's UI map displayed).
Navigate to UI Map - Schema tab and define the HTML to add the new element

Add this HTML immediately AFTER the


Solar Installed HTML (remember it's
always faster to copy from some other
part of a UI map or from the Tips)

Test your UI map - you should see


your new element

7 (part II) - 71

Copyright 2010, Oracle. All rights reserved.

7-5 Solution
Update Your Service Point
5

Update your service point with its type of air conditioning.

Update your SP

7 (part II) - 72

Copyright 2010, Oracle. All rights reserved.

7-5 Solution
Add A Factor
Navigate to Admin / F / + Factor to add a Factor that holds
the weather normalization factors (prefixed with your initials)

Factor

Description

Identifying BO

RW-WN-AC

RW - Weather Normalization
(Air Conditioning)

Factor Number

Your SP has this char value so your factor only needs this for
the purpose of this practice

7 (part II) - 73

Copyright 2010, Oracle. All rights reserved.

7-5 Solution
Add Factor Values For Each Char Value
Click the Add icon to add char values

Assumes that 1-5-2010 was atypically hot day and


therefore the measured consumption will be scaled down
(multiplying it by .75) before it is compared to historic
consumption

7 (part II) - 74

Copyright 2010, Oracle. All rights reserved.

Review Questions

7 (part II) - 75

Copyright 2010, Oracle. All rights reserved.

Vous aimerez peut-être aussi