net.kalio.empweb.engine
Interface Process

All Known Implementing Classes:
AddTransactionToStatus, AdjustProfileValues, CheckExpiredReservation, CheckLateReturn, CreateCancelFine, CreateCancelReservation, CreateCancelSuspension, CreateFine, CreateLoan, CreateReservation, CreateReturn, CreateSuspension, DumpEnvironment, ExtractLoan, ExtractObjectCategory, ExtractUserClass, FOToPDF, GetCurrentTransactionIds, GetExistingReservation, GetFine, GetHistoricTransactionIds, GetHistoricTransactions, GetObject, GetObjectStatus, GetProfile, GetReservation, GetSuspension, GetTransactionsById, GetUser, GetUserStatus, GetUserStatusIds, GetUserStatusList, GroovyInterpreter, HasFineOrSuspension, Lock, ProcessFO, PublishTimestampAdjustments, RemoveTransactionFromStatus, ReturnTransactionResults, SendMail, SignData, Unlock, UpdateDb, ValidateAvailability, VerifySignature, XSLFOProcessor

public interface Process

Title: Process

Description: Processes/Rules/Finally's in the TransactionPipeline must implement this interface. A ProcessDefinition will encapsulate a run-time instance of this class, along with its parameters, default limits, etc.

Copyright: Copyright (c) 2004-2005
Company: Kalio

Version:
1.0
Author:
Barzilai Spinak, Sebastian Filippini, Ciro Mondueri

Method Summary
 ProcessResult execute(TransactionContext context)
          The method that actually implements this Process' behavior.
 

Method Detail

execute

ProcessResult execute(TransactionContext context)
                      throws EngineException,
                             java.lang.Exception

The method that actually implements this Process' behavior. The TransactionEngine calls the invokeProcess method for the ProcessDefinition that encapsulates this Process. In turn, invokeProcess calls this Process' execute.

A TransactionContext is passed to this method with information about the transaction being performed, the configuration environment, parameters, and default limit values given in the pipeline, and other values. The Process can read values from the TransactionContext and store new values in it for the following Processes to use.

The ProcessResult returned usually has an EngineResult.Msg, and possibly an extra result DOM Element. For successful completions of this Process, the ProcessResult should have its "successful" attribute set to true. The Process could fail in four different ways:

  1. The condition that it checks has failed (for ex., the user has borrowed too many objects)
  2. An error internal to the Process has occurred (for ex., a needed TransactionContext parameter is missing, a scripting syntax error was found in a scriptable Process)
  3. A lower level EngineException has been thrown by the Empweb system.
  4. Some other unexpected and unhandled general Exception (NullPointerException)
In cases 1 and 2, the Process should return a unsuccessful ProcessResult with an appropriate EngineResult.Msg error message explaining the error.
For cases 3 and 4, the Process may choose to let the exception pass through and it will be handled in a standard way by ProcessDefinition, collapsing all possible exceptions to an equivalent, unsuccessful ProcessResult. In most cases, this behaviour is sufficient and a good practice (especially in case 4).

Throws:
EngineException
java.lang.Exception