com.bigbross.bossa.wfnet
Class Case

java.lang.Object
  extended bycom.bigbross.bossa.wfnet.Case
All Implemented Interfaces:
Serializable

public class Case
extends Object
implements Serializable

This class represents a specific instance of a case type. It holds the current state of a case.

Author:
BigBross Team
See Also:
Serialized Form

Method Summary
 boolean closeCase()
          Closes this case.
 List getActivities()
          Returns a list of activities associated with this case.
 Activity getActivity(int id)
          Returns a specific activity, selected by its id.
 Map getAttributes()
          Returns the current attributes of this case.
 CaseType getCaseType()
          Returns the case type of this case.
 int getId()
          Returns the id of this case.
 List getResources()
          Returns all local resources of this case.
 Map getState()
          Returns the state of the case, that is, how many tokens are in each place.
 WorkItem getWorkItem(String id)
          Returns a specific work item, selected by its id.
 List getWorkItems()
          Returns the list of currently fireable work items associated with this case.
 void setState(Map state)
          Changes the state of the case, that is, how many tokens are in each place.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getId

public int getId()
Returns the id of this case.

Returns:
the id of this case.

getCaseType

public CaseType getCaseType()
Returns the case type of this case.

Returns:
the case type of this case.

getResources

public List getResources()
Returns all local resources of this case.

Returns:
a list of all local resources of this case.

getState

public Map getState()
Returns the state of the case, that is, how many tokens are in each place.

Returns:
the token count as a map (String, Integer), indexed by the place id.

setState

public void setState(Map state)
              throws BossaException
Changes the state of the case, that is, how many tokens are in each place. This method bypasses the usual transition firing process and should be used with caution to override the normal sequence of activities.

Parameters:
state - the token count as a map (String, Integer), indexed by the place id. Only the places present in this map have their token count modified, the others are unchanged.
Throws:
EvaluationException - if an expression evaluation error occurs. If this exception is thrown the state of this case may be left inconsistent.
BossaException

getAttributes

public Map getAttributes()
Returns the current attributes of this case.

Returns:
the attributes as an unmodifiable map (String, Object) of variables names (as used in edge weight expressions) and Java objects.

getWorkItems

public List getWorkItems()
Returns the list of currently fireable work items associated with this case.

Returns:
A list with the fireable work items of this case.

getWorkItem

public WorkItem getWorkItem(String id)
Returns a specific work item, selected by its id.

Parameters:
id - the work item id.
Returns:
the work item, null if there is no work item with this id.

getActivities

public List getActivities()
Returns a list of activities associated with this case.

Returns:
The list of activities of this case.

getActivity

public Activity getActivity(int id)
Returns a specific activity, selected by its id.

Parameters:
id - the activity id.
Returns:
the activity, null if there is no activity with this id.

closeCase

public boolean closeCase()
                  throws BossaException
Closes this case. A case will close automatically when there are no active work items. This method should only be used to override the normal case closing procedure and prematurely abort a case.

Returns:
true if the case could be closed, false otherwise.
Throws:
PersistenceException - if an error occours when making the execution of this method persistent.
BossaException


Copyright © 2003,2004 OpenBR Sistemas S/C Ltda.