org.yawlfoundation.yawl.resourcing
Class WorkQueue

java.lang.Object
  extended by org.yawlfoundation.yawl.resourcing.WorkQueue

public class WorkQueue
extends Object

Convenience class that encapsulates the various work queues for a Participant and/or Administrator - each instance representing a single queue

Author:
Michael Adams v0.1, 03/08/2007

Field Summary
static int ALLOCATED
           
static int OFFERED
           
static int STARTED
           
static int SUSPENDED
           
static int UNDEFINED
           
static int UNOFFERED
           
static int WORKLISTED
           
 
Constructor Summary
WorkQueue()
           
WorkQueue(String ownerID, HashMap<String,WorkItemRecord> items, int qType, boolean persisting)
           
WorkQueue(String ownerID, int qType, boolean persisting)
           
WorkQueue(String ownerID, WorkItemRecord item, int qType, boolean persisting)
           
WorkQueue(String ownerID, WorkQueue queue, int qType, boolean persisting)
           
 
Method Summary
 void add(WorkItemRecord item, boolean log)
          Adds a workitem to the queue
 void addQueue(Map<String,WorkItemRecord> queueMap)
          Adds all members of the Map passed to the queue
 void addQueue(WorkQueue queue)
          Adds all the items in the queue passed to this work queue (i.e.
 void cleanse(WorkItemCache cache)
           
 void clear()
           
 void fromXML(org.jdom.Element element)
           
 void fromXML(String xml)
           
 WorkItemRecord get(String itemID)
          Retrieves a workitem from the queue (but does not remove it)
 Set<WorkItemRecord> getAll()
          Retrieves a Set of all workitems in the queue
 String getID()
           
 String getOwnerID()
           
 Map<String,WorkItemRecord> getQueueAsMap()
          Retrieves a HashMap of all workitems in the queue
 String getQueueName()
          returns the name of this queue
static String getQueueName(int qType)
          returns the apropriate String identifier for the queue type passed
 int getQueueSize()
          returns the number of workitems in this queue
 int getQueueType()
           
 boolean isEmpty()
           
 boolean isPersisting()
           
static boolean isValidQueueType(int queueType)
           
 void remove(WorkItemRecord item)
          Removes a workitem from the queue
 void removeCase(String caseID)
           
 void removeQueue(WorkQueue queue)
          Removes all the items in the queue passed from this work queue (i.e.
 void setOwnerID(String id)
           
 void setPersisting(boolean persist)
           
 void setQueue(WorkQueue queue)
          Sets (replaces) this work queue's members with the members of the queue passed
 void setQueueType(int qType)
           
 String toXML()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNDEFINED

public static final int UNDEFINED
See Also:
Constant Field Values

OFFERED

public static final int OFFERED
See Also:
Constant Field Values

ALLOCATED

public static final int ALLOCATED
See Also:
Constant Field Values

STARTED

public static final int STARTED
See Also:
Constant Field Values

SUSPENDED

public static final int SUSPENDED
See Also:
Constant Field Values

UNOFFERED

public static final int UNOFFERED
See Also:
Constant Field Values

WORKLISTED

public static final int WORKLISTED
See Also:
Constant Field Values
Constructor Detail

WorkQueue

public WorkQueue()

WorkQueue

public WorkQueue(String ownerID,
                 int qType,
                 boolean persisting)

WorkQueue

public WorkQueue(String ownerID,
                 WorkItemRecord item,
                 int qType,
                 boolean persisting)

WorkQueue

public WorkQueue(String ownerID,
                 HashMap<String,WorkItemRecord> items,
                 int qType,
                 boolean persisting)

WorkQueue

public WorkQueue(String ownerID,
                 WorkQueue queue,
                 int qType,
                 boolean persisting)
Method Detail

setOwnerID

public void setOwnerID(String id)

getOwnerID

public String getOwnerID()

getID

public String getID()

getQueueType

public int getQueueType()

setQueueType

public void setQueueType(int qType)

isPersisting

public boolean isPersisting()

setPersisting

public void setPersisting(boolean persist)

add

public void add(WorkItemRecord item,
                boolean log)
Adds a workitem to the queue

Parameters:
item - the workitem to add

addQueue

public void addQueue(Map<String,WorkItemRecord> queueMap)
Adds all members of the Map passed to the queue

Parameters:
queueMap - the Map of [item id, YWorkItem] to add

addQueue

public void addQueue(WorkQueue queue)
Adds all the items in the queue passed to this work queue (i.e. does not replace the queue)

Parameters:
queue - the queue of items to add

setQueue

public void setQueue(WorkQueue queue)
Sets (replaces) this work queue's members with the members of the queue passed

Parameters:
queue - the new queue

get

public WorkItemRecord get(String itemID)
Retrieves a workitem from the queue (but does not remove it)

Parameters:
itemID - the ID of the workitem to retrieve
Returns:
the retrieved workitem

getAll

public Set<WorkItemRecord> getAll()
Retrieves a Set of all workitems in the queue

Returns:
a Set of all WorkItemRecord objects in the work queue

getQueueAsMap

public Map<String,WorkItemRecord> getQueueAsMap()
Retrieves a HashMap of all workitems in the queue

Returns:
all members of the queue as a HashMap of [item id, YWorkItem]

remove

public void remove(WorkItemRecord item)
Removes a workitem from the queue

Parameters:
item - the workitem to remove

removeQueue

public void removeQueue(WorkQueue queue)
Removes all the items in the queue passed from this work queue (i.e. does not replace the queue)

Parameters:
queue - the queue of items to remove

clear

public void clear()

cleanse

public void cleanse(WorkItemCache cache)

removeCase

public void removeCase(String caseID)

isEmpty

public boolean isEmpty()
Returns:
true if the work queue contains no work items

getQueueSize

public int getQueueSize()
returns the number of workitems in this queue


getQueueName

public static String getQueueName(int qType)
returns the apropriate String identifier for the queue type passed


isValidQueueType

public static boolean isValidQueueType(int queueType)

getQueueName

public String getQueueName()
returns the name of this queue


toXML

public String toXML()

fromXML

public void fromXML(String xml)

fromXML

public void fromXML(org.jdom.Element element)


Copyright © 2004-2012 The YAWL Foundation.