Thursday, 18 June 2020

OUAF Business Object Plugin spots Execution Order

Plugin spots for business object in Oracle Utilities Application Framework (OUAF) are many. It is a bit confusing to determine the order of execution of each of these plugin spots. This blog aims to set straight the order of execution of different plugin spots by the framework when a Business object is added.

Now there are some existing documentation on the order of execution of these plug in spots but they are generally few plugin spots and not all spots in entity. Also these don’t include the BO lifecycle plugin spots calling order or MO plugin spots. This is an attempt to club all the plugins for a BO addition in entity.


Below it the order of execution of each plugin spot when a business object instance is added.




To determine the order, I had created individual scripts for each plugin spots that is to be checked and attached these custom scripts to respective plugins spots on a business object. Inside each script, I have logged comment of which plugin spot is getting called. Below is a sample of the code in each script.


After that have created a BPA script, in which I am invoking the business object for add. After that I checked the log entries made by each script to determine the order of execution. Above flow diagram is the output of analysis of the log entries. 

Below is an excerpt of the log entries

(CM_PPTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity BO Preprocessing Plugin Spot - BO Status: null - Action: ADD
(CM_DetBO) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity MO Determine BO Plugin Spot - BO Status: PENDING
(CM_DetBO) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity MO Determine BO Plugin Spot - BO Status: PENDING
(CM_ValTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity BO Validation Plugin Spot - Old BO Status: null - New BO Status: PENDING
(CM_EntTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity BO Enter Plugin Spot - BO Status: PENDING
(CM_MTrnTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity MO Transition Plugin Spot - Old BO Status: null - New BO Status: PENDING
(CM_MonTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity BO Monitor Plugin Spot - BO Status: PENDING
(CM_ExtTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity BO Exit Plugin Spot - BO Status: PENDING
(CM_EntTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity BO Enter Plugin Spot - BO Status: VALIDATE
(CM_PPTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity BO Preprocessing Plugin Spot - BO Status: VALIDATE - Action: UPD
(CM_DetBO) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity MO Determine BO Plugin Spot - BO Status: VALIDATE
(CM_MTrnTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity MO Transition Plugin Spot - Old BO Status: PENDING - New BO Status: VALIDATE
(CM_MonTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity BO Monitor Plugin Spot - BO Status: VALIDATE
(CM_ExtTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity BO Exit Plugin Spot - BO Status: VALIDATE
(CM_EntTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity BO Enter Plugin Spot - BO Status: WAITEFFTDT
(CM_MTrnTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity MO Transition Plugin Spot - Old BO Status: VALIDATE - New BO Status: WAITEFFTDT
(CM_MonTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity BO Monitor Plugin Spot - BO Status: WAITEFFTDT
(CM_ExtTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity BO Exit Plugin Spot - BO Status: WAITEFFTDT
(CM_EntTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity BO Enter Plugin Spot - BO Status: WAITAPPT
(CM_PPTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity BO Preprocessing Plugin Spot - BO Status: WAITAPPT - Action: UPD
(CM_DetBO) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity MO Determine BO Plugin Spot - BO Status: WAITAPPT
(CM_MTrnTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity MO Transition Plugin Spot - Old BO Status: WAITEFFTDT - New BO Status: WAITAPPT
(CM_ExtTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity BO Exit Plugin Spot - BO Status: WAITAPPT
(CM_EntTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity BO Enter Plugin Spot - BO Status: COMINPROG
(CM_DetBO) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity MO Determine BO Plugin Spot - BO Status: COMINPROG
(CM_DetBO) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity MO Determine BO Plugin Spot - BO Status: COMINPROG
(CM_DetBO) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity MO Determine BO Plugin Spot - BO Status: COMINPROG
(CM_PPTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity BO Preprocessing Plugin Spot - BO Status: COMINPROG - Action: UPD
(CM_DetBO) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity MO Determine BO Plugin Spot - BO Status: COMINPROG
(CM_MTrnTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity MO Transition Plugin Spot - Old BO Status: WAITAPPT - New BO Status: COMINPROG
(CM_MonTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity BO Monitor Plugin Spot - BO Status: COMINPROG
(CM_PoPTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity BO Post Processing Plugin Spot - BO Status: COMINPROG - Action: ADD
(CM_DetBO) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity MO Determine BO Plugin Spot - BO Status: COMINPROG
(CM_AudTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity BO Audit Plugin Spot - BO Status: COMINPROG
(CM_MAudTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity MO Audit Plugin Spot - BO Status: COMINPROG


  1. BO Preprocessing is the first plugin spot that is invoked.
  2. The next plugin spot is Determine BO. (If this is not present, or if this script doesn’t return the BO value, all subsequent plugins at BO level are not called by the framework. Only MO Audit plugin will be called after that). Below is an execution where Determine BO plug in doesn’t set the BO value. As seen below, only MO Audit algorithm is called, after Determine BO.
  3. After that BO Validation plugin spot is invoked.
  4. Next the Enter plugin spot on the first state on the lifecycle is invoked.
  5. Then the MO transition plugin spot is invoked.
  6. After that BO lifecycle Monitor plugin spot is invoked (This is called only if no monitor batch is attached on the lifecycle status).
  7. Next BO lifecycle Exit plugin spot is called.
  8. After that the BO lifecycle Enter plugin spot of next lifecycle state is called. After that MO Transition plugin spot is invoked. After that BO lifecycle Monitor plugin spot of new lifecycle state is called. Then BO lifecycle Exit plugin spot of new lifecycle state is called. This cycle (BO Enter -> MO Transition -> BO Monitor -> BO Exit) goes on for each lifecycle state, till it reaches a state from which the transition logic present doesn’t transition the BO to next state and remains in same state.
  9. In this final state the BO lifecycle exit algorithm is not executed as it has not exited from this state. In our example above, this state is ‘COMINPROG’. As seen from the logs, exit plugin is not executed for this state.
  10. After that the BO Post-Processing plugin spot is executed.
  11. Next BO Audit plugin spot is executed.
  12. The last plugin spot that is executed is the MO Audit plugin spot.
  13. One thing noticed in the logs is that BO Pre-Processing plugin spot is called whenever an ‘invokeBO for update’ logic is present in the attached lifecycle scripts. As seen in the logs, the action value is 'UPD' for these cases.
  14. Also Determine BO is called immediately after Pre-Processing plugin spot is called for update. Also Determine BO plug in spot is called many times by the framework in the above flow. The exact trigger for these calls to Determine BO is yet to be determined. 
Execution with Determine BO plugin not returning any BO value
(CM_PPTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity BO Preprocessing Plugin Spot - BO Status: null
(CM_DetBO) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity MO Determine BO Plugin Spot - BO Status: null
(CM_DetBO) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity MO Determine BO Plugin Spot - BO Status: null
(CM_MAudTest) *x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x* - Inside Field Activity MO Audit Plugin Spot - BO Status: null

For anyone attempting to replicate above test on their own, I have highlighted below, the steps for your reference.

D1-FieldActivity Business object that is present in C2M product of OUAF is used for demo. You can create similar custom plugin spots and attach on any Business object of your choice present in your OUAF product for testing. 


Below screenshots show the custom algorithms plugged in.

Business object plugin spots
  • Audit – CM_AUDTEST
  • Post-Processing – CM_POPTEST
  • Pre-Processing – CM_PPTEST
  • Validation – CM-VALTEST


Business object lifecycle plugin spots

  • Enter – CM_ENTTEST
  • Monitor – CM_MONTEST
  • Exit – CM_EXTTEST


Maintenance Object plugin spots
  • Determine BO – CM_DETBO
  • Audit – CM_MAUDTEST
  • Transition – CM_MTRNTEST


BPA script
This BPA scripts adds a business object of the type D1-FieldActivity


Then this BPA script is executed using Ctrl + Shift + S



Try it out. Let me know in case you face any issues. Also post your observations/learnings about these plugin spots in comments section below.

Updating the blog with flow with MO changehandlers. Although going ahead we will see less use of changehandlers as Oracle wants us to use plugins spots as part of their cloud focus.

Execution order with Maintenance object java changehandlers. In case you have configured changehandlers at MO level in java. The order of execution is as below. This has also been determined by putting a logger in changehandler and checking the execution order.

Changehandlers are called just after BO Preprocessing and before MO - Determine BO plugin.



No comments:

Post a Comment

OUAF Oracle Utilities WAM / ODM 2.4.0.0 installation on Windows

  This blog is for anyone looking to install Oracle Utilities WAM or ODM 2.4.0.0 (Oracle Utilities Workflow and Asset Management) or (Orac...