Sie sind auf Seite 1von 28

8

Options

Copyright 2009, Oracle. All rights reserved.

Check Point
You know how to:

Define a BO's data structure (i.e., its schema)


Create business rules for a BO by plugging in algorithms
Create a child BO that inherits rules defined on a parent BO
Control the various stages of a BO's lifecycle
Introduce business rules that only execute during specific stages
of a BO's lifecycle

In this section, you'll learn how to use "options" to extend


your BO's and MO's

8-2

Copyright 2009, Oracle. All rights reserved.

Problem Statement
Let's assume that some elements become required when a
BO enters a given state
For example, let's assume that a Cancel Reason must be defined
before an object can enter the Canceled state

You could set this up with an Enter plug-in


It would have an Edit Data step that would have something like:
If "string(cancelReason) = string($BLANK)"

Error

8-3

Enter

But there's an easier way, it involves using options


Canceled

Copyright 2009, Oracle. All rights reserved.

Use The Required Element Option Type


To solve our required element problem, we
can take advantage of the BO / status
options
Think of an option as a field that you can
add to a BO / State without having to change
the database
The base-package is supplied with an
option type called Required element
You would set up a BO / State / Option for
each required element where each option
references:

BO

Valid
Status

BO / State /
Option

Option Type = Required Element


Option Value = The required element's name
In our example, you'd add a new option
(including group nodes)
where:
- Option Type: Required Element
- Option Value: cancelReason

8-4

Copyright 2009, Oracle. All rights reserved.

Option
Type

Valid Values:
Required Element

Options Are Only Limited By Your Imagination


As described, the base-package is supplied with the Required Element option type
However, your designs can introduce additional option types for use in your Enter,
Exit and Monitor algorithms

Business
Object
Valid
Status

BO / State /
Option

8-5

This new option can be used by a monitor


algorithm to transition a BO to another state
when it's been waiting too long
You can add additional option types to be
used by your algorithms. For example, you
could create a new option type called
Timeout Hours to define how long an object
can be in a state before it "times out"'

Option
Type

Valid Values:
Required Element

Copyright 2009, Oracle. All rights reserved.

Team Walk Through (15 minutes)


Add an option to a BO

8-6

Break up into teams and follow the instructions in the workbook

Copyright 2009, Oracle. All rights reserved.

8
BO Options

Copyright 2009, Oracle. All rights reserved.

BO Options vs BO / State / Options


In the previous section, we described how you can define
options on the BO / State meta-data
And we described how some option types come with the basepackage (e.g., Required Element), and how an implementation can
add additional option types

But what if the option is accessed by numerous states?


This is why options can be declared at the BO level too

8-8

Copyright 2009, Oracle. All rights reserved.

An Option Type To Disable A Base-Package Algorithm


In an earlier chapter, we described how to
disable an algorithm that's been plugged in by
the base-package team on a BO
This is done by using a BO option type called
Inactive Algorithm

BO

The option value would be the algorithm's code

BO /
Option

The framework will not execute an algorithm if


it's been inactivated using this technique
Note, you must inactivate the algorithm at the same
level in the BO hierarchy as the algorithm is
plugged-in, i.e., if you have a child BO that has an
inactive algorithm referenced and this algorithm is
plugged in on a parent BO, it will still execute
(you'd need to inactivate it on the parent BO rather)

Please note, you can also inactivate an


algorithm plugged in on BO / State by
populating an appropriate BO / State option

Valid Values:
Inactive Algorithm

You'd add a separate option for


every base-package algorithm you
need to disable

This is the 2nd BO / State option type you've been


exposed to (the 1st was Required element)

8-9

Option
Type

Copyright 2009, Oracle. All rights reserved.

8
MO Options

Copyright 2009, Oracle. All rights reserved.

Options Exist Throughout The Meta Data ERD


And finally, the MO meta data can
have an unlimited number of
options

MO
Option
Type

MO /
Option
BO

Option
Type

BO /
Option
Valid
Status

Option
Type
8 - 11

Copyright 2009, Oracle. All rights reserved.

BO / State /
Option

You Can Inactivate MO Algorithms


You can inactivate MO algorithms
using the analogous function for
algorithms plugged in on the MO
(e.g., Info, Transition Error,
Determine BO, etc.)

MO

MO /
Option

Option
Type
Valid Values:
Inactive Algorithm

You'd add a separate option for


every base-package algorithm you
need to disable

8 - 12

Copyright 2009, Oracle. All rights reserved.

Some Options Must Be Set Up For New MO's


When you create a new MO, remember to
set up the following options:
Tell the framework that BO maintenance
(add, change, delete) is allowed by adding
an option type of BO Maintenance (Y/N)
with an option value of Y
If the MO has a status field, tell the
framework the name of the status field by
adding an option type of Status Field with
an option value of the column name of the
status field
If the MO has an admin object, tell the
framework the name of the type field by
adding an option type of Type Field with an
option value of the column name of the
type field

8 - 13

Copyright 2009, Oracle. All rights reserved.

MO

MO /
Option

Option
Type
Valid Values:
BO Maintenance
(Y/N)
Status Field
Type Field

BO Option Types On MO's


(this is confusing)
If you add a new option type for a BO, you
must update its MO to declare this new
option type
If you don't, it won't appear on the
dropdown on the BO transaction

You do this by setting up an MO option


where:
Option Type = Valid BO Option Type
Option Value = The value of the option type

Analogously, if you add a new option type


to a BO / State, you have add an MO
option where:

Option
Type
Valid Values:
Valid BO Option
Type
Valid BO Status
Option Type

Option
Type

MO /
Option

BO

BO /
Option
Valid
Status

Option Type = Valid BO Status Option Type


Option Value = The value of the option type

Option
Type
8 - 14

MO

Copyright 2009, Oracle. All rights reserved.

BO / State /
Option

BO System Events On MO's


Analogously, if you add a new
system event (i.e., plug-in spot)
for a BO, you must update its MO
to declare this new system event
If you don't, it won't appear on the
dropdown on the BO transaction

You do this by setting up an MO


option where:

MO
Option
Type
Valid Values:
Valid BO System
Event

Option Type = Valid BO System Event


Option Value = The value of the
system event flag

8 - 15

MO /
Option

Copyright 2009, Oracle. All rights reserved.

BO

System
Event

BO /
Algorithm

A Very Obscure MO Option Type


(this is rarely used)
Some older admin MO's have 2 FK's to
business object
One defines the BO of the admin object
The other holds the BO of the transaction object
This is unusual and it's only done when the
transaction object existed prior to the advent of BO
technology (we define the transaction BO on the
admin BO because it's impossible to populate the
BO column on the pre-existing transaction rows)

In this situation, the base-package "determine


BO plug-in" won't be able to determine the
admin MO's BO as there are 2 FK's to business
object on the admin MO's primary table
Therefore the ambiguity must be resolved by
setting up an MO option where:
Option Type = BO Code Field Name
Option Value = The column that holds the admin
object's business object code

8 - 16

MO
Option
Type
Valid Values:
BO Code Field
Name

Copyright 2009, Oracle. All rights reserved.

MO /
Option

8
Summary

Copyright 2009, Oracle. All rights reserved.

Base-Package Option Types

These option types


are owned by the
framework. Some
designs introduce
additional values.

Valid Values:
BO Code Field Name
BO Maintenance Allowed (Y/N)
BO Restricted Field Name
Inactive Algorithm
Status Field Name
Type Field Name
Valid BO Option Type
Valid BO / Status Option Type
Valid BO System Event
Periodic Monitor Batch Process
Valid Values:
Inactive Algorithm
there are several base package
values that are UI-oriented so we'll
save these for later

Valid Values:
Required Element
Inactive Algorithm
8 - 18

MO
Option
Type

MO /
Option
BO

Option
Type

BO /
Option
Valid
Status

Option
Type

Copyright 2009, Oracle. All rights reserved.

BO / State /
Option

Multi versus Single Options

Copyright 2009, Oracle. All rights reserved.

Single versus Multi Options


Recall that BO plug-in spots (i.e., system events) are classified as multi
or single
For multi plug-in spots, the framework executes all algorithms from the top
of the BO hierarchy to the bottom
For single plug-in spots, the framework executes the plug-in "nearest" to
the BO being executed

Options have the same concept (i.e., some option types are considered
single, others are considered multi)
The difference between algorithms and options is that the framework
knows if the system event is single or multi; options are different
there is no data that defines if an option type is single or multi, and
therefore, the program that needs the option value tells the FW if it
should retrieve the values for an option type using the single or multi
method:
For single, the framework returns the option value "nearest" to the BO
For multi, the framework assembles the list of option values from the top of
the hierarchy to the bottom (and supplies all in a list)
8 - 20

Copyright 2009, Oracle. All rights reserved.

Multi Options Are "Top Down"


Imagine an option type that holds valid phone types for different types
of customers
This would be a multi
Parent BO: GenericCustomer
Option Type: Valid Phone Type
Sequence: 10
Option Value: Primary Number

BO: BusinessCustomer

BO: HumanCustomer
Option Type: Valid Phone Type
Sequence: 10
Option Value: Home Phone
Option Type: Valid Phone Type
Sequence: 20
Option Value: Work Phone

8 - 21

If you asked the FW


for the option values
for a
HumanCustomer,
you'd get Primary,
Home and Work

Option Type: Valid Phone Type


Sequence: 10
Option Value: Billing Contact Phone
Option Type: Valid Phone Type
Sequence: 20
Option Value: Marketing Contact Phone

Copyright 2009, Oracle. All rights reserved.

Single Options Are "Find The Nearest"


Imagine an option type that holds the letter type for welcome letters
for different types of customers
This would be a single
Parent BO: GenericCustomer
Option Type: Welcome Letter Type
Sequence: 10
Option Value: Generic Letter

BO: HumanCustomer

BO: OtherCustomer

Option Type: Welcome Letter Type


Sequence: 10
Option Value: Business Letter

Option Type: Welcome Letter Type


Sequence: 10
Option Value: Residential Letter
If you asked the FW for the option
value for a HumanCustomer, you'd
get Residential Letter

8 - 22

BO: BusinessCustomer

If you asked the FW for the


option value for an
OtherCustomer, you'd get
Generic Letter
Copyright 2009, Oracle. All rights reserved.

Options and Ownership

Copyright 2009, Oracle. All rights reserved.

MO Options
Obviously, an implementation team can add options to
base-package owned MO's
If they couldn't, they could never inactivate an MO algorithm or add
new BO system events or BO options

If the option type is considered single and the basepackage is shipped with the option in place, the
implementation team must add an option value whose
sequence number is greater than the base-package value
(because the framework will return the option with the
greatest value for "singles")

8 - 24

Copyright 2009, Oracle. All rights reserved.

BO Options
For BO options, the implementation team has a choice:
They could add "CM" option values to the base-package BO or BO /
Status
If they do this, they should use the technique described on the prior
slide

Alternatively, they could create a child BO and add the option


values there

8 - 25

Copyright 2009, Oracle. All rights reserved.

Team Walk Through (45 minutes)


Explore the options associated with MOs and BOs
Break up into teams and follow the instructions in the workbook

8 - 26

Copyright 2009, Oracle. All rights reserved.

Review Questions

8 - 27

Copyright 2009, Oracle. All rights reserved.

8 - 28

Copyright 2009, Oracle. All rights reserved.

Das könnte Ihnen auch gefallen