Enterprise Information Portal APIs

com.ibm.mm.sdk.server
Class DKWorkFlowServiceFed

java.lang.Object
  |
  +--com.ibm.mm.sdk.server.dkAbstractService
        |
        +--com.ibm.mm.sdk.server.DKWorkFlowServiceFed
All Implemented Interfaces:
DKConstant, DKConstantFed, DKMessageId, DKMessageIdFed, dkService, dkWorkFlowServiceFed

public class DKWorkFlowServiceFed
extends dkAbstractService
implements dkWorkFlowServiceFed, DKConstantFed, DKMessageIdFed

This is an implementation of workflow service for EIP that provides a set of methods for the document-based workflow.


Fields inherited from interface com.ibm.mm.sdk.common.DKConstantFed
    For details, see the class or interface
 
Fields inherited from interface com.ibm.mm.sdk.common.DKConstant
    For details, see the class or interface
 
Fields inherited from interface com.ibm.mm.sdk.common.DKMessageIdFed
    For details, see the class or interface
 
Fields inherited from interface com.ibm.mm.sdk.common.DKMessageId
    For details, see the class or interface
 
Constructor Summary
DKWorkFlowServiceFed()
          Constructs a new DKWorkFlowServiceFed object.
DKWorkFlowServiceFed(java.lang.String configuration)
          Constructs a new DKWorkFlowServiceFed object with configuration.
 
Method Summary
 void addExtension(java.lang.String extensionName, dkExtension extensionObj)
          Adds a new extension object.
 void connect(java.lang.String service_name, java.lang.String user_name, java.lang.String authentication, java.lang.String connect_string)
          Connects to the named workflow service with user name, authentication, and connect string information.
 DKHandle connection()
          Returns the connection handle of the workflow service.
 void disconnect()
          Disconnects from the workflow service.
 dkDatastore getDatastore()
          Gets the reference to the associated datastore object.
 dkExtension getExtension(java.lang.String extensionName)
          Gets the extension object from a given extenstion name.
 boolean isConnected()
          Returns the status of connecting to the workflow service.
 boolean isWorkFlow(java.lang.String name)
          Checks if the specified name is a workflow.
 boolean isWorkFlowTemplate(java.lang.String name)
          Checks if the specified name is a workflow template.
 boolean isWorkList(java.lang.String name)
          Checks if the specified name is a worklist.
 java.lang.String[] listExtensionNames()
          Gets the list of extension objects' names
 dkCollection listWorkFlows()
          Returns a collection of DKWorkFlowFed objects in the system.
 dkCollection listWorkFlows(java.lang.String filter, java.lang.String sort_criteria, int threshold)
          Returns a collection of DKWorkFlowFed objects in the system based on the given filter, sort criteria and threshold.
 dkCollection listWorkFlowTemplates()
          Returns a collection of DKWorkFlowTemplateFed objects in the system.
 dkCollection listWorkItems(java.lang.String filter, java.lang.String sort_criteria, int threshold)
          Returns a collection of DKWorkItemFed objects in the system based on the given filter, sort criteria and threshold.
 dkCollection listWorkLists()
          Returns a collection of DKWorkListFed objects in the system.
 void removeExtension(java.lang.String extensionName)
          Remove an existing extension object
 java.lang.String serviceCategory()
          Returns the category of the service.
 java.lang.String serviceName()
          Returns the name of the workflow service.
 java.lang.String serviceType()
          Returns the type of the workflow service.
 void setDatastore(dkDatastore ds)
          Sets the reference to the associated datastore object.
 void setServiceName(java.lang.String service_name)
          Sets the name of the service.
 void setUserName(java.lang.String user_name)
          Sets the anem of the user.
 java.lang.String userName()
          Returns the user name.
 
Methods inherited from class com.ibm.mm.sdk.server.dkAbstractService
destroy, serviceId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.mm.sdk.common.dkService
destroy, serviceId
 

Constructor Detail

DKWorkFlowServiceFed

public DKWorkFlowServiceFed()
                     throws DKException,
                            java.lang.Exception
Constructs a new DKWorkFlowServiceFed object.

This is the default constructor of DKWorkFlowServiceFed.


DKWorkFlowServiceFed

public DKWorkFlowServiceFed(java.lang.String configuration)
                     throws DKException,
                            java.lang.Exception
Constructs a new DKWorkFlowServiceFed object with configuration.

The configuration parameter is optional and reserved for future use.

Parameters:
configuration - a configuration string.
Method Detail

connect

public void connect(java.lang.String service_name,
                    java.lang.String user_name,
                    java.lang.String authentication,
                    java.lang.String connect_string)
             throws DKException,
                    java.lang.Exception
Connects to the named workflow service with user name, authentication, and connect string information.

Make sure that the same user name is used for both DKDatastoreFed and DKWorkFlowServiceFed. The setDatastore method needs to be called before connecting to the named workflow service.

 DKWorkFlowServiceFed svWF = new DKWorkFlowServiceFed (); 
 DKDatastoreFed fedDS = new DKDatastoreFed();
 fedDS.connect (wfsrv, userid, pw, "");
 svWF.setDatastore (fedDS);         
 svWF.connect (wfsrv, userid, pw, "");    
 
Specified by:
connect in interface dkService
Overrides:
connect in class dkAbstractService
Parameters:
service_name - name of the service.
user_name - user name.
authentication - authentification of the user.
connect_string - optional connection string.
Throws:
DKDatastoreError - if already connected to a workflow service.
DKUsageError - if user name is incorrenct or DKWorkFlowServieFed is null.
DKDatastoreAccessError - if having a problem connecting to a workflow service.

disconnect

public void disconnect()
                throws DKException,
                       java.lang.Exception
Disconnects from the workflow service.
Specified by:
disconnect in interface dkService
Overrides:
disconnect in class dkAbstractService
Throws:
DKDatastoreAccessError - if having a problem in disconnecting the workflow service.

serviceName

public java.lang.String serviceName()
                             throws java.lang.Exception
Returns the name of the workflow service.
Specified by:
serviceName in interface dkService
Overrides:
serviceName in class dkAbstractService
Returns:
service name.

serviceType

public java.lang.String serviceType()
                             throws java.lang.Exception
Returns the type of the workflow service.
Specified by:
serviceType in interface dkService
Overrides:
serviceType in class dkAbstractService
Returns:
service type.

serviceCategory

public java.lang.String serviceCategory()
                                 throws java.lang.Exception
Returns the category of the service.
Specified by:
serviceCategory in interface dkService
Overrides:
serviceCategory in class dkAbstractService
Returns:
service category.

userName

public java.lang.String userName()
                          throws java.lang.Exception
Returns the user name.
Specified by:
userName in interface dkService
Overrides:
userName in class dkAbstractService
Returns:
user name.

connection

public DKHandle connection()
                    throws java.lang.Exception
Returns the connection handle of the workflow service.
Specified by:
connection in interface dkService
Overrides:
connection in class dkAbstractService
Returns:
DKHandle object.
Throws:
DKUsageError - if the DKWorkFlowServiceFed object is not connected.

isConnected

public boolean isConnected()
                    throws java.lang.Exception
Returns the status of connecting to the workflow service.
Specified by:
isConnected in interface dkService
Overrides:
isConnected in class dkAbstractService
Returns:
boolean value indicating the connection status.

setServiceName

public void setServiceName(java.lang.String service_name)
                    throws java.lang.Exception
Sets the name of the service.
Specified by:
setServiceName in interface dkService
Overrides:
setServiceName in class dkAbstractService
Parameters:
service_name - name of the service.

setUserName

public void setUserName(java.lang.String user_name)
                 throws java.lang.Exception
Sets the anem of the user.
Specified by:
setUserName in interface dkService
Overrides:
setUserName in class dkAbstractService
Parameters:
user_name - user name.

getExtension

public dkExtension getExtension(java.lang.String extensionName)
                         throws DKException,
                                java.lang.Exception
Gets the extension object from a given extenstion name.

Not implemented in this class.

Specified by:
getExtension in interface dkService
Overrides:
getExtension in class dkAbstractService
Parameters:
extensionName - name of the extension object.
Returns:
extension object.

addExtension

public void addExtension(java.lang.String extensionName,
                         dkExtension extensionObj)
                  throws DKException,
                         java.lang.Exception
Adds a new extension object.

Not implemented in this class.

Specified by:
addExtension in interface dkService
Overrides:
addExtension in class dkAbstractService
Parameters:
extensionName - name of new extension object
extensionObj - the extension object to be set

removeExtension

public void removeExtension(java.lang.String extensionName)
                     throws DKException,
                            java.lang.Exception
Remove an existing extension object

Not implemented in this class.

Specified by:
removeExtension in interface dkService
Overrides:
removeExtension in class dkAbstractService
Parameters:
extensionName - name of extension object to be removed

listExtensionNames

public java.lang.String[] listExtensionNames()
                                      throws DKException,
                                             java.lang.Exception
Gets the list of extension objects' names

Not implemented in this class.

Specified by:
listExtensionNames in interface dkService
Overrides:
listExtensionNames in class dkAbstractService
Returns:
an array of extension objects' names

getDatastore

public dkDatastore getDatastore()
                         throws java.lang.Exception
Gets the reference to the associated datastore object.
Specified by:
getDatastore in interface dkWorkFlowServiceFed
Returns:
the dkDatastore object.

setDatastore

public void setDatastore(dkDatastore ds)
                  throws DKUsageError,
                         java.lang.Exception
Sets the reference to the associated datastore object.
Specified by:
setDatastore in interface dkWorkFlowServiceFed
Parameters:
ds - datastore.

listWorkFlows

public dkCollection listWorkFlows()
                           throws DKException,
                                  java.lang.Exception
Returns a collection of DKWorkFlowFed objects in the system. Each DKWorkFlowFed object represents a workflow in EIP.

The following code assumes svWF is a connected DKWorkFlowServiceFed object.

 DKSequentialCollection coll = (DKSequentialCollection)svWF.listWorkFlows();
 
Specified by:
listWorkFlows in interface dkWorkFlowServiceFed
Returns:
a collection of DKWorkFlowFed objects.
Throws:
DKUsageError - if the DKWorkFlowServiceFed object is not connected or the workflows cannot be retrieved.

listWorkFlows

public dkCollection listWorkFlows(java.lang.String filter,
                                  java.lang.String sort_criteria,
                                  int threshold)
                           throws DKException,
                                  java.lang.Exception
Returns a collection of DKWorkFlowFed objects in the system based on the given filter, sort criteria and threshold. Each DKWorkFlowFed object represents a workflow in EIP.

The following code assumes svWF is a connected DKWorkFlowServiceFed object. The filter "NAME LIKE '*Claim*'" will query workflow name with a substring 'Claim'. The sort criteria "NAME DESC" will sort workflows by workflow name in the descending order. The threshold DK_FED_FMC_MAX_RESULTS indicates that the query will return all.

 DKSequentialCollection coll = (DKSequentialCollection)svWF.listWorkFlows("NAME LIKE '*Claim*'", 
                                                                          "NAME DESC",
                                                                          DK_FED_FMC_MAX_RESULTS);
 
Specified by:
listWorkFlows in interface dkWorkFlowServiceFed
Parameters:
filter - filter criteria for querying
sort_criteria - sort criteria for sorting
threshold - number of returned results (DK_FED_FMC_MAX_RESULTS for max results)
Returns:
a collection of DKWorkFlowFed objects.
Throws:
DKUsageError - if the DKWorkFlowServiceFed object is not connected or the workflows cannot be retrieved.

listWorkItems

public dkCollection listWorkItems(java.lang.String filter,
                                  java.lang.String sort_criteria,
                                  int threshold)
                           throws DKException,
                                  java.lang.Exception
Returns a collection of DKWorkItemFed objects in the system based on the given filter, sort criteria and threshold. Each DKWorkItemFed object represents a work item in the system.

The following code assumes svWF is a connected DKWorkFlowServiceFed object. The filter "NAME LIKE '*ST*'" will query for work item name with a substring 'ST'. The sort criteria "NAME DESC" will sort workitems by work item name in the descending order. The threshold DK_FED_FMC_MAX_RESULTS indicates that the query will return all.

 DKSequentialCollection coll = (DKSequentialCollection)svWF.listWorkItems("NAME LIKE '*ST*'", 
                                                                          "NAME DESC", 
                                                                          DK_FED_FMC_MAX_RESULTS);
 
Specified by:
listWorkItems in interface dkWorkFlowServiceFed
Parameters:
filter - filter criteria for querying
sort_criteria - sort criteria for sorting
threshold - number of returned results (DK_FED_FMC_MAX_RESULTS for max results)
Returns:
a collection of DKWorkItemFed objects.
Throws:
DKUsageError - if the DKWorkFlowServiceFed object is not connected or the workitems cannot be retrieved.

listWorkFlowTemplates

public dkCollection listWorkFlowTemplates()
                                   throws DKException,
                                          java.lang.Exception
Returns a collection of DKWorkFlowTemplateFed objects in the system.

The following code assumes svWF is a connected DKWorkFlowServiceFed object.

 DKSequentialCollection coll = (DKSequentialCollection)svWF.listWorkFlowTemplates();
 
Specified by:
listWorkFlowTemplates in interface dkWorkFlowServiceFed
Returns:
a collection of DKWorkFlowTemplateFed objects.
Throws:
DKUsageError - if the DKWorkFlowServiceFed object is not connected or the workflow templates cannot be retrieved.

listWorkLists

public dkCollection listWorkLists()
                           throws DKException,
                                  java.lang.Exception
Returns a collection of DKWorkListFed objects in the system.

The following code assumes svWF is a connected DKWorkFlowServiceFed object.

 DKSequentialCollection coll = (DKSequentialCollection)svWF.listWorkLists();
 
Specified by:
listWorkLists in interface dkWorkFlowServiceFed
Returns:
a collection of DKWorkListFed objects.
Throws:
DKUsageError - if the DKWorkFlowServiceFed object is not connected or the worklists cannot be retrieved.

isWorkFlow

public boolean isWorkFlow(java.lang.String name)
                   throws DKException,
                          java.lang.Exception
Checks if the specified name is a workflow.

The following code assumes svWF is a connected DKWorkFlowServiceFed object.

       
 boolean isWF = svWF.isWorkFlow("WF");
 
Specified by:
isWorkFlow in interface dkWorkFlowServiceFed
Parameters:
name - a workflow name
Returns:
boolean value indicating if the specified name is a workflow.
Throws:
DKUsageError - if the DKWorkFlowServiceFed object is not connected.

isWorkFlowTemplate

public boolean isWorkFlowTemplate(java.lang.String name)
                           throws DKException,
                                  java.lang.Exception
Checks if the specified name is a workflow template.

The following code assumes svWF is a connected DKWorkFlowServiceFed object.

       
 boolean isWF = svWF.isWorkFlowTemplate("WT");
 
Specified by:
isWorkFlowTemplate in interface dkWorkFlowServiceFed
Parameters:
name - a workflow template name
Returns:
boolean value indicating if the specified name is a workflow template.
Throws:
DKUsageError - if the DKWorkFlowServiceFed object is not connected.

isWorkList

public boolean isWorkList(java.lang.String name)
                   throws DKException,
                          java.lang.Exception
Checks if the specified name is a worklist.

The following code assumes svWF is a connected DKWorkFlowServiceFed object.

       
 boolean isWL = svWF.isWorkList("WL");
 
Specified by:
isWorkList in interface dkWorkFlowServiceFed
Parameters:
name - a worklist name
Returns:
boolean value indicating if the specified name is a worklist.
Throws:
DKUsageError - if the DKWorkFlowServiceFed object is not connected.

EIP Java APIs

(c) Copyright International Business Machines Corporation 1996, 2002. IBM Corp. All rights reserved.