org.yawlfoundation.yawl.scheduling.persistence
Class DataMapper

java.lang.Object
  extended by org.yawlfoundation.yawl.scheduling.persistence.DataMapper

public class DataMapper
extends Object

This class encapsulates the database. It exclusively uses stored procedures to access the persistence layer, thereby maintaining the concept of logical data independence. As long as the signature of the stored procedure and their semantics do not change, data source and application code may be developed independently from each other. Specifically, DataMapper facilitates the persistence of resource utilisation plans (RUPs) and of mappings. A mapping is a bijective function that assigns to every YAWL workitem Id a unique request key, where the latter is used by the custom service. In effect, the mapping table binds the operations of the Scheduling Service to the YAWL engine in a non-ambiguous way.

Version:
$Id$
Author:
tbe, jku

Constructor Summary
DataMapper()
           
 
Method Summary
 List<Case> getActiveRups(String timestamp)
           
 List<Case> getAllRups()
           
 List<Mapping> getMappings()
          Get all mappings from the database
 List<String> getRupActivityTypes(String activityName)
           
 List<Case> getRupByCaseId(String caseId)
           
 List<List<org.jdom.Element>> getRupNodes(String activityName, String activityType, String nodeName)
           
 List<Case> getRupsByActivity(String activityName)
           
 List<Case> getRupsByInterval(Date from, Date to, List<String> yCaseIdsToExclude, boolean activeOnly)
          Get all RUPs from the database that start after "from" and end before "to".
 void removeMapping(Mapping mapping)
          removes a mapping from database
 void removeMapping(String workItemId)
          Removes all mappings with specified "workItemId"
 void saveMapping(Mapping mapping)
          Saves or updates a mapping to the database for recovery of failed YAWL requests
 void saveRup(Case theCase)
           
 void updateRup(String caseId, boolean active)
          Update RUP, set "active status"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataMapper

public DataMapper()
Method Detail

saveMapping

public void saveMapping(Mapping mapping)
Saves or updates a mapping to the database for recovery of failed YAWL requests

Parameters:
mapping - object

removeMapping

public void removeMapping(Mapping mapping)
removes a mapping from database

Parameters:
mapping - Object

removeMapping

public void removeMapping(String workItemId)
Removes all mappings with specified "workItemId"

Parameters:
workItemId - - YAWL's unique work item identifier

getMappings

public List<Mapping> getMappings()
Get all mappings from the database

Returns:
ArrayList

saveRup

public void saveRup(Case theCase)

getRupsByInterval

public List<Case> getRupsByInterval(Date from,
                                    Date to,
                                    List<String> yCaseIdsToExclude,
                                    boolean activeOnly)
Get all RUPs from the database that start after "from" and end before "to". Allow for specifying a set of Yawl case Ids that are to be excluded from the result. Also, it is possible to select only RUPs that are active.

Parameters:
from -
to -
yCaseIdsToExclude -
activeOnly -
Returns:
List all cases with RUPs that meet the selection criteria

getRupByCaseId

public List<Case> getRupByCaseId(String caseId)

getAllRups

public List<Case> getAllRups()
Parameters:
-
Returns:

getActiveRups

public List<Case> getActiveRups(String timestamp)
Parameters:
timestamp -
Returns:

getRupNodes

public List<List<org.jdom.Element>> getRupNodes(String activityName,
                                                String activityType,
                                                String nodeName)
Parameters:
activityName -
activityType -
nodeName -
Returns:

getRupsByActivity

public List<Case> getRupsByActivity(String activityName)
Parameters:
activityName -
Returns:

getRupActivityTypes

public List<String> getRupActivityTypes(String activityName)
Parameters:
activityName -
Returns:

updateRup

public void updateRup(String caseId,
                      boolean active)
Update RUP, set "active status"

Parameters:
caseId -
active -


Copyright © 2004-2012 The YAWL Foundation.