Skip to end of metadata
Go to start of metadata

For the purposes of simplicity, the term "entity" means an object mapped to the database using XML if talking about OJB and means an entity mapped to the database with JPA if we are talking about JPA.

OJB

Create New

  1. A user clicks on the "Create New" button for a business object being maintained
  2. KRAD+Spring framework will create a new MaintenanceForm which will create a new instance of MaintenanceDocumentBase
  3. When MaintenanceDocumentBase is created, it creates an instance of the "new" and "old" maintainables by doing Class.newInstance() for the business or data object class (as defined in the data dictionary).
  4. This MaintenanceDocumentBase is stored on the form which is stored in the HttpSession
  5. This will then forward the request for processing to MaintenanceDocumentController
  6. This maintenance document will be associated with a DocumentHeader which is mapped to KRNS_DOC_HDR_T
  7. The form is returned to the view for rendering which will access properties of the document and the related business object being maintained (based on data dictionary configuration of the maintenance document)
    • If any of the properties being accessed are lazy, then OJB will just-in-time start a JTA transaction and fetch the lazy relationship, committing the transaction at the end
  8. The rendered HTML will be returned to the browser
  9. Once the initial form is displayed to the user in the browser, they can fill in values on the form as desired.
  10. Any time the form is POST-ed to the server, the Spring MVC framework will take incoming post parameters and apply them to the document and it's related business objects by calling the appropriate "setter" methods.
  11. When the "save" or "submit" buttons are clicked, the following happens:
    • The business objects for the maintenance documents are serialized to XML using XStream and that XML is set on MaintenanceDocumentBase.xmlDocumentContents
    • The Document and DocumentHeader (currently stored on the form in the Session) are saved using PersistenceBroker.store, inserting records into KRNS_MAINT_DOC_T (including serialized XML) and KRNS_DOC_HDR_T
    • The appropriate KEW action is executed

Opening an Enroute Document

  1. Once the document is enroute, a user will open the doc back up to take action against it by clicking on the document id from their Action List
  2. This will trigger the "docHandler" for this document.
  3. The MaintenanceDocumentController will load the existing Document and DocumentHeader using OJB
    • As with create new, the document will be stored on the form, which is also stored in the HttpSession
  4. The business object will be deserialized from the XML representation stored in KRNS_DOC_HDR_T using XStream and set on the maintenance document
  5. The form is returned to the view for rendering of the form (the data may or may not be editable based on permissions on the document)

After Final Approval

Once all approvals have been gathered against the document, the workflow engine will switch it's status to "PROCESSED". This happens in a background thread so is not the direct result of using interaction (except that user interaction such as "approving" the document is what triggers the asynchronous background processing to happen). This triggers processing in KualiPostProcessor.doRouteStatusChange, the process of which is outlined below:

  1. Loads the document using DocumentService.getByDocumentHeaderId
    • This will load the document from the database using OJB as well as deserializing the business objects from the XML content stored on KRNS_MAINT_DOC_T using XStream
  2. Invokes doRouteStatusChange on the document passing the status change event
  3. Since the document is processed, will save the business object via MaintainableImpl.saveDataObject
    • This method will call BusinessObjectService.linkAndSave which will call PersistenceService.linkObjects and ultimately BusinessObjectDaoOjb.save
    • The BusinessObjectDaoOjb.save method will do some things to "link in" collections and then call PersistenceBroker.store using OJB
  4. At this point the new business object is inserted into the database!

Additional Details

MaintenanceDocumentBase Mapping

MaintenanceDocumentBase Mapping

  • No labels