org.yawlfoundation.yawl.engine.interfce.interfaceB
Class InterfaceB_EnvironmentBasedClient

java.lang.Object
  extended by org.yawlfoundation.yawl.engine.interfce.Interface_Client
      extended by org.yawlfoundation.yawl.engine.interfce.interfaceB.InterfaceB_EnvironmentBasedClient

public class InterfaceB_EnvironmentBasedClient
extends Interface_Client

An API for custom services to call Engine functionalities regarding workitem management, process progression and case state.

Author:
Lachlan Aldred, Michael Adams (refactored for v2.0)
Created/Last Date:
27/01/2004

Constructor Summary
InterfaceB_EnvironmentBasedClient(String backEndURIStr)
          Constructor.
 
Method Summary
 String cancelCase(String caseID, String sessionHandle)
          Cancels the case with caseID.
 String checkConnection(String sessionHandle)
          Checks whether the connection with the engine is alive, authenticated properly.
 String checkInWorkItem(String workItemID, String data, String sessionHandle)
          Deprecated. since 2.1 - use checkInWorkItem(String, String, String, String) instead Checks the work item back into the engine once the task is complete. Succesfully doing so will cause the work item to be completed in the engine.
 String checkInWorkItem(String workItemID, String data, String logPredicate, String sessionHandle)
          Checks the work item back into the engine once the task is complete.
 String checkOutWorkItem(String workItemID, String sessionHandle)
          Allow a client to obtain ownership of a unit of work.
 String checkPermissionToAddInstances(String workItemID, String sessionHandle)
          Determines whether or not a task will allow a dynamically created new instance to be created.
 String connect(String userID, String password)
          Connects the user to the engine.
 String createNewInstance(String workItemID, String paramValueForMICreation, String sessionHandle)
          Creates a new instance of a multi instance task.
 String getAllRunningCases(String sessionHandle)
           
 String getBackEndURI()
           
 String getCaseData(String caseID, String sessionHandle)
          Gets the data of the case
 String getCaseInstanceSummary(String sessionHandle)
          Gets a summary table of all currently live process instances
 String getCases(String specID, String sessionHandle)
          Deprecated. superseded by getCases(YSpecificationID, String)
 String getCases(YSpecificationID specID, String sessionHandle)
          Gets the set of active cases in the engine.
 String getCaseState(String caseID, String sessionHandle)
          Gets the state description of the case
 List<WorkItemRecord> getChildrenOfWorkItem(String workItemID, String sessionHandle)
          Finds out the children of a given work item.
 List<WorkItemRecord> getCompleteListOfLiveWorkItems(String sessionHandle)
          Returns a list (of WorkItemRecord) of all the work items that are currently active in the engine.
 String getCompleteListOfLiveWorkItemsAsXML(String sessionHandle)
          Returns an XML string describing all the work items that are currently active in the engine.
 List<WorkItemRecord> getLiveWorkItemsForIdentifier(String idType, String id, String sessionHandle)
          Retrieves a List of live workitems for the case or spec id passed
 String getLiveWorkItemsForIdentifierAsXML(String idType, String id, String sessionHandle)
          Retrieves an XML description of live workitems for the case or spec id passed
 String getMITaskAttributes(String specID, String taskID, String sessionHandle)
          Deprecated. superseded by getMITaskAttributes(YSpecificationID, String, String) - this version should be used for pre-2.0 schema-based specifications only
 String getMITaskAttributes(YSpecificationID specID, String taskID, String sessionHandle)
          Gets an XML representation of the attributes of a multi-instance task.
 String getParameterInstanceSummary(String caseID, String itemID, String sessionHandle)
          Gets a summary table of all data parameters for the workitem of the case specified
 String getResourcingSpecs(YSpecificationID specID, String taskID, String sessionHandle)
          Gets the set of resourcing specifications for the specified task of the specified spec
 String getSpecification(String specID, String sessionHandle)
          Deprecated. superseded by getSpecification(YSpecificationID, String)
 String getSpecification(YSpecificationID specID, String sessionHandle)
          Gets an XML representation of a workflow specification.
 String getSpecificationDataSchema(String specID, String sessionHandle)
          Deprecated. superseded by getSpecificationDataSchema(YSpecificationID, String)
 String getSpecificationDataSchema(YSpecificationID specID, String sessionHandle)
          Gets the user-defined data schema for a specification
 String getSpecificationForCase(String caseID, String sessionHandle)
          Gets an XML representation of a workflow specification for a specified, currently executing case.
 List<SpecificationData> getSpecificationList(String sessionHandle)
          Creates a list of SpecificationData objects for the specifications currently loaded into the engine.
 String getTaskInformationStr(String specID, String taskID, String sessionHandle)
          Deprecated. superseded by getTaskInformationStr(YSpecificationID, String, String) - this version should be used for pre-2.0 schema-based specifications only
 String getTaskInformationStr(YSpecificationID specID, String taskID, String sessionHandle)
          Gets an XML representation of information the task declaration.
 String getWorkItem(String itemID, String sessionHandle)
          Returns an XML string describing all a current work item.
 long getWorkItemExpiryTime(String itemID, String sessionHandle)
          Returns the expiry time of a work item's timer.
 String getWorkItemInstanceSummary(String caseID, String sessionHandle)
          Gets a summary table of all completed and live workitems for a case
 List<WorkItemRecord> getWorkItemsForCase(String caseID, String sessionHandle)
          Returns the current set of active workitems for a case
 List<WorkItemRecord> getWorkItemsForService(String serviceURI, String sessionHandle)
          Returns the current set of active workitems that are associated with a specified custom service
 List<WorkItemRecord> getWorkItemsForSpecification(String specName, String sessionHandle)
          Returns the current set of active workitems for a specification
 List<WorkItemRecord> getWorkItemsForTask(String taskID, String sessionHandle)
          Returns the current set of active workitems that are instances of a specified task
 boolean isAdministrator(String sessionHandle)
          Checks if the session has administrative access
 String launchCase(String specID, String caseParams, String sessionHandle)
          Deprecated. superseded by launchCase(YSpecificationID, String, String)
 String launchCase(String specID, String caseParams, String sessionHandle, String completionObserverURI)
          Deprecated. superseded by launchCase(YSpecificationID, String, String)
 String launchCase(YSpecificationID specID, String caseParams, String sessionHandle, YLogDataItemList logData, String completionObserverURI)
          Override of launchCase to provide the ability to add a listener for the Case-Completion event
 String launchCase(YSpecificationID specID, String caseParams, String sessionHandle, YLogDataItemList logData, String completionObserverURI, Date start)
           
 String launchCase(YSpecificationID specID, String caseParams, String sessionHandle, YLogDataItemList logData, String completionObserverURI, Duration wait)
           
 String launchCase(YSpecificationID specID, String caseParams, String sessionHandle, YLogDataItemList logData, String completionObserverURI, long mSec)
           
 String launchCase(YSpecificationID specID, String caseParams, YLogDataItemList logData, String sessionHandle)
          Launches a case instance of the latest version of the specification loaded.
 TaskInformation parseTaskInformation(String taskInfoStr)
          Parses the XML string and returns a TaskInfo object (easier to manage).
 String postToExternalURL(String url, Map<String,String> params)
          A generic method for sending a HTTP POST message, with parameters, to a URL external to the standard YAWL environment
 String rejectAnnouncedEnabledTask(String workItemID, String sessionHandle)
           
 String rollbackWorkItem(String workItemID, String sessionHandle)
          Rolls back a work item, from 'executing' to 'fired' status.
 String skipWorkItem(String workItemID, String sessionHandle)
          Skips a work item.
 String stripOuterElement(String xml)
          Removes the outermost set of xml tags from a string, if any
 String suspendWorkItem(String workItemID, String sessionHandle)
          Suspends a work item.
 String unsuspendWorkItem(String workItemID, String sessionHandle)
          Unuspends a work item.
 
Methods inherited from class org.yawlfoundation.yawl.engine.interfce.Interface_Client
executeGet, executePost, prepareParamMap, setReadTimeout, successful
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InterfaceB_EnvironmentBasedClient

public InterfaceB_EnvironmentBasedClient(String backEndURIStr)
Constructor.

Parameters:
backEndURIStr - the back end uri of where to find the engine. A default deployment this value is http://localhost:8080/yawl/ib
Method Detail

getBackEndURI

public String getBackEndURI()

connect

public String connect(String userID,
                      String password)
               throws IOException
Connects the user to the engine.

Parameters:
userID - the user id.
password - the user password
Returns:
the session handle
Throws:
IOException - if engine cannot be found

getCompleteListOfLiveWorkItems

public List<WorkItemRecord> getCompleteListOfLiveWorkItems(String sessionHandle)
                                                    throws IOException
Returns a list (of WorkItemRecord) of all the work items that are currently active in the engine.

Parameters:
sessionHandle - the session handle
Returns:
the list of WorkItemRecord objects
Throws:
IOException - if engine can't be found.
See Also:
WorkItemRecord

getCompleteListOfLiveWorkItemsAsXML

public String getCompleteListOfLiveWorkItemsAsXML(String sessionHandle)
                                           throws IOException
Returns an XML string describing all the work items that are currently active in the engine.

Parameters:
sessionHandle - the session handle
Returns:
an XML representation of the set of live workitems
Throws:
IOException - if engine can't be found.

getWorkItem

public String getWorkItem(String itemID,
                          String sessionHandle)
                   throws IOException
Returns an XML string describing all a current work item.

Parameters:
itemID - the workitem id
sessionHandle - the session handle
Returns:
an XML representation of the of workitem
Throws:
IOException - if engine can't be found.

getWorkItemExpiryTime

public long getWorkItemExpiryTime(String itemID,
                                  String sessionHandle)
                           throws IOException
Returns the expiry time of a work item's timer.

Parameters:
itemID - the workitem id
sessionHandle - the session handle
Returns:
a long value representing the moment the timer will expire, or 0 if the work item does not have a timer or does not exist
Throws:
IOException - if engine can't be found.

getWorkItemsForCase

public List<WorkItemRecord> getWorkItemsForCase(String caseID,
                                                String sessionHandle)
                                         throws IOException
Returns the current set of active workitems for a case

Parameters:
caseID - the case in question
sessionHandle - the session handle
Returns:
a list of live workitems (as WorkItemRecords)
Throws:
IOException - if engine can't be found.

getWorkItemsForSpecification

public List<WorkItemRecord> getWorkItemsForSpecification(String specName,
                                                         String sessionHandle)
                                                  throws IOException
Returns the current set of active workitems for a specification

Parameters:
specName - the specification in question
sessionHandle - the session handle
Returns:
a list of live workitems (as WorkItemRecords)
Throws:
IOException - if engine can't be found.

getWorkItemsForTask

public List<WorkItemRecord> getWorkItemsForTask(String taskID,
                                                String sessionHandle)
                                         throws IOException
Returns the current set of active workitems that are instances of a specified task

Parameters:
taskID - the task in question
sessionHandle - the session handle
Returns:
a list of live workitems (as WorkItemRecords)
Throws:
IOException - if engine can't be found.

getLiveWorkItemsForIdentifier

public List<WorkItemRecord> getLiveWorkItemsForIdentifier(String idType,
                                                          String id,
                                                          String sessionHandle)
                                                   throws IOException,
                                                          org.jdom.JDOMException
Retrieves a List of live workitems for the case or spec id passed

Parameters:
idType - : "case" for a case's workitems, "spec" for a specification's, "task" for a specific taskID
id - the identifier for the case/spec/task
sessionHandle - the session handle
Returns:
the List of live workitems (as WorkItemRecords)
Throws:
IOException - if there's a problem connecting to the engine
org.jdom.JDOMException - if there's a problem with xml conversions

getWorkItemsForService

public List<WorkItemRecord> getWorkItemsForService(String serviceURI,
                                                   String sessionHandle)
                                            throws IOException
Returns the current set of active workitems that are associated with a specified custom service

Parameters:
serviceURI - the uri of the service in question
sessionHandle - the session handle
Returns:
a list of live workitems (as WorkItemRecords)
Throws:
IOException - if engine can't be found.

getLiveWorkItemsForIdentifierAsXML

public String getLiveWorkItemsForIdentifierAsXML(String idType,
                                                 String id,
                                                 String sessionHandle)
                                          throws IOException,
                                                 org.jdom.JDOMException
Retrieves an XML description of live workitems for the case or spec id passed

Parameters:
idType - : "case" for a case's workitems, "spec" for a specification's, "task" for a specific taskID
id - the identifier for the case/spec/task
sessionHandle - the session handle
Returns:
the XML representation of live workitems in the engine
Throws:
IOException - if there's a problem connecting to the engine
org.jdom.JDOMException - if there's a problem with xml conversions

getSpecificationList

public List<SpecificationData> getSpecificationList(String sessionHandle)
                                             throws IOException
Creates a list of SpecificationData objects for the specifications currently loaded into the engine. These are brief meta data summary information objects that describe a worklfow specification.

Parameters:
sessionHandle - the session handle
Returns:
the list of spec data objects
Throws:
IOException - if engine can't be found.

getSpecification

public String getSpecification(String specID,
                               String sessionHandle)
                        throws IOException
Deprecated. superseded by getSpecification(YSpecificationID, String)

Gets an XML representation of a workflow specification.

Parameters:
specID - the specid.
sessionHandle - the session handle
Returns:
the XML representation, or an XML diagnostic error message.
Throws:
IOException - if the engine can't be found.

getSpecification

public String getSpecification(YSpecificationID specID,
                               String sessionHandle)
                        throws IOException
Gets an XML representation of a workflow specification.

Parameters:
specID - the specid.
sessionHandle - the session handle
Returns:
the XML representation, or an XML diagnostic error message.
Throws:
IOException - if the engine can't be found.

getSpecificationForCase

public String getSpecificationForCase(String caseID,
                                      String sessionHandle)
                               throws IOException
Gets an XML representation of a workflow specification for a specified, currently executing case.

Parameters:
caseID - the identifier of a currently executing case.
sessionHandle - the session handle
Returns:
the XML representation, or an XML diagnostic error message.
Throws:
IOException - if the engine can't be found.

getSpecificationDataSchema

public String getSpecificationDataSchema(String specID,
                                         String sessionHandle)
                                  throws IOException
Deprecated. superseded by getSpecificationDataSchema(YSpecificationID, String)

Gets the user-defined data schema for a specification

Parameters:
specID - the specification id
sessionHandle - an active session handle
Returns:
an XML representation, or an XML diagnostic error message.
Throws:
IOException - if the engine can't be found.

getSpecificationDataSchema

public String getSpecificationDataSchema(YSpecificationID specID,
                                         String sessionHandle)
                                  throws IOException
Gets the user-defined data schema for a specification

Parameters:
specID - the specification id
sessionHandle - an active session handle
Returns:
an XML representation, or an XML diagnostic error message.
Throws:
IOException - if the engine can't be found.

checkOutWorkItem

public String checkOutWorkItem(String workItemID,
                               String sessionHandle)
                        throws IOException
Allow a client to obtain ownership of a unit of work. This means that the workitem must be enabled or fired first, and that upon successful checkout the workitem will be exectuing.

Parameters:
workItemID - the workitem id.
sessionHandle - the sessionhandle
Returns:
in case of success returns a WorkItemRecord object of the created workitem. In case of failure returns a diagnostic XML message.
Throws:
IOException - if the engine can't be found.

rejectAnnouncedEnabledTask

public String rejectAnnouncedEnabledTask(String workItemID,
                                         String sessionHandle)
                                  throws IOException
Throws:
IOException

getTaskInformationStr

public String getTaskInformationStr(String specID,
                                    String taskID,
                                    String sessionHandle)
                             throws IOException
Deprecated. superseded by getTaskInformationStr(YSpecificationID, String, String) - this version should be used for pre-2.0 schema-based specifications only

Gets an XML representation of information the task declaration. This can be parsed into a copy of a YTask

Parameters:
specID - the spec id.
taskID - the task id.
sessionHandle - the session handle
Returns:
an XML Representation of the task information
Throws:
IOException - if the engine can't be found.

getTaskInformationStr

public String getTaskInformationStr(YSpecificationID specID,
                                    String taskID,
                                    String sessionHandle)
                             throws IOException
Gets an XML representation of information the task declaration. This can be parsed into a copy of a YTask

Parameters:
specID - the spec id.
taskID - the task id.
sessionHandle - the session handle
Returns:
an XML Representation of the task information
Throws:
IOException - if the engine can't be found.

checkConnection

public String checkConnection(String sessionHandle)
                       throws IOException
Checks whether the connection with the engine is alive, authenticated properly.

Parameters:
sessionHandle - the session handle
Returns:
a diagnostic message indicating connection state.
Throws:
IOException - if engine cannot be found.

checkInWorkItem

public String checkInWorkItem(String workItemID,
                              String data,
                              String logPredicate,
                              String sessionHandle)
                       throws IOException
Checks the work item back into the engine once the task is complete. Succesfully doing so will cause the work item to be completed in the engine.

Parameters:
workItemID - the work item id.
data - formated data eg. value
logPredicate - configurable logging string to be logged with the checkin
sessionHandle - the session handle
Returns:
in case success returns the work item as xml. In case of failure returns the reason for failure.
Throws:
IOException - if engine cannot be found.

checkInWorkItem

public String checkInWorkItem(String workItemID,
                              String data,
                              String sessionHandle)
                       throws IOException
Deprecated. since 2.1 - use checkInWorkItem(String, String, String, String) instead Checks the work item back into the engine once the task is complete. Succesfully doing so will cause the work item to be completed in the engine.

Parameters:
workItemID - the work item id.
data - formated data eg. value
sessionHandle - the session handle
Returns:
in case success returns the work item as xml. In case of failure returns the reason for failure.
Throws:
IOException - if engine cannot be found.

checkPermissionToAddInstances

public String checkPermissionToAddInstances(String workItemID,
                                            String sessionHandle)
                                     throws IOException
Determines whether or not a task will allow a dynamically created new instance to be created.

Parameters:
workItemID - the workItemID of a sibling work item.
sessionHandle - the session handle
Returns:
diagnostic message that should indicate permission if task is MultiInstance, and if task allows dynamic instance creation, and if current number of instances is less than the maxInstances for the task.
Throws:
IOException - if engine cannot be found if task does not allow dynamic instance creation, or if current number of instances is not less than the maxInstances for the task.
Precondition:
the 'parent' task is a MultiInstance Task with dynamic instance creation.

createNewInstance

public String createNewInstance(String workItemID,
                                String paramValueForMICreation,
                                String sessionHandle)
                         throws IOException
Creates a new instance of a multi instance task.

Parameters:
workItemID - the work item id of a sibling workitem
paramValueForMICreation - the data needed for creating a new instance.
sessionHandle - the session handle
Returns:
diagnostic string indicating result of action
Throws:
IOException - if engine cannot be found.
Precondition:
the referenced task is multi-instance and allows dynamic creation

skipWorkItem

public String skipWorkItem(String workItemID,
                           String sessionHandle)
                    throws IOException
Skips a work item.

Parameters:
workItemID - the work item id.
sessionHandle - the sessoin handle
Returns:
diagnostic XML message
Throws:
IOException - if the engine can't be found.

suspendWorkItem

public String suspendWorkItem(String workItemID,
                              String sessionHandle)
                       throws IOException
Suspends a work item.

Parameters:
workItemID - the work item id.
sessionHandle - the sessoin handle
Returns:
diagnostic XML message
Throws:
IOException - if the engine can't be found.

unsuspendWorkItem

public String unsuspendWorkItem(String workItemID,
                                String sessionHandle)
                         throws IOException
Unuspends a work item.

Parameters:
workItemID - the work item id.
sessionHandle - the sessoin handle
Returns:
diagnostic XML message
Throws:
IOException - if the engine can't be found.

rollbackWorkItem

public String rollbackWorkItem(String workItemID,
                               String sessionHandle)
                        throws IOException
Rolls back a work item, from 'executing' to 'fired' status.

Parameters:
workItemID - the work item id.
sessionHandle - the sessoin handle
Returns:
diagnostic XML message
Throws:
IOException - if the engine can't be found.

launchCase

public String launchCase(String specID,
                         String caseParams,
                         String sessionHandle)
                  throws IOException
Deprecated. superseded by launchCase(YSpecificationID, String, String)

Launches a case instance of the latest version of the specification loaded.

Parameters:
specID - the specification id (see SpecificationData.getID())
caseParams - the case params in XML. i.e.
    <data>
        <firstParam>value</firstParam>
        <secondParam>value</secondParam>
    </data>
 
If there are no case params then null should be passed.
sessionHandle - the session handle
Returns:
returns a diagnostic message in case of failure
Throws:
IOException - if engine can't be found

launchCase

public String launchCase(YSpecificationID specID,
                         String caseParams,
                         YLogDataItemList logData,
                         String sessionHandle)
                  throws IOException
Launches a case instance of the latest version of the specification loaded.

Parameters:
specID - the specification id
caseParams - the case params in XML. i.e.
    <data>
        <firstParam>value</firstParam>
        <secondParam>value</secondParam>
    </data>
 
If there are no case params then null should be passed.
sessionHandle - the session handle
Returns:
returns a diagnostic message in case of failure
Throws:
IOException - if engine can't be found

launchCase

public String launchCase(String specID,
                         String caseParams,
                         String sessionHandle,
                         String completionObserverURI)
                  throws IOException
Deprecated. superseded by launchCase(YSpecificationID, String, String)

Override of launchCase to provide the ability to add a listener for the Case-Completion event

Parameters:
specID - the specification id (see SpecificationData.getID())
caseParams - the case params in XML.
sessionHandle - the session handle
completionObserverURI - the URI of the IB service that will listen for a case-completed event
Returns:
returns a diagnostic message in case of failure
Throws:
IOException - if engine can't be found

launchCase

public String launchCase(YSpecificationID specID,
                         String caseParams,
                         String sessionHandle,
                         YLogDataItemList logData,
                         String completionObserverURI)
                  throws IOException
Override of launchCase to provide the ability to add a listener for the Case-Completion event

Parameters:
specID - the specification id
caseParams - the case params in XML.
sessionHandle - the session handle
completionObserverURI - the URI of the IB service that will listen for a case-completed event
Returns:
returns a diagnostic message in case of failure
Throws:
IOException - if engine can't be found

launchCase

public String launchCase(YSpecificationID specID,
                         String caseParams,
                         String sessionHandle,
                         YLogDataItemList logData,
                         String completionObserverURI,
                         long mSec)
                  throws IOException
Throws:
IOException

launchCase

public String launchCase(YSpecificationID specID,
                         String caseParams,
                         String sessionHandle,
                         YLogDataItemList logData,
                         String completionObserverURI,
                         Date start)
                  throws IOException
Throws:
IOException

launchCase

public String launchCase(YSpecificationID specID,
                         String caseParams,
                         String sessionHandle,
                         YLogDataItemList logData,
                         String completionObserverURI,
                         Duration wait)
                  throws IOException
Throws:
IOException

getCases

public String getCases(String specID,
                       String sessionHandle)
                throws IOException
Deprecated. superseded by getCases(YSpecificationID, String)

Gets the set of active cases in the engine.

Parameters:
specID - the specification id.
sessionHandle - the session handle
Returns:
an XML list of case ids that are instances of the spec with specid.
Throws:
IOException - if engine cannot be found

getCases

public String getCases(YSpecificationID specID,
                       String sessionHandle)
                throws IOException
Gets the set of active cases in the engine.

Parameters:
specID - the specification id.
sessionHandle - the session handle
Returns:
an XML list of case ids that are instances of the spec with specid.
Throws:
IOException - if engine cannot be found

getAllRunningCases

public String getAllRunningCases(String sessionHandle)
                          throws IOException
Throws:
IOException

getCaseState

public String getCaseState(String caseID,
                           String sessionHandle)
                    throws IOException
Gets the state description of the case

Parameters:
caseID - the case id.
sessionHandle - the session handle
Returns:
An XML representation of the case state, or a diagnostic error message.
Throws:
IOException - if engine cannot be found

getCaseData

public String getCaseData(String caseID,
                          String sessionHandle)
                   throws IOException
Gets the data of the case

Parameters:
caseID - the case id.
sessionHandle - the session handle
Returns:
An XML representation of the case data, or a diagnostic error message.
Throws:
IOException - if engine cannot be found

cancelCase

public String cancelCase(String caseID,
                         String sessionHandle)
                  throws IOException
Cancels the case with caseID.

Parameters:
caseID - the case id.
sessionHandle - the session handle
Returns:
a diagnostic string providing information about the result of cancellation.
Throws:
IOException - if the engine cannot be found.

getChildrenOfWorkItem

public List<WorkItemRecord> getChildrenOfWorkItem(String workItemID,
                                                  String sessionHandle)
                                           throws IOException
Finds out the children of a given work item. Only work items that are parents have children.

Parameters:
workItemID - the work item id of the parent workitem.
sessionHandle - the session handle
Returns:
a Java.util.List of WorkItemRecord objects.
Throws:
IOException - if the engine cannot be found.

parseTaskInformation

public TaskInformation parseTaskInformation(String taskInfoStr)
Parses the XML string and returns a TaskInfo object (easier to manage).

Parameters:
taskInfoStr - the task information String
Returns:
the TaskInformation object
See Also:
getTaskInformationStr(YSpecificationID, String, String)

isAdministrator

public boolean isAdministrator(String sessionHandle)
                        throws IOException
Checks if the session has administrative access

Parameters:
sessionHandle - the session to check
Returns:
true if this session has administration privileges
Throws:
IOException - if the engine cannot be found.

getMITaskAttributes

public String getMITaskAttributes(String specID,
                                  String taskID,
                                  String sessionHandle)
                           throws IOException
Deprecated. superseded by getMITaskAttributes(YSpecificationID, String, String) - this version should be used for pre-2.0 schema-based specifications only

Gets an XML representation of the attributes of a multi-instance task.

Parameters:
specID - the spec id.
taskID - the task id.
sessionHandle - the session handle
Returns:
an XML Representation of the task information
Throws:
IOException - if the engine cannot be found.

getMITaskAttributes

public String getMITaskAttributes(YSpecificationID specID,
                                  String taskID,
                                  String sessionHandle)
                           throws IOException
Gets an XML representation of the attributes of a multi-instance task.

Parameters:
specID - the spec id.
taskID - the task id.
sessionHandle - the session handle
Returns:
an XML Representation of the task information
Throws:
IOException - if the engine cannot be found.

getResourcingSpecs

public String getResourcingSpecs(YSpecificationID specID,
                                 String taskID,
                                 String sessionHandle)
                          throws IOException
Gets the set of resourcing specifications for the specified task of the specified spec

Parameters:
specID - the specification id
taskID - the id of the task to get the resourcing specs for
sessionHandle - the session handle
Returns:
an XML Representation of the resourcing information for the task
Throws:
IOException - if the engine cannot be found.

getCaseInstanceSummary

public String getCaseInstanceSummary(String sessionHandle)
                              throws IOException
Gets a summary table of all currently live process instances

Parameters:
sessionHandle - the session handle
Returns:
an XML Representation of live processes
Throws:
IOException - if the engine cannot be found.

getWorkItemInstanceSummary

public String getWorkItemInstanceSummary(String caseID,
                                         String sessionHandle)
                                  throws IOException
Gets a summary table of all completed and live workitems for a case

Parameters:
caseID - the case id of the process to get the workitems for
sessionHandle - the session handle
Returns:
an XML Representation of workitems for a live case
Throws:
IOException - if the engine cannot be found.

getParameterInstanceSummary

public String getParameterInstanceSummary(String caseID,
                                          String itemID,
                                          String sessionHandle)
                                   throws IOException
Gets a summary table of all data parameters for the workitem of the case specified

Parameters:
caseID - the case id of the process to get the workitems for
itemID - the id of the workitem to get the data params for
sessionHandle - the session handle
Returns:
an XML Representation of parameters for a workitem
Throws:
IOException - if the engine cannot be found.

postToExternalURL

public String postToExternalURL(String url,
                                Map<String,String> params)
                         throws IOException
A generic method for sending a HTTP POST message, with parameters, to a URL external to the standard YAWL environment

Parameters:
url - the external URL to which the message is posted
params - a map of attribute-value pairs to post with the message
Returns:
a reply string from the external URL
Throws:
IOException - if the external URL is invalid or unresponsive.

stripOuterElement

public String stripOuterElement(String xml)
Description copied from class: Interface_Client
Removes the outermost set of xml tags from a string, if any

Overrides:
stripOuterElement in class Interface_Client
Parameters:
xml - the xml string to strip
Returns:
the stripped xml string


Copyright © 2004-2012 The YAWL Foundation.