org.yawlfoundation.yawl.resourcing
Class ResourceManager

java.lang.Object
  extended by org.yawlfoundation.yawl.engine.interfce.interfaceB.InterfaceBWebsideController
      extended by org.yawlfoundation.yawl.resourcing.ResourceManager

public class ResourceManager
extends InterfaceBWebsideController

The ResourceManager singleton manages all aspects of the resource perspective, including the loading & maintenance of the org model, and overseeing the distribution of tasks to participants.

Author:
Michael Adams
Created/Last Date:
03/08/2007

Field Summary
static String ADMIN_STR
           
static boolean serviceInitialised
           
 
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
 
Method Summary
 WorkItemRecord acceptOffer(Participant p, WorkItemRecord wir)
           
 String addChain(Participant p, WorkItemRecord wir)
           
 String addExternalClient(YExternalClient client)
           
 String addParticipant(Participant p)
          Adds a new participant to the Resource DataSet, and persists it also
 String addRegisteredService(YAWLServiceReference service)
           
 void addToOfferedSet(WorkItemRecord wir, Participant p)
           
 void announceModifiedQueue(String pid)
           
 boolean assignUnofferedItem(WorkItemRecord wir, String[] pidList, String action)
           
 boolean canAddNewInstance(WorkItemRecord wir)
           
 String cancelCase(String caseID, String userHandle)
          Cancels the case & removes its workitems (if any) from the service's queues & caches.
 String chainCase(Participant p, WorkItemRecord wir)
           
 void checkInAutoTask(WorkItemRecord wir, org.jdom.Element outData)
           
 String checkinItem(Participant p, WorkItemRecord wir)
          Checks a (checked out) workitem back into the engine
protected  List checkOutChildren(WorkItemRecord wir, List children)
          Checks out all the child workitems of the parent item specified
protected  boolean checkOutWorkItem(WorkItemRecord wir)
          Check the workitem out of the engine
 boolean checkServiceConnection(String handle)
           
 WorkItemRecord createNewWorkItemInstance(String id, String value)
           
 boolean deallocateWorkItem(Participant p, WorkItemRecord wir)
           
 boolean delegateWorkItem(Participant pFrom, Participant pTo, WorkItemRecord wir)
           
 void deletePersistedPiledTasks(YSpecificationID specID)
           
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          displays a web page describing the service
 Participant expireSession(String jSessionID)
           
 void finaliseInitialisation()
           
 String getActiveParticipantsAsXML()
           
 QueueSet getAdminQueues()
           
 Set<AbstractAllocator> getAllocators()
           
 String getAllocatorsAsXML()
           
 Set<ResourceMap> getAllResourceMaps()
           
 String getAllSelectors()
           
 YBuildProperties getBuildProperties()
           
 ResourceMap getCachedResourceMap(WorkItemRecord wir)
           
 ResourceMap getCachedResourceMap(YSpecificationID specID, String taskID)
           
 ResourceCalendar getCalendar()
           
 Map<String,FormParameter> getCaseInputParams(YSpecificationID spec)
           
 Set<String> getChainedCases(Participant p)
           
 List<WorkItemRecord> getChildren(String parentID)
           
 Set<WorkItemRecord> getChildrenFromCache(String parentID)
           
 InterfaceClients getClients()
           
 List<YParameter> getCodeletParameters(String codeletName)
           
 String getCodeletParametersAsXML(String codeletName)
           
 Set<AbstractCodelet> getCodelets()
           
 String getCodeletsAsXML()
           
 Set<AbstractConstraint> getConstraints()
           
 String getConstraintsAsXML()
           
 String getDataSchema(String itemID)
           
 String getDataSchema(WorkItemRecord wir, YSpecificationID specID)
           
 String getDataSchema(YSpecificationID specID)
           
 String getDecompID(WorkItemRecord wir)
          get the workitem's (task) decomposition id
 String getDecompID(YSpecificationID specID, String taskID)
          gets a task's decomposition id
 Set<Participant> getDistributionSet(String itemID)
           
 String getEngineBuildProperties()
           
 WorkItemRecord getExecutingChild(WorkItemRecord parent)
           
 Set<AbstractFilter> getFilters()
           
 String getFiltersAsXML()
           
 String getFullNameForUserID(String userID)
           
protected  Object getIBEventMutex()
           
static ResourceManager getInstance()
           
 String getInstanceData(String schema, WorkItemRecord wir)
           
 String getInstanceData(String schema, YSpecificationID specID)
           
 Set<SpecificationData> getLoadedSpecs()
           
 org.apache.log4j.Logger getLogger()
           
 String getMIFormalInputParamName(WorkItemRecord wir)
           
 String getNetParamValue(String caseID, String paramName)
           
 ResourceDataSet getOrgDataSet()
           
 DataSource getOrgDataSource()
           
 String getOutputOnlyTaskParamsAsXML(String itemID)
           
 Participant getParticipantAssignedWorkItem(WorkItemRecord wir, int qType)
           
 Participant getParticipantFromUserID(String userID)
           
 Set<Participant> getParticipantsAssignedWorkItem(String workItemID, int queueType)
           
 Set<Participant> getParticipantsAssignedWorkItem(WorkItemRecord wir)
           
 ResourceMap getPersistedPiledTask(YSpecificationID specID, String taskID)
           
 Set<ResourceMap> getPersistedPiledTasks(Participant p)
           
 Set<ResourceMap> getPiledTaskMaps(Participant p)
           
 ResourceMap getResourceMap(String itemID)
           
 ResourceMap getResourceMap(WorkItemRecord wir)
           
 SecondaryResources getSecondaryResources(WorkItemRecord wir)
           
 String getSelectors(Set items, String tag)
           
 SpecificationData getSpecData(YSpecificationID spec)
           
 Map<String,org.jdom.Element> getSpecificationDataSchema(YSpecificationID specID)
           
 Set<SpecificationData> getSpecList()
           
 String getTaskParamsAsXML(String itemID)
           
 TaskPrivileges getTaskPrivileges(String itemID)
           
 TaskPrivileges getTaskPrivileges(WorkItemRecord wir)
           
 Set<ResourceMap> getUnpersistedPiledTasks(Participant p)
           
 String getUserIDForSessionHandle(String handle)
           
 QueueSet getUserQueueSet(String userID)
           
 Dimension getVisualiserDimension()
           
 Set<Participant> getWhoCompletedTask(String taskID, WorkItemRecord wir)
           
 String getWorkItem(String itemID)
           
 WorkItemCache getWorkItemCache()
           
 String getWorkItemDurationsForParticipant(YSpecificationID specID, String taskName, String pid)
           
 Map<String,FormParameter> getWorkItemParamsInfo(WorkItemRecord wir)
           
 WorkItemRecord getWorkItemRecord(String itemID)
           
 void handleAllocatedQueueOnRemoval(WorkQueue qAlloc)
           
 void handleCancelledCaseEvent(String caseID)
          Receives notification from the engine that an active case has been cancelled.
 void handleCancelledWorkItemEvent(WorkItemRecord wir)
          Receives notification from the engine that an active workitem has been cancelled.
 void handleCodeletCompletion(WorkItemRecord wir, org.jdom.Element codeletResult)
           
 void handleCompleteCaseEvent(String caseID, String casedata)
          Receives notification from the engine that an active case has been completed.
 void handleEnabledWorkItemEvent(WorkItemRecord wir)
          Receives notification from the engine of an enabled workitem.
 void handleEngineInitialisationCompletedEvent()
          Receives notification from the engine that it has finished startup initialisation and is now in a running state.
 void handleOfferedQueueOnRemoval(Participant p, WorkQueue qOffer)
           
 void handleStartCaseEvent(YSpecificationID specID, String caseID, String launchingService, boolean delayed)
          Receives notification from the engine that a case has been started.
 void handleStartedQueuesOnRemoval(Participant p, WorkQueue qStart)
           
 void handleTimerExpiryEvent(WorkItemRecord wir)
          Receives notification from the engine that an active workitem's timer has expired.
 void handleWorkItemStatusChangeEvent(WorkItemRecord wir, String oldStatus, String newStatus)
          Receives notification from the engine that the status of a workitem has been modified.
 void handleWorkQueueOnRemoval(WorkQueue wq)
           
 void handleWorkQueuesOnRemoval(Participant p)
           
 void handleWorkQueuesOnRemoval(Participant p, QueueSet qs)
           
 boolean hasOrgDataSource()
           
 boolean hasUserTaskPrivilege(Participant p, WorkItemRecord wir, int privilege)
           
 void importParticipant(Participant p)
           
 void initBuildProperties(InputStream stream)
           
 void initOrgDataSource(String dataSourceClassName, int refreshRate)
           
 void initRandomOrgDataGeneration(int count)
           
 boolean isActiveSession(String jSessionID)
           
 boolean isDefaultOrgDB()
           
 boolean isKnownUserID(String userid)
           
 boolean isOrgDataRefreshing()
           
 boolean isPersisting()
           
 boolean isPersistPiling()
           
 boolean isSpecBetaVersion(WorkItemRecord wir)
           
 boolean isValidUserSession(String handle)
           
 boolean isVisualiserEnabled()
           
 String launchCase(YSpecificationID specID, String caseData, String handle)
           
 String launchCase(YSpecificationID specID, String caseData, String handle, Date delay)
           
 String launchCase(YSpecificationID specID, String caseData, String handle, Duration delay)
           
 String launchCase(YSpecificationID specID, String caseData, String handle, long delay)
           
 void loadResources()
          Loads all the org data from db into the ResourceDataSet mappings
 String login(String userid, String password, String jSessionID)
          9.
 void logout(String handle)
           
 boolean mapSetContains(Set<ResourceMap> mapSet, ResourceMap other)
           
 WorkItemRecord offerToAll(WorkItemRecord wir)
           
 String pileWorkItem(Participant p, WorkItemRecord wir)
           
 boolean reallocateStatefulWorkItem(Participant pFrom, Participant pTo, WorkItemRecord wir)
           
 boolean reallocateStatelessWorkItem(Participant pFrom, Participant pTo, WorkItemRecord wir)
           
 void reassignWorklistedItem(WorkItemRecord wir, String[] pidList, String action)
           
 String redirectWorkItemToYawlService(String itemID, String serviceName)
          Dispatches a work item to a YAWL Custom Service for handling.
 void refreshOrgData()
           
 String registerCalendarStatusChangeListener(String uri, String handle)
           
 void registerJSFApplicationReference(ApplicationBean app)
           
 void removeCalendarStatusChangeListener(String uri, String handle)
           
 void removeCalendarStatusChangeListeners(String handle)
           
 void removeCaseFromAllQueues(String caseID)
           
 void removeChain(String caseID)
           
 String removeExternalClient(String id)
           
 void removeFromAll(WorkItemRecord wir)
           
 void removeParticipant(Participant p)
           
 boolean removeParticipant(String pid)
           
 String removeRegisteredService(String id)
           
 boolean routeChainedWorkItem(Participant p, WorkItemRecord wir)
           
 boolean routeIfChained(WorkItemRecord wir, Set<Participant> distributionSet)
           
 boolean routePiledWorkItem(Participant p, WorkItemRecord wir)
           
 void sanitiseCaches()
          This does final initialisation tasks involved in ensuring the caches match the engine's known work.
 String serviceConnect(String userid, String password, long timeOutSeconds)
           
 void serviceDisconnect(String handle)
           
 void setAllowExternalOrgDataMods(boolean allow)
           
 void setBlockOnUnavailableSecondaryResources(boolean block)
           
 void setExternalUserAuthentication(boolean externalAuth)
           
 void setOrgDataRefreshing(boolean refreshing)
           
 void setPersisting(boolean flag)
           
 void setPersistPiling(boolean persist)
           
static void setServiceInitialised()
           
 void setVisualiserDimension(Dimension d)
           
 void setVisualiserDimension(String s)
           
 void setVisualiserEnabled(boolean enable)
           
 void shutdown()
           
 boolean skipWorkItem(Participant p, WorkItemRecord wir)
           
 boolean start(Participant p, WorkItemRecord wir)
          moves the workitem to executing for the participant.
 boolean startImmediate(Participant p, WorkItemRecord wir)
           
 void startOrgDataRefreshTimer(long interval)
          Starts a timer task to refresh the org data dataset at regular intervals, or turns an existing timer off if interval < 0
 boolean suspendWorkItem(Participant p, WorkItemRecord wir)
           
 String unloadSpecification(YSpecificationID specID)
           
 String unpileTask(ResourceMap resMap, Participant p)
           
 boolean unsuspendWorkItem(Participant p, WorkItemRecord wir)
           
 String updateExternalClient(String id, String password, String doco)
           
 void updateParticipant(Participant p)
           
 String updateWorkItemData(String itemID, String data)
           
 String validateUserCredentials(String userid, String password, boolean admin)
           
 void withdrawOfferFromAll(WorkItemRecord wir)
           
 
Methods inherited from class org.yawlfoundation.yawl.engine.interfce.interfaceB.InterfaceBWebsideController
checkConnection, checkInWorkItem, checkInWorkItem, checkInWorkItem, checkOut, checkOutAllInstancesOfThisTask, connect, describeRequiredParams, destroy, getAuthenticationConfig, getCachedWorkItem, getChildren, getEngineStoredWorkItem, getIBCache, getModel, getResourcingSpecs, getSpecificationData, getSpecificationData, getSpecificationPrototypesList, getTaskInformation, getTaskInformation, handleCaseResumedEvent, handleCaseSuspendedEvent, handleCaseSuspendingEvent, 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

ADMIN_STR

public static final String ADMIN_STR
See Also:
Constant Field Values

serviceInitialised

public static boolean serviceInitialised
Method Detail

getInstance

public static ResourceManager getInstance()
Returns:
the instantiated ResourceManager reference

initOrgDataSource

public void initOrgDataSource(String dataSourceClassName,
                              int refreshRate)

getClients

public InterfaceClients getClients()

getIBEventMutex

protected Object getIBEventMutex()

initBuildProperties

public void initBuildProperties(InputStream stream)

getBuildProperties

public YBuildProperties getBuildProperties()

getEngineBuildProperties

public String getEngineBuildProperties()

finaliseInitialisation

public void finaliseInitialisation()

setAllowExternalOrgDataMods

public void setAllowExternalOrgDataMods(boolean allow)

setExternalUserAuthentication

public void setExternalUserAuthentication(boolean externalAuth)

setVisualiserDimension

public void setVisualiserDimension(String s)

setVisualiserDimension

public void setVisualiserDimension(Dimension d)

getVisualiserDimension

public Dimension getVisualiserDimension()

initRandomOrgDataGeneration

public void initRandomOrgDataGeneration(int count)

setVisualiserEnabled

public void setVisualiserEnabled(boolean enable)

isVisualiserEnabled

public boolean isVisualiserEnabled()

getWorkItemCache

public WorkItemCache getWorkItemCache()

registerJSFApplicationReference

public void registerJSFApplicationReference(ApplicationBean app)

hasOrgDataSource

public boolean hasOrgDataSource()

setOrgDataRefreshing

public void setOrgDataRefreshing(boolean refreshing)

isOrgDataRefreshing

public boolean isOrgDataRefreshing()

getLogger

public org.apache.log4j.Logger getLogger()

getCalendar

public ResourceCalendar getCalendar()

registerCalendarStatusChangeListener

public String registerCalendarStatusChangeListener(String uri,
                                                   String handle)

removeCalendarStatusChangeListener

public void removeCalendarStatusChangeListener(String uri,
                                               String handle)

removeCalendarStatusChangeListeners

public void removeCalendarStatusChangeListeners(String handle)

handleEnabledWorkItemEvent

public void handleEnabledWorkItemEvent(WorkItemRecord wir)
Description copied from class: InterfaceBWebsideController
Receives notification from the engine of an enabled workitem. Typically, a custom service will implement this method to check out the work item, and process it as appropriate for the service.

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

handleCancelledWorkItemEvent

public void handleCancelledWorkItemEvent(WorkItemRecord wir)
Description copied from class: InterfaceBWebsideController
Receives notification from the engine that an active workitem has been cancelled. A custom service will implement this method to take any cleanup action on a previously checked out workitem.

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

handleTimerExpiryEvent

public void handleTimerExpiryEvent(WorkItemRecord wir)
Description copied from class: InterfaceBWebsideController
Receives notification from the engine that an active workitem's timer has expired. Override this method to handle timer expiries on timed workitems.

Overrides:
handleTimerExpiryEvent in class InterfaceBWebsideController
Parameters:
wir - the workitem that has an expired timer

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

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

handleEngineInitialisationCompletedEvent

public void handleEngineInitialisationCompletedEvent()
Description copied from class: InterfaceBWebsideController
Receives notification from the engine that it has finished startup initialisation and is now in a running state. Override this method to handle final service initialisation tasks that require a running engine

Overrides:
handleEngineInitialisationCompletedEvent in class InterfaceBWebsideController

handleWorkItemStatusChangeEvent

public void handleWorkItemStatusChangeEvent(WorkItemRecord wir,
                                            String oldStatus,
                                            String newStatus)
Description copied from class: InterfaceBWebsideController
Receives notification from the engine that the status of a workitem has been modified. Override this method to handle any effects a status change might have on a custom service

Overrides:
handleWorkItemStatusChangeEvent in class InterfaceBWebsideController
Parameters:
wir - the work item that has had its status modified
oldStatus - the work item's previous status
newStatus - the work item's new status

handleStartCaseEvent

public void handleStartCaseEvent(YSpecificationID specID,
                                 String caseID,
                                 String launchingService,
                                 boolean delayed)
Description copied from class: InterfaceBWebsideController
Receives notification from the engine that a case has been started. By overriding this method a service can process case start events as required.

Overrides:
handleStartCaseEvent in class InterfaceBWebsideController
Parameters:
specID - the specification id of the started case
caseID - the id of the case
launchingService - the uri (String) of the service that started the case
delayed - true if this is a delayed case start, false if immediate

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws IOException,
                  javax.servlet.ServletException
displays a web page describing the service

Overrides:
doGet in class InterfaceBWebsideController
Parameters:
request - the request
response - the response.
Throws:
IOException - if an error is detected when the servlet handles the GET request
javax.servlet.ServletException - if the request for the GET could not be handled

getConstraints

public Set<AbstractConstraint> getConstraints()

getFilters

public Set<AbstractFilter> getFilters()

getAllocators

public Set<AbstractAllocator> getAllocators()

getConstraintsAsXML

public String getConstraintsAsXML()

getFiltersAsXML

public String getFiltersAsXML()

getAllocatorsAsXML

public String getAllocatorsAsXML()

getAllSelectors

public String getAllSelectors()

getSelectors

public String getSelectors(Set items,
                           String tag)

getCodeletsAsXML

public String getCodeletsAsXML()

getCodelets

public Set<AbstractCodelet> getCodelets()

getCodeletParameters

public List<YParameter> getCodeletParameters(String codeletName)

getCodeletParametersAsXML

public String getCodeletParametersAsXML(String codeletName)

isDefaultOrgDB

public boolean isDefaultOrgDB()

getOrgDataSet

public ResourceDataSet getOrgDataSet()

loadResources

public void loadResources()
Loads all the org data from db into the ResourceDataSet mappings


refreshOrgData

public void refreshOrgData()

sanitiseCaches

public void sanitiseCaches()
This does final initialisation tasks involved in ensuring the caches match the engine's known work. It is called via the EngineInitialisationCompleted event, because it needs the engine to be completely initialised first. It may also be executed via the 'synch' button on the admin queues.


isKnownUserID

public boolean isKnownUserID(String userid)

addParticipant

public String addParticipant(Participant p)
Adds a new participant to the Resource DataSet, and persists it also

Parameters:
p - the new Participant

importParticipant

public void importParticipant(Participant p)

updateParticipant

public void updateParticipant(Participant p)

removeParticipant

public void removeParticipant(Participant p)

removeParticipant

public boolean removeParticipant(String pid)

getActiveParticipantsAsXML

public String getActiveParticipantsAsXML()

getParticipantFromUserID

public Participant getParticipantFromUserID(String userID)

getUserQueueSet

public QueueSet getUserQueueSet(String userID)

getParticipantsAssignedWorkItem

public Set<Participant> getParticipantsAssignedWorkItem(String workItemID,
                                                        int queueType)

getParticipantsAssignedWorkItem

public Set<Participant> getParticipantsAssignedWorkItem(WorkItemRecord wir)

getParticipantAssignedWorkItem

public Participant getParticipantAssignedWorkItem(WorkItemRecord wir,
                                                  int qType)

getFullNameForUserID

public String getFullNameForUserID(String userID)

offerToAll

public WorkItemRecord offerToAll(WorkItemRecord wir)

withdrawOfferFromAll

public void withdrawOfferFromAll(WorkItemRecord wir)

removeFromAll

public void removeFromAll(WorkItemRecord wir)

removeCaseFromAllQueues

public void removeCaseFromAllQueues(String caseID)

getAdminQueues

public QueueSet getAdminQueues()

acceptOffer

public WorkItemRecord acceptOffer(Participant p,
                                  WorkItemRecord wir)

handleWorkQueuesOnRemoval

public void handleWorkQueuesOnRemoval(Participant p)

handleWorkQueuesOnRemoval

public void handleWorkQueuesOnRemoval(Participant p,
                                      QueueSet qs)

handleWorkQueueOnRemoval

public void handleWorkQueueOnRemoval(WorkQueue wq)

handleOfferedQueueOnRemoval

public void handleOfferedQueueOnRemoval(Participant p,
                                        WorkQueue qOffer)

handleAllocatedQueueOnRemoval

public void handleAllocatedQueueOnRemoval(WorkQueue qAlloc)

handleStartedQueuesOnRemoval

public void handleStartedQueuesOnRemoval(Participant p,
                                         WorkQueue qStart)

start

public boolean start(Participant p,
                     WorkItemRecord wir)
moves the workitem to executing for the participant. Note that when an item is checked out of the engine, at least one child item is spawned, and that is the item that executes (i.e. not the parent).

Parameters:
p - the participant starting the workitem
wir - the item to start
Returns:
true for a successful workitem start

suspendWorkItem

public boolean suspendWorkItem(Participant p,
                               WorkItemRecord wir)

unsuspendWorkItem

public boolean unsuspendWorkItem(Participant p,
                                 WorkItemRecord wir)

reallocateStatelessWorkItem

public boolean reallocateStatelessWorkItem(Participant pFrom,
                                           Participant pTo,
                                           WorkItemRecord wir)

reallocateStatefulWorkItem

public boolean reallocateStatefulWorkItem(Participant pFrom,
                                          Participant pTo,
                                          WorkItemRecord wir)

deallocateWorkItem

public boolean deallocateWorkItem(Participant p,
                                  WorkItemRecord wir)

delegateWorkItem

public boolean delegateWorkItem(Participant pFrom,
                                Participant pTo,
                                WorkItemRecord wir)

skipWorkItem

public boolean skipWorkItem(Participant p,
                            WorkItemRecord wir)

pileWorkItem

public String pileWorkItem(Participant p,
                           WorkItemRecord wir)

unpileTask

public String unpileTask(ResourceMap resMap,
                         Participant p)

routePiledWorkItem

public boolean routePiledWorkItem(Participant p,
                                  WorkItemRecord wir)

startImmediate

public boolean startImmediate(Participant p,
                              WorkItemRecord wir)

hasUserTaskPrivilege

public boolean hasUserTaskPrivilege(Participant p,
                                    WorkItemRecord wir,
                                    int privilege)

getTaskPrivileges

public TaskPrivileges getTaskPrivileges(String itemID)

getTaskPrivileges

public TaskPrivileges getTaskPrivileges(WorkItemRecord wir)

getWorkItem

public String getWorkItem(String itemID)

getWorkItemRecord

public WorkItemRecord getWorkItemRecord(String itemID)

updateWorkItemData

public String updateWorkItemData(String itemID,
                                 String data)

chainCase

public String chainCase(Participant p,
                        WorkItemRecord wir)

routeChainedWorkItem

public boolean routeChainedWorkItem(Participant p,
                                    WorkItemRecord wir)

addChain

public String addChain(Participant p,
                       WorkItemRecord wir)

removeChain

public void removeChain(String caseID)

getChainedCases

public Set<String> getChainedCases(Participant p)

routeIfChained

public boolean routeIfChained(WorkItemRecord wir,
                              Set<Participant> distributionSet)

getPiledTaskMaps

public Set<ResourceMap> getPiledTaskMaps(Participant p)
Returns:
the union of persisted and unpersisted maps

getUnpersistedPiledTasks

public Set<ResourceMap> getUnpersistedPiledTasks(Participant p)

getPersistedPiledTasks

public Set<ResourceMap> getPersistedPiledTasks(Participant p)

getPersistedPiledTask

public ResourceMap getPersistedPiledTask(YSpecificationID specID,
                                         String taskID)

deletePersistedPiledTasks

public void deletePersistedPiledTasks(YSpecificationID specID)

mapSetContains

public boolean mapSetContains(Set<ResourceMap> mapSet,
                              ResourceMap other)

getAllResourceMaps

public Set<ResourceMap> getAllResourceMaps()

getOrgDataSource

public DataSource getOrgDataSource()

setPersisting

public void setPersisting(boolean flag)

isPersisting

public boolean isPersisting()

startOrgDataRefreshTimer

public void startOrgDataRefreshTimer(long interval)
Starts a timer task to refresh the org data dataset at regular intervals, or turns an existing timer off if interval < 0

Parameters:
interval - the number of minutes between each refresh

setPersistPiling

public void setPersistPiling(boolean persist)

isPersistPiling

public boolean isPersistPiling()

setBlockOnUnavailableSecondaryResources

public void setBlockOnUnavailableSecondaryResources(boolean block)

getDistributionSet

public Set<Participant> getDistributionSet(String itemID)

getResourceMap

public ResourceMap getResourceMap(String itemID)

getCachedResourceMap

public ResourceMap getCachedResourceMap(WorkItemRecord wir)

getCachedResourceMap

public ResourceMap getCachedResourceMap(YSpecificationID specID,
                                        String taskID)

getResourceMap

public ResourceMap getResourceMap(WorkItemRecord wir)

setServiceInitialised

public static void setServiceInitialised()

getWhoCompletedTask

public Set<Participant> getWhoCompletedTask(String taskID,
                                            WorkItemRecord wir)

getDecompID

public String getDecompID(WorkItemRecord wir)
get the workitem's (task) decomposition id

Parameters:
wir - - the workitem to get the decomp id for

getDecompID

public String getDecompID(YSpecificationID specID,
                          String taskID)
gets a task's decomposition id

Parameters:
specID - the specification id
taskID - the task's id

checkOutWorkItem

protected boolean checkOutWorkItem(WorkItemRecord wir)
Check the workitem out of the engine

Parameters:
wir - - the workitem to check out
Returns:
true if checkout was successful

checkinItem

public String checkinItem(Participant p,
                          WorkItemRecord wir)
Checks a (checked out) workitem back into the engine

Parameters:
p - - the participant checking in the item
wir - - workitem to check into the engine
Returns:
true if checkin is successful

getSecondaryResources

public SecondaryResources getSecondaryResources(WorkItemRecord wir)

checkOutChildren

protected List checkOutChildren(WorkItemRecord wir,
                                List children)
Checks out all the child workitems of the parent item specified

Parameters:
wir - - the parent wir object

getExecutingChild

public WorkItemRecord getExecutingChild(WorkItemRecord parent)

login

public String login(String userid,
                    String password,
                    String jSessionID)
9. CONNECTION METHODS *


logout

public void logout(String handle)

isValidUserSession

public boolean isValidUserSession(String handle)

validateUserCredentials

public String validateUserCredentials(String userid,
                                      String password,
                                      boolean admin)

expireSession

public Participant expireSession(String jSessionID)

isActiveSession

public boolean isActiveSession(String jSessionID)

shutdown

public void shutdown()

serviceConnect

public String serviceConnect(String userid,
                             String password,
                             long timeOutSeconds)

serviceDisconnect

public void serviceDisconnect(String handle)

checkServiceConnection

public boolean checkServiceConnection(String handle)

getUserIDForSessionHandle

public String getUserIDForSessionHandle(String handle)

getLoadedSpecs

public Set<SpecificationData> getLoadedSpecs()

getSpecList

public Set<SpecificationData> getSpecList()

getSpecData

public SpecificationData getSpecData(YSpecificationID spec)

isSpecBetaVersion

public boolean isSpecBetaVersion(WorkItemRecord wir)

cancelCase

public String cancelCase(String caseID,
                         String userHandle)
                  throws IOException
Cancels the case & removes its workitems (if any) from the service's queues & caches. Note: this method is synchronised to prevent any clash with 'handleCancelledCaseEvent', which is triggered by the call to cancelCase in this method.

Parameters:
caseID - the case to cancel
Returns:
a message from the engine indicating success or otherwise
Throws:
IOException - if there's trouble talking to the engine

getChildren

public List<WorkItemRecord> getChildren(String parentID)

getChildrenFromCache

public Set<WorkItemRecord> getChildrenFromCache(String parentID)

unloadSpecification

public String unloadSpecification(YSpecificationID specID)
                           throws IOException
Throws:
IOException

launchCase

public String launchCase(YSpecificationID specID,
                         String caseData,
                         String handle)
                  throws IOException
Throws:
IOException

launchCase

public String launchCase(YSpecificationID specID,
                         String caseData,
                         String handle,
                         long delay)
                  throws IOException
Throws:
IOException

launchCase

public String launchCase(YSpecificationID specID,
                         String caseData,
                         String handle,
                         Date delay)
                  throws IOException
Throws:
IOException

launchCase

public String launchCase(YSpecificationID specID,
                         String caseData,
                         String handle,
                         Duration delay)
                  throws IOException
Throws:
IOException

getTaskParamsAsXML

public String getTaskParamsAsXML(String itemID)
                          throws IOException
Throws:
IOException

getOutputOnlyTaskParamsAsXML

public String getOutputOnlyTaskParamsAsXML(String itemID)

getWorkItemParamsInfo

public Map<String,FormParameter> getWorkItemParamsInfo(WorkItemRecord wir)
                                                throws IOException,
                                                       org.jdom.JDOMException
Throws:
IOException
org.jdom.JDOMException

announceModifiedQueue

public void announceModifiedQueue(String pid)

addRegisteredService

public String addRegisteredService(YAWLServiceReference service)
                            throws IOException
Throws:
IOException

removeRegisteredService

public String removeRegisteredService(String id)
                               throws IOException
Throws:
IOException

addExternalClient

public String addExternalClient(YExternalClient client)
                         throws IOException
Throws:
IOException

removeExternalClient

public String removeExternalClient(String id)
                            throws IOException
Throws:
IOException

updateExternalClient

public String updateExternalClient(String id,
                                   String password,
                                   String doco)
                            throws IOException
Throws:
IOException

getNetParamValue

public String getNetParamValue(String caseID,
                               String paramName)
                        throws IOException
Throws:
IOException

getDataSchema

public String getDataSchema(YSpecificationID specID)

getDataSchema

public String getDataSchema(String itemID)

getDataSchema

public String getDataSchema(WorkItemRecord wir,
                            YSpecificationID specID)

getCaseInputParams

public Map<String,FormParameter> getCaseInputParams(YSpecificationID spec)

getSpecificationDataSchema

public Map<String,org.jdom.Element> getSpecificationDataSchema(YSpecificationID specID)
                                                        throws IOException
Throws:
IOException

getInstanceData

public String getInstanceData(String schema,
                              YSpecificationID specID)

getInstanceData

public String getInstanceData(String schema,
                              WorkItemRecord wir)

assignUnofferedItem

public boolean assignUnofferedItem(WorkItemRecord wir,
                                   String[] pidList,
                                   String action)

addToOfferedSet

public void addToOfferedSet(WorkItemRecord wir,
                            Participant p)

reassignWorklistedItem

public void reassignWorklistedItem(WorkItemRecord wir,
                                   String[] pidList,
                                   String action)

handleCodeletCompletion

public void handleCodeletCompletion(WorkItemRecord wir,
                                    org.jdom.Element codeletResult)

checkInAutoTask

public void checkInAutoTask(WorkItemRecord wir,
                            org.jdom.Element outData)

getMIFormalInputParamName

public String getMIFormalInputParamName(WorkItemRecord wir)

canAddNewInstance

public boolean canAddNewInstance(WorkItemRecord wir)

createNewWorkItemInstance

public WorkItemRecord createNewWorkItemInstance(String id,
                                                String value)

getWorkItemDurationsForParticipant

public String getWorkItemDurationsForParticipant(YSpecificationID specID,
                                                 String taskName,
                                                 String pid)

redirectWorkItemToYawlService

public String redirectWorkItemToYawlService(String itemID,
                                            String serviceName)
Dispatches a work item to a YAWL Custom Service for handling.

Parameters:
itemID - the id of the work to be redirected.
serviceName - the name of the service to redirect it to
Returns:
a success or diagnostic error message
Precondition:
The item id refers to a work item that is currently in the list of items known to the Resource Service, and the work item has enabled or fired status, The service name refers to a service registered in the engine, The service is up and running


Copyright © 2004-2012 The YAWL Foundation.