Professional Documents
Culture Documents
Check Point
Up to now, you've learned to define a BO's data structure
(i.e., you learned how to define the elements in a BO
schema)
In this section, you'll learn how to set up business rules
for your business objects
5-2
5-3
Business
Object
BO /
Algorithm
5-5
Algorithm
Individual
Taxpayer BO
Map Individual
Taxpayer BO XML to
Person MO XML
Person MO
Map Person XML back to
Individual Taxpayer XML
4
Add
6
Individual taxpayer added
taxpayerId = 9999129912
name = Mark, Brazil
email = abc@yahoo.con
ssn = 1234567
homePhone = 973-451-7777
birthDate = 1970-01-01
5-6
3
Validate
All business rules applied
Database
Validation Rules
You'd plug-in a validation algorithm on a BO if you need more sophisticated
validation than can be defined using the schema attributes
Notice how your validation algorithms are executed after the MO processing
(e.g., core validation rules)
Fun facts:
In
vo
BO k e
Individual Taxpayer
In
v
M oke
O
Enter
2. MO Processing
5-7
Exit
Person MO
(Service)
Copyright 2009, Oracle. All rights reserved.
3. Validation algorithms
In
vo
BO k e
Individual Taxpayer
In
v
M oke
O
Enter
2. MO Processing
5-8
Exit
Person MO
(Service)
3. Validation algorithms
3 Language Choices
An algorithm can be written in one of the following
languages:
Java. Typically used for "intense" logic.
Cobol. Typically used for "intense" logic.
Scripting. This is a high-level "4GL". Typically used for simpler
logic or logic that you know will be changed by an implementation
(and you want to make changing it easy).
5 - 10
The next section describes how to create a script; this course does not deal with Java or Cobol
The system uses this meta-data to know which program to invoke when a BO is added, changed
or deleted
Later, you'll learn when you might have more than 1 algorithm for an algorithm type
Programming
Language
Business
Object
BO
Algorithm
5 - 11
3
4
Algorithm
1
2
Algorithm
Type
Fundamentals
Notice that the script's logic is held in the system's meta-data and not
in a directory
Plug-In
Script
The script's steps contain the
algorithm's logic; we'll discuss
steps in a few slides
Step
5 - 13
Plug-In
Script
Step
5 - 14
Business
Object
Maint.
Object
Business
Object
BO
Algorithm
5 - 15
3
4
Algorithm
1
Plug-In
Script
2
Algorithm
Type
Step
<customer>
<lastName mapField= ... />
<homePhone ... />
<mobilePhone ... />
<driversLicense ... />
...
</customer>
<account>
<creditLimit mapField= ... />
<preferredDueDay ... />
<customerClass ... />
...
</account>
5 - 17
It's the superset of these schemas that forms the script's XML
document
Plug-in
script
Data Area
BO
Standalone
Service
Script
Business
Service
5 - 18
Business
Object
Plug-in
script
Data Area
5 - 19
<customerId/>
<customerName/>
<homePhone/>
<workPhone/>
</hard>
</parm>
<customer>
<lastName mapField= ... />
<homePhone ... />
<mobilePhone ... />
<driversLicense ... />
...
<account>
<creditLimit mapField= ... />
<preferredDueDay ... />
<customerClass ... />
...
Step
Step Type
5 - 21
5 - 22
The script can also add, change or delete other objects. Each of
these functions causes an XML document to be sent to a service
Invokes a service that adds a new BO (called Person) passing the data in the XML
document in the node "parm/cust" (and this is a group node that contains many elements)
Copy an XML node to another node
Add another BO passing a different section
of the XML document (the "parm/spouse"
group node)
Add another BO passing a different section
of the XML document ("account")
And so on
5 - 23
5 - 24
5 - 25
5 - 26
5 - 28
Debugging
This area appears when you enter the system in debug=true mode. You must
turn on the Global debug checkbox if you want to turn on server logging
5 - 30
You can see the log entries by clicking the Show User Log button
All log records for YOUR USER ID appear in a pop-up window
This is why you should not use anyone's user ID but your own
5 - 31
5 - 32
Commenting Steps
As stated on the previous slide, every step causes a log
entry to be created when you're in debug mode
If the first two characters of a step's text contains '//', the
step will be skipped at execution time
This might prove useful to keep debugging logic in your
scripts and leave them commented
5 - 33
5 - 34
Algorithm
BO /
Algorithm
System
Event
5 - 36
In
vo
BO ke
Enter
In
v
M oke
O
1. Pre-processing rules
2. MO Processing
5 - 37
Individual Taxpayer
Exit
Person MO
(Service)
3. Validation rules
One can argue that post processing could just be your last
"validation" algorithm
In
vo
BO k e
However, there are core processes (e.g., conversion, ConfigLab) that can
invoke objects in "validate only mode" and you'd really not want to have
post processing to be executed in these scenarios
In
v
M oke
O
1. Pre-processing rules
2. MO Processing
5 - 38
Individual Taxpayer
Enter
Exit
Person MO
(Service)
4. Post-processing rules
3. Validation rules
Audit Rules
You'd create an audit algorithm if you want to store audit
trail (or other audit type objects) when a BO is added,
changed or deleted
One can argue that audit algorithms could just be your
last "post processing" algorithm
In
vo
BO k e
Individual Taxpayer
Enter
Exit
In
v
M oke
O
5. Audit processing
2. MO Processing
5 - 39
Person MO
(Service)
4. Post-processing rules
3. Validation rules
In
vo
BO k e
In
v
M oke
O
1. Pre-processing rules
(updates allowed)
2. MO Processing
5 - 40
Individual Taxpayer
Enter
Exit
Person MO
(Service)
5. Audit processing
(updates allowed)
4. Post-processing rules
(updates allowed)
3. Validation rules
(no updates)
Info Routine
The "info plug-in spot" is responsible for returning the
standard string of information that appears throughout the
system
It's not a "business rule" as it's used purely for display purposes
If the BO's for a given MO all have the same "info string"
logic, you can rather use a plug-in spot on the MO (the BO
plug-in overrides the MO)
5 - 41
Algorithm Entity
Every plug-in script references an algorithm entity
The algorithm entity serves two important functions:
It defines the script's API (i.e., its input and output)
It prevents the script from being plugged in on the wrong object (e.g., you
can't plug a validation script into a pre-processing algorithm type)
5 - 42
Algorithm
Entity
Plug-In
Script
Algorithm
Type
<parm>
<hard>
<businessObject>
<id/>
</businessObject>
<newBusinessObject>
<lastName/>
<homePhone/>
...
</newBusinessObject>
<originalBusinessObject>
<lastName/>
<homePhone/>
...
</originalBusinessObject>
</hard>
</parm>
5 - 44
You also learned that when you create a plug-in script / algorithm type, you
must define their algorithm entity so the system can construct's the program's
API
There are 100's of algorithm entities you've only learned those that are used on
BO's (the others are used on other objects that you don't know about yet)
Algorithm
Entity
Plug-In
Script
5 - 45
Algorithm
Type
Algorithm
BO
BO /
Algorithm
System
Event
Pre-processing
Post-processing
Validation
Audit
BO
BO /
Algorithm
5 - 46
System
Event
Valid Values:
Validation
Pre-processing
Post-processing
Audit
Information
5 - 48
Up to now, you've just seen BO-oriented plug-in spots (e.g., validation, audit,
info, etc.)
However, there are many other plug-in spots, one of which is on the MO
When an MO is initially created, the base-package team plugs-in an
algorithm whose logic knows where to look for a given MO's BO
The following are common algorithms:
If you create a new MO and you don't plug-in this type of algorithm, the
system will NOT invoke any BO rules
Maint.
Object
MO /
Algorithm
5 - 49
Algorithm
System
Event
Valid Values:
Determine BO
Information
In
vo
BO ke
In
v
M oke
O
1. Pre-processing rules
Individual Taxpayer
Enter
Exit
Person MO
(Service)
2. MO Processing
3. Determine BO
5 - 50
Individual Taxpayer
1. Pre-processing rules
2. Determine BO
In
v
M oke
O
In
vo
BO k e
Person MO
(Service)
3. MO Processing
6. Audit rules
5. Post-processing rules
4. Validation rules
5 - 51
MO: Person
Logic:
- Return the value of the "person
flag" (e.g., Human or Business)
BO: Human
BO: Business
BO: GenericCustomer
5 - 52
5 - 54
Account
Account
CI_ACCT
Bill
Message
CI_ACCT_MSG
Performance Concerns
Invoke BO add and Invoke BO update are slower than their "fast"
counterparts as we read the entire BO after the update (so don't use
these actions if your script doesn't need a refreshed object)
Note well, the system will return the PK of a new BO after a fast add so you
don't need to use the slow version if your subsequent logic just need the
newly added PK
The overhead may not be relevant if the plug-in scripts arent called
during major batch processing
5 - 57
5 - 58
5 - 59
Review Questions
5 - 60
5 - 61