Enterprise Information Portal APIs

com.ibm.mm.sdk.common
Class DKWorkFlowFed

java.lang.Object
  |
  +--com.ibm.mm.sdk.common.DKWorkFlowFed
All Implemented Interfaces:
DKConstant, DKConstantFed, DKMessageId, DKMessageIdFed, java.io.Serializable

public class DKWorkFlowFed
extends java.lang.Object
implements java.io.Serializable, DKConstantFed, DKMessageIdFed

An object oriented representation of the workflow in the workflow engine. The workpacket name is used to uniquely identify a workflow.

See Also:
Serialized Form

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
DKWorkFlowFed(dkWorkFlowServiceFed service)
          Constructs a DKWorkFlowFed object with the specified workflow service.
DKWorkFlowFed(dkWorkFlowServiceFed service, java.lang.String name)
          Constructs a DKWorkFlowFed object with the specified workflow service and a workflow name.
 
Method Summary
 void add(java.lang.String workflow_template)
          Adds a workflow in the system.
 void del()
          Deletes the workflow.
 DKTimestamp endTime()
          Returns the end time of the workflow.
 java.lang.String getDescription()
          Returns the description of the workflow.
 java.lang.String getName()
          Returns the name the workflow.
 DKWorkFlowContainerFed inContainer()
          Returns a DKWorkFlowContainerFed object associated with the In Container of this workflow.
 DKTimestamp modifiedTime()
          Returns the last modification time of the workflow.
 DKTimestamp notificationTime()
          Returns the notification time.
 void resume()
          Resuems the suspended workflow.
 void resumeDeep()
          Resuems the suspended workflow and its sub-workflows.
 void retrieve()
          Retrieves and refreshes the information of the workflow.
 void setDescription(java.lang.String description)
          Sets the description of the workflow.
 void setName(java.lang.String name)
          Sets the name of the workflow.
 void start(DKWorkFlowContainerFed container)
          Starts the workflow with an input container.
 DKTimestamp startTime()
          Returns the start time of the workflow.
 int state()
          Returns the state of the workflow.
 DKTimestamp stateChangeTime()
          Returns the state change time of the workflow.
 void suspend(DKTimestamp suspension_time)
          Suspends the workflow with a specified time.
 void suspendDeep(DKTimestamp suspension_time)
          Suspends the workflow and its sub-workflows with a specified time.
 DKTimestamp suspensionTime()
          Returns the suspension time of the workflow.
 void terminate()
          Terminates the workflow.
 void update()
          Updates the workflow.
 java.lang.String workFlowTemplateName()
          Returns the name of the workflow template that is associated with the workflow.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DKWorkFlowFed

public DKWorkFlowFed(dkWorkFlowServiceFed service)
              throws DKException,
                     java.lang.Exception
Constructs a DKWorkFlowFed object with the specified workflow service.
Parameters:
service - DKWorkFlowServiceFed object.

DKWorkFlowFed

public DKWorkFlowFed(dkWorkFlowServiceFed service,
                     java.lang.String name)
              throws DKException,
                     java.lang.Exception
Constructs a DKWorkFlowFed object with the specified workflow service and a workflow name.
Parameters:
sercvive - DKWorkFlowServiceFed object.
name - name of a workflow.
Method Detail

getName

public java.lang.String getName()
                         throws DKException,
                                java.lang.Exception
Returns the name the workflow.
Returns:
name of the workflow.

setName

public void setName(java.lang.String name)
             throws DKException,
                    java.lang.Exception
Sets the name of the workflow.
Parameters:
name - name of the workflow.

getDescription

public java.lang.String getDescription()
                                throws DKException,
                                       java.lang.Exception
Returns the description of the workflow.
Returns:
description of the workflow.
Throws:
DKUsageError - if the DKWorkFlowFed object is not retrieved.

setDescription

public void setDescription(java.lang.String description)
                    throws DKException,
                           java.lang.Exception
Sets the description of the workflow.
Parameters:
description - description of the workflow

workFlowTemplateName

public java.lang.String workFlowTemplateName()
                                      throws DKException,
                                             java.lang.Exception
Returns the name of the workflow template that is associated with the workflow.
Returns:
name of the workflow template.
Throws:
DKUsageError - if the DKWorkFlowFed object is not retrieved.

modifiedTime

public DKTimestamp modifiedTime()
                         throws DKException,
                                java.lang.Exception
Returns the last modification time of the workflow.
Returns:
DKTimestamp object for the last modification time.
Throws:
DKUsageError - if the DKWorkFlowFed object is not retrieved.

notificationTime

public DKTimestamp notificationTime()
                             throws DKException,
                                    java.lang.Exception
Returns the notification time.
Returns:
DKTimestamp object for the notification time.
Throws:
DKUsageError - if the DKWorkFlowFed object is not retrieved.

stateChangeTime

public DKTimestamp stateChangeTime()
                            throws DKException,
                                   java.lang.Exception
Returns the state change time of the workflow.
Returns:
DKTimestamp object for the state change time.
Throws:
DKUsageError - if the DKWorkFlowFed object is not retrieved.

startTime

public DKTimestamp startTime()
                      throws DKException,
                             java.lang.Exception
Returns the start time of the workflow.
Returns:
DKTimestamp object for the start time.
Throws:
DKUsageError - if the DKWorkFlowFed object is not retrieved.

endTime

public DKTimestamp endTime()
                    throws DKException,
                           java.lang.Exception
Returns the end time of the workflow.
Returns:
DKTimestamp object for the end time.
Throws:
DKUsageError - if the DKWorkFlowFed object is not retrieved.

suspensionTime

public DKTimestamp suspensionTime()
                           throws DKException,
                                  java.lang.Exception
Returns the suspension time of the workflow.
Returns:
DKTimestamp object for the suspension time.
Throws:
DKUsageError - if the DKWorkFlowFed object is not retrieved.

state

public int state()
          throws DKException,
                 java.lang.Exception
Returns the state of the workflow. The state can be in one of the following:
Returns:
the state of the workflow.
Throws:
DKUsageError - if the DKWorkFlowFed object is not retrieved.

inContainer

public DKWorkFlowContainerFed inContainer()
                                   throws DKException,
                                          java.lang.Exception
Returns a DKWorkFlowContainerFed object associated with the In Container of this workflow.

The inContainer method is called to retrieve the container content of a workflow. The following code assumes WF is a retrieved DKWorkFlowFed object.

 DKWorkFlowContainerFed con = WF.inContainer();
 
Returns:
DKWorkFlowContainerFed object.
Throws:
DKUsageError - if the DKWorkFlowFed object is not retrieved.

start

public void start(DKWorkFlowContainerFed container)
           throws DKException,
                  java.lang.Exception
Starts the workflow with an input container.

The following code assumes WF is a retrieved DKWorkFlowFed object. An input container is retrieved first. A valid PID string pid is specified, which is a persistent ID of a document. The priority is set to 100. The input container is passed to the start method to start a workflow instance.

 DKWorkFlowContainerFed con = WF.inContainer();
 con.retrieve();
 con.setPersistentID(pid);
 con.setPriority(100);
 con.update();
 WF.start(con);
 
Parameters:
container - DKWorkFlowContainerFed object.
Throws:
DKUsageError - if the DKWorkFlowFed object is not retrieved, or the start operation fails.

terminate

public void terminate()
               throws DKException,
                      java.lang.Exception
Terminates the workflow. The state of a workflow has to be one of the following:

The following code assumes WF is a retrieved DKWorkFlowFed object.

 WF.terminate();
 
Throws:
DKUsageError - if the DKWorkFlowFed object is not retrieved, the workflow is in an incorrect state, or the terminate operation fails.

suspend

public void suspend(DKTimestamp suspension_time)
             throws DKException,
                    java.lang.Exception
Suspends the workflow with a specified time. A NULL DKTimestamp means to suspend the workflow indefinitely. A workflow has to be in the state of DK_FED_FMC_PS_RUNNING for suspension.

The following code assumes WF is a retrieved DKWorkFlowFed object.

 if (WF.state() == DKConstantFed.DK_FED_FMC_PS_RUNNING)
 {
    DKTimestamp suspension = null;
    WF.suspend(suspension);
 }
 
Parameters:
suspension_time - suspension time.
Throws:
DKUsageError - if the DKWorkFlowFed object is not retrieved, the workflow is in an incorrect state, or the suspend operation fails.

suspendDeep

public void suspendDeep(DKTimestamp suspension_time)
                 throws DKException,
                        java.lang.Exception
Suspends the workflow and its sub-workflows with a specified time. A NULL DKTimestamp means to suspend the workflow indefinitely. A workflow has to be in the state of DK_FED_FMC_PS_RUNNING for suspension.

The following code assumes WF is a retrieved DKWorkFlowFed object.

 if (WF.state() == DKConstantFed.DK_FED_FMC_PS_RUNNING)
 {
    DKTimestamp suspension = null;
    WF.suspendDeep(suspension);
 }
 
Parameters:
suspension_time - suspension time.
Throws:
DKUsageError - if the DKWorkFlowFed object is not retrieved, the workflow is in an incorrect state, or the suspend operation fails.

resume

public void resume()
            throws DKException,
                   java.lang.Exception
Resuems the suspended workflow. The state of the workflow has to be one of the following:

The following code assumes WF is a retrieved DKWorkFlowFed object.

 WF.resume();         
 
Throws:
DKUsageError - if the DKWorkFlowFed object is not retrieved, the workflow is in an incorrect state, or the resume operation fails.

resumeDeep

public void resumeDeep()
                throws DKException,
                       java.lang.Exception
Resuems the suspended workflow and its sub-workflows. The state of the workflow has to be one of the following:

The following code assumes WF is a retrieved DKWorkFlowFed object.

 WF.resumeDeep();         
 
Throws:
DKUsageError - if the DKWorkFlowFed object is not retrieved, the workflow is in an incorrect state, or the resume operation fails.

add

public void add(java.lang.String workflow_template)
         throws DKException,
                java.lang.Exception
Adds a workflow in the system. A workflow is created with the specified workflow template.

The following code assumes svWF is an existing DKWorkFlowServiceFed object. WF is created as a new DKWorkFlowFed object. The setName method defines the name of the workflow such as "Claim001". The add method will create a workflow instance with the specified name "Claim001" based on the workflow template such as "ClaimProcess". The name of the workflow must be unique. If the name of the workflow is not specified, a unique workflow name will be generated with the workflow template name as the prefix.

 DKWorkFlowFed WF = new DKWorkFlowFed(svWF);
 WF.setName("Claim001");
 WF.add("ClaimProcess");
 
Parameters:
workflow_template - name of a workflow template.
Throws:
DKUsageError - if the add operation fails.

update

public void update()
            throws DKException,
                   java.lang.Exception
Updates the workflow. Specifically it updates the description of the workflow.

The following code assumes WF is a retrieved DKWorkFlowFed object.

 WF.setDescription("Updated description");    
 WF.update();
 
Throws:
DKUsageError - if the DKWorkFlowFed object is not retrieved, or the update operation fails.

del

public void del()
         throws DKException,
                java.lang.Exception
Deletes the workflow. The state of the workflow has to be one of the following:

The following code assumes WF is a retrieved DKWorkFlowFed object.

  
 WF.del();
 
Throws:
DKUsageError - if the DKWorkFlowFed object is not retrieved, the workflow is in an incorrect state, or the delete operation fails.

retrieve

public void retrieve()
              throws DKException,
                     java.lang.Exception
Retrieves and refreshes the information of the workflow.

The following code assumes WF is a DKWorkFlowFed object.

  
 WF.retrieve();
 
Throws:
DKUsageError - if the DKWorkFlowFed object cannot be retrieved.

EIP Java APIs

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