Class ConditionalAutoCheckoutRunner<T extends Iterated>

java.lang.Object
com.ptc.qualitymanagement.qms.util.helper.ConditionalAutoCheckoutRunner<T>
Type Parameters:
T - The type of the object to be conditionally checked-out

public abstract class ConditionalAutoCheckoutRunner<T extends Iterated> extends Object
This class is used to perform business operations on an object that must be checked-out. It conditionally checks if the managed object is already checked-out. When it is already checked-out it does nothing. When it is not checked out, the managed object is checked-out and then checked-in at the end of the process. If the managed object is not a workable no check-out/in processing is done.

The managed object is always tested as the latest iteration. If it isn't the latest iteration a WTException is thrown.

When the managed object is checked-out but the managed object is not the working copy, a WTException is thrown.

Sample usage note, you must call invoke() to begin the process.


 regulatorySubmission = new ConditionalAutoCheckoutRunner<RegulatorySubmission>(regulatorySubmission) { @Override
     public RegulatorySubmission performBusinessProcess(RegulatorySubmission managedObject) throws Exception {
 
         // custom logic goes here
 
         return managedObject;
     }
 }.invoke();
 


Supported API: true

Extendable: false
  • Constructor Details

    • ConditionalAutoCheckoutRunner

      public ConditionalAutoCheckoutRunner(T managedObect)
      Constructor setting the object to be managed.

      Supported API: true
      Parameters:
      managedObect - the object to checked-out
  • Method Details

    • performBusinessProcess

      public abstract T performBusinessProcess(T managedObject) throws Exception
      Implement the business logic to be performed while the managed object is checked-out

      Supported API: true
      Parameters:
      managedObject -
      Returns:
      The managed object
      Throws:
      Exception
    • invoke

      public T invoke() throws Exception
      Initiate the process described in the class level java-doc

      Supported API: true
      Returns:
      The managed object. When an auto check-out/in is performed this is the next iteration of the object.
      Throws:
      Exception