Named Extensions

The Extensibility Framework provides a mechanism by which system event lifecycles can be extended. The various lifecycle steps are given specific names in the system, so they have to be accessed using those names. Custom Java code can be added before or after a lifecycle step, or it can replace the lifecycle step altogether. The Extensibility Framework is present at the transaction processing, Web Service and user interface levels. The Extensibility Framework maps custom Java classes to named points in the system. These names vary based on the context, and are described in detail later in this document. A single Java class can be mapped to multiple extension points and, conversely, a single extension point can have multiple Java classes mapped to it. The Extensibility Framework allows for wildcards in the specification of the extension point name. For instance, Activity.* will call a custom Java class for every extension point starting with Activity. If "*" is used by itself, then all extension points will be processed by the Java class.

 

Wildcard Options

 

Specification Example Explanation
<Qualifier> . <Name> Activity.StartProcessing Only the StartProcessing event will be intercepted.
<Qualifier> .* Activity.* All extension points starting with Activity will be intercepted.
* * All extension points will be intercepted.

Lifecycle flow control is managed through the two methods exposed by every extension point interface, processPre(..) and processPost(..). The processPre(..) method is executed prior to the lifecycle event. When this method returns true, it indicates that the lifecycle step should execute and when it returns false it indicates that that the lifecycle step and processPost(..) should be skipped. This allows for lifecycle steps to be overridden by custom code. The processPost(..) method is called after the lifecycle step has completed. If that lifecycle step generated any data, it will be present in the context map as "Result".

It's important to note that extensions are not thread-safe. That means, for performance, a single instance is created and continually executed. The use of member variables in an extension is discouraged unless proper locking is in place.

All extension points contain context data in the form of a java.util.Map. The contents of this map will vary depending on the extension point. This map is shared between the processPre(..) and processPost(..) methods, but it is not shared with other extension points. Inter-extension communication can be achieved through the use of some context data mechanism, depending on the implementation. This could be in the form of a ThreadLocal variable or an HTTP/Servlet request context.

Each extension point can have one or more extensions registered to it. These extensions are executed in the order in which they appear in the XML configuration.

Example XML Configuration

<extensions>
<extensionPoint type="com.example.extension.ExtensionPointClassName" 
extensionPointName="ExtensionPoint.Name">
<register extension="com.example.extension.ExtensionClassName1" />
<register extension="com.example.extension.ExtensionClassName2" />
</extensionPoint>
</extensions>

Shared Rules Engine

The Shared Rules Engine (SRE) can be extended through the use of the extensibility framework. The SRE powers activity processing, and can be extended at many critical lifecycle points.

Example XML Configuration

<extensionPoint type="com.adminserver.sre.extensibility.SreExtensionPoint"
extensionPointName="Activity.*">
<register extension="com.example.SreExtension" />
</extensionPoint>
All extensions written for the SreExtensionPoint must implement ISreExtension.
public interface ISreExtension {
public boolean processPre( SreExtensionContext extensionContext );
public void processPost( SreExtensionContext extensionContext );
}

SRE Extension Points

Forward Processing

Lifecycle Step         Extension Point Available Variables
ActivityBll.Process         Activity.InitializeProcessing ClientNumber, ActivityProcessType
ActivityProcessorBll.Process       Activity.StartProcessing InputVariableMap, ApplicationCallback, ActivityProcessType
    DoSuspense     Activity.StartSuspense Activity, Transaction
      ProcessSuspense   Activity.ProcessSuspense Activity
      ProcessMultiSuspense   Activity.ProcessMultiSuspense Activity
    DoValuation     Activity.StartValuation Activity, Transaction
      PolicyValuation.Value   Activity.ValuePolicy ValuationInformation, Activity
    DoMath     Activity.ProcessMath Activity
    DoBusinessLogic     Activity.StartBusinessLogic Activity
      ProcessRule   Activity.ProcessBusinessRule BusinessRule, RuleOption, Activity
  DoAssignment     Activity.StartAssignment Activity, Transaction
      ProcessAssignments   Activity.ProcessAssignments AssignmentList, Activity, ExpressionValidator
        ProcessAssignment Activity.ProcessAssignment Assignment, Activity
    DoDisbursement     Activity.StartDisbursement Activity, Transaction
      ProcessDisbursements   Activity.ProcessDisbursements DisbursementDetails, Activity
        ProcessBalanced Activity.ProcessBalancedDisbursements DisbursementDetails, Activity, DisbursementData
        ProcessUnbalanced Activity.ProcessUnBalancedDisbursements DisbursementDetails, Activity, DisbursementData
    DoAccounting     Activity.StartAccounting Activity
      ProcessAccounting   Activity.ProcessAccounting Activity
    DoSpawn     Activity.ProcessSpawn Activity, Transaction
    PrepareValuationChanges     Activity.CompleteValuation Activity,
    PrepareActivityChanges     Activity.ProcessActivityChanges Activity
  DoWrite       Activity.Persist ActivityProcessResult
DoWriteOnSystemError       Activity.SystemError Exception

 

Reverse Processing

Lifecycle Step       Extension Point Available Variables
ActivityBll.Process       Activity.InitializeProcessing ClientNumber, ActivityProcessType
  UndoProcessor.Process     Activity.StartUndoProcessing InputVariableMap, ApplicationCallback
    DoBusinessLogicForNuvPending   Activity.StartNuvPendingBusinessLogic Activity, Transaction
      Rule.ProcessNuvPending Activity.ProcessBusinessRuleNuvPending BusinessRule, Activity
  ProcessValuationForUndo   Activity.ProcessValuationForUndo Activity, UndoActivityStatusCode
    DoAccounting   Activity.StartAccounting Activity
      ProcessAccounting Activity.ProcessAccounting Activity
  DoBusinessLogicForUndo   Activity.StartUndoBusinessLogic Activity, Transaction
      Rule.ProcessUndo Activity.ProcessBusinessRuleUndo BusinessRule, Activity
  DoWrite     Activity.Persist ActivityProcessResult
  DoWriteOnSystemError     Activity.SystemError Exception

 

Scheduled Valuation

 

Lifecycle Step Extension Point Available Variables
GenerateScheduledValuation ScheduledValuation.GenerateScheduledValuation ValuesRequestTask

Data Intake File Processing

Data Intake file processing can be extended through the use of the extensibility framework.

Example XML Configuration

<extensionPoint type="com.adminserver.pas.bll.extensibility.
PasExtensionPoint" extensionPointName="IntakeFile.*">
<register extension="com.example.IntakeFileExtension" />
</extensionPoint>

All extensions for the PasExtensionPoint type must implement IPasExtension, which has the following definition:

public interface IPasExtension {	
public boolean processPre( PasExtensionContext extensionContext );
public void processPost( PasExtensionContext extensionContext );
}

 

Intake File Processing

 

Lifecycle Step       Extension Point Available Variables
IntakeFileBll          
  File Submission        
    BeginLoading   IntakeFile.BeginLoading IntakeFileData
    CompleteLoading   IntakeFile.CompleteLoading IntakeFileData
  Process   IntakeFile.Process IntakeFileData
    Reverse   IntakeFile.Reverse IntakeFileData
File Processing        
    PreProcess   IntakeFile.PreProcess IntakeFileData
    Execute   IntakeFile.Execute IntakeFileData
      Validate IntakeFile.Validate IntakeFileData
    CompleteProcessing   IntakeFile.CompleteProcessing IntakeFileData
  File Reversal        
    BeginReversal   IntakeFile.BeginReversal IntakeFileData
    CompleteReversal   IntakeFile.CompleteReversal IntakeFileData

FileReceived

The FileReceived Web Service can be extended through the use of the extensibility framework by implementing one of two interfaces.

Example XML Configuration

<extensionPoint type="com.adminserver.webservice.extensibility.
FileReceivedExtensionPoint"
extensionPointName="FileReceived.*">
<register extension="com.example.FileReceivedExtension" />
</extensionPoint>

All extensions written for the FileReceivedExtensionPoint must implement IFileReceivedExtension.

public interface IFileReceivedExtension {
public boolean processPre( FileReceivedExtensionContext extensionContext );
public void processPost( FileReceivedExtensionContext extensionContext );
}

 

File Received Extension Points

 

Lifecycle Step               Extension Point   Available Variables  
FileReceived                 FileReceived.StartProcessingFileReceived   FileId, IncomingXml
  RetrieveFileProcessDcl             FileReceived.StartRetrievingFileRecord   FileId  
      FindByFileId         FileReceived.FindRecord   FileProcessData  
      PopulateFileProcessDcl         FileReceived.CreateDataCarrier   XmlHelperUtility, FileProcessData  
    ProcessAssignAttributes           FileReceived.ProcessAssignAttributes   FileProcessData  
  ProcessRequest           FileReceived.StartProcessingRequest   FileProcessData  
    TransformtoAsXml         FileReceived.TransformToXml   FileProcessData  
    ValidateAsXml         FileReceived.ValidateXml   AsXmlDocument  
      MapXmlToObject         FileReceived.Deserialize   FileProcessData  
      ProcessImportedObject         FileReceived.StartProcessingDataCarriers   FileProcessData, PendingImportedObject, AsXmlDocument  
        PerformPreInsert       FileReceived.StartPreInsert   FileProcessData, PendingInsertObjects  
          RetrieveDclList     FileReceived.StartRetrievingDataCarriers   PendingImportedObject  
              BuildDclListFromAsXml FileReceived.BuildDataCarriersList   PendingImportedObject  
          DoPreInsert   FileReceived.PreInsert   FileProcessData, PendingInsertObjects  
        PerformInsert       FileReceived.InsertData   PendingInsertObjects  
        PerformPostInsert       FileReceived.StartPostInsert   FileProcessData, PendingInsertObjects, AsXmlDocument  
            DoPostInsertProcessing   FileReceived.StartPostInsertProcessing   FileProcessData, PendingInsertObjects, AsXmlDocument  
            DoPostInsert FileReceived.PostInsert   FileProcessData, PendingInsertObjects  
      BuildResultString     DoPostInsertProcessing   FileReceived.StartBuildingResult   FileProcessData  
        LoadOutputXslt     FileReceived.LoadOutputXslt   FileProcessData  

Example XML Configuration

<extensionPoint type="com.adminserver.webservice.extensibility.
WebserviceExtensionPoint"
extensionPointName=" XsltHelper.XmlTransform">
<register extension="com.example.WebServiceExtension" />
</extensionPoint>
All extensions written for the WebserviceExtensionPoint must 
implement IWebserviceExtension.
public interface IWebserviceExtension {
public boolean processPre( WebserviceExtensionContext extensionContext );
public void processPost( WebserviceExtensionContext extensionContext );
}

This extension point allows for the overriding of the default XSLT transformer at two stages during processing of the FileReceived web service.

<td></td>

  1. When Input Xml is transformed to AsXml.
  2. When an Xslt is applied to the response Xml.

This extension will receive the following parameters in the context map:

 

SourceDocument XML Document for transformation.
Parameters The parameters available for passing to the transformer. These are values of attributes set using AssignAttribute in AsFile

In the processPost method, the context map will contain TransformedXml, which holds the result of the Xslt transformation.

User Interface

The extension point names for the user interface are convention based. They take the form of <PageName>.<StartProcessing/Process[Action]>. An example would be Policy.ProcessSave.

Example XML Configuration

<extensionPoint type="com.adminserver.pas.uip.extensibility.
UipExtensionPoint"
extensionPointName="*">
<register extension="com.example.UipExtension" />
</extensionPoint>

All extensions written for the UipExtensionPoint must implement IUipExtension.

public interface IUipExtension {
public boolean processPre( UipExtensionContext extensionContext );
public void processPost( UipExtensionContext extensionContext );
}

The UI extension point names can be discovered by writing a "catch-all" extension point and logging the extension point names. For example the following steps can be followed to discover available named extension points on the client screen.

  1. Create a Java class called OIPAExtension.java. This class can be given any name.
  2. Add the following code to the class.
public class OIPAExtension implements IUipExtension {
public boolean processPre( UipExtensionContext extensionContext ){
boolean result = true;
// Use the System.out.println() or java logger to print all 
extension points using extensionContext
String extensionName = extensionContext.getExtensionPoint().getName();
System.out.println(" UI Client Page Extension Name : " + extensionName);
}
@SuppressWarnings("boxing")
public void processPost( UipExtensionContext extensionContext ) {
}
}
  1. Generate OIPAExtension.jar and deploy it to the application server. In WebSphere, include the absolute path of the OIPAExtension.jar in sharedlib. In WebLogic, drop the OIPAExtension.jar within WEB-INF/lib of the OIPA war included in the OIPA media pack.
  2. Add the following to the extensions xml configuration.
    <extensionPoint type="com.adminserver.pas.uip.extensibility.UipExtensionPoint"
    extensionPointName="*">
    <register extension="com.example.OIPAExtension" />
    </extensionPoint>
  3. Login to OIPA application.
  4. Navigate to the Client Screen.
  5. The JVM console output will list all the extension point names.

Follow the same steps for different screens.

 

 

 

 

 

Copyright © 2017, Oracle and/or its affiliates. All rights reserved. About Oracle Insurance | Contact Us