com.gridsystems.nextgrid.api.pom
Class IfThenElseProcessImpl

java.lang.Object
  extended by com.gridsystems.nextgrid.api.pom.PemHelper
      extended by com.gridsystems.nextgrid.api.pom.ProcessImpl
          extended by com.gridsystems.nextgrid.api.pom.ControlProcessImpl
              extended by com.gridsystems.nextgrid.api.pom.IfThenElseProcessImpl
All Implemented Interfaces:
Enactable, WithExpression, java.io.Serializable, java.lang.Cloneable, nextgrid.api.pom.ControlProcess, nextgrid.api.pom.IfThenElseProcess, nextgrid.api.pom.Process

public final class IfThenElseProcessImpl
extends ControlProcessImpl
implements nextgrid.api.pom.IfThenElseProcess, WithExpression

Type description.

Author:
Rodrigo Ruiz
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.gridsystems.nextgrid.api.pom.ProcessImpl
ProcessImpl.ValidationType
 
Field Summary
 
Fields inherited from class com.gridsystems.nextgrid.api.pom.ProcessImpl
DFA_INITIAL_STATE, ENACTOR_LOG
 
Constructor Summary
IfThenElseProcessImpl()
          Creates a new instance.
 
Method Summary
protected  void doReset()
          Performs specific reset actions in each subclass.
protected  void doValidate(ProcessImpl.ValidationType when)
          Performs any validation action needed for the process implementation.
 nextgrid.api.pom.Process getElse()
          Gets the process in the "else" branch.
 nextgrid.api.pom.Expression getExpression()
          Gets the expr value.
 nextgrid.api.pom.Process getThen()
          Gets the process in the "then" branch.
 void run(ProcessContext ctx)
          Performs the actual enaction of a process.
 nextgrid.api.pom.Process setElse(nextgrid.api.pom.Process process)
          Sets the process in the "else" branch.
 void setExpression(nextgrid.api.pom.Expression expression)
          Sets the expr value.
 nextgrid.api.pom.Process setThen(nextgrid.api.pom.Process process)
          Sets the process in the "then" branch.
 java.lang.String toString()
          
 
Methods inherited from class com.gridsystems.nextgrid.api.pom.ControlProcessImpl
addChildren, addChildren, copy, discover, doEvaluate, findProcessById, getChildCount, getChildren, getChildren, getLocalVar, getLocalVars, isMemoizeActive, prioritise, removeChild, removeChild, resetChildren, setChildren, setChildren, setLocalVar, setMemoizeActive, trim
 
Methods inherited from class com.gridsystems.nextgrid.api.pom.ProcessImpl
attachListeners, enact, evaluate, evaluate, findRoot, getAttribute, getAttribute, getAttribute, getAttributes, getDescription, getId, getInput, getInputs, getInputs, getInputType, getName, getOutput, getOutputs, getOutputs, getOutputType, getParent, getState, getUsedInputNames, getUsedOutputNames, invalidate, isEvaluated, isLazy, isValidated, prioritise, putInput, putOutput, removeInput, removeOutput, reset, setAttribute, setAttribute, setDescription, setEvaluated, setId, setLazy, setName, setParent, setState, unuseInput, unuseOutput, useInput, useOutput, validate, waitForInputs
 
Methods inherited from class com.gridsystems.nextgrid.api.pom.PemHelper
addListener, fireDiscovererSelected, fireDiscoveryFailed, fireDiscoveryFinished, fireDiscoveryStarting, fireEvent, fireProcessEvaluated, fireProcessFailed, fireProcessFailed, fireProcessFinished, fireProcessFinished, fireProcessSelected, fireProcessStarted, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface nextgrid.api.pom.ControlProcess
addChildren, addChildren, getChildCount, getChildren, getChildren, getLocalVar, getLocalVars, isLazy, isMemoizeActive, removeChild, removeChild, setChildren, setChildren, setLazy, setLocalVar, setMemoizeActive, trim
 
Methods inherited from interface nextgrid.api.pom.Process
addListener, copy, discover, enact, evaluate, findProcessById, findRoot, getAttribute, getAttribute, getAttribute, getAttributes, getDescription, getId, getInput, getInputs, getInputType, getName, getOutput, getOutputs, getOutputType, getParent, getUsedInputNames, getUsedOutputNames, invalidate, isEvaluated, isValidated, prioritise, putInput, putOutput, removeInput, removeListener, removeOutput, reset, setAttribute, setAttribute, setDescription, setId, setName, setParent, unuseInput, unuseOutput, useInput, useOutput, validate
 

Constructor Detail

IfThenElseProcessImpl

public IfThenElseProcessImpl()
Creates a new instance.

Method Detail

getExpression

public nextgrid.api.pom.Expression getExpression()
Gets the expr value.

Specified by:
getExpression in interface nextgrid.api.pom.IfThenElseProcess
Returns:
The expr

setExpression

public void setExpression(nextgrid.api.pom.Expression expression)
Sets the expr value.

Specified by:
setExpression in interface WithExpression
Specified by:
setExpression in interface nextgrid.api.pom.IfThenElseProcess
Parameters:
expression - The expr to set

getThen

public nextgrid.api.pom.Process getThen()
Gets the process in the "then" branch.

Specified by:
getThen in interface nextgrid.api.pom.IfThenElseProcess
Returns:
The process in the "then" branch

getElse

public nextgrid.api.pom.Process getElse()
Gets the process in the "else" branch.

Specified by:
getElse in interface nextgrid.api.pom.IfThenElseProcess
Returns:
The process in the "else" branch

setThen

public nextgrid.api.pom.Process setThen(nextgrid.api.pom.Process process)
Sets the process in the "then" branch.

Specified by:
setThen in interface nextgrid.api.pom.IfThenElseProcess
Parameters:
process - The process in the "then" branch
Returns:
The previous process in the "then" branch

setElse

public nextgrid.api.pom.Process setElse(nextgrid.api.pom.Process process)
Sets the process in the "else" branch.

Specified by:
setElse in interface nextgrid.api.pom.IfThenElseProcess
Parameters:
process - The process in the "else" branch
Returns:
The previous process in the "else" branch

doValidate

protected void doValidate(ProcessImpl.ValidationType when)
                   throws nextgrid.api.pom.ProcessException
Performs any validation action needed for the process implementation.

Specified by:
doValidate in class ProcessImpl
Parameters:
when - Specifies when this validation is being invoked
Throws:
nextgrid.api.pom.ProcessException - If the validation fails

run

public void run(ProcessContext ctx)
         throws nextgrid.api.pom.ProcessException,
                java.lang.InterruptedException
Performs the actual enaction of a process.

The instance must take into account possible errors, like service unavailability, or execution errors. As long as there are more "valid" candidates for the process, errors should not be propagated to the parent, and the next candidate should be selected and enacted.

A ProcessException as a result of this call means that this process is unable to correctly finish its execution, and that the parent must do something to fix the problem.

Specified by:
run in interface Enactable
Parameters:
ctx - A process context
Throws:
nextgrid.api.pom.ProcessException - If an unrecoverable local error occurs
java.lang.InterruptedException - If the thread is interrupted

doReset

protected void doReset()
Performs specific reset actions in each subclass.

Specified by:
doReset in class ProcessImpl

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object


Copyright © 2006-2008 Grid Systems, S.A.. All Rights Reserved.