org.yawlfoundation.yawl.scheduling
Class Service

java.lang.Object
  extended by org.yawlfoundation.yawl.engine.interfce.interfaceB.InterfaceBWebsideController
      extended by org.yawlfoundation.yawl.scheduling.Service
All Implemented Interfaces:
Constants
Direct Known Subclasses:
SchedulingService

public abstract class Service
extends InterfaceBWebsideController
implements Constants

Bridge between Service and YAWL, has to be registered with the YAWL engine.

Author:
tbe
Created/Last Date:
2010-10-22

Field Summary
protected  Set<String> _cancelledWorkitemOrCaseIds
           
 ConfigManager _config
           
protected  DataMapper _dataMapper
           
protected  String _handle
           
protected  PropertyReader _props
           
 
Fields inherited from class org.yawlfoundation.yawl.engine.interfce.interfaceB.InterfaceBWebsideController
_ibCache, _interfaceBClient, _logger, _report, engineLogonName, engineLogonPassword, XSD_ANYURI_TYPE, XSD_NAMESPACE, XSD_NCNAME_TYPE, XSD_STRINGTYPE
 
Fields inherited from interface org.yawlfoundation.yawl.scheduling.Constants
ADDRESS_TYPE_EMAIL, ADDRESS_TYPE_IP, ADDRESS_TYPE_SMS, CSS_BOOLEANINPUT, CSS_DATEINPUT, CSS_DURATIONINPUT, CSS_ERRORINPUT, CSS_ERRORTEXT, CSS_INTINPUT, CSS_REQUIRED, CSS_TEXTINPUT, CSS_WARNINGINPUT, CSS_WARNINGTEXT, CSV_DELIMITER, DELIMITER, LANGUAGE_ATTRIBUTE_NAME, LANGUAGE_DEFAULT, LANGUAGES, MSGREL_AFTER, MSGREL_BEFORE, RESOURCE_STATUS_AVAILABLE, RESOURCE_STATUS_NOTAVAILABLE, RESOURCE_STATUS_REQUESTED, RESOURCE_STATUS_RESERVED, RESOURCE_STATUS_UNCHECKED, RESOURCE_STATUS_UNKNOWN, UTILISATION_TYPE_BEGIN, UTILISATION_TYPE_END, UTILISATION_TYPE_PLAN, WORD_SEPARATORS, XML_ACTIVITY, XML_ACTIVITYNAME, XML_ACTIVITYTYPE, XML_ADDRESS, XML_ADDRESSTYPE, XML_CAPABILITY, XML_CASEID, XML_CATEGORY, XML_CHANNEL, XML_DUMMY, XML_DURATION, XML_ENDTASKID, XML_ERROR, XML_EVENT_RECEIVE, XML_FILTERMODEL, XML_FROM, XML_ID, XML_MAX, XML_MESSAGE_SEND, XML_MESSAGEPUSH_SEND, XML_MESSAGES, XML_MIN, XML_MSGBODY, XML_MSGDURATION, XML_MSGREL, XML_MSGTO, XML_MSGTRANSFER, XML_MSGUTILISATIONTYPE, XML_OTHERACTIVITYNAME, XML_OTHERUTILISATIONTYPE, XML_PAYLOAD, XML_REQUESTTYPE, XML_RESCHEDULING, XML_RESERVATION, XML_RESERVATIONID, XML_RESOURCE, XML_RESOURCE_TYPE, XML_ROLE, XML_RUP, XML_RUP_LIGHT, XML_STARTTASKID, XML_STATUS, XML_STATUSTOBE, XML_SUBCATEGORY, XML_TEXT, XML_THISUTILISATIONTYPE, XML_TIMESTAMP, XML_TO, XML_UNIT, XML_UTILISATION, XML_UTILISATION_TYPE, XML_UTILISATIONREL, XML_UTILISATIONTYPE, XML_WARNING, XML_WORKLOAD, XSDDatatypes_Boolean, XSDDatatypes_DateTime, XSDDatatypes_Double, XSDDatatypes_Duration, XSDDatatypes_Int, XSDDatatypes_Long, XSDDatatypes_String
 
Constructor Summary
Service()
          will be started by: - engine, because its defined in web.xml - static block - JCouplingImporter throws JCouplingServiceDAOException throws SimpleDAOException throws TransferException
 
Method Summary
 void checkInWorkItem(Mapping mapping, String payload)
          TODO@tbe: validate payload before to avoid that work item failed if payload is invalid
protected  void checkOutWorkItem(Mapping mapping)
          Check the work item out of the engine InterfaceBWebsideController.checkOut() adds work item with ID=wirID to workItemCache
protected  List<WorkItemRecord> getChildren(String workItemID)
          ermittelt Children eines Parent-WorkItems, dieses muss dazu bereits ausgecheckt sein
protected  org.jdom.Element getDataListFromWorkItem(Mapping mapping)
           
protected  String getHandle()
          checks if there is a valid connection to the engine, and if there isn't, attempts to connect
protected  org.jdom.Element getOutputData(String data)
           
 org.jdom.Element getSpecificationForCase(String caseId)
           
protected  WorkItemRecord getWorkItemFromCache(Mapping mapping)
          re-adds checkedout item to local cache after a restore (if required)
 void handleCancelledCaseEvent(String caseID)
          Receives notification from the engine that an active case has been cancelled.
 void handleCancelledWorkItemEvent(WorkItemRecord workItemRecord)
          ********** inherited by InterfaceBWebsideController ************* Removes (if necessary) the work items from the YAWL Engine
 void handleCompleteCaseEvent(String caseID, String casedata)
          Receives notification from the engine that an active case has been completed.
 void handleEnabledWorkItemEvent(WorkItemRecord wirParent)
          ********** inherited by InterfaceBWebsideController ************* receives messages and requests from YAWL work items Saves or updates a mapping to the database for recovery of failed YAWL requests
 void handleEngineInitialisationCompletedEvent()
          the SS and the RS will get the event at the same time, so the SS will need to delay the call to the RS by 10 seconds while the RS gets the credentials from the engine
protected  boolean isCancelledWorkitem(String wirID)
           
protected  void processMapping(Mapping mapping)
          checkout parent work item from YAWL engine get children work items, cache them, process them check parent back into the engine remove the mapping for successful processed parent work items updates the mapping continuously
protected abstract  void processMappingChild(Mapping mapping)
           
protected  void sort(List<Mapping> mappings)
          sort mappings by workItemId ascending
 
Methods inherited from class org.yawlfoundation.yawl.engine.interfce.interfaceB.InterfaceBWebsideController
checkConnection, checkInWorkItem, checkInWorkItem, checkInWorkItem, checkOut, checkOutAllInstancesOfThisTask, connect, describeRequiredParams, destroy, doGet, getAuthenticationConfig, getCachedWorkItem, getChildren, getEngineStoredWorkItem, getIBCache, getModel, getResourcingSpecs, getSpecificationData, getSpecificationData, getSpecificationPrototypesList, getTaskInformation, getTaskInformation, handleCaseResumedEvent, handleCaseSuspendedEvent, handleCaseSuspendingEvent, handleStartCaseEvent, handleTimerExpiryEvent, handleWorkItemStatusChangeEvent, logContactError, prepareReplyRootElement, setEngineLogonName, setEngineLogonPassword, setRemoteAuthenticationDetails, setUpInterfaceBClient, successful
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_cancelledWorkitemOrCaseIds

protected Set<String> _cancelledWorkitemOrCaseIds

_dataMapper

protected DataMapper _dataMapper

_handle

protected String _handle

_props

protected PropertyReader _props

_config

public ConfigManager _config
Constructor Detail

Service

public Service()
will be started by: - engine, because its defined in web.xml - static block - JCouplingImporter throws JCouplingServiceDAOException throws SimpleDAOException throws TransferException

Method Detail

processMappingChild

protected abstract void processMappingChild(Mapping mapping)
                                     throws Exception
Throws:
Exception

handleEnabledWorkItemEvent

public void handleEnabledWorkItemEvent(WorkItemRecord wirParent)
********** inherited by InterfaceBWebsideController ************* receives messages and requests from YAWL work items Saves or updates a mapping to the database for recovery of failed YAWL requests

Specified by:
handleEnabledWorkItemEvent in class InterfaceBWebsideController
Parameters:
wirParent - the enabled work item

processMapping

protected void processMapping(Mapping mapping)
                       throws Exception
checkout parent work item from YAWL engine get children work items, cache them, process them check parent back into the engine remove the mapping for successful processed parent work items updates the mapping continuously

Parameters:
mapping: - contained work item is parent
Throws:
Exception

getDataListFromWorkItem

protected org.jdom.Element getDataListFromWorkItem(Mapping mapping)
                                            throws Exception
Throws:
Exception

handleCancelledWorkItemEvent

public void handleCancelledWorkItemEvent(WorkItemRecord workItemRecord)
********** inherited by InterfaceBWebsideController ************* Removes (if necessary) the work items from the YAWL Engine

Specified by:
handleCancelledWorkItemEvent in class InterfaceBWebsideController
Parameters:
workItemRecord - the cancelled work item

handleEngineInitialisationCompletedEvent

public void handleEngineInitialisationCompletedEvent()
the SS and the RS will get the event at the same time, so the SS will need to delay the call to the RS by 10 seconds while the RS gets the credentials from the engine

Overrides:
handleEngineInitialisationCompletedEvent in class InterfaceBWebsideController

handleCancelledCaseEvent

public void handleCancelledCaseEvent(String caseID)
Description copied from class: InterfaceBWebsideController
Receives notification from the engine that an active case has been cancelled. Override this method to take any necessary action.

Overrides:
handleCancelledCaseEvent in class InterfaceBWebsideController
Parameters:
caseID - the id of the case that has been cancelled

isCancelledWorkitem

protected boolean isCancelledWorkitem(String wirID)

handleCompleteCaseEvent

public void handleCompleteCaseEvent(String caseID,
                                    String casedata)
Description copied from class: InterfaceBWebsideController
Receives notification from the engine that an active case has been completed. By overriding this method a service can process case completion events as required.

Overrides:
handleCompleteCaseEvent in class InterfaceBWebsideController
Parameters:
caseID - the id of the completed case.
casedata - the set of net-level data for the case when it completes

checkInWorkItem

public void checkInWorkItem(Mapping mapping,
                            String payload)
                     throws YAWLException
TODO@tbe: validate payload before to avoid that work item failed if payload is invalid

Parameters:
mapping -
payload -
Throws:
YAWLException

getChildren

protected List<WorkItemRecord> getChildren(String workItemID)
                                    throws YAWLException,
                                           IOException
ermittelt Children eines Parent-WorkItems, dieses muss dazu bereits ausgecheckt sein

Parameters:
workItemID -
Returns:
Throws:
IOException
YAWLException

checkOutWorkItem

protected void checkOutWorkItem(Mapping mapping)
                         throws SQLException,
                                YAWLException
Check the work item out of the engine InterfaceBWebsideController.checkOut() adds work item with ID=wirID to workItemCache

Parameters:
mapping - - contains the work item ID to check out
Throws:
SQLException
YAWLException

getHandle

protected String getHandle()
                    throws IOException
checks if there is a valid connection to the engine, and if there isn't, attempts to connect

Returns:
true if reconnected
Throws:
IOException

getWorkItemFromCache

protected WorkItemRecord getWorkItemFromCache(Mapping mapping)
                                       throws Exception
re-adds checkedout item to local cache after a restore (if required)

Throws:
Exception

getOutputData

protected org.jdom.Element getOutputData(String data)
Parameters:
data -
Returns:

sort

protected void sort(List<Mapping> mappings)
sort mappings by workItemId ascending

Parameters:
mappings -

getSpecificationForCase

public org.jdom.Element getSpecificationForCase(String caseId)


Copyright © 2004-2012 The YAWL Foundation.