net.kalio.empweb.engine.rules
Class GetProfile

java.lang.Object
  extended by net.kalio.empweb.engine.rules.GetProfile
All Implemented Interfaces:
Process

public class GetProfile
extends java.lang.Object
implements Process

Title: GetProfile

Description: This Process obtains a Profile from the active Policy and stores it in the TransactionContext under the well-known name TransactionContext.PROFILE ("profile").
To select a Profile, it uses the "userClass" and "objectCategory" stored in the TransactionContext.

A "priority" parameter with valid values of "userClass" or "objectCategory" may be passed to the Process. The behaviour is as follows:

TC.userClass represents the userClass in the TransactionContext (and similarly for TC.objectCategory)

Copyright (c) 2005 Kalio.net


Constructor Summary
GetProfile()
           
 
Method Summary
 ProcessResult execute(TransactionContext tc)
          The method that actually implements this Process' behavior.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GetProfile

public GetProfile()
Method Detail

execute

public ProcessResult execute(TransactionContext tc)
                      throws EngineException,
                             java.lang.Exception
Description copied from interface: Process

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).

Specified by:
execute in interface Process
Throws:
EngineException
java.lang.Exception