public abstract class InterfaceBWebsideController
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected IBControllerCache |
_ibCache |
protected InterfaceB_EnvironmentBasedClient |
_interfaceBClient |
protected org.apache.logging.log4j.Logger |
_logger |
protected java.lang.String |
_report |
protected java.lang.String |
engineLogonName |
protected java.lang.String |
engineLogonPassword |
protected static java.lang.String |
XSD_ANYURI_TYPE |
protected static java.lang.String |
XSD_NAMESPACE |
protected static java.lang.String |
XSD_NCNAME_TYPE |
protected static java.lang.String |
XSD_STRINGTYPE |
Constructor and Description |
---|
InterfaceBWebsideController()
Constructs a controller.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkConnection(java.lang.String sessionHandle)
Checks if the sessionhandle with the engine is currently active.
|
java.lang.String |
checkInWorkItem(java.lang.String workItemID,
Element inputData,
Element outputData,
java.lang.String sessionHandle)
Deprecated.
since 2.1 - use checkInWorkItem(String, Element, Element, String, String)
Checks a work item into the engine.
|
java.lang.String |
checkInWorkItem(java.lang.String workItemID,
Element inputData,
Element outputData,
java.lang.String logPredicate,
java.lang.String sessionHandle)
Checks a work item into the engine.
|
java.lang.String |
checkInWorkItem(java.lang.String workItemID,
java.lang.String inputData,
java.lang.String outputData,
java.lang.String sessionHandle)
Deprecated.
since 2.1 - use checkInWorkItem(String, Element, Element, String, String)
Checks a work item back into the engine.
|
WorkItemRecord |
checkOut(java.lang.String workItemID,
java.lang.String sessionHandle)
Checks a work item out of the engine.
|
protected java.util.List<WorkItemRecord> |
checkOutAllInstancesOfThisTask(WorkItemRecord enabledWorkItem,
java.lang.String sessionHandle)
Utility method for implementers to use for helping to check all instances
of a given task out of the engine.
|
java.lang.String |
connect(java.lang.String userID,
java.lang.String password)
Creates a session with the engine.
|
YParameter[] |
describeRequiredParams()
Override this method if you wish to allow other tools to find out what
input parameters are required for your custom YAWL service to work.
|
void |
destroy()
Receives notification when the environment is being shutdown.
|
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Override this method to provide a welcome screen for your Custom YAWL Service
For instance you could redirect to a JSP or just write typical
servlet doGet() code inside your subclass.
|
AuthenticationConfig |
getAuthenticationConfig()
Gets a reference to the authentication configuration for the local service (if any)
|
WorkItemRecord |
getCachedWorkItem(java.lang.String workItemID)
Gets a locally stored copy of a work item.
|
java.util.List<WorkItemRecord> |
getChildren(java.lang.String workItemID,
java.lang.String sessionHandle)
Retrieve a list of all the child work items for a given parent work item
|
WorkItemRecord |
getEngineStoredWorkItem(java.lang.String workItemID,
java.lang.String sessionHandle)
Gets a copy of a workitem form the engine's cache
|
IBControllerCache |
getIBCache() |
IBControllerCache |
getModel()
Deprecated.
use getIBCache() instead
|
protected Element |
getResourcingSpecs(YSpecificationID specID,
java.lang.String taskID,
java.lang.String sessionHandle)
Retrieve the resourcing specifications for a given task
|
SpecificationData |
getSpecificationData(java.lang.String specID,
java.lang.String sessionHandle)
Deprecated.
superseded by getSpecificationData(YSpecificationID, String)
|
SpecificationData |
getSpecificationData(YSpecificationID specID,
java.lang.String sessionHandle)
Gets the specification data object with the spec id.
|
java.util.List<SpecificationData> |
getSpecificationPrototypesList(java.lang.String sessionHandle)
Gets a list of all specifications currently loaded in the engine
|
TaskInformation |
getTaskInformation(java.lang.String specID,
java.lang.String taskID,
java.lang.String sessionHandle)
Deprecated.
superseded by getTaskInformation(YSpecificationID, String, String)
|
TaskInformation |
getTaskInformation(YSpecificationID specID,
java.lang.String taskID,
java.lang.String sessionHandle)
Gets metadata of a task.
|
void |
handleCancelledCaseEvent(java.lang.String caseID)
Receives notification from the engine that an active case has been
cancelled.
|
abstract void |
handleCancelledWorkItemEvent(WorkItemRecord workItemRecord)
Receives notification from the engine that an active workitem has been
cancelled.
|
void |
handleCaseResumedEvent(java.lang.String caseID)
Receives notification from the engine that an active case has been
cancelled.
|
void |
handleCaseSuspendedEvent(java.lang.String caseID)
Receives notification from the engine that an active case has been
cancelled.
|
void |
handleCaseSuspendingEvent(java.lang.String caseID)
Receives notification from the engine that an active case has been
cancelled.
|
void |
handleCompleteCaseEvent(java.lang.String caseID,
java.lang.String casedata)
Receives notification from the engine that an active case has been
completed.
|
void |
handleDeadlockedCaseEvent(java.lang.String caseID,
java.lang.String tasks)
Receives notification from the engine that an active case has become
deadlocked.
|
abstract void |
handleEnabledWorkItemEvent(WorkItemRecord enabledWorkItem)
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 |
handleStartCaseEvent(YSpecificationID specID,
java.lang.String caseID,
java.lang.String launchingService,
boolean delayed)
Receives notification from the engine that a case has been started.
|
void |
handleTimerExpiryEvent(WorkItemRecord expiredWorkItem)
Receives notification from the engine that an active workitem's timer has
expired.
|
void |
handleWorkItemStatusChangeEvent(WorkItemRecord workItem,
java.lang.String oldStatus,
java.lang.String newStatus)
Receives notification from the engine that the status of a workitem has been
modified.
|
static void |
logContactError(java.io.IOException e,
java.lang.String backEndURIStr)
Logs the failure of a client to contact the YAWL engine.
|
protected Element |
prepareReplyRootElement(WorkItemRecord enabledWorkItem,
java.lang.String sessionHandle)
Utility method to prepare the reply element for checking a work item back into
the engine.
|
protected void |
setEngineLogonName(java.lang.String logonName) |
protected void |
setEngineLogonPassword(java.lang.String logonPassword) |
void |
setRemoteAuthenticationDetails(java.lang.String userName,
java.lang.String password,
java.lang.String httpProxyHost,
java.lang.String proxyPort)
If a custom service is installed outside of a firewall then you will need to
set this method once.
|
void |
setUpInterfaceBClient(java.lang.String backEndURI)
Provided that you set up the web.xml file according to the YAWL documentation
you do not need to call this method.
|
boolean |
successful(java.lang.String input)
Checks an interface return message for success .
|
protected InterfaceB_EnvironmentBasedClient _interfaceBClient
protected IBControllerCache _ibCache
protected java.lang.String _report
protected static final java.lang.String XSD_STRINGTYPE
protected static final java.lang.String XSD_ANYURI_TYPE
protected static final java.lang.String XSD_NCNAME_TYPE
protected static final java.lang.String XSD_NAMESPACE
protected java.lang.String engineLogonName
protected java.lang.String engineLogonPassword
protected org.apache.logging.log4j.Logger _logger
public InterfaceBWebsideController()
public void setUpInterfaceBClient(java.lang.String backEndURI)
backEndURI
- the uri of the engine.public abstract void handleEnabledWorkItemEvent(WorkItemRecord enabledWorkItem)
enabledWorkItem
- the enabled work itempublic abstract void handleCancelledWorkItemEvent(WorkItemRecord workItemRecord)
workItemRecord
- the cancelled work itempublic void handleCancelledCaseEvent(java.lang.String caseID)
caseID
- the id of the case that has been cancelledpublic void handleDeadlockedCaseEvent(java.lang.String caseID, java.lang.String tasks)
caseID
- the id of the case that has been cancelledtasks
- the list of deadlocked task idspublic void handleStartCaseEvent(YSpecificationID specID, java.lang.String caseID, java.lang.String launchingService, boolean delayed)
specID
- the specification id of the started casecaseID
- the id of the caselaunchingService
- the uri (String) of the service that started the casedelayed
- true if this is a delayed case start, false if immediatepublic void handleCompleteCaseEvent(java.lang.String caseID, java.lang.String casedata)
caseID
- the id of the completed case.casedata
- the set of net-level data for the case when it completespublic void handleTimerExpiryEvent(WorkItemRecord expiredWorkItem)
expiredWorkItem
- the workitem that has an expired timerpublic void handleEngineInitialisationCompletedEvent()
public void handleWorkItemStatusChangeEvent(WorkItemRecord workItem, java.lang.String oldStatus, java.lang.String newStatus)
workItem
- the work item that has had its status modifiedoldStatus
- the work item's previous statusnewStatus
- the work item's new statuspublic void handleCaseSuspendingEvent(java.lang.String caseID)
caseID
- the id of the case that has been cancelledpublic void handleCaseSuspendedEvent(java.lang.String caseID)
caseID
- the id of the case that has been cancelledpublic void handleCaseResumedEvent(java.lang.String caseID)
caseID
- the id of the case that has been cancelledpublic void destroy()
public YParameter[] describeRequiredParams()
public void setRemoteAuthenticationDetails(java.lang.String userName, java.lang.String password, java.lang.String httpProxyHost, java.lang.String proxyPort)
userName
- mandatorypassword
- mandatoryhttpProxyHost
- optional (if using a non authenticating proxy firewall).proxyPort
- optional (if using a non authenticating proxy firewall).protected void setEngineLogonName(java.lang.String logonName)
protected void setEngineLogonPassword(java.lang.String logonPassword)
public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException
request
- the requestresponse
- the response.java.io.IOException
- if an error is detected when the servlet handles the GET requestjavax.servlet.ServletException
- if the request for the GET could not be handledpublic boolean checkConnection(java.lang.String sessionHandle) throws java.io.IOException
sessionHandle
- the session handlejava.io.IOException
- if a connection with the engine cannot be established.public java.lang.String connect(java.lang.String userID, java.lang.String password) throws java.io.IOException
userID
- the userIDpassword
- the password.java.io.IOException
- if a connection with the engine cannot be established.public WorkItemRecord checkOut(java.lang.String workItemID, java.lang.String sessionHandle) throws java.io.IOException, YAWLException
workItemID
- the work item id.sessionHandle
- a valid session handlejava.io.IOException
- if a connection with the engine cannot be established.YAWLException
- if the checkout was unsuccessfulpublic java.lang.String checkInWorkItem(java.lang.String workItemID, java.lang.String inputData, java.lang.String outputData, java.lang.String sessionHandle) throws java.io.IOException, JDOMException
workItemID
- the work item id.inputData
- the input data.outputData
- the output data.sessionHandle
- the session handle.java.io.IOException
- if there is a problem contacting the engine.JDOMException
- if there is a problem parsing XML of input or output datapublic java.lang.String checkInWorkItem(java.lang.String workItemID, Element inputData, Element outputData, java.lang.String sessionHandle) throws java.io.IOException, JDOMException
workItemID
- the work item id.inputData
- the input data as an XML String.outputData
- the output data as an XML StringsessionHandle
- a valid session handlejava.io.IOException
- if there is a problem contacting the engine.JDOMException
- if there is a problem parsing XML of input or output datapublic java.lang.String checkInWorkItem(java.lang.String workItemID, Element inputData, Element outputData, java.lang.String logPredicate, java.lang.String sessionHandle) throws java.io.IOException, JDOMException
workItemID
- the work item id.inputData
- the input data as an XML String.outputData
- the output data as an XML StringlogPredicate
- a configurable logging string to be logged when the item
completes. May be a simple string or an xml'd YLogDataItemList object.sessionHandle
- a valid session handlejava.io.IOException
- if there is a problem contacting the engine.JDOMException
- if there is a problem parsing XML of input or output datapublic WorkItemRecord getCachedWorkItem(java.lang.String workItemID)
workItemID
- the id of the workitem to retrievepublic WorkItemRecord getEngineStoredWorkItem(java.lang.String workItemID, java.lang.String sessionHandle) throws java.io.IOException
workItemID
- the id of the workitem to retrievesessionHandle
- a valid sesion handlejava.io.IOException
- if there is a problem contacting the engine.public TaskInformation getTaskInformation(java.lang.String specID, java.lang.String taskID, java.lang.String sessionHandle) throws java.io.IOException
specID
- the specification idtaskID
- the task idsessionHandle
- a valid session handlejava.io.IOException
- if there is a problem contacting the engine.public TaskInformation getTaskInformation(YSpecificationID specID, java.lang.String taskID, java.lang.String sessionHandle) throws java.io.IOException
specID
- the specification idtaskID
- the task idsessionHandle
- a valid session handlejava.io.IOException
- if there is a problem contacting the engine.public IBControllerCache getModel()
public IBControllerCache getIBCache()
public AuthenticationConfig getAuthenticationConfig()
public java.util.List<WorkItemRecord> getChildren(java.lang.String workItemID, java.lang.String sessionHandle) throws java.io.IOException
workItemID
- the id of the parent workitemsessionHandle
- a valid session handlejava.io.IOException
- if there is a problem contacting the engine.public static void logContactError(java.io.IOException e, java.lang.String backEndURIStr)
e
- the thrown exceptionbackEndURIStr
- the uri of the enginepublic boolean successful(java.lang.String input)
input
- the return messagepublic java.util.List<SpecificationData> getSpecificationPrototypesList(java.lang.String sessionHandle) throws java.io.IOException
sessionHandle
- a valid session handlejava.io.IOException
- if there is a problem contacting the engine.public SpecificationData getSpecificationData(java.lang.String specID, java.lang.String sessionHandle) throws java.io.IOException
specID
- the specification idsessionHandle
- a valid session handlejava.io.IOException
- if there is a problem contacting the engine.public SpecificationData getSpecificationData(YSpecificationID specID, java.lang.String sessionHandle) throws java.io.IOException
specID
- the specification idsessionHandle
- a valid session handlejava.io.IOException
- if there is a problem contacting the engine.protected java.util.List<WorkItemRecord> checkOutAllInstancesOfThisTask(WorkItemRecord enabledWorkItem, java.lang.String sessionHandle) throws java.io.IOException, YAWLException
enabledWorkItem
- an enabled WorkItemRecord.sessionHandle
- a valid session handle with the engine.java.io.IOException
- if there is a problem communicating with the engine.YAWLException
- if the checkout is unsuccessfulprotected Element prepareReplyRootElement(WorkItemRecord enabledWorkItem, java.lang.String sessionHandle) throws java.io.IOException
enabledWorkItem
- the enabled work item.sessionHandle
- the session handlejava.io.IOException
- if there is a problem communicating with the engine.protected Element getResourcingSpecs(YSpecificationID specID, java.lang.String taskID, java.lang.String sessionHandle) throws java.io.IOException
specID
- the specification idtaskID
- the task idsessionHandle
- a valid sessionhandlejava.io.IOException
- if there is a problem communicating with the engine.Copyright © 2004-2014 The YAWL Foundation.