17 BPA Scripts

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 79

17 BPA Scripts

Copyright © 2009, Oracle. All rights reserved.


You've Been Using Many BPA Scripts

• BPA scripts are used in many parts of the UI to guide a


user through business processes
• For example, in this last section, you were shown a UI
map that had buttons on it; clicking a button kicks off a
BPA script to guide the user through the respective
business process

Clicking the Edit button will start


a BPA script that guides the user
through editing the BO being
displayed in the map

17 - 2 Copyright © 2009, Oracle. All rights reserved.


A Different Type of Script

• Up to now, you've been creating plug-in scripts and service scripts to


develop server-based business rules and functions
• These types of scripts run on the application server (this is why we
sometimes use the term "server script" to refer to both types of scripts)
• During this section, we'll expose you to business process assistant
(BPA) scripts
• These types of scripts run on the client's browser
– NO CLIENT SOFTWARE IS INSTALLED, these scripts are executed in the
client's browser
All 3 types of scripts are defined
using the Script transaction that Script
you've been using (BPA scripts
just have different types of
steps)

BPA Plug-In Service

17 - 3 Copyright © 2009, Oracle. All rights reserved.


UI-Oriented Scripts

• BPA scripts help users work through business processes


• They typically ask users to enter information and then
invoke a server-based service to update the database
• For example, you can develop BPA scripts to help users:
• Add a new person to an existing account
• Set up a customer to pay automatically
• Modify a customer who no longer wants to receive marketing
information
• Modify a customer’s web password
• Record a complaint
• Merge two accounts into one account
• … (the list is only limited by your time and imagination)

17 - 4 Copyright © 2009, Oracle. All rights reserved.


17
Invoking BPA Scripts

Copyright © 2009, Oracle. All rights reserved.


The BPA Menu Has Two Functions
• In the last exercise you executed a BPA script by selecting an item
from the Administration menu
• There are many other ways to initiate a BPA script, one is to use the
BPA menu
• The BPA menu can be invoked by clicking the wizard's hat
• The BPA menu has two functions:

1. The top part of the menu contains the


user’s favorite scripts

2. The bottom part of the menu contains


scripts that satisfy the user’s search criteria

You close the menu by:


- Selecting a script
- Pressing Esc (this is how all menus work)

17 - 6 Copyright © 2009, Oracle. All rights reserved.


A User’s Favorite Scripts

• A user defines their favorite scripts in their user preferences


• A hot key combination - Ctrl+Shift+a number - can be used to
execute one of the first 9 scripts without opening the script menu
(this is why numbers suffix the first 9 favorite scripts in the script
menu)

User

Favorite
Scripts

Script

17 - 7 Copyright © 2009, Oracle. All rights reserved.


A User’s Favorite Scripts Can Be Dictated

• To achieve consistency throughout a user community, you can define


favorite scripts on a template user
• You can then link this template user to real users
• The template user’s favorite scripts become the real user’s favorite
scripts

The template user whose favorite


User
transactions AND scripts are dictated
to the linked users

Favorite
Scripts

Script

17 - 8 Copyright © 2009, Oracle. All rights reserved.


Version 2 Implications

• With the advent of version 2, the need to use the BPA menu to invoke
scripts is greatly reduced
• This is because version 2 allows designers to place HL's and icons
that execute BPA scripts in more easily accessible places on the UI:
• A menu item can invoke a BPA script (you just did this)
• A context menu item can invoke a BPA script
• An entry in the Favorite Links dashboard zone can invoke a BPA script
• A hyperlink in an explorer zone can invoke a BPA script
• A zone header can contain a hyperlink that invokes a BPA script
• Buttons on display-only UI maps can invoke BPA scripts
• Context sensitive zones can contains buttons and hyperlinks to invoke
BPA scripts
• Selecting a To Do entry can kick off a BPA script
• Etc.

17 - 9 Copyright © 2009, Oracle. All rights reserved.


17 The BPA Area

Copyright © 2009, Oracle. All rights reserved.


Earlier, We Said The Following

The action bar contains buttons that allow you to update the
database and navigate to transactions

These 4 elements
The menu bar allows you to
appear onDisplay
Object
navigate to other pages
every Area
page
This area contains the portal /The maintenance objectzones
dashboard contains
(note, the Dashboard can be turned off
/ query that you’vethat allow you to perform common
requested
by setting up user preferences
tasks and navigate to other
accordingly (or by clicking its "bar"))
transactions

The status bar contains informational messages


about what the system just did

17 - 11 Copyright © 2009, Oracle. All rights reserved.


There's One More Area - The BPA Area

When a BPA script executes, it can open an area on top of the


Object Display Area where it can display and capture information;
we refer to this as the BPA area

This area is rarely used in modern BPA scripts except for debugging and
displaying termination errors

Object Display Area

17 - 12 Copyright © 2009, Oracle. All rights reserved.


17
Refresher: Declaring Data Areas for BPA Scripts

Copyright © 2009, Oracle. All rights reserved.


BPA Scripts – Defining Data Areas
• Just like server scripts, BPA scripts need to have their data areas declared
• It's the superset of these data areas that form the XML document whose data
can be manipulated by the script

Remember, UI
maps have
UI Map schemas just like
everything else that
appears below
Service
Script
Script
(BPA)

Data Area BO

For example, if your script is going to


Stand-
interact with a BO or service script, you alone
just have to reference the object's data
area (i.e., you don't have to redundantly
declare the data area in the BPA script) Business
Service

17 - 14 Copyright © 2009, Oracle. All rights reserved.


Naming Data Areas
• You define a logical name for each data area so that you
can reference multiple instances of the same object
Human BO Schema

<taxpayerId mapField="PER_ID"/>

This script’s data area can <name mapField=“ENTITY_NAME”>


<row mapChild=“CI_PER_NAME">
Script reference 4 instances of
<PRIM_NAME_SW is="Y"/>
the same BO
(BPA) <NAME_TYPE_FLG default="Primary"/>
</row>
</name>

<email mapField=“EMAILID"/>
BO
Data Area <socialSecurityNumber mapField="PER_ID_NBR">
<row mapChild=“CI_PER_ID">
<ID_TYPE_CD is="SSN"/>
</row>
• “Taxpayer” BO: Human <socialSecurityNumber/>
• “Spouse” BO: Human
• “Depend1” BO: Human <homePhone mapField="PHONE" >
<row mapChild="CI_PER_PHONE">
• “Depend2” BO: Human <PHONE_TYPE_CD is="HOME" />
</row>
</homePhone>

17 - 15 Copyright © 2009, Oracle. All rights reserved.


Same Thing

• You could achieve the same thing by referencing a single


service script whose schema is configured accordingly
• And this is, by far, the preferred approach as a single service call
from the client to the server is always better than 4 service calls
Family Service Script Schema

Script <Taxpayer type=“group”>


(BPA) <includeBO name=“Human"/>
<Taxpayer/>

<Spouse type=“group”>
Service <includeBO name=“Human"/>
Data Area Script <Spouse/>

<Depend1 type=“group”>
<includeBO name=“Human"/>
<Depend1/>
• “Family” SS: Human <Depend2 type=“group”>
<includeBO name=“Human"/>
<Depend2/>

17 - 16 Copyright © 2009, Oracle. All rights reserved.


17 BPA Step Types
(Some You Know, Some Are New)

Copyright © 2009, Oracle. All rights reserved.


Refresher: Scripts Are Constructed Of Steps

Valid Values:
• You'll recognize some step types • Move data
Script
from server scripts • Conditional branch
• Label
• These are shown in gray • Go to a step
• The remainder fit into 3 categories: • Edit data
Step • Invoke business object
• Still available, but rarely used • Invoke business service
– Scripts have undergone an evolution • Invoke service script
• Terminate
with the advent of V2 and some step
• Prompt user
types are rarely used Step Type • Input data
• Control the UI • Set focus to a field
• Mathematical operation
• Structured programming techniques • Invoke function
• In other words, you just have to learn • Invoke map
• Height
7 new step types to write BPA scripts • Navigate to a page
(the red and the green) • Press a button
• Display text
• Perform script
• Transfer control

17 - 18 Copyright © 2009, Oracle. All rights reserved.


Edit Data Recap
• All logic supported by the server-based scripts can be defined in a
BPA's edit data steps (e.g., invokeBO, goto, branch, terminate, etc.)
• Just like server-based scripts, you can use For and If statements
• In addition, the following BPA-only step types can be referenced:
• Transfer control
• Perform script
• Invoke map
• Navigate to a page
• You can also use Xpath, but you are limited to the XPath 1.0 language
as most browsers have not adopted 2.0 yet

10 steps or 1 “edit data” step; the choice is yours

17 - 19 Copyright © 2009, Oracle. All rights reserved.


Height Steps
• Height steps allow you to change the height
of the BPA area to be larger or smaller than
the standard size
Script
• You can also specify a height of 0 to hide
the BPA area
• Most of our scripts don't use the BPA area Step
and therefore the first step is frequently a
Height of zero
• Remember, if you want to display data Height Unit

during debugging, set the Height to


Valid Values:
something other than zero (15% is a • Pixels
standard height) • Percentage

• Or just leave out the height step (but then you'd


have to add it before "production")
17 - 20 Copyright © 2009, Oracle. All rights reserved.
Display Text Steps

• A Display text step displays text and/or field values in the


BPA area
• This is typically used during debugging to display the
contents of XML groups / elements
• It's also used to show error messages associated with
abnormal terminations
• Remember to use a Height step to set it to something > 0
otherwise your text won't be seen
You can use the %+…+% syntax to display
all elements in a group from the script's XML
document in the BPA area (make sure the
height is something other than 0%!)

17 - 21 Copyright © 2009, Oracle. All rights reserved.


Navigate To A Page Steps

• Use a Navigate to a page step to transfer to a portal or


maintenance transaction
• These steps reference a navigation option; the navigation
option defines the target transaction (and a few other
things…)
Script

Remember, when you create a portal, the


system creates a navigation option for you;
Step you should rarely need to create new
navigation options

Navigation
Option

17 - 22 Copyright © 2009, Oracle. All rights reserved.


Invoke Map Steps

• An Invoke map step is used to display a UI map to capture


input from the user
• The map can be displayed in one of 3 places:
• The object display area (we frequently do this)
• In a pop-up window (we sometimes do this for certain UI patterns)
• The BPA area (we almost never do this)
• We'll discuss this type of step in the next sections

17 - 23 Copyright © 2009, Oracle. All rights reserved.


Press A Button Steps

• A Press a Button step is used to press a button in the


main button bar (or in the dashboard or in a traditional
page)
• This is rarely used in V2 BPA scripts except to redisplay a
portal after a user has executed a script that can change
something on the portal

17 - 24 Copyright © 2009, Oracle. All rights reserved.


Perform Steps

• A Perform step would better be defined as an Include step


• Perform steps are used to execute script steps that are
defined in a separate script (which we refer to in common
parlance as a "subscript")
• You'd move steps into a "subscript" just because it’s a
good programming technique to not repeat the same logic
in multiple scripts
• No one can force you to be a good programmer though

17 - 25 Copyright © 2009, Oracle. All rights reserved.


Transfer Steps

• A Transfer step stops execution of the current script and


starts execution of another script
• Again, you use this to consolidate common logic
• And again, no one can force you to be a good programmer

17 - 26 Copyright © 2009, Oracle. All rights reserved.


17
The Implications of Common Dialogs

Copyright © 2009, Oracle. All rights reserved.


Common Dialogs = Common BPA Scripts

• In an upcoming chapter (Maintenance Patterns), we describe that


most blueprints adhere to standard design dialogs to maintain an
MO's BO's
• We do this as it results in a more predictable user experience
• The nice side effect of this is that, while most MO's require a new BPA
script to add, change and delete their BO's, the script is trivial
• What takes the work is the development of the UI maps to capture data
• We will only be able to explain how this was achieved after the future
chapter is behind us
• If you're interested in "reading ahead", have a look at the BPA script
used to add an approval profile and notice how virtually everything in
it is dynamic
• We'll now move on to describing the structure of the UI maps that are
invoked by these trivial BPA scripts

17 - 28 Copyright © 2009, Oracle. All rights reserved.


17
Scripts and UI Maps

Copyright © 2009, Oracle. All rights reserved.


UI Maps Aren’t Just For Display-Only Zones

• Up to now, the UI maps were used to construct display-


only map zones
• But, as you've just learned, UI maps can also be presented
during BPA scripts to capture information during a
business process

17 - 30 Copyright © 2009, Oracle. All rights reserved.


An Example

Clicking the icon causes a


BPA script to execute

The BPA script, in turn,


caused this UI map to be
popped up (to ask the user
where they want the bill sent)

17 - 31 Copyright © 2009, Oracle. All rights reserved.


Review: UI Map Meta Data
The map’s schema defines the
The UI map contains the
fields whose values are displayed
HTML presented to the user
and maintained on the map
UI Map

HTML Schema

<includeBO name=“C1-ConsProg"/>
<tr>
<td oraLabel="conservationProgram/description"></td>
<td><input type="text"
oraField="conservationProgram/description" />
</td>
</tr>
<tr>
<td oraLabel="conservationProgram/generalInfo/startDate"></td> Notice in this example
<td><input type="text" that we’ve just “included”
oraField="conservationProgram/generalInfo/startDate" />
the schema of a BO (so if
</td>
</tr> you change this BO, you
don’t have to change the
map’s schema, but you’d
This HTML is more interesting than the HTML in the need to change the HTML
map zones as it can capture element values if the change is displayed)

17 - 32 Copyright © 2009, Oracle. All rights reserved.


BPA Scripts – “Invoke map” Step Type
• UI maps are presented using the Invoke map step type
• This step type has several options

You define the portion of the script’s data area that is


“injected” into the map’s HTML (and it’s also this portion
that’s populated after the user is finished with the map)

You define the name of the UI Map

You define where to go based


on what the user clicks on

17 - 33 Copyright © 2009, Oracle. All rights reserved.


How This Works At Runtime

• When an Invoke map step is executed:


• The data area group’s XML is injected into the map's HTML
• The injected HTML is presented to the user
• When the user indicates they are ready to continue:
• The element values in the HTML are loaded back into the group's
data area (assuming the user didn’t cancel)
• A system variable is populated with an indication of what the user
wants to do next (e.g., if the user clicks the Save button, the system
variable will indicate such)
• The BPA then transfers control to the step associated with the
system variable’s value

17 - 34 Copyright © 2009, Oracle. All rights reserved.


17
Pop-Ups versus Page Area

Copyright © 2009, Oracle. All rights reserved.


Which Target Area?
• You must say where the map should appear by referencing
a Target Area

You define where the map appears:


- in a pop-up window
- in the BPA area
- in the page area

17 - 36 Copyright © 2009, Oracle. All rights reserved.


Base-Package Patterns

• The BPA area is rarely, if ever, used as it looks odd having


a UI map in the BPA area
• Pop-ups are used when:
• You want the user to confirm the action (e.g., if the user wants to
delete something, we will frequently pop-up a map asking them to
confirm the deletion)
• You need a small amount of additional information to complete the
action (e.g., if the user wants to reject an adjustment, we would
pop-up a map asking them for the rejection reason)
• The Page area is used for all other situations
• Note, when the page area is used, the system disables the rest of
the UI so that the user must complete the map or cancel the
business process

17 - 37 Copyright © 2009, Oracle. All rights reserved.


17
HTML in UI Maps Invoked By BPA Scripts

Copyright © 2009, Oracle. All rights reserved.


Map Zone HTML versus BPA Map HTML

• The differences in the HTML:


• Display-only map zones are display-only; BPA maps are frequently
input-output
• Buttons on display-only map zones typically kick off BPA scripts,
buttons on BPA maps are typically restricted to OK, Save, Cancel,
etc.
• Display-only map zones don’t have to deal with displaying errors;
BPA maps must cater for error display

17 - 39 Copyright © 2009, Oracle. All rights reserved.


Enforcing Consistency

• We ship a sample style sheet so your HTML can inherit the


look and feel from a single spot
• We also ship a library of JavaScript functions to handle
things like monetary formatting, date formatting,
defaulting, etc.
• You can add your own functions if you want
• You can choose to ignore our functions; the choice is yours

17 - 40 Copyright © 2009, Oracle. All rights reserved.


HTML Sources

• The UI map tips contain many HTML examples


• Recall that the UI map transaction has a dashboard zone
that can generate sample HTML for display only and input
maps using the map's schema
• There are many base-package and demo BPA scripts and
UI maps with interesting examples

17 - 41 Copyright © 2009, Oracle. All rights reserved.


Team Walk Through (60 minutes)

• Analyze a maintenance UI map


• Break up into teams and follow the instructions in the workbook

17 - 42 Copyright © 2009, Oracle. All rights reserved.


17
User Interface (UI) Maps

Drop Downs

Copyright © 2009, Oracle. All rights reserved.


Simple Drop Downs On UI Maps

• The base-package UI
map functionality
supports several
different ways to
populate a drop down
without the need for
Java Script (this is
from the tips)
• Notice all the different
ways to easily populate
a drop down

17 - 44 Copyright © 2009, Oracle. All rights reserved.


Drop Downs and The User Experience

• The clever use of drop downs can greatly improve the


user's experience
• Let's check out the Add Conservation Program dialog to
see what we're talking about…

17 - 45 Copyright © 2009, Oracle. All rights reserved.


The CCB Base Package Has Good Examples

• We've supplied examples in the base-package of


idiosyncratic UI maps
• See the map used to add / update a Conservation Program for how
to populate dropdowns with interesting values (e.g., show only SA
Types for a selected Division)
– This example also has several techniques of UI events invoking
services to change dropdown values based on the selection of another
drop down (e.g., show only To Do Roles for a selected To Do Type,
show only Adjustment Types for a SA Type)
– This example also shows how to implement complex grids
• See the map used to add / update a Rebate Definition to see how
users can upload data from a CSV (useful for mass uploads)
• See the map used to display the Sample and Submit results to see
how user can see a list of the results from an explorer zone in a UI
map

17 - 46 Copyright © 2009, Oracle. All rights reserved.


17
Updating The Database

Copyright © 2009, Oracle. All rights reserved.


A Strong Pattern: “Invoke map” Steps Are Followed By
A Step That Invokes A Server-Based Service
• One of the following steps will frequently follow an “Invoke map” step:
• Invoke business object
• Invoke service script
• Invoke business service

You define the portion of the script’s data


area that is sent to the service script

You define the name of the service


script that’s invoked

You define where to go if the


service call fails and succeeds…

17 - 48 Copyright © 2009, Oracle. All rights reserved.


Displaying Errors

• In most sample scripts, if an error is returned, we return to the step


that invokes the map
• This causes the map to be redisplayed with the error message shown in
red
• This is the base-package standard
• If you want to show the error in a pop-up, you can; just navigate to a
step that invokes another pop-up

You can click the message


to see the long message

17 - 49 Copyright © 2009, Oracle. All rights reserved.


Highlighting The Field That's In Error

• In addition to displaying the error message at the top of


the UI map, you can also turn the background of the field
in error to red
• The framework will do this for you for all schema-based
validation
• For idiosyncratic validation in your plug-ins, simply return
the name of the element that's in error in the Terminate
with error step

17 - 50 Copyright © 2009, Oracle. All rights reserved.


17
Favorite Links and BPA Scripts

Copyright © 2009, Oracle. All rights reserved.


Favorite Links Can Reference A BPA Script

• Favorite Links is a dashboard zone that contain the user's "favorite"


transactions
• These transaction can be true maintenance pages and portals
• They can also initiate BPA scripts
• We realize that this is duplicative of the user's favorite scripts and there is
no reason to use one versus the other

User Navigation
Option
Navigation options that
appear on a user's favorite
links can reference a BPA
script
User /
Favorite
Script
Link Transaction Script
(BPA)

The script must be “user invokable”

17 - 52 Copyright © 2009, Oracle. All rights reserved.


17
Menu Items for BPA Scripts

Copyright © 2009, Oracle. All rights reserved.


Navigation Options Can Reference A BPA Script
• Kicking off scripts from menus

Menu

Navigation
Option
Menu Line Navigation options that
appear on menus can
reference a BPA script

Menu Item
Script
Transaction Script
(BPA)

You can put these navigation The script must be “user invokable”
options on the menu bars
and on context menus

17 - 54 Copyright © 2009, Oracle. All rights reserved.


Temporary Storage Is Initiated For Context Menus
• If the menu item is on a context menu, a temporary storage variable is initiated:
• The name of the variable is the name of the field in the navigation option’s context
• For example, you could have an item on the account context menu to “stop autopay”; when this
script is initiated, a temporary storage variable named ACCT_ID will be populated so you can
read the account’s current autopay options and pop a window where they can be changed

Navigation
Option
Context

Menu Item
Script
Transaction Script
(BPA)

17 - 55 Copyright © 2009, Oracle. All rights reserved.


17
Advanced BPA Script Features

BPA Scripts On Info and Query Zones

Copyright © 2009, Oracle. All rights reserved.


BPA Scripts On Query & Info Zones

• You've already seen how columns in info and query zones


can invoke a BPA script
This icon column has been
configured to launch a BPA script
(and to pass the respective Bill Id)

17 - 57 Copyright © 2009, Oracle. All rights reserved.


Context Menus Query & Info Zones

• You've already seen how a FK ref column contains a context menu


• You can add menu items to these context menus that kick off BPA scripts

This context menu can contain


items that launch a BPA script
(passing the ID of the respective
object in context)

17 - 58 Copyright © 2009, Oracle. All rights reserved.


17 Access Rights

Copyright © 2009, Oracle. All rights reserved.


BPA Scripts Can Be Secured

• Earlier, you learned how the application service on a BO


and a service script governs who can access and update it
• BPA scripts can optionally reference an application
service
• If a BPA script has an application service, the user must have
access right to this app services in order to execute the BPA script

Script Application Valid actions


aren't used for
Service this type of
security check

This is optional
BPA and
Plug-In
Service

17 - 60 Copyright © 2009, Oracle. All rights reserved.


When Are Access Rights Checked?

• Access rights are checked whenever a user attempts to


invoke a BPA script (it doesn't matter what type of
invocation method)

17 - 61 Copyright © 2009, Oracle. All rights reserved.


17
Advanced BPA Script Features

Learn Via Experimentation

Copyright © 2009, Oracle. All rights reserved.


Scratching The Surface

• Being able to invoke a service passing the data entered on


an HTML form is a powerful tool
• The combinations of user interface patterns that you can
now implement are infinite
• However, we try to avoid unusual dialogs because users
typically like predictable, simple dialogs and we've tried to
include as many of these as possible in the demo
database

17 - 63 Copyright © 2009, Oracle. All rights reserved.


Review Questions

17 - 64 Copyright © 2009, Oracle. All rights reserved.


17 Eligibility Rules

Copyright © 2009, Oracle. All rights reserved.


Outdated Concept

• Eligibility rules were used prior to version 2


• With the advent of V2 (and the ability to put BPA scripts on
menus, favorites, explorer hyperlinks, explorer zone
header hyperlinks, context sensitive zones, etc.) the need
to use the BPA menu and the eligible scripts zones to
invoke scripts has been reduced
• Because eligibility rules are only used on the BPA menu
and the eligible scripts zone, this section is therefore not
as relevant as it used to be
• If you're running short of time, skip this section as it's
sophisticated and will rarely be used in base-package
development

17 - 66 Copyright © 2009, Oracle. All rights reserved.


Eligibility Rules Reduce Search Results

• You can optionally link eligibility rules to a script


• For example, you can indicate a script is only eligible if the user is
part of the “CSR” user group AND the current account’s customer
class is “residential” and the account’s division is “Texas”
• Eligibility rules do not affect a user’s favorite scripts, i.e., a
user can execute a favorite script even if it’s not eligible
• Eligibility rules do affect the scripts that appear when a
user searches for a script, i.e., only eligible scripts
matching the user’s search criteria appear in the bottom
half of the script menu (if they’ve turn on the switch on the
BPA menu)…

17 - 67 Copyright © 2009, Oracle. All rights reserved.


Only Eligible Scripts May Appear In The BPA Menu

• You can optionally link eligibility rules to a script


• For example, you can indicate a script is only eligible if the user is part of the
“CSR” user group AND the current account’s customer class is “residential
• Eligibility rules do not affect a user’s favorite scripts
• i.e., a user can execute a favorite script even if it’s not eligible
• Eligibility rules do affect the scripts that appear when a user
searches for a script
• i.e., only eligible scripts matching the user’s search criteria appear in the
bottom half of the script menu (if they’ve turn on the switch on the BPA
menu)

Only eligible scripts appear if


the check box is on

17 - 68 Copyright © 2009, Oracle. All rights reserved.


Eligible Scripts Can Appear In The Dashboard
• If a user updates their portal
preferences to include the Eligible
Scripts Zone, a zone will appear on
the Dashboard
• This zone contains the user’s eligible
scripts
• Clicking on a line executes a script

Only visible if the user has


selected the zone on Portal
Preferences

17 - 69 Copyright © 2009, Oracle. All rights reserved.


You Don’t Have To Set Up Eligibility Rules
• When you set up a BPA script, you must indicate if it has
eligibility rules or if it’s judged as “always eligible” or
“never eligible”
• By default, the system assumes a script is “always
eligible”
• If a script is “always eligible” or “never eligible”, the rest of
this presentation is not applicable
Valid Values:
• Always Eligible
Eligibility • Never Eligible
Indicator • Based on Criteria Group

Script

17 - 70 Copyright © 2009, Oracle. All rights reserved.


If A Script Is Not “Always / Never Eligible” Then It Has
Criteria Groups
• A script’s criteria group(s) control whether the
script is eligible
• A script must have at least one criteria group if
it’s not always/ never eligible Script
• At a high level, it works like this
• A criteria group has one or more eligibility criteria
• A group’s criteria control whether the group is
considered TRUE or FALSE for a given customer and Criteria
user Group
• You also define what should happen if the group is
TRUE or FALSE. You have the following choices
– The script is judged as eligible
Eligibility
Criteria
– The script is judged as ineligible
– The next criteria group should be checked

17 - 71 Copyright © 2009, Oracle. All rights reserved.


Schematic Of A Sample Script’s Eligibility Rules
• Assume a script exists that can only be selected if
• Customer’s credit rating is > 700 and amount of debt older than 60
days is between $50 and $500, OR
• Credit rating is > 800 and the amount of debt older than 60 days is
Eligibility Group 1
between $50 and $1,000 Eligible for the script if the criteria indicate the group is
• The script needs two TRUE

criteria groups and each Script Eligibility Criteria

group needs two eligibility Credit rating > 700

criteria Debt older than 60 days is between $50 and $500

Script – Setup Payment Arrangement


Script Group 2
Eligibility Groups Eligible for the script if the criteria indicate the group is
TRUE
Customer has a good credit rating and old debt is
between $50 and $500 Package Eligibility Criteria

Credit rate > 800


Customer has an excellent credit rating and old
debt is between $50 and $1,000 Debt older than 60 days is between $50 and $1,000

17 - 72 Copyright © 2009, Oracle. All rights reserved.


Eligibility Criteria
• When an eligibility criterion is executed, the system
• Retrieves a comparison value and compares it to something
• Based on results, determines if next eligibility criterion in the group should be
checked of if the group should be judged TRUE or FALSE
• Here is an example of an eligibility criteria group that restricts a script to
customers whose credit rating is > 700 and whose debt that’s older than
60 days is between $50 and $500

17 - 73 Copyright © 2009, Oracle. All rights reserved.


Eligibility Criteria ERD
Used if you need to retrieve a value
Valid Values: from a person, account, or premise
• Person characteristic
Criteria
• Account
characteristic
• Premise
entity
All 3 flags have the same values:
Script - The group is true
Valid Values:
How to retrieve - The group is false
• Call an algorithm
comparison - Check the next eligibility criteria
• Characteristic
value

This is only used if you need Value Criteria What happens


to retrieve a value from
someplace else in the Retrieval Group if the criteria is
true
system (other than a Algorithm
characteristic)
What happens
Valid Values:
Eligibility if the criteria is
•< How to Criteria false
• <= compare
•= What happens
• >= if the criteria is
•> Comparison indeterminate
• <> Algorithm
• Between This is only used if you need to perform a
• In complex comparison (e.g., determine if a birth
• Call an algorithm date is that of a “senior”)

17 - 74 Copyright © 2009, Oracle. All rights reserved.


Eligibility Group ERD
• The criteria group is simpler; it simply contains an indication
of what should happen if the eligibility criteria indicate the
group is considered to be TRUE or FALSE
• There are only 3 options:
• The script is eligible
• The script isn’t eligible Script
• Check the next group
Valid values: If Group Is
Eligible
Ineligible True
Check Next Group
Criteria
Group
Valid values: If Group Is
Eligible False
Ineligible Eligibility
Check Next Group
Criteria

17 - 75 Copyright © 2009, Oracle. All rights reserved.


17
Value Retrieval Algorithms

Copyright © 2009, Oracle. All rights reserved.


Base Package Value Retrieval Algorithms

• The following value retrieval


algorithms are delivered with Script
the base package
• Return the value of a field held on
CI_ACCT Criteria
How to retrieve Group
• Return TRUE if the account has a comparison
non-closed / non-canceled SA of a value
given service type Value Eligibility
• Return TRUE if the user belongs to Retrieval Criteria
a given user group Algorithm

17 - 77 Copyright © 2009, Oracle. All rights reserved.


Base Package Value Comparison Algorithms

• Only one value comparison is


being delivered in the base
• It has the same logic as the “time
span comparison” algorithm Script
from the package eligibility rules
• It may prove handy for criteria
like Criteria
How to
compare
Group
• Must be a senior
• Must have been a customer for less than
a year Comparison Eligibility
Algorithm Criteria

17 - 78 Copyright © 2009, Oracle. All rights reserved.


17 - 79 Copyright © 2009, Oracle. All rights reserved.

You might also like