org.yawlfoundation.yawl.elements.data.external
Class SimpleExternalDBGatewayImpl

java.lang.Object
  extended by org.yawlfoundation.yawl.elements.data.external.AbstractExternalDBGateway
      extended by org.yawlfoundation.yawl.elements.data.external.SimpleExternalDBGatewayImpl

public class SimpleExternalDBGatewayImpl
extends AbstractExternalDBGateway

Author: Michael Adams Creation Date: 13/08/2009


Field Summary
 
Fields inherited from class org.yawlfoundation.yawl.elements.data.external.AbstractExternalDBGateway
_dbEngine, _log
 
Constructor Summary
SimpleExternalDBGatewayImpl()
           
 
Method Summary
 String getDescription()
           
 org.jdom.Element populateCaseData(YSpecificationID specID, String caseID, List<YParameter> inputParams, List<YVariable> localVars, org.jdom.Element caseDataTemplate)
          Populates the case data template passed with values selected from a database.
 org.jdom.Element populateTaskParameter(YTask task, YParameter param, org.jdom.Element caseData)
          Populates the task parameter passed with a value selected from a database.
 void updateFromCaseData(YSpecificationID specID, String caseID, List<YParameter> outputParams, org.jdom.Element updatingData)
          Update the database with the case's values.
 void updateFromTaskCompletion(String paramName, org.jdom.Element outputData, org.jdom.Element caseData)
          Update the database with the workitem's values.
 
Methods inherited from class org.yawlfoundation.yawl.elements.data.external.AbstractExternalDBGateway
configureSession, configureSession, toXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleExternalDBGatewayImpl

public SimpleExternalDBGatewayImpl()
Method Detail

getDescription

public String getDescription()
Specified by:
getDescription in class AbstractExternalDBGateway
Returns:
a user-understandable description of the use of the particular extending class, which will be seen in a list in the editor and from which the user can choose the class.

populateTaskParameter

public org.jdom.Element populateTaskParameter(YTask task,
                                              YParameter param,
                                              org.jdom.Element caseData)
Description copied from class: AbstractExternalDBGateway
Populates the task parameter passed with a value selected from a database. Called by the engine to populate a workitem when the workitem starts.

Specified by:
populateTaskParameter in class AbstractExternalDBGateway
Parameters:
task - the task template for the starting workitem.
param - the name of the parameter that requires values.
caseData - the current set of case variables and values.
Returns:
an Element named after the param (use param.getName()), populated with the appropriate value.

updateFromTaskCompletion

public void updateFromTaskCompletion(String paramName,
                                     org.jdom.Element outputData,
                                     org.jdom.Element caseData)
Description copied from class: AbstractExternalDBGateway
Update the database with the workitem's values. Called by the engine when the workitem completes.

Specified by:
updateFromTaskCompletion in class AbstractExternalDBGateway
Parameters:
paramName - the name of the task of which this workitem is an instance.
outputData - the datalist from which the corresponding database values are to be updated.
caseData - the current set of case variables and values.

populateCaseData

public org.jdom.Element populateCaseData(YSpecificationID specID,
                                         String caseID,
                                         List<YParameter> inputParams,
                                         List<YVariable> localVars,
                                         org.jdom.Element caseDataTemplate)
Description copied from class: AbstractExternalDBGateway
Populates the case data template passed with values selected from a database. Called by the engine to populate the case-level variables when the case starts. Note that the the returned Element MUST be correctly populated with a value for each input parameter. Local variables are passed so that their initial values may (optionally) be changed, if required; to do so, change the value directly within each variable - local variable values are NOT to be included in the returned Element.

Specified by:
populateCaseData in class AbstractExternalDBGateway
Parameters:
specID - the specification identifier of the case.
caseID - the case identifier.
inputParams - the input parameters that require values.
localVars - the local variables (optionally change their initial values).
caseDataTemplate - the data structure that requires values.
Returns:
an Element of the same structure as 'caseDataTemplate', with populated values.

updateFromCaseData

public void updateFromCaseData(YSpecificationID specID,
                               String caseID,
                               List<YParameter> outputParams,
                               org.jdom.Element updatingData)
Description copied from class: AbstractExternalDBGateway
Update the database with the case's values. Called by the engine when the case completes.

Specified by:
updateFromCaseData in class AbstractExternalDBGateway
Parameters:
specID - the specification identifier of the case.
caseID - the case identifier.
outputParams - the output parameters for the case.
updatingData - the datalist from which the corresponding database values are to be updated.


Copyright © 2004-2012 The YAWL Foundation.