com.flexive.shared.workflow
Class Workflow

java.lang.Object
  extended by com.flexive.shared.AbstractSelectableObjectWithName
      extended by com.flexive.shared.workflow.Workflow
All Implemented Interfaces:
SelectableObject, SelectableObjectWithName, java.io.Serializable
Direct Known Subclasses:
WorkflowEdit

public class Workflow
extends AbstractSelectableObjectWithName
implements java.io.Serializable, SelectableObjectWithName

Workflow data beans.

Author:
Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
See Also:
Serialized Form

Field Summary
protected  java.lang.String description
           
protected  long id
           
protected  java.lang.String name
           
protected  java.util.List<Route> routes
           
protected  java.util.List<Step> steps
           
 
Constructor Summary
protected Workflow()
          Default constructor.
  Workflow(long id, java.lang.String name, java.lang.String description, java.util.List<Step> steps, java.util.List<Route> routes)
          Constructor.
 
Method Summary
 WorkflowEdit asEditable()
          Returns this workflow as an editable object.
 java.lang.String getDescription()
          Returns the description of the workflow.
 long getId()
          Returns the id of the workflow.
 Step getLiveStep()
          Get the live step of this workflow, will throw an exception if no live step is defined
 java.lang.String getName()
          Returns the name of the workflow.
 java.util.List<Route> getRoutes()
          Return the workflow routes (connections between steps).
 java.util.List<Step> getSteps()
          Returns the individual steps of the workflow.
 java.util.List<Step> getTargets(long stepId)
          Get a list of all possible targets for the given step id
 boolean hasLiveStep()
          Is a Live step contained in this workflow?
 boolean isRouteValid(long source, long dest)
          Check if a route from source to dest exists for the calling user
 boolean isStepValid(long stepId)
          Check if the given step is valid for this workflow
 java.lang.String toString()
          
 
Methods inherited from class com.flexive.shared.AbstractSelectableObjectWithName
equals, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

description

protected java.lang.String description

id

protected long id

steps

protected java.util.List<Step> steps

routes

protected java.util.List<Route> routes
Constructor Detail

Workflow

public Workflow(long id,
                java.lang.String name,
                java.lang.String description,
                java.util.List<Step> steps,
                java.util.List<Route> routes)
Constructor.

Parameters:
id - the id of the workflow
name - the name of the workflow
description - a description
steps - the workflow steps
routes - the workflow routes

Workflow

protected Workflow()
Default constructor.

Method Detail

asEditable

public WorkflowEdit asEditable()
Returns this workflow as an editable object.

Returns:
this workflow as an editable object.

getName

public java.lang.String getName()
Returns the name of the workflow.

Specified by:
getName in interface SelectableObjectWithName
Returns:
the name of the workflow

getDescription

public java.lang.String getDescription()
Returns the description of the workflow.

Returns:
the description of the workflow, may be a empty String but is never null.

getId

public long getId()
Returns the id of the workflow.

Specified by:
getId in interface SelectableObject
Returns:
the id of the workflow

getSteps

public java.util.List<Step> getSteps()
Returns the individual steps of the workflow.

Returns:
the individual steps of the workflow.

getRoutes

public java.util.List<Route> getRoutes()
Return the workflow routes (connections between steps).

Returns:
the workflow routes (connections between steps).

isStepValid

public boolean isStepValid(long stepId)
Check if the given step is valid for this workflow

Parameters:
stepId - the step ID to be checked
Returns:
if the given step is valid for this workflow

toString

public java.lang.String toString()

Overrides:
toString in class AbstractSelectableObjectWithName

getLiveStep

public Step getLiveStep()
                 throws FxApplicationException
Get the live step of this workflow, will throw an exception if no live step is defined

Returns:
live step
Throws:
FxApplicationException - on errors

hasLiveStep

public boolean hasLiveStep()
Is a Live step contained in this workflow?

Returns:
if a Live step exists

getTargets

public java.util.List<Step> getTargets(long stepId)
Get a list of all possible targets for the given step id

Parameters:
stepId - source step id to get all targets for
Returns:
target steps

isRouteValid

public boolean isRouteValid(long source,
                            long dest)
Check if a route from source to dest exists for the calling user

Parameters:
source - source step id
dest - destination step id
Returns:
does a valid route exist?