Interface IDfWorkflow

All Superinterfaces:
IDfPersistentObject, IDfTypedObject

public interface IDfWorkflow extends IDfPersistentObject
This interface provides methods that allow you to create, start, and manage a workflow. The methods in this interface are called by the StartWorkflow and Inbox SBOs. You can also use the StartWorkflow SBO to create a new workflow and the Inbox SBO to manage tasks. For more information, refer the SBO Javadocs.
  • Field Details

  • Method Details

    • execute

      void execute() throws DfException
      Starts a workflow.

      A workflow is a runtime instance of a dm_process object. You must be the workflow creator or supervisor or a user with Sysadmin or Superuser privileges to use this method.

      The following code example demonstrates how to create and execute a second workflow under the same process as a previously started workflow:


       // Setup all params for sendToDistributionList() here...
       IDfId wfId = sess.sendToDistributionList(userList,groupList,"Please review",objList,5,false);
       IDfWorkflow wfObj = (IDfWorkflow)sess.getObject(wfId);
       IDfWorkflow wfObj2 = (IDfWorkflow)sess.newObject("dm_workflow");
       wfObj2.setProcessId(wfObj.getProcessId());
       wfObj2.setSupervisorName("someUser")
       wfObj2.save();
       wfObj2.execute();
       

      Throws:
      DfException - if the server returns an error
    • restart

      void restart(int activitySeqNo) throws DfException
      Restarts a failed activity in the workflow.

      You must be the workflow supervisor or a user with Sysadmin or Superuser privileges to use this method. Restarting a failed activity retries the operation that failed. If the operation succeeds, the activity is restarted. If the operation doesn't succeed, the restart method fails.

      If you want to restart a workflow, refer to restartAll().

      The following code example demonstrates how to halt then restart an activity:


       // Create all activity and process objects first...
       IDfWorkflow wfObj = (IDfWorkflow)sess.newObject("dm_workflow");
       wfObj.setProcessId(procObj.getObjectId());
       wfObj.setSupervisorName("someUser")
       wfObj.execute();
       wfObj.addPackage(actObj1.getObjectName(), actObj1.getPortName(0),
            sysObj.getObjectName(), "dm_document", null, false, objList);
       for (int i = 0; i < wfObj.getActivityCount(); i++)
       {
            if (wfObj.getActState(i) == 4)
            {
                // Halt the "Failed" activity...
                wfObj.halt(wfObj.getActSeqno(i));
                // ...
                // Do some other stuff here...
                // ...
                // Restart the halted activity...
                wfObj.restart(wfObj.getActSeqno(i));
            }
       {
       

      Parameters:
      activitySeqNo - the sequence number of the activity that you want to restart. You can obtain this using getActSeqno(int).
      Throws:
      DfException - if the activity is not in the failed state.
      See Also:
    • restartEx

      void restartEx(int activitySeqNo, boolean manualComplete) throws DfException
      Restarts a failed activity in the workflow and indicates whether the automatic task (if any) of this activity is intended to be manually completed.

      This method is intended for internal use by Webtop or desktop client task manager, users should not use it. You must be the workflow supervisor or a user with Sysadmin or Superuser privileges to use this method. Restarting a failed activity retries the operation that failed. If the operation succeeds, the activity is restarted. If the operation doesn't succeed, the restart method fails.

      The following code example demonstrates how to halt then restart an activity:


       // Create all activity and process objects first...
       IDfWorkflow wfObj = (IDfWorkflow)sess.newObject("dm_workflow");
       wfObj.setProcessId(procObj.getObjectId());
       wfObj.setSupervisorName("someUser")
       wfObj.execute();
       wfObj.addPackage(actObj1.getObjectName(), actObj1.getPortName(0),
            sysObj.getObjectName(), "dm_document", null, false, objList);
       for (int i = 0; i < wfObj.getActivityCount(); i++)
       {
            if (wfObj.getActState(i) == 4)
            {
                // Halt the "Failed" activity...
                wfObj.halt(wfObj.getActSeqno(i));
                // ...
                // Do some other stuff here...
                // ...
                // Restart the halted activity...
                wfObj.restartEx(wfObj.getActSeqno(i), true);
            }
       {
       

      Parameters:
      activitySeqNo - the sequence number of the activity that you want to restart. You can obtain this using getActSeqno(int). Provide a sequence number only when you want to restart an activity.
      manualComplete - indicates whether the automatic task (if any) of this activity instance is intended to be manually completed. True means the automatic task is intended to be manually completed, therefore will not be processed by the workflow agent.
      Throws:
      DfException - if the workflow is not in the halted state or the activity is not in the failed state.
      See Also:
    • halt

      void halt(int activitySeqNo) throws DfException
      Halts an activity.

      You must be the workflow supervisor or a user with Sysadmin or Superuser privileges to halt an activity. However, if enable_workitem_mgmt, a server.ini key,is set to true, any user can halt a running activity.

      Halting an activity sets the activity's state to halted. The activity must be in the active state to be halted.

      This method halts an activity until it is explicitly resumed. If you want to halt an activity for a specified time period, to be automatically resumed after the period expires, use haltEx(int, int). To halt the entire workflow, use haltAll().

      For more information about halting activities, refer to Server Fundamentals.

      The following code example demonstrates how to halt all activities in the "Active" state:


       // Create all activity and process objects first...
       IDfWorkflow wfObj = (IDfWorkflow)sess.newObject("dm_workflow");
       wfObj.setProcessId(procObj.getObjectId());
       wfObj.setSupervisorName("someUser")
       wfObj.execute();
       wfObj.addPackage(actObj1.getObjectName(), actObj1.getPortName(0),
            sysObj.getObjectName(), "dm_document", null, false, objList);
       for (int i = 0; i < wfObj.getActivityCount(); i++)
       {
            if (wfObj.getActState(i) == 1)
            {
                // Halt the "Active" activity...
                wfObj.halt(wfObj.getActSeqno(i));
            }
       {
       

      Parameters:
      activitySeqNo - the sequence number of the activity in the workflow. You can use getActSeqno(int) to obtain the sequence number.
      Throws:
      DfException - if the activity is not in the active state
      See Also:
    • haltEx

      void haltEx(int activitySeqNo, int suspendInterval) throws DfException
      Halts an activity with a suspend interval.

      This method halts an activity for the specified time period and then automatically resumes the activity. To halt an activity for an indefinite length of time, use halt(int). You must be the workflow supervisor or a user with Sysadmin or Superuser privileges to halt an activity. However, if enable_workitem_mgmt, a server.ini key,is set to true, any user can halt a running activity.

      Halting an activity sets the activity's state to halted. The activity must be in the active state to be halted. For more information about halting activities, refer to Server Fundamentals.

      Parameters:
      activitySeqNo - the sequence number of the activity in the workflow. You can use getActSeqno(int) to obtain the sequence number.
      suspendInterval - the length of time, in minutes, in which the activity should be resumed after it is halted.
      Throws:
      DfException - if the activity is not in the active state
      See Also:
    • resume

      void resume(int activitySeqNo) throws DfException
      Moves a halted activity to the active state.

      You must be the workflow supervisor or a user with Sysadmin or Superuser privileges to resume an activity. The activity must be in the halted state.

      If you want to resume a workflow, refer to resumeAll().

      For more information about resuming activities, refer to Server Fundamentals.

      Parameters:
      activitySeqNo - the sequence number of the activity in the workflow. You can use getActSeqno(int) to obtain the sequence number.
      Throws:
      DfException - if the activity is not in the halted state
      See Also:
    • restartAll

      void restartAll() throws DfException
      Restarts a halted workflow.

      You must be the workflow supervisor or a user with Sysadmin or Superuser privileges to resume a workflow.

      Restarting a workflow removes all the current activity instances and generated work items and packages. The method regenerates runtime instances for the start activities in the workflow and resets any activity pre-timers. Do not use this method to restart individual activities in the workflow. Use restart(int)for that purpose.

      For more information about restarting workflows, refer to Server Fundamentals.

      Throws:
      DfException - if the workflow is not in the halted state
      See Also:
    • abort

      void abort() throws DfException
      Terminates a workflow.

      You must be the workflow supervisor or a user with Sysadmin or Superuser privileges to terminate the workflow. The workflow must be in the running or halted state and there can be no active automatic activities.

      This method sets the workflow's r_runtime_state attribute to terminated.

      The following code example demonstrates how to start and abort a workflow:


       IDfList userList = new DfList();
       IDfList groupList = new DfList();
       IDfList objList = new DfList();
       userList.appendString("joeuser");
       groupList.appendString("EngineeringGroup");
       objList.append(new DfId("0900d5bb8001f900"));
       IDfId wfId = sess.sendToDistributionList(userList,groupList,"Please review",objList,5,false);
       IDfWorkflow wfObj = (IDfWorkflow)sess.getObject(wfId);
       wfObj.abort();
       

      Throws:
      DfException - if the server returns an error
    • queue

      IDfId queue(String supervisor, String eventType, int priority, boolean sendMail, IDfTime dueDate, String message) throws DfException
      Sends an event to a workflow.

      Workflow activities can be triggered by events. If a triggering event is defined for an activity, the server checks the workflow's queue for the event when it evaluates the pre-conditions of the activity prior to starting the activity.

      This method is the means by which such triggering events are sent to the workflow queue. To define a triggering event, use IDfActivity.setTriggerEvent(java.lang.String).

      For more information about triggering events and activities, refer to Server Fundamentals.

      The following code example demonstrates how to trigger an event by calling queue():


       // Create all activity and process objects first, then start the
       // workflow - assume setTriggerEvent() was called when setting up
       // the first activity...
       IDfWorkflow wfObj = (IDfWorkflow)sess.newObject("dm_workflow");
       wfObj.setProcessId(procObj.getObjectId());
       wfObj.setSupervisorName("someUser")
       wfObj.execute();
       // ...Perhaps in another app (or thread), an event is queued which triggers the workflow
       IDfTime t = new DfTime("08/09/2000", "mm/dd/yyyy");
       IDfId inboxId = wfObj.queue("tuser","EventName",1,false,t,"Please review");
       

      Parameters:
      supervisor - the name of the workflow supervisor. You can specify this as null if you wish.
      eventType - the name of the event. This argument must be specified.
      priority - the importance of the event. This is optional and can be specified as null.
      sendMail - true if you want to send an email notification of the event to the workflow supervisor or false if you do not.
      dueDate - specifies a date for the completion of the work represented by the queued object.
      message - a message included in the email notification sent to the workflow supervisor. Include a message only if sendMail is set to true.
      Returns:
      An IDfId interface to the queue item object that represents the queued event.
      Throws:
      DfException - if the server returns an error.
    • addPackage

      IDfId addPackage(String startActivityName, String inputPortName, String packageName, String packageType, String noteText, boolean notePersistent, IDfList componentId) throws DfException
      Adds a package to a start activity in a workflow.

      You must be the workflow supervisor, the workflow creator, or a user with at least Sysadmin privileges to use this method. The workflow must be in the running state (r_runtime_state=1). The package may have one component or it may have no components. To add a package with no components, specify componentId as null. The start activity must have input ports and a defined pre-condition.

      If package control is not enabled at either the process (workflow) or repository level, the method obtains the name of the component specified in componentId and records the name in the package's r_component_name attribute.

      Note: If you wish to specify a skill level for the package, use addPackageEx(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean, com.documentum.fc.common.IDfList, int). For more information about packages and package control, refer to Server Fundamentals. The Content Server Administrator's Guide describes how to enable or disable package control.

      The following code example demonstrates how to start routing object to users by calling addPackage on the first activity's input port:


       // Create all activity and process objects first...
       IDfWorkflow wfObj = (IDfWorkflow)sess.newObject("dm_workflow");
       wfObj.setProcessId(procObj.getObjectId());
       wfObj.setSupervisorName("someUser")
       wfObj.execute();
       // Add a package to the first activity's input port thereby triggering the
       // object routing mechanism...
       wfBldrObj.addPackage(actObj1.getObjectName(), actObj1.getPortName(0),
            actObj1.getPackageName(), "dm_document", null, false, objList);
       

      Parameters:
      startActivityName - the name of one of the workflow's start activities.
      inputPortName - the name of an input port in the start activity.
      packageName - the name of a package. This must be a package that is already defined in the workflow definition.
      packageType - the object type of the component. This is either the actual object type of the component or a supertype of the component.
      noteText - a string that is either the note id or the note content. This can be empty if there is no note for the package.
      notePersistent - set this to true if you want the note defined in noteText to accompany the package through the entire workflow. Set this to false if you only want the note to go to performers of the activities immediately following the start activity. The notePersistent flag has no effect if noteText is empty.
      componentId - an IDfList object that contains the object ID of the package's component, or null
      Returns:
      An IDfID interface to the package object
      Throws:
      DfException - if the server returns an error
      See Also:
    • addPackageEx

      IDfId addPackageEx(String startActivityName, String inputPortName, String packageName, String packageType, String noteText, boolean notePersistent, IDfList componentId, int skillLevel) throws DfException
      Adds a package to a start activity in the workflow and specifies a skill_level for the package

      You must be the workflow supervisor the workflow creator, or a user with at least Sysadmin privileges to use this method. The workflow must be in the running state (r_runtime_state=1). This method adds a package, consisting of one component or no components, to the workflow's start activity and specifies a skill level for the package. If you do not want to specify a skill level, set the argument to 0.

      The package may have one component, or it may have no components. To add a package with no components, specify componentIds as null. The activity must have input ports and a defined pre-condition.

      If package control is not enabled at either the process (workflow) or repository level, the method obtains the name of the component specified in componentId and records the name in the package's r_component_name attribute.

      For more information about packages, package control, and package skill levels, refer to Server Fundamentals. The Content Server Administrator's Guide describes how to enable or disable package control

      The following code example demonstrates how to start routing object to users by calling addPackage on the first activity's input port:


       // Create all activity and process objects first...
       IDfWorkflow wfObj = (IDfWorkflow)sess.newObject("dm_workflow");
       wfObj.setProcessId(procObj.getObjectId());
       wfObj.setSupervisorName("someUser")
       wfObj.execute();
       // Add a package to the first activity's input port thereby triggering the
       // object routing mechanism...
       wfBldrObj.addPackageEx(actObj1.getObjectName(), actObj1.getPortName(0),
            actObj1.getPackageName(), "dm_document", null, false, objList, skill_level);
       

      Parameters:
      startActivityName - the name of one of the workflow's start activities.
      inputPortName - the name of an input port in the start activity.
      packageName - the name of a package. This must be a package that is already defined in the workflow definition.
      packageType - the object type of the component. This is either the actual object type of the component or a supertype of the component.
      noteText - a string that is either the note id or the note content. This can be empty if there is no note for the package.
      notePersistent - set this to true if you want the note defined in noteText to accompany the package through the entire workflow. Set this to false if you only want the note to go to performers of the activities immediately following the start activity. The notePersistent flag has no effect if noteText is empty.
      componentId - an IDfList object that contains the object ID of the package's component, or null
      skillLevel - an Integer that indicates the required skill level of the package
      Returns:
      An IDfID interface to the package object
      Throws:
      DfException - if the server returns an error
      See Also:
    • addPackage

      IDfId addPackage(String startActivityName, String inputPortName, String packageName, String packageType, String noteText, boolean notePersistent, IDfList componentId, IDfList componentName) throws DfException
      Adds a package to a start activity in a workflow.

      You must be the workflow supervisor, the workflow creator, or a user with at least Sysadmin privileges to use this method. The workflow must be in the running state (r_runtime_state=1). The package may have one component, or it may have no components. To add a package with no components, specify componentIds as null. The start activity must have input ports and a defined pre-condition.

      If package control is not enabled at either the process (workflow) or repository level, the method obtains the name of the component specified in componentId and records the name in the package's r_component_name attribute.

      Note: If you wish to specify a skill level for the package, use addPackageEx(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean, com.documentum.fc.common.IDfList, int). For more information about packages and package control, refer to Server Fundamentals. The Content Server Administrator's Guide describes how to enable or disable package control.

      The following code example demonstrates how to start routing object to users by calling addPackage on the first activity's input port:


       // Create all activity and process objects first...
       IDfWorkflow wfObj = (IDfWorkflow)sess.newObject("dm_workflow");
       wfObj.setProcessId(procObj.getObjectId());
       wfObj.setSupervisorName("someUser")
       wfObj.execute();
       // Add a package to the first activity's input port thereby triggering the
       // object routing mechanism...
       wfBldrObj.addPackage(actObj1.getObjectName(), actObj1.getPortName(0),
            actObj1.getPackageName(), "dm_document", null, false, objList);
       

      Parameters:
      startActivityName - the name of one of the workflow's start activities.
      inputPortName - the name of an input port in the start activity.
      packageName - the name of a package. This must be a package that is already defined in the workflow definition.
      packageType - the object type of the component. This is either the actual object type of the component or a supertype of the component.
      noteText - a string that is either the note id or the note content. This can be empty if there is no note for the package.
      notePersistent - set this to true if you want the note defined in noteText to accompany the package through the entire workflow. Set this to false if you only want the note to go to performers of the activities immediately following the start activity. The notePersistent flag has no effect if noteText is empty.
      componentId - an IDfList object that contains the object ID of the package's component, or null
      componentName - an IDfList object that contains the name of the package's component or null
      Returns:
      An IDfID interface to the package object
      Throws:
      DfException - if the server returns an error
      See Also:
    • addPackageEx

      IDfId addPackageEx(String startActivityName, String inputPortName, String packageName, String packageType, String noteText, boolean notePersistent, IDfList componentId, IDfList componentName, int skillLevel) throws DfException
      Adds a package to a start activity in the workflow and specifies a skill_level for the package

      You must be the workflow supervisor the workflow creator, or a user with at least Sysadmin privileges to use this method. The workflow must be in the running state (r_runtime_state=1). This method adds a package, consisting of one or no components, to the workflow's start activity and specifies a skill level for the package. If you do not want to specify a skill level, set the argument to 0.

      The package may have one component, or it may have no components. To add a package with no components, specify componentIds as null. The activity must have input ports and a defined pre-condition.

      If package control is not enabled at either the process (workflow) or repository level, the method obtains the name of the component specified in componentId and records the name in the package's r_component_name attribute.

      For more information about packages, package control, and package skill levels, refer to Server Fundamentals. The Content Server Administrator's Guide describes how to enable or disable package control

      The following code example demonstrates how to start routing object to users by calling addPackage on the first activity's input port:


       // Create all activity and process objects first...
       IDfWorkflow wfObj = (IDfWorkflow)sess.newObject("dm_workflow");
       wfObj.setProcessId(procObj.getObjectId());
       wfObj.setSupervisorName("someUser")
       wfObj.execute();
       // Add a package to the first activity's input port thereby triggering the
       // object routing mechanism...
       wfBldrObj.addPackageEx(actObj1.getObjectName(), actObj1.getPortName(0),
            actObj1.getPackageName(), "dm_document", null, false, objList, skill_level);
       

      Parameters:
      startActivityName - the name of one of the workflow's start activities.
      inputPortName - the name of an input port in the start activity.
      packageName - the name of a package. This must be a package that is already defined in the workflow definition.
      packageType - the object type of the component. This is either the actual object type of the component or a supertype of the component.
      noteText - a string that is either the note id or the note content. This can be empty if there is no note for the package.
      notePersistent - set this to true if you want the note defined in noteText to accompany the package through the entire workflow. Set this to false if you only want the note to go to performers of the activities immediately following the start activity. The notePersistent flag has no effect if noteText is empty.
      componentId - an IDfList object that contains the object ID of the package's component, or null
      componentName - an IDfList object that contains the name of the package's component or null
      skillLevel - an Integer that indicates the required skill level of the package
      Returns:
      An IDfID interface to the package object
      Throws:
      DfException - if the server returns an error
      See Also:
    • removePackage

      void removePackage(String startActivityName, String portName, String packageName) throws DfException
      Removes a package from a start activity in the workflow.

      You must be the workflow supervisor to use this method.

      The following code example demonstrates how to remove a package from a start activity:


       // Create all activity and process objects first...
       IDfWorkflow wfObj = (IDfWorkflow)sess.newObject("dm_workflow");
       wfObj.setProcessId(procObj.getObjectId());
       wfObj.setSupervisorName("someUser")
       wfObj.execute();
       // Packages are added here via addPackage()...
       // ...
       // Let's say at some point during processing we don't want a package to be
       // dealt with by a particular user, hence, the following call is made...
       wfObj.removePackage(actObjN.getObjectName(), actObjN.getPortName(0), sysObj.getObjectName());
       

      Parameters:
      startActivityName - the name of the start activity from which you are removing the package.
      portName - the name of the port with which the package is associated.
      packageName - the name of the package you are removing.
      Throws:
      DfException - if the server returns an error.
      See Also:
    • getObjectName

      String getObjectName() throws DfException
      Returns the name of the workflow object.

      A workflow object is the runtime instance of a dm_process object (a workflow definition). For more information about workflows and workflow definitions, refer to Server Fundamentals.

      Returns:
      The object name of the workflow
      Throws:
      DfException - if the server returns an error
    • setObjectName

      void setObjectName(String objectName) throws DfException
      Sets the object name of a workflow object.

      A workflow object is the runtime instance of a dm_process object (a workflow definition). For more information about workflows and workflow definitions, refer to Server Fundamentals.

      Parameters:
      objectName - the name you want to give the workflow object
      Throws:
      DfException - if the server returns an error
    • getProcessId

      IDfId getProcessId() throws DfException
      Returns the object ID of the workflow's definition.

      Workflow definitions are stored in dm_process objects. Executing getProcessId returns the object ID of the process object on which the workflow is based.

      Returns:
      An IDfId interface object that contains the object ID
      Throws:
      DfException - if the server returns an error
    • setProcessId

      void setProcessId(IDfId processId) throws DfException
      Sets the process ID for the workflow.

      A workflow is a runtime instance of a dm_process object. Process objects contain workflow definitions. When you build a workflow in an application, you must identify the process object on which the workflow is based by executing the setProcessId method.

      Parameters:
      processId - the object ID of the process object containing the workflow's definition
      Throws:
      DfException - if the server returns an error
    • getCreatorName

      String getCreatorName() throws DfException
      Returns the name of the person who created the workflow.

      Returns:
      The name of the workflow's creator.
      Throws:
      DfException - if the server returns an error
    • getSupervisorName

      String getSupervisorName() throws DfException
      Returns the name of the workflow's supervisor.

      The default is the creator of the workflow.

      Returns:
      The name of the supervisor.
      Throws:
      DfException - if the server returns an error
    • setSupervisorName

      void setSupervisorName(String supervisorName) throws DfException
      Sets the name of the workflow supervisor.

      Parameters:
      supervisorName - the name of the supervisor
      Throws:
      DfException - if the server returns an error
    • getRuntimeState

      int getRuntimeState() throws DfException
      Returns the state of the workflow.

      Returns:
      An integer representing the state of the workflow. Valid values and their meanings are:
       Value    Meaning
       0        Dormant
       1        Running
       2        Finished
       3        Halted
       4        Terminated
      Throws:
      DfException - if the server returns an error
    • getStartDate

      IDfTime getStartDate() throws DfException
      Returns the start date of the workflow.

      This is the date on which the workflow was started. The start date is set automatically by the server.

      Returns:
      An IDfTime interface object that contains the start date
      Throws:
      DfException - if the server returns an error
    • getNextSeqno

      int getNextSeqno() throws DfException
      Returns the next sequence number in the workflow.

      Sequence numbers are assigned to activity instances in the workflow. The next sequence number is the number to be assigned to the next activity instance.

      Returns:
      The next sequence number
      Throws:
      DfException - if the server returns an error
    • getActivityCount

      int getActivityCount() throws DfException
      Returns the number of activity instances in the workflow.

      Activities are instantiated when they are started. The instances are stored in a set of repeating attributes in the workflow object. This method effectively returns the number of activity instances by returning a count of the number of values in the workflow repeating attributes.

      For more information about runtime activities, refer to Server Fundamentals.

      Returns:
      The number of activity instances in the workflow
      Throws:
      DfException - if the server returns an error
    • getActSeqno

      int getActSeqno(int valueIndex) throws DfException
      Returns the sequence number of an activity.

      Information about instantiated activities, including their sequence number, is stored in a set of repeating attributes in the workflow object. The information at one index position across the attributes represents one instantiated activity.

      To execute this method, you must provide the index position of the activity. Index positions begin at 0 and increment by 1 for each value in the repeating attribute, up to n-1 where n is the total number of values in the attribute. To obtain the total number of values, use getActivityCount().

      Parameters:
      valueIndex - the index position of the activity
      Returns:
      The activity's sequence number
      Throws:
      DfException - if the server returns an error
    • getActName

      String getActName(int valueIndex) throws DfException
      Returns the name of an activity.

      Information about instantiated activities is stored in a set of repeating attributes in the workflow object. The information at one index position across the attributes represents one instantiated activity.

      To execute this method, you must provide the activity's index position in those repeating attributes. Index positions begin at 0 and increment by 1 for each value in the repeating attribute, up to n-1 where n is the total number of values in the attribute. To obtain the total number of values, use getActivityCount().

      Parameters:
      valueIndex - the index position of the activity
      Returns:
      The activity's name
      Throws:
      DfException - if the server returns an error
    • getActDefId

      IDfId getActDefId(int valueIndex) throws DfException
      Returns the object ID of an activity's definition.

      Activity definitions are stored in dm_activity objects. The object ID of an activity's definition is part of the information about the activity that is stored in repeating attributes in the workflow object. The information at one index position across the attributes represents one instantiated activity.

      To execute this method, you must provide the activity's index position in those repeating attributes. Index positions begin at 0 and increment by 1 for each value in the repeating attribute, up to n-1 where n is the total number of values in the attribute. To obtain the total number of values, use getActivityCount().

      Parameters:
      valueIndex - the index position of the activity
      Returns:
      An IDfId interface that contains the object ID of the activity's definition
      Throws:
      DfException - if the server returns an error
    • getActErrorno

      int getActErrorno(int valueIndex) throws DfException
      Returns the error number for a failed activity operation.

      If an activity fails, the system records the error number associated with the failure. Use getActErrorno for failure recovery.

      To execute this method, you must provide the activity's index position in the repeating attributes that store information about activities in the workflow. Index positions begin at 0 and increment by 1 for each value in a repeating attribute, up to n-1 where n is the total number of values in the attribute. To obtain the total number of values, use getActivityCount().

      Parameters:
      valueIndex - the index position of the activity
      Returns:
      The error number of the error that caused the failure
      Throws:
      DfException - if the server returns an error
    • getActState

      int getActState(int valueIndex) throws DfException
      Returns the state of an activiity.

      To execute this method, you must provide the activity's index position in the repeating attributes that store information about activities in the workflow. Index positions begin at 0 and increment by 1 for each value in a repeating attribute, up to n-1 where n is the total number of values in the attribute. To obtain the total number of values, use getActivityCount().

      Parameters:
      valueIndex - the index position of the activity
      Returns:
      An integer value representing the state of the activity. Valid values and their meanings are:
       Value    Meaning
       0        Dormant
       1        Active
       2        Finished
       3        Halted
       4        Failed
      Throws:
      DfException - if the server returns an error
    • getRepeatInvoke

      boolean getRepeatInvoke(int valueIndex) throws DfException
      Indicates whether the activity is repeatable.

      If an activity is repeatable, it can be invoked more than once in the workflow.

      To execute this method, you must provide the activity's index position in the repeating attributes that store activity information in the workflow. Index positions begin at 0 and increment by 1 for each value in a repeating attribute, up to n-1 where n is the total number of values in the attribute. To obtain the total number of values, use getActivityCount().

      Parameters:
      valueIndex - the index position of the activity
      Returns:
      true if the activity is repeatable; false if it is not
      Throws:
      DfException - if the server returns an error
    • getTriggerThresh

      int getTriggerThresh(int valueIndex) throws DfException
      Returns the trigger threshold for an activity.

      An activity's trigger threshold is the number of input ports that must accept packages before the activity can be started.

      To execute this method, you must provide the activity's index position in the repeating attributes that store activity information in the workflow. Index positions begin at 0 and increment by 1 for each value in a repeating attribute, up to n-1 where n is the total number of values in the attribute. To obtain the total number of values, use getActivityCount().

      Parameters:
      valueIndex - the index position of the activity
      Returns:
      The number of input ports required to accept packages to start the activity
      Throws:
      DfException - if the server returns an error
      See Also:
    • getTriggerInput

      int getTriggerInput(int valueIndex) throws DfException
      Returns the number of triggered input ports.

      The server records each time an input port accepts a package. When the number reaches the activity's trigger threshold, the activity is started and no more packages are accepted.

      To execute this method, you must provide the activity's index position in the repeating attributes that store activity information in the workflow. Index positions begin at 0 and increment by 1 for each value in a repeating attribute, up to n-1 where n is the total number of values in the attribute. To obtain the total number of activity instances, use getActivityCount().

      For more information about input ports and how they are triggered, refer to Server Fundamentals.

      The following code example demonstrates how to start routing objects to users by calling addPackage on the first activity's input port, then checking the number of triggered input ports for each activity instance:


       // Create all activity and process objects first...
       IDfWorkflow wfObj = (IDfWorkflow)sess.newObject("dm_workflow");
       wfObj.setProcessId(procObj.getObjectId());
       wfObj.setSupervisorName("someUser")
       wfObj.execute();
       wfObj.addPackage(actObj1.getObjectName(), actObj1.getPortName(0),
            sysObj.getObjectName(), "dm_document", null, false, objList);
       for (int i = 0; i < wfObj.getActivityCount(); i++)
       {
            System.out.println("Activity " + i);
            System.out.println("Input Ports: + wfObj.getTriggerInput(i));
       {
       

      Parameters:
      valueIndex - the index position of the activity.
      Returns:
      the number of input ports triggered to start the activity.
      Throws:
      DfException - if the server returns an error.
    • getTriggerRevert

      int getTriggerRevert(int valueIndex) throws DfException
      Returns a value indicating whether a revert port was triggered for an activity instance.

      A revert port accepts packages coming back to an activity. That is, an activity performer can choose to send a package back to a prior activity. The prior activity accepts such returns through a revert port. After an activity accepts a package through a revert port, the activity is started for the reverted package and no more packages are accepted through any port, revert or input. Consequently, the value returned by this method is either 0 (no revert ports triggered) or 1 (1 revert port triggered).

      To execute this method, you must provide the activity's index position in the repeating attributes that store activity information in the workflow. Index positions begin at 0 and increment by 1 for each value in a repeating attribute, up to n-1 where n is the total number of values in the attribute. To obtain the total number of values, use getActivityCount().

      The following code example demonstrates how to start routing objects to users by calling addPackage on the first activity's input port, then checking if a revert port was triggered for each activity instance:


       // Create all activity and process objects first...
       IDfWorkflow wfObj = (IDfWorkflow)sess.newObject("dm_workflow");
       wfObj.setProcessId(procObj.getObjectId());
       wfObj.setSupervisorName("someUser")
       wfObj.execute();
       wfObj.addPackage(actObj1.getObjectName(), actObj1.getPortName(0),
            sysObj.getObjectName(), "dm_document", null, false, objList);
       for (int i = 0; i < wfObj.getActivityCount(); i++)
       {
            System.out.println("Activity " + i);
            System.out.println("Revert Port Triggered: + wfObj.getTriggerInput(i));
       {
       

      Parameters:
      valueIndex - the index position of the activity.
      Returns:
      0,no revert ports triggered, or 1, one revert port triggered.
      Throws:
      DfException - if the server returns an error.
    • getPreTimer

      IDfTime getPreTimer(int valueIndex) throws DfException
      Returns the pre-timer value for an activity.

      The pre-timer value defines the date and time at which the activity is expected to start. If that date and time arrives and the activity hasn't started, the server sends a message to the workflow's supervisor.

      The date and time is determined by the pre-timer value set in the activity's definition and the actual start date of the workflow.

      To execute this method, you must provide the activity's index position in the repeating attributes that store activity information in the workflow. Index positions begin at 0 and increment by 1 for each value in a repeating attribute, up to n-1 where n is the total number of values in the attribute. To obtain the total number of values, use getActivityCount().

      Parameters:
      valueIndex - the index position of the activity
      Returns:
      An IDfTime interface object that contains the date and time
      Throws:
      DfException - if the server returns an error
      See Also:
    • getPostTimer

      IDfTime getPostTimer(int valueIndex) throws DfException
      Returns the post-timer value for an activity.

      The post-timer value defines date and time by which the activity is expected to be completed. The post-timer is started when the activity starts. If the date and time arrive before the activity is completed, a message is sent to the workflow supervisor.

      The date and time are determined by the post-timer value set in the activity's definition and the actual start date of the activity.

      To execute this method, you must provide the activity's index position in the repeating attributes that store activity information in the workflow. Index positions begin at 0 and increment by 1 for each value in a repeating attribute, up to n-1 where n is the total number of values in the attribute. To obtain the total number of values, use getActivityCount().

      Parameters:
      valueIndex - the index position of the activity.
      Returns:
      An IDfTime interface object that contains the date and time
      Throws:
      DfException - if the server returns an error
      See Also:
    • getTotalWitem

      int getTotalWitem(int valueIndex) throws DfException
      Returns the number of work items generated by an activity.

      A work item object stores information about a task for a human or automatic performer. Workitems are generated by the workflow engine from an activity object. Users cannot create or modify workitems. >P> To execute this method, you must provide the activity's index position in the repeating attributes that store activity information in the workflow. Index positions begin at 0 and increment by 1 for each value in a repeating attribute, up to n-1 where n is the total number of values in the attribute. To obtain the total number of values, use getActivityCount().

      For more information about work items and their relationship to activities, refer to Server Fundamentals.

      Parameters:
      valueIndex - the index position of the activity
      Returns:
      The number of work items generated by the activity
      Throws:
      DfException - if the server returns an error
    • getCompleteWitem

      int getCompleteWitem(int valueIndex) throws DfException
      Returns the number of completed work items for an activity.

      A work item object stores information about a task for a human or automatic performer. Workitems are generated by the workflow engine from an activity object. Users cannot create or modify workitems. >P> To execute this method, you must provide the activity's index position in the repeating attributes that store activity information in the workflow. Index positions begin at 0 and increment by 1 for each value in a repeating attribute, up to n-1 where n is the total number of values in the attribute. To obtain the total number of values, use getActivityCount().

      For more information about work items and their relationship to activities, refer to Server Fundamentals.

      Parameters:
      valueIndex - the index position of the activity
      Returns:
      The number of completed work items
      Throws:
      DfException - if the server returns an error
    • getLastPerformer

      String getLastPerformer(int valueIndex) throws DfException
      Returns the name of the performer who most recently completed a work item for a particular activity.

      To execute this method, you must provide the activity's index position in the repeating attributes that store activity information in the workflow. Index positions begin at 0 and increment by 1 for each value in a repeating attribute, up to n-1 where n is the total number of values in the attribute. To obtain the total number of values, use getActivityCount().

      For more information about work items and their relationship to activities, refer to Server Fundamentals.

      Parameters:
      valueIndex - the index position of the activity
      Returns:
      The name of the last performer completing a work item in the activity
      Throws:
      DfException - if the server returns an error
    • getLastWitemId

      IDfId getLastWitemId(int valueIndex) throws DfException
      Returns the object ID of the most recently completed work item for a particular activity.

      A work item object stores information about a task for a human or automatic performer. Workitems are generated by the workflow engine from an activity object. Users cannot create or modify workitems. >P> To execute this method, you must provide the activity's index position in the repeating attributes that store activity information in the workflow. Index positions begin at 0 and increment by 1 for each value in a repeating attribute, up to n-1 where n is the total number of values in the attribute. To obtain the total number of values, use getActivityCount().

      For more information about work items and their relationship to activities, refer to Server Fundamentals.

      Parameters:
      valueIndex - the index position of the activity
      Returns:
      An IDfId interface to the object ID of the work item
      Throws:
      DfException - if the server returns an error
    • getPerformerFlag

      int getPerformerFlag(int valueIndex) throws DfException
      Indicates the activity performer's extra capabilities.

      A workflow designer can give an activity performer the ability to delegate and/or extend an activity. This method returns an integer value that indicates whether an activity's performer has either or both or neither of these abilities.

      To execute this method, you must provide the activity's index position in the repeating attributes that store activity information in the workflow. Index positions begin at 0 and increment by 1 for each value in a repeating attribute, up to n-1 where n is the total number of values in the attribute. To obtain the total number of values, use getActivityCount().

      Parameters:
      valueIndex - the index position of the activity
      Returns:
      An integer that corresponds to the special abilities assigned to the performer. Valid values and their meanings are:
       Value    Meaning
       0        Performer cannot delegate or extend the activity
       1        Performer can delegate the activity
       2        Performer can extend the activity
       3        Performer can delegate and extend the activity
      Throws:
      DfException - if the server returns an error
      See Also:
    • haltAll

      void haltAll() throws DfException
      Halts the workflow.

      You must be the workflow supervisor or a user with Sysadmin or Superuser privileges to halt a workflow. The workflow must be in in the running state and cannot have any automatic activities in the acquired state.

      Halting a workflow sets the workflow's state to halted and pauses all unfinished activities. Users cannot acquire tasks until the workflow is resumed. If you want to halt only one activity, use halt(int) or haltEx(int, int).

      For more information about halting workflows, refer to Server Fundamentals.

      Throws:
      DfException - if the server returns an error
      See Also:
    • resumeAll

      void resumeAll() throws DfException
      Moves a halted workflow to the running state.

      You must be the workflow supervisor or a user with Sysadmin or Superuser privileges to resume a workflow.

      Resuming a workflow sets the workflow's state to running. The workflow must be in the halted state to be resumed. Do not use this method to resume individual activities in the workflow. Use resume(int)for that purpose.

      For more information about resuming workflows, refer to Server Fundamentals.

      Throws:
      DfException - if the server returns an error
      See Also:
    • getAliasSetId

      IDfId getAliasSetId() throws DfException
      Returns the alias set object id for the workflow instance.

      Returns:
      The alias set object id of the workflow instance.
      Throws:
      DfException - if the server returns an error
    • getInstructionsCount

      int getInstructionsCount() throws DfException
      Returns the number of values the instructions attribute has.

      Returns:
      value count of the attribute instructions
      Throws:
      DfException - if server error occurs
      See Also:
    • getInstructions

      String getInstructions(int index) throws DfException
      Returns the instructions attribute at the specified index.

      Parameters:
      index - Index at which instructions returns
      Returns:
      instructions at index
      Throws:
      DfException - if server error occurs
      See Also:
    • setInstructions

      void setInstructions(int index, String instr) throws DfException
      Sets the instructions attribute at a specified index.

      Parameters:
      index - Index at which instructions sets
      instr - Name set to instructions
      Throws:
      DfException - if server error occurs
      See Also:
    • setPerformers

      void setPerformers(String actName, IDfList userGroupList) throws DfException
      Sets the performers attributes for the specified activity name.

      The values for the performer list depends on the performer type of the specified activity. Here is the valid values for each performer type:

       Performer Type    Valid performers
       0 - Workflow Supervisor                No effect
       1 - Repository Owner           No effect
       2 - Last Performer                     No effect
       3 - Specific User                      A single user name
       4 - All Users From Group               A single group name
       5 - Single User From Group     A single group name
       6 - Least Loaded User From Group               A single group name
       8, 9 - Some Users (Sequentially)               Any numbers of user names and/or group names (Note: For each group name provided, only one task will be generated and the first user who acquires the task owns the task.)
       10 - Single User From Work Queue               A single group name
       
      Parameters:
      actName - Activity name for which the performers is being set
      userGroupList - List of performers which contains user names and/or group names
      Throws:
      DfException - if server error occurs
    • getPerformerActivityNames

      IDfList getPerformerActivityNames() throws DfException
      Returns a list of user and group names for the specified performer activity name.

      Returns:
      List of activity names for which performers have been set
      Throws:
      DfException - if server error occurs
    • getPerformers

      IDfList getPerformers(String actName) throws DfException
      Returns a list of user and group names for the specified performer activity name.

      Parameters:
      actName - Activity name for which the performers is being returned
      Returns:
      List of performers which contains user names and/or group names
      Throws:
      DfException - if server error occurs
    • updateSupervisorName

      void updateSupervisorName(String supervisorName) throws DfException
      Change the supervisor of a running workflow.

      Parameters:
      supervisorName - User name of the new workflow supervisor.
      Throws:
      DfException - if a server error occurs
      Since:
      5.1
    • addAttachment

      IDfId addAttachment(String componentType, IDfId componentId) throws DfException
      Adds an attachment to the workflow.

      You must be the workflow supervisor to use this method. And the workflow must be in active state.

      This method adds an attachment, consisting of only one component, to the workflow.

      Parameters:
      componentType - the object type of the component. This is either the actual object type of the component or a supertype of the component.
      componentId - an object ID to the package's components.
      Returns:
      An IDfID interface to the attachment object.
      Throws:
      DfException - if the server returns an error.
      Since:
      5.3
      See Also:
    • removeAttachment

      void removeAttachment(IDfId attachmentId) throws DfException
      Removes an attachment from the workflow.

      You must be the workflow supervisor to use this method. And the workflow must be in active state.

      Parameters:
      attachmentId - an object ID to the attachment you are removing.
      Throws:
      DfException - if the server returns an error.
      Since:
      5.3
      See Also:
    • getAttachments

      IDfCollection getAttachments() throws DfException
      Returns a list of all the workflow's attachments.

      This method returns a collection that contains one query result object for each attachment. The query result objects have the following attributes:

          r_object_id
          r_component_id
          r_component_name
          r_component_type
          r_creator_name
          r_creation_date
       
      Refer to the description of the dmi_wf_attachment type in the EMC Documentum Object Reference Manual for a description of these attributes.

      Returns:
      An IDfCollection object that contains the specifiec attributes of the attachment
      Throws:
      DfException - if the query failed or the session has timed out and cannot be reestablished
      Since:
      5.3
    • getAttachment

      IDfWorkflowAttachment getAttachment(IDfId attachmentId) throws DfException
      Returns an attachment object given the ID of the object.

      Parameters:
      attachmentId - the object ID of the attachment.
      Returns:
      an IDfWorkflowAttachment object.
      Throws:
      DfException - if the server returns an error.
    • setPackageSkillLevel

      void setPackageSkillLevel(String packageName, int skillLevel) throws DfException
      Set the skill level of a given package.

      Parameters:
      packageName - the name of the package.
      skillLevel - the skill level of the package.
      Throws:
      DfException - if the server returns an error.
    • getPackageSkillLevel

      int getPackageSkillLevel(String packageName) throws DfException
      Returns the skill level of the given package.

      If there is no user skill level for this package, return 0. If no package with the packageName defined, return 0.

      Parameters:
      packageName - the name of the package.
      Returns:
      an integer.
      Throws:
      DfException - if the server returns an error.
    • getParentId

      IDfId getParentId() throws DfException
      Returns value of the 'parent_id' attribute.
      Returns:
      Id of the parent workflow object
      Throws:
      DfException
    • setParentId

      void setParentId(IDfId parentId) throws DfException
      Set parent_id attribute of the workflow
      Parameters:
      parentId -
      Throws:
      DfException
    • getParentActName

      String getParentActName() throws DfException
      Returns value of the 'parent_act_name' attribute.
      Returns:
      Act name of the parent workflow object from where the sub-process was launched
      Throws:
      DfException
    • setParentActName

      void setParentActName(String actName) throws DfException
      Set parent_act_name attribute of the workflow
      Parameters:
      actName -
      Throws:
      DfException
    • getParentActSeqno

      int getParentActSeqno() throws DfException
      Returns value of the 'parent_act_seqno' attribute.
      Returns:
      Act seqno of the parent workflow object from where the sub-process was launched
      Throws:
      DfException
    • setParentActSeqno

      void setParentActSeqno(int actSeqno) throws DfException
      Set parent_act_seqno attribute of the workflow
      Parameters:
      actSeqno -
      Throws:
      DfException
    • getInitiateAct

      String getInitiateAct() throws DfException
      Returns value of the 'initiate_act' attribute.
      Returns:
      Name of the initiate activity that started the workflow
      Throws:
      DfException
    • setInitiateAct

      void setInitiateAct(String actName) throws DfException
      Set initiate_act attribute of the workflow
      Throws:
      DfException
    • addPackageToInitiateAct

      void addPackageToInitiateAct(String packageName, String packageType, IDfList componentId) throws DfException
      This funtion would add the package to the start activities linked with the initiate activity that has been previously set by the setInitiateAct() API, if the package is defined on some input port of each start activity. If the setInitiateAct() API has not been called and therefore the initiate_act attribute has not been set yet, then this function would add the package to all start activities, if the package is defined on some input port of each start activity.
      Parameters:
      packageName - the name of a package. This must be a package that is already defined in the workflow definition.
      packageType - the object type of the component. This is either the actual object type of the component or a supertype of the component.
      componentId - an IDfList object that contains the object ID of the package's component, or null
      Throws:
      DfException
    • addPackageToInitiateAct

      void addPackageToInitiateAct(String packageName, String packageType, IDfList componentId, String noteText, boolean persistentNote, int skillLevel) throws DfException
      This funtion would add the package to the start activities linked with the initiate activity that has been previously set by the setInitiateAct() API, if the package is defined on some input port of each start activity. If the setInitiateAct() API has not been called and therefore the initiate_act attribute has not been set yet, then this function would add the package to all start activities, if the package is defined on some input port of each start activity.
      Parameters:
      packageName - the name of a package. This must be a package that is already defined in the workflow definition.
      packageType - the object type of the component. This is either the actual object type of the component or a supertype of the component.
      componentId - an IDfList object that contains the object ID of the package's component, or null
      noteText - a string that is either the note id or the note content. This can be empty if there is no note for the package.
      persistentNote - set this to true if you want the note defined in noteText to accompany the package through the entire workflow. Set this to false if you only want the note to go to performers of the activities immediately following the start activity. The notePersistent flag has no effect if noteText is empty.
      skillLevel - an Integer that indicates the required skill level of the package
      Throws:
      DfException
    • getCorrelationIdentifier

      String getCorrelationIdentifier() throws DfException
      Returns value of the 'correlation_identifier' attribute.
      Returns:
      String
      Throws:
      DfException