Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2008 BEA Systems, Inc. All Rights Reserved
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.beasys.commerce.foundation
Class StateMachine

    java.lang.Object
      com.beasys.commerce.foundation.StateMachine

All Implemented Interfaces
  BusinessSmartComponent, Workflow, Serializable

Direct Known Subclasses:
  PaymentWorkflow

Deprecated See BEA Commerce product offering

    @Deprecated
    public class StateMachine

extends Object
implements Workflow

This is the reference implemenation of a Workflow object. It provides a simple implemenation based on a set of states and transitions.

See Also
  `Workflow`, Serialized Form

Field Summary
`protected State` | `currentState` Deprecated See BEA Commerce product offering
`protected State` | `initialState` Deprecated See BEA Commerce product offering
`protected TreeSet` | `states` Deprecated See BEA Commerce product offering
`protected String` | `TRANSITION_KEY_TOKEN` Deprecated See BEA Commerce product offering
`protected TreeMap` | `transitions` Deprecated See BEA Commerce product offering

Constructor Summary
`StateMachine()` Deprecated See BEA Commerce product offering

Method Summary
`protected void` | `addTransition(Transition t)` Deprecated See BEA Commerce product offering
`String` | `doTransition(String transitionName)` Deprecated See BEA Commerce product offering
`WorkflowContext` | `getContext()` Deprecated See BEA Commerce product offering
`String` | `getCurrentStateName()` Deprecated See BEA Commerce product offering
`String` | `getInitialStateName()` Deprecated See BEA Commerce product offering
`String[]` | `getOutgoingTransitions(String state)` Deprecated See BEA Commerce product offering
`String[]` | `getStateNames()` Deprecated See BEA Commerce product offering
`String[]` | `getTransitionNames()` Deprecated See BEA Commerce product offering
`String` | `lookAheadTransition(String transition)` Deprecated See BEA Commerce product offering
`void` | `reset()` Deprecated See BEA Commerce product offering
`void` | `setContext(WorkflowContext workflowContext)` Deprecated See BEA Commerce product offering

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### TRANSITION_KEY_TOKEN

    protected String TRANSITION_KEY_TOKEN

  Deprecated See BEA Commerce product offering

### currentState

    protected State currentState

  Deprecated See BEA Commerce product offering

### initialState

    protected State initialState

  Deprecated See BEA Commerce product offering

### transitions

    protected TreeMap transitions

  Deprecated See BEA Commerce product offering

### states

    protected TreeSet states

  Deprecated See BEA Commerce product offering

Constructor Detail

### StateMachine

    public StateMachine()

  Deprecated See BEA Commerce product offering

  Use WorkflowHome.create("com.beasys.commerce.foundation.StateMachine") to instantiate the workflow.

Method Detail

### doTransition

    public String doTransition(String transitionName)
                        throws IllegalWorkflowTransitionException

  Deprecated See BEA Commerce product offering

  Given the name of the transition, perform the transition and return the new state. If transition is invalid for the current state of the state machine, throw IllegalWorkflowTransitionException

  Specified by:
    `doTransition` in interface `Workflow`
  Parameters
    `transition` - the name of the transition to be performed
  Returns
    new state.
  Throws
    `IllegalWorkflowTransitionException` - if the transition is invalid

### getContext

    public WorkflowContext getContext()

  Deprecated See BEA Commerce product offering

  Get the context of the Workflow. This method should be used only by the classes that implement the Workflow interface.

  Specified by:
    `getContext` in interface `Workflow`
  Returns
    WorkflowContext

### getCurrentStateName

    public String getCurrentStateName()

  Deprecated See BEA Commerce product offering

  Get the name of the current state

  Specified by:
    `getCurrentStateName` in interface `Workflow`
  Returns
    current state name

### getInitialStateName

    public String getInitialStateName()

  Deprecated See BEA Commerce product offering

  Get the name of the initial state

  Specified by:
    `getInitialStateName` in interface `Workflow`
  Returns
    initial state name

### getStateNames

    public String[] getStateNames()

  Deprecated See BEA Commerce product offering

  Get all State names in an array of Strings.

  Specified by:
    `getStateNames` in interface `Workflow`
  Returns
    String[] an array of Strings

### getTransitionNames

    public String[] getTransitionNames()

  Deprecated See BEA Commerce product offering

  Get all transition names in an array of Strings.

  Specified by:
    `getTransitionNames` in interface `Workflow`
  Returns
    String[] an array of Strings

### lookAheadTransition

    public String lookAheadTransition(String transition)
                               throws IllegalWorkflowTransitionException

  Deprecated See BEA Commerce product offering

  Given the name of the transition, look ahead the transition and return the predicted new state. If transition is invalid for the current state of the state machine, throw IllegalWorkflowTransitionException.

  Specified by:
    `lookAheadTransition` in interface `Workflow`
  Parameters
    `transition` - the name of the transition to be performed
  Returns
    predicted new state.
  Throws
    `IllegalWorkflowTransitionException` - if the transition is invalid

### getOutgoingTransitions

    public String[] getOutgoingTransitions(String state)
                                    throws IllegalWorkflowTransitionException

  Deprecated See BEA Commerce product offering

  Given the name of the state, return all transitions starting from that state

  Specified by:
    `getOutgoingTransitions` in interface `Workflow`
  Parameters
    `state` - the name of the state
  Returns
    a String[] of transition names.
  Throws
    `IllegalWorkflowTransitionException` - if the transition is invalid

### reset

    public void reset()

  Deprecated See BEA Commerce product offering

  Reset the current workflow state to the initial state

  Specified by:
    `reset` in interface `Workflow`

### setContext

    public void setContext(WorkflowContext workflowContext)

  Deprecated See BEA Commerce product offering

  Set the new context for the underlying workflow engine. This method should be used only by the classes that implement the Workflow interface.

  Specified by:
    `setContext` in interface `Workflow`
  Parameters
    `WorkflowContext` - the new context for the underlying workflow engine.

### addTransition

    protected void addTransition(Transition t)

  Deprecated See BEA Commerce product offering

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008 BEA Systems, Inc. All Rights Reserved