Professional Documents
Culture Documents
Overview
Up to now, you've learned to:
In this section, you'll learn how to control the various stages of a BO's lifecycle.
Objectives
Understand how each BO's lifecycle is configurable via the BO meta data
Understand what a "save point" is and how to use one in your logic
Chapter 7
10-Oct-16
10-Oct-16
The Issues Detected state has a nice bit of defensive logic to make sure that there's
an issue before they are allowed to enter this state. This was not in the blueprint
and it was a good catch.
The Issues Detected state has a UI map that's dynamically invoked to capture the
manual issue. This was not in the blueprint as this technique was invented by the
development team.
The Canceled state has a required element and a state transition UI map. These
were not in the blueprint as these techniques were not invented when the blueprint
was written.
The Approval In Progress state's Monitor (used to be called Auto Transition)
algorithm transitions to the Receipt Verification state when all approvers (if any) have
approved the claim.
The Approval In Progress state's Monitor (used to be called Auto Transition)
algorithm that's in the blueprint that was looking for stuff that was "Waiting Too Long"
has to be configured as we didn't ship it on the base BO as we felt an
implementation team should set this up. So, there's an algorithm type in the base for
this, we just didn't set up a base algorithm and plug it in on the base rebate claim
BO.
The Approval In Progress state's Exit algorithm was not in the blueprint and it was a
good catch (to complete any hanging To Do entry when it leaves this state).
The Receipt Verification state was implemented as designed.
The Complete state was implemented as designed. This is a good sample of
financial logic if you need this in future plug-ins.
Chapter 7
The Rejected state has a required element and a state transition UI map. These
were not in the blueprint as these techniques were not invented when the blueprint
was written.
10-Oct-16
10-Oct-16
Save your work. At this point, your start date validation has been removed from your
BO. We'll now add a new plug-in in that will execute when a user attempts to inactivate
the BO. This new plug-in will contain the same logic from your original plug-in (i.e., it'll
check that the start date isn't in the future).
Chapter 7
10-Oct-16
Script - Main
10-Oct-16
Script - Schema
Why aren't the elements supplied? The reason that Enter plug-ins do not supply the
BO's before and after image like Validation plug-ins do is because Enter (and Exit and
Monitor) plug-ins can change the BO and the framework did not want to have to re-read
the BO before every enter plug-in (as there are many Enters that may not need the BO).
Chapter 7
Notice that the hard parameters are very different from those supplied to the Validation
plug-in you wrote in the previous chapter. Specifically notice that you are not supplied
the BO's elements like you were for the Validation plug-in spot. This means that before
you can validate that the start date is not in the future, you'll have to read the BO.
10-Oct-16
Object: XXX_ConservationProgram
Data Area Name: this defaults to the same name as our Object; you can leave
this.
10-Oct-16
Chapter 7
Script - Schema
10-Oct-16
Step Sequence: 10
Script - Step - 10
Note, if you wanted to use an Enter data step instead of a Move data, your Edit Data
Text would be:
move "parm/hard/businessObjectKey/conservationProgram" to
"REW_ConservationProgram/conservationProgram";
10-Oct-16
Step 20 will read the BO (i.e., populate the section of the script's schema with the BO's
elements). You should enter the following values:
Step Sequence: 20
Action: Read
Script - Step - 20
Note, if you wanted to use an Enter data step instead of a Move data, you'd have just
entered Edit Data Text of:
invokeBO 'XXX_ConservationProgram' using "XXX_ConservationProgram" for
read;
Chapter 7
10-Oct-16
Step 30 will contain your validation. You should enter the following values:
Step Sequence: 30
if ("xs:date(XXX_ConservationProgram/generalInfo/startDate) >
xs:date($CURRENT-DATE)")
terminate with error (90000, 1500 element='generalInfo/startDate');
end-if;
Script - Step - 30
Xpath is not validated. The framework is not able to validate information within double
quotes (i.e., the Xpath), therefore take care with what you enter. If you have entered
invalid Xpath, you'll see a "nasty" error at execution time.
Note, rather than enter 3 steps, you could have had a single Edit data step that looked as
follows:
At this point, we're ready to do the tedious tasks that the "Create algorithm" wizard did
for us.
10-Oct-16
Chapter 7
10-Oct-16
This will transfer you to the algorithm page ready to add an algorithm for this algorithm
type. Please supply the following information:
Algorithm - Main
10-Oct-16
Sequence: 10
Chapter 7
10-Oct-16
Review Questions
1. All MO's can have lifecycle rules defined using the business object meta-data.
True/False
Only MO's with a status column that have been introduced after version 2.1 can take
advantage of the BO lifecycle functionality.
2. Two BO's linked to the same MO may have different lifecycles. True/False
This is only true if the BO's are not child BO's (see next question).
3. Every business object may have a different lifecycle. True/False
Trick question - child BO's inherit their lifecycle from their topmost parent BO and
therefore cannot have their own.
4. While child BO's can't have their own lifecycle, they can have their own lifecycle
rules (i.e., you can plug-in Enter, Exit and Monitor plug-ins on child BO's).
True/False
5. When defining a BO's lifecycle, multiple statuses can be defined as initial.
True/False
6. When defining the lifecycle of a BO, multiple status values may be defined as final.
True/False
7. When a BO transitions into a new state, all exit algorithms on the old state are
executed and then, if there are no errors, all enters on the new state are executed.
True/False
8. If the state into which an object is being transitioned has a monitoring algorithm, this
algorithm will be executed when the object enters the state. True/False
Trick question - if the state into which a BO is transitioning has a "monitoring" batch
process linked to it, the monitoring algorithm(s) will NOT be invoked when the BO
enters the state. Rather, the invocation will be deferred to when the batch process
executes.
9. An Enter plug-in can tell the framework to transition the object into a new state.
True/False
10. If an Enter plug-in tells the framework to transition a BO into a new state, none of the
Monitoring plug-ins on the state will execute; however the Exit plug-ins will execute
before the BO leaves the state. True/False
11. It's possible, in a single logical transaction, for a BO to enter and exit several states.
True/False
12. Deferring the monitoring of a BO to a batch process might be a wise decision if it
results in "heavy processing". True/False
13. If the base-package ships a BO / State without a reference to a monitoring batch
process, the implementation team cannot defer monitoring of this state. True/False
Trick question - you don't know this, but the monitoring batch process on a basepackage owned BO can be changed by an implementation team. We refer to this
type of column as being "CM-able" and it can be Customer Modified while still being
owned by the base-package. This means that any changes made by the team to
this column will survive the upgrade.
10-Oct-16
14. If a MO is missing its Determine BO plug-in, none of the lifecycle rules will execute.
True/False
15. It is impossible for a BO to reside in a state that is marked as Transitory.
True/False
16. A "save point" is kind of like a logical transaction within a logical transaction.
True/False
17. Save points will only be issued if the appropriate plug-in has been defined on the
BO's MO. True/False
18. Most post 2.1 MO's that have a status column also have a log table. True/False
19. The logic to create log entries when a BO is created and when its state changes is
done in algorithms that are plugged in on the BO. True/False
The base MO has the logic to create the "created" and "state transition" log entries
so you don't have to plug-in anything to get these.
Chapter 7