Interface IDfWorkitem

All Superinterfaces:
IDfPersistentObject, IDfTypedObject

public interface IDfWorkitem extends IDfPersistentObject
This interface contains the methods to manage work items, the runtime objects that represent the tasks associated with activity instances in a workflow.
  • Field Details

    • DF_WI_STATE_UNKNOWN

      static final int DF_WI_STATE_UNKNOWN
      The state of the workitem is unknown.
      Since:
      5.3
      See Also:
    • DF_WI_STATE_DORMANT

      static final int DF_WI_STATE_DORMANT
      The state of the workitem is Dormant.
      Since:
      5.3
      See Also:
    • DF_WI_STATE_ACQUIRED

      static final int DF_WI_STATE_ACQUIRED
      The state of the workitem is Acquired.
      Since:
      5.3
      See Also:
    • DF_WI_STATE_FINISHED

      static final int DF_WI_STATE_FINISHED
      The state of the workitem is Finished.
      Since:
      5.3
      See Also:
    • DF_WI_STATE_PAUSED

      static final int DF_WI_STATE_PAUSED
      The state of the workitem is Paused.
      Since:
      5.3
      See Also:
    • DF_WI_STATE_DHALTED

      static final int DF_WI_STATE_DHALTED
      The state of the workitem is DHalted.
      Since:
      5.3
      See Also:
    • DF_WI_STATE_AHALTED

      static final int DF_WI_STATE_AHALTED
      The state of the workitem is AHalted.
      Since:
      5.3
      See Also:
    • DF_WI_STATE_PHALTED

      static final int DF_WI_STATE_PHALTED
      The state of the workitem is PHalted.
      Since:
      5.3
      See Also:
    • DF_WI_STATE_FAULTED

      static final int DF_WI_STATE_FAULTED
      The state of the workitem is Faulted.
      Since:
      6.0
      See Also:
  • Method Details

    • getNextActivityNames

      IDfList getNextActivityNames() throws DfException
      Retrieves all activities that immediately follow this work item.

      For information about activities and how they are ordered within a workflow, refer to Server Fundamentals.

      The following code example demonstrates how to obtain an IDfWorkitem interface then display all activities that follow the current activity:


       IDfCollection tasks = sess.getTasks("someUser", DfSession.DF_TASKS, null, "task_name");
       while (tasks.next())
       {
             IDfWorkitem wi = (IDfWorkitem)sess.getObject(tasks.getId("item_id"));
             IDfList listObj = wi.getNextActivityNames();
             for (int i = 0; i < listObj.getCount(); i++)
             {
                 IDfActivity act = (IDfActivity)listObj.get(i);
                 System.out.println("Next Activities: " + act.getObjectName());
             }
       }
       

      Returns:
      an IDfList object that contains the activity names.
      Throws:
      DfException - if the query failed or the session has timed out and cannot be re-established.
    • getPreviousActivityNames

      IDfList getPreviousActivityNames() throws DfException
      Retrieves all activities that immediately preceeded this work item.

      For information about activities and how they are ordered within a workflow, refer to Server Fundamentals.

      Returns:
      An IDfList object that contains the activity names
      Throws:
      DfException - if the query failed or the session has timed out and cannot be re-established
    • getPackages

      IDfCollection getPackages(String additionalAttributes) throws DfException
      Returns a list of all the work item's packages.

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

          r_object_id
          r_component_id
          r_package_name
          r_package_type
          i_package_oprtn
          r_note_id
      plus any additional attributes passed in with the additionalAttributes parameter.

      Refer to the description of the dmi_package type in the EMC Documentum Object Reference Manual for a description of these attributes.

      Parameters:
      additionalAttributes - the additional package attributes that you want to retrieve
      Returns:
      An IDfCollection object that contains the specified attributes
      Throws:
      DfException - if the query failed or the session has timed out and cannot be reestablished
    • addPackage

      IDfId addPackage(String packageName, String packageType, IDfList componentId) throws DfException
      Adds a package to a work item.

      Packages represent the object or objects on which the work item's performer operates. This method can be used by the work item performer, the workflow supervisor, or a user with Sysadmin or Superuser privileges. The work item must be in the acquired state. Since 6.7, Content-Server also allows adding package to a failed (apaused) automatic work item.

      A package may have one component or no components. To add a package with no components, specify componentId as null.

      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.

      If you wish to add a package with a specified skill level, use addPackageEx(java.lang.String, java.lang.String, com.documentum.fc.common.IDfList, int).

      If you wish to add a note to the package, call IDfPackage.appendNote(java.lang.String, boolean) after addPackage.

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

      Parameters:
      packageName - the name of the package. This must be unique among the work item packages.
      packageType - the object type of the package. This is 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.
      Returns:
      An IDfId object that contains the object ID of the new package
      Throws:
      DfException - if the server returns an error
      See Also:
    • addPackageEx

      IDfId addPackageEx(String packageName, String packageType, IDfList componentId, int skillLevel) throws DfException
      Adds a package to a work item and specifies a skill level for the package.

      Packages represent the object or objects on which the work item's performer operates. A skill level is effective only for work items generated from activities placed on a workqueue. This method can be used by the work item performer, the workflow supervisor, or a user with Sysadmin or Superuser privileges. The work item must be in the acquired state. Since 6.7, Content-Server also allows adding package to a failed (apaused) automatic work item.

      A package may have one component or no components. To add a package with no components, specify componentId as null.

      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.

      If you wish to add a note to the package, call IDfPackage.appendNote(java.lang.String, boolean) after addPackage.

      For information about work items, packages, and package control, refer to Server Fundamentals. The Content Server Administrator's Guide describes how to enable or disable package contro. Refer to the Business Process Manager documentation for complete information about using skill levels.

      Parameters:
      packageName - the name of the package. This must be unique among the work item packages.
      packageType - the object type of the package. This is 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.
      skillLevel - an Integer that indicates the required skill level of the package.
      Returns:
      An IDfId object that contains the object ID of the new package
      Throws:
      DfException - if the server returns an error
    • addPackage

      IDfId addPackage(String packageName, String packageType, IDfList componentId, IDfList componentName) throws DfException
      Adds a package to a work item.

      Packages represent the object or objects on which the work item's performer operates. This method can be used by the work item performer, the workflow supervisor, or a user with Sysadmin or Superuser privileges. The work item must be in the acquired state. Since 6.7, Content-Server also allows adding package to a failed (apaused) automatic work item.

      A package may have one component or no components. To add a package with no components, specify componentId as null.

      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.

      If you wish to add a package with a specified skill level, use addPackageEx(java.lang.String, java.lang.String, com.documentum.fc.common.IDfList, int).

      If you wish to add a note to the package, call IDfPackage.appendNote(java.lang.String, boolean) after addPackage.

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

      Parameters:
      packageName - the name of the package. This must be unique among the work item packages.
      packageType - the object type of the package. This is 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.
      componentName - an IDfList object that contains the name of the package's component or null
      Returns:
      An IDfId object that contains the object ID of the new package
      Throws:
      DfException - if the server returns an error
      See Also:
    • addPackageEx

      IDfId addPackageEx(String packageName, String packageType, IDfList componentId, IDfList componentName, int skillLevel) throws DfException
      Adds a package to a work item and specifies a skill level for the package.

      Packages represent the object or objects on which the work item's performer operates. A skill level is effective only for work items generated from activities placed on a workqueue. This method can be used by the work item performer, the workflow supervisor, or a user with Sysadmin or Superuser privileges. The work item must be in the acquired state. Since 6.7, Content-Server also allows adding package to a failed (apaused) automatic work item.

      A package may have one component or no components. To add a package with no components, specify componentId as null.

      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.

      If you wish to add a note to the package, call IDfPackage.appendNote(java.lang.String, boolean) after addPackage.

      For information about work items, packages, and package control, refer to Server Fundamentals. The Content Server Administrator's Guide describes how to enable or disable package contro. Refer to the Business Process Manager documentation for complete information about using skill levels.

      Parameters:
      packageName - the name of the package. This must be unique among the work item packages.
      packageType - the object type of the package. This is 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.
      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 object that contains the object ID of the new package
      Throws:
      DfException - if the server returns an error
    • getPackage

      IDfPackage getPackage(IDfId packageId) throws DfException
      Returns a package object given the ID of the object.

      Packages represent the object on which the work item's performer operates. For information about work items and packages, refer to Server Fundamentals.

      The following code example demonstrates how to obtain an IDfWorkitem interface then display all packages for the current activity:


       IDfCollection tasks = sess.getTasks("someUser", DfSession.DF_TASKS, null, "task_name");
       while (tasks.next())
       {
            IDfWorkitem wi = (IDfWorkitem)sess.getObject(tasks.getId("item_id"));
            IDfActivity act = wi.getActivity();
            for (int i = 0; i < act.getPackageCount(); i++)
            {
                IDfId packageId = act.getPackageId(i);
                IDfPackage packageObj = wi.getPackage(packageId);
                System.out.println("Package Name: " + packageObj.getPackageName());
            }
       }
       

      Parameters:
      packageId - the object ID of the package.
      Returns:
      an IDfPackage object.
      Throws:
      DfException - if the server returns an error.
    • removePackage

      void removePackage(String packageName) throws DfException
      Removes a package from the work item.

      Packages represent the object on which the work item's performer operates. This method can be used by the work item performer, the workflow supervisor, or a user with Sysadmin or Superuser privileges. The work item must be in the acquired state. Since 6.7, Content-Server also allows removing package from a failed (apaused) automatic work item. For information about work items and packages, refer to Server Fundamentals.

      Parameters:
      packageName - the name of the package that you want to remove
      Throws:
      DfException - if the server returns an error
    • acquire

      void acquire() throws DfException
      Acquires a work item for the current user.

      Work items are tasks in the workflow. After a work item appears in a performer's inbox, the performer must acquire the work item before beginning work on the item. The user issuing this method must be the work item's performer or, if the assigned performer is a group, a member of the group, the workflow supervisor, or a user with Sysadmin or Superuser privileges.

      Note: If the enable_workitem_mgmt server.ini key is set to true, any user can acquire the work item. This key is set to false by default. The workflow must be in the running state, the activity that generated the work item must be in the installed state, and the work item must be in the dormant state.

      Executing this methods changes the work item's state to acquired, sets the actual_start_date attribute of the associated dmi_queue_item object, and sets the work item's r_performer_name attribute to the current user. Re-run the inbox query to refresh the inbox if you want the user to see the changes.

      For more information about workflows, refer to Server Fundamentals.

      The following code example demonstrates how to obtain an IDfWorkitem interface, then acquire and complete the task:


       IDfCollection tasks = sess.getTasks("someUser", DfSession.DF_TASKS, null, "task_name");
       while (tasks.next())
       {
            IDfPersistentObject pObj = sess.getObjectByQualification("dmi_queue_item where r_object_id='" +
                tasks.getId("r_object_id").toString() + "'");
            // Make sure the task(s) for this user are associated with the workflow
            if (pObj.getId("router_id").toString().equals(wfId.getId()))
            {
                IDfWorkitem wi = (IDfWorkitem)sess.getObject(tasks.getId("item_id"));
                wi.acquire();
                // Do some processing on the work item here
                wi.complete();
            }
       }
       

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

      void repeat(IDfList list) throws DfException
      Defines an extended round of work item performers.

      If an activity is defined as repeatable, the performer can designate additional performers for the associated work item. After the first performer completes the activity, the server puts the associated work item in the inboxes of the designated extended performers.

      For more information about this feature, refer to Server Fundamentals.

      Parameters:
      list - an IDfList object containing the names of the repository users and groups designated as extended performers
      Throws:
      DfException - if the server returns an error
      See Also:
    • setOutput

      void setOutput(IDfList list) throws DfException
      Sets the output ports.

      Typically, when a work item is completed, the server uses information in the workflow and activity definitions to determine the output ports. However, you can use this method to manually identify the output ports.

      The work item must be in the acquired state and the person issuing this method must be the activity's performer, the workflow supervisor, or a superuser.

      Parameters:
      list - an IDfList object that contains a list of the ports. These ports must already be defined for this work item.
      Throws:
      DfException - if the server returns an error
    • delegateTask

      void delegateTask(String user) throws DfException
      Delegates the work item to someone else.

      The work item's performer must have the ability to delegate the work item. That ability is set using IDfActivity.setPerformerFlag(int). For more information about work item delegation, refer to Server Fundamentals.

      Parameters:
      user - the name of the user to whom the work item is delegated
      Throws:
      DfException - if the server returns an error
    • getActivity

      IDfActivity getActivity() throws DfException
      Returns the work item's corresponding activity object.

      Every work item is associated with an activity. When the activity is started, the server generates the associated work items and puts them in the inboxes of the designated activity performers.

      The following code example demonstrates how to obtain an IDfWorkitem interface then obtain the corresponding activity object:


       IDfCollection tasks = sess.getTasks("someUser", DfSession.DF_TASKS, null, "task_name");
       while (tasks.next())
       {
            IDfWorkitem wi = (IDfWorkitem)sess.getObject(tasks.getId("item_id"));
            IDfActivity act = wi.getActivity();
            System.out.println("Activity Name: " + act.getObjectName());
       }
       

      Returns:
      an IDfActivity object that contains the object ID of the activity.
      Throws:
      DfException - if the server returns an error.
    • isDelegatable

      boolean isDelegatable() throws DfException
      Indicates whether the work item can be delegated.

      A work item can be delegated if its performer has been given the ability to delegate activities. When this is the case, the work item performer can give the work item to another user. Delegation is done with the method delegateTask(java.lang.String).

      For more information about delegating work items, refer to Server Fundamentals.

      Returns:
      true if task can be delegated; false if it cannot
      Throws:
      DfException - if the server returns an error
    • isRepeatable

      boolean isRepeatable() throws DfException
      Indicates whether the work item can be repeated.

      If an activity is defined as repeatable, the performer can designate additional (extended) performers for the associated work item. After the first performer completes the work item, the server puts the work item in the inboxes of the designated extended performers.

      For more information about the extension feature, refer to Server Fundamentals.

      Returns:
      true if the work item can be repeated; false if it cannot
      Throws:
      DfException - if the server returns an error
      See Also:
    • pause

      void pause() throws DfException
      Pauses the work item.

      The work item must be in the dormant state. The user issuing this method must be the workflow supervisor or a user with Sysadmin or Superuser privileges. If the method is successful, the work item's state is set to paused.

      Executing this methods changes information in the queue item associated with the work item. Re-run the inbox query to refresh the inbox if you want the user to see the changes.

      For more information about manipulating work item states, refer to Server Fundamentals.

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

      void resume() throws DfException
      Moves a paused work item to the dormant state.

      The user issuing this method must be the workflow supervisor or a user with Sysadmin or Superuser privileges. If the method is successful, the work item's state is set to dormant.

      Executing this methods changes information in the queue item associated with the work item. Re-run the inbox query to refresh the inbox if you want the user to see the changes.

      For more information about manipulating work item states, refer to Server Fundamentals.

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

      void complete() throws DfException
      Marks a work item as finished.

      The user issuing this method must be the work item's performer, the workflow supervisor, or a user with Sysadmin or Superuser privileges. The work item must be in the acquired state. If the method is successful, it sets the work item's state to finished.

      Note: If the activity that generated this work item has sign_off_required set to true, then the IDfPersistentObject.signoff(java.lang.String, java.lang.String, java.lang.String) method must be executed successfully before the complete method can be executed. To determine if a signoff is required, use the isSignOffRequired() method.

      Executing this method changes information in the queue item associated with the work item. Re-run the inbox query to refresh the inbox if you want the user to see the changes.

      The method also updates the r_complete_witem and r_last_performer attributes for the activity runtime instance in the workflow object.

      To provide a return value, record an error message or result document ID, then use completeEx(int, java.lang.String, com.documentum.fc.common.IDfId) instead of this method. For more information about manipulating work item states, refer to Server Fundamentals.

      If the activity that generated the work item has a route case transition defined using an XPath condition, you cannot use this method inside a user-defined transaction.

      The following code example demonstrates how to obtain an IDfWorkitem interface, then acquire and complete the task:


       IDfCollection tasks = sess.getTasks("someUser", DfSession.DF_TASKS, null, "task_name");
       while (tasks.next())
       {
            IDfPersistentObject pObj = sess.getObjectByQualification("dmi_queue_item where r_object_id='" +
                tasks.getId("r_object_id").toString() + "'");
            // Make sure the task(s) for this user are associated with the workflow
            if (pObj.getId("router_id").toString().equals(wfId.getId()))
            {
                IDfWorkitem wi = (IDfWorkitem)sess.getObject(tasks.getId("item_id"));
                wi.acquire();
                // Do some processing on the work item here
                wi.complete();
            }
       }
       

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

      void completeEx2(int returnValue, String execOSError, IDfId execResultId, int userTime, double userCost) throws DfException
      Marks the work item as complete.

      The user issuing this method must be the work item's performer, the workflow supervisor, or a user with Sysadmin or Superuser privileges. The work item must be in the acquired state. If the method is successful, it sets the work item's state to finished.

      Use this method instead of complete() when you want to record a return value, OS error number, or result document ID for the completed work item.

      Executing this method changes information in the queue item associated with the work item. Re-run the inbox query to refresh the inbox if you want the user to see the changes.

      The method also updates the r_complete_witem and r_last_performer attributes for the activity runtime instance in the workflow object.

      Note: If the activity that generated this work item has sign_off_required set to true, then the IDfPersistentObject.signoff(java.lang.String, java.lang.String, java.lang.String) method must be executed successfully before the completeEx method can be executed. To determine if a signoff is required, use the isSignOffRequired() method.

      Parameters:
      returnValue - set this to 0 to indicate that the work item completed successfully. Set this to a non-zero integer to indicate the work item did not complete successfully. The actual non-zero value you use will depend on your business rules.
      execOSError - set this to the error number or message that indicates the cause of failure. This may be up to 255 characters.
      execResultId - an IDfId object that contains the object ID of the document whose content contains the results of the work item's execution. This parameter is valid only for automatic activities.
      userTime - an integer value that indicates the time user spent on this task.
      userCost - a double value that indicates the cost user spent on this task.
      Throws:
      DfException - if the server returns an error
    • getWorkflowId

      IDfId getWorkflowId() throws DfException
      Returns the object ID of the workflow that contains this work item.

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

      int getActSeqno() throws DfException
      Returns the sequence number of the activity with which the work item is associated.

      Activities occur in a defined sequence. When each activity is started, the server assigns the activity a sequence number.

      Returns:
      The activity's sequence number
      Throws:
      DfException - if the server returns an error
    • getPerformerName

      String getPerformerName() throws DfException
      Returns the name of the work item's performer.

      The performer is the person or group to whom the work item is assigned. The performer is specified in the associated activity's definition.

      Returns:
      The name of the work item's performer
      Throws:
      DfException - if the server returns an error
    • getCreationDate

      IDfTime getCreationDate() throws DfException
      Returns the date on which the work item was created.

      When an activity is started, the server generates the needed work items and puts them in the inboxes of the designated performers. This method returns the date on which that occurred for this work item.

      Returns:
      An IDfTime object that contains the date and time of the work item's creation
      Throws:
      DfException - if the server returns an error
    • getDueDate

      IDfTime getDueDate() throws DfException
      Returns the work item's due date.

      The due date is the date by which the work item is expected to be completed.

      Returns:
      An IDfTime object that contains the due date
      Throws:
      DfException - if the server returns an error
    • getPriority

      int getPriority() throws DfException
      Returns the priority assigned to the work item.

      The priority is user-defined. It is set when the activity is added to the workflow definition. For more information about priorities, refer to Server Fundamentals.

      Returns:
      An integer value that corresponds to the priority
      Throws:
      DfException - if the server returns an error
      See Also:
    • getAutoMethodId

      IDfId getAutoMethodId() throws DfException
      Returns the object ID of the method that invokes the work item's application.

      getAutoMethodId is only valid if the work item is generated from an automatic activity. An automatic activity is an activity whose operations are performed by an application.

      This method returns the ID of the method object which invokes the application that performs the work item operations.

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

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

      int getReturnValue() throws DfException
      Returns the return value.

      The return value indicates whether the work item was successfully completed. It is set when the performer marks the work item as complete using the completeEx(int, java.lang.String, com.documentum.fc.common.IDfId) method.

      Returns:
      The return value. This is 0 if the work item completed successfully or a non-zero value (defined by the user) if the work item failed.
      Throws:
      DfException - if the server returns an error
    • getExecResultId

      IDfId getExecResultId() throws DfException
      Returns the object ID of the document containing the results of the application's execution.

      This method is valid only for automatic activities. The operations associated with automatic activities are performed by an application. The workflow designer can choose to save the application's results to a document (refer to IDfActivity.setExecSaveResults(boolean)).

      For more information about executing automatic activities, refer to Server Fundamentals.

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

      boolean isExecLaunch() throws DfException
      Indicates whether the application failed.

      This method is valid only for automatic activities. The exec launch value is set by the method associated with the activity that generated the work item. The value matches the value in the launch_failed attribute of result object returned by the method.

      For more information about a method's query result object and its attributes, refer to the description in the DQL EXECUTE statement description in the DQL Reference Manual.

      Returns:
      true if the method's application did not complete successfully; false if the application is successfull the return value is non-zero
      Throws:
      DfException - if the server returns an error
    • isExecTimeOut

      boolean isExecTimeOut() throws DfException
      Indicates whether the application timed out.

      This method is valid only for automatic activities. The method tells you whether the application that performs the work item's operations has timed out. You can specify a timeout period in the method definition, in the activity's definition, or in both (the application is invoked by a method). A timeout specified in the activity definition overrides a timeout specified in the method's definition.

      For information about defining methods, refer to the Server Administrator's Guide.

      Returns:
      true if the application has timed out; false if it has not
      Throws:
      DfException - if the server returns an error
      See Also:
    • getExecOsError

      String getExecOsError() throws DfException
      Returns the error string, if any.

      This method is valid only for automatic activities. If the application that performs the activity's operations fails, the system records the error string if possible.

      For information about automatic activities and their execution, refer to Server Fundamentals.

      Returns:
      The error string
      Throws:
      DfException - if the server returns an error
    • getOutputPort

      String getOutputPort(int valueIndex) throws DfException
      Returns the name of an output port of the work item.

      Output ports are recorded in a repeating attribute in work items. To execute this method, you must provide the output port's index position in the repeating attribute.

      Index positions begin at 0 and increment by 1 for each value in the attribute, up to n-1, where n is the total number of values in the attribute. To obtain the total number of values, use getOutputPortCount().

      Parameters:
      valueIndex - the index position of the output port
      Returns:
      The name of the output port
      Throws:
      DfException - if the server returns an error
    • getOutputPortCount

      int getOutputPortCount() throws DfException
      Returns the number of output ports for the work item.

      Returns:
      The number of output ports
      Throws:
      DfException - if the server returns an error
    • getExtendedPerformer

      String getExtendedPerformer(int valueIndex) throws DfException
      Returns the name of an extended performer.

      If the activity that generated the work item is repeatable, the work item's performer can designate one or more users to perform the work item again in a extended round of operations. When the first performer finishes the work item, the server checks whether any extended performers are defined. If so, the server creates a new work item for each user or group in the list of extended performers.

      The list of extended performers is recorded in the work item in a repeating attribute. To execute getExtendedPerformer, you must provide the extended performer's index position in the repeating attribute.

      Index positions begin at 0 and increment by 1 for each value in the attribute, up to n-1, where n is the total number of values in the attribute. To obtain the total number of values, use getExtendedPerformerCount().

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

      int getExtendedPerformerCount() throws DfException
      Returns the number of extended performers for the work item.

      This method is valid only for work items generated by repeatable activities. Repeatable activities allow their performers to designate another set of users to perform the associated work items again, after the first performance is completed. The second set of performers are called the extended performers. For more information about repeatable activities and extended performers, refer to Server Fundamentals.

      Returns:
      The number of extended performers
      Throws:
      DfException - if the server returns an error
    • getRuntimeState

      int getRuntimeState() throws DfException
      Returns the work item's state.

      For information about work item states, refer to Server Fundamentals.

      Returns:
      An integer value that corresponds to the work item's state. Valid values and their meanings are:
       Value    Meaning
       0        Dormant
       1        Acquired
       2        Finished
       3        Paused
      Throws:
      DfException - if the server returns an error
    • getQueueItemId

      IDfId getQueueItemId() throws DfException
      Returns the object ID of the queue item corresponding to the work item.

      Every work item has a corresponding queue item that represents the queued work item in a user's inbox. For information about the attributes of the queue item, refer to the EMC Documentum Object Reference Manual. To manipulate the queue item, use the IDfQueueItem interface.

      The following code example demonstrates how to obtain an IDfQueueItem interface:


       IDfCollection tasks = sess.getTasks("someUser", DfSession.DF_TASKS, null, "task_name");
       while (tasks.next())
       {
            IDfWorkitem wi = (IDfWorkitem)sess.getObject(tasks.getId("item_id"));
            IDfId queueItemId = wi.getQueueItemId();
            IDfQueueItem qi = (IDfQueueItem)sess.getObject(queueItemId);
            System.out.println("Item Name: " + qi.getItemName());
       }
       

      Returns:
      an IDfId object that contains the object ID of the queue item.
      Throws:
      DfException - if the server returns an error.
    • getActDefId

      IDfId getActDefId() throws DfException
      Returns the object ID of the activity definition whose runtime instance generated the work item.

      Activity defintions are stored in dm_activity objects. When an activity is started, the server generates the activity's runtime instance and the required work items. The work items are queued to the specified performers.

      Returns:
      An IDfId object that contains the object ID of the activity definition
      Throws:
      DfException - if the server returns an error
    • isSignOffRequired

      boolean isSignOffRequired() throws DfException
      Indicates whether the work item requires a sign off.

      The workflow designer can define an activity such that its generated work items must be signed off by the performers as part of the completion requirements. This method indicates whether the work item has such a requirement.

      Returns:
      true if sign off is required; false if not
      Throws:
      DfException - if the server returns an error
    • isManualTransition

      boolean isManualTransition() throws DfException
      Indicates whether the work item's transition is manual.

      Each activity has a transition type that defines how the transition from that activity to the next is handled by the workflow. Transition types are specified when the activity is defined. There are three valid transition types: prescribed, manual, and automatic. For information about these, refer to Server Fundamentals.

      Returns:
      true if the transition type is manual; false if it is not
      Throws:
      DfException - if the server returns an error
    • getRejectActivities

      IDfList getRejectActivities() throws DfException
      Returns a list of activity objects that have at least one revert port.

      A revert port allows an activity to accept packages that have been sent back by a following activity.

      For more information about revert ports, refer to Server Fundamentals.

      Returns:
      An IDfList object containing a list of activities
      Throws:
      DfException - if the server returns an error
    • getForwardActivities

      IDfList getForwardActivities() throws DfException
      Returns a list of IDfActivity interfaces that have at least one input port linked to one of the current activity's output ports.

      Input and output ports are the means by which a package moves through a workflow. The ports are defined in activity definitions. The links between the ports are defined in the workflow's definition. For more detailed information about ports and links, refer to Server Fundamentals.

      The following code example demonstrates how to obtain an IDfWorkitem interface then display all activities who have input ports connected to the current activity's output port:


       IDfCollection tasks = sess.getTasks("someUser", DfSession.DF_TASKS, null, "task_name");
       while (tasks.next())
       {
            IDfWorkitem wi = (IDfWorkitem)sess.getObject(tasks.getId("item_id"));
            IDfList listObj = wi.getForwardActivities();
            for (int i = 0; i < listObj.getCount(); i++)
            {
                IDfActivity act = (IDfActivity)listObj.get(i);
                System.out.println("Activity Name: " + act.getObjectName());
            }
       }
       

      Returns:
      an IDfList object that contains a list of IDfActivity interfaces.
      Throws:
      DfException - if the server returns an error.
    • setOutputByActivities

      void setOutputByActivities(IDfList actList) throws DfException
      Defines the next activities to be assigned packages in the workflow.

      This method defines, by name, the activities that follow this work item. Typically, when a work item is completed, the server uses information in the workflow and activity definitions to determine the output ports. However, you can use this method to manually identify the output ports.

      The following code example demonstrates how to obtain an IDfWorkitem interface then set the output to the last activity in the workflow:


       IDfCollection tasks = sess.getTasks("someUser", DfSession.DF_TASKS, null, "task_name");
       while (tasks.next())
       {
            IDfWorkitem wi = (IDfWorkitem)sess.getObject(tasks.getId("item_id"));
            IDfList listObj = wi.getNextActivityNames();
            for (int i = 0; i < listObj.getCount(); i++)
            {
                // Loop to the last activity...
            }
            // Set the output to the last activity thus skipping the
            // other activities in this workflow
            IDfActivity act = (IDfActivity)listObj.get(i - 1);
            IDfList actList = new IDfList();
            actList.append(act);
            wi.setOutputByActivities(actList);
       }
       

      Parameters:
      actList - an IDfList object that contains a list of the activity names.
      Throws:
      DfException - if the server returns an error.
    • getMissingOutputPackages

      IDfCollection getMissingOutputPackages() throws DfException
      Returns a collection whose result objects describe all output ports in the work item that don't have a package.

      Before a work item can be considered completed, all output ports must have an associated package. This method returns the output ports that are awaiting packages and the binding conditions for each package.

      For more information about ports, packages, and package binding conditions, refer to Server Fundamentals.

      Returns:
      an IDfCollection object representing a collection containing one query result object for each missing package. The query result objects have the following attributes:
       r_port_type
       r_port_name
       r_package_name
       r_package_type
       r_package_label
       r_package_flag (if the repository supports this attribute)
       
      Throws:
      DfException - if the server returns an error.
    • completeEx

      void completeEx(int returnValue, String execOSError, IDfId execResultId) throws DfException
      Marks the work item as complete.

      The user issuing this method must be the work item's performer, the workflow supervisor, or a user with Sysadmin or Superuser privileges. The work item must be in the acquired state. If the method is successful, it sets the work item's state to finished.

      Use this method instead of complete() when you want to record a return value, OS error number, or result document ID for the completed work item.

      Executing this method changes information in the queue item associated with the work item. Re-run the inbox query to refresh the inbox if you want the user to see the changes.

      Parameters:
      returnValue - set this to 0 to indicate that the work item completed successfully. Set this to a non-zero integer to indicate the work item didn't complete successfully. The actual non-zero value you use will depend on your business rules.
      execOSError - set this to the error number or message that indicates the cause of failure.
      execResultId - an IDfId object that contains the object ID of the document whose content contains the results of the work item's execution. This parameter is valid only for automatic activities.
      Throws:
      DfException - if the server returns an error
    • isManualExecution

      boolean isManualExecution() throws DfException
      Indicates whether the work item's associated activity is a manual activity.

      Activities are defined as manual or automatic. If an activity is manual, the work item is performed by a human being. If the activity is automatic, the work item is performed by an application or procedure.

      Returns:
      true if the associated activity is a manual activity; false if it is not
      Throws:
      DfException - if the server returns an error
    • getLaunchTimeout

      IDfTime getLaunchTimeout() throws DfException
      Returns the launch timeout value of this work item.

      Returns:
      r_launch_timeout attribute of this work item
      Throws:
      DfException - if server error occurs
    • 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
    • setPriority

      void setPriority(int newPriority) throws DfException
      Sets the priority.

      The workitem can not be in finished state. The workflow must be in running state.

      The person issuing this method must be the workflow supervisor or superuser, the workitem's performers can not change priority of their workitems. If enable_workitem_mgmt is set to T in server.ini file, then any user can issue this method.

      Parameters:
      newPriority - set priority of the workitem to newPriority
      Throws:
      DfException - if server error occurs
    • addAttachment

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

      You must be the task performer to use this method. And the task 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 task performer to use this method. And the task 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.
    • getAllPackages

      IDfCollection getAllPackages(String additionalAttributes) throws DfException
      Returns a query result collection containing the following attributes: String documentIDs object ID's of documents, separated by commas String r_package_name String r_packageType String i_package_oprtn IDfId r_note_id

      This differs from getPackages by returning both visible and invisible packages.

      Parameters:
      additionalAttributes - for the query string. The parameter has the form of a comma delimited string
      Returns:
      an IDfCollection.
      Throws:
      DfException - if the query failed or the session has timed out and cannot be reestablished.
    • getUserCost

      double getUserCost() throws DfException
      Returns the user assignable cost provided at completion time.
      Returns:
      the user assignable cost provided at completion time
      Throws:
      DfException
    • getUserTime

      int getUserTime() throws DfException
      Returns the user assignable time provided at completion time.
      Returns:
      the user assignable time provided at completion time
      Throws:
      DfException
    • queue

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

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


       IDfWorkitem wkitem = ...
       IDfTime t = new DfTime("08/09/2000", "mm/dd/yyyy");
       IDfId inboxId = wkitem.queue("tuser","EventName",1,false,t,"Please review");
       

      Parameters:
      user - the name of the user. You can specify this as null if you wish, which is interpreted to mean the workflow supervisor.
      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.
    • 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.
    • getSkillLevel

      int getSkillLevel() throws DfException
      Returns the skill level of the task.

      The skill_level is stored in the 'position' attibute of the task's queueitem.

      Returns:
      an integer.
      Throws:
      DfException - if the server returns an error.
    • getTargetTaskId

      IDfId getTargetTaskId() throws DfException
      Returns value of the r_target_task_id attribute
      Returns:
      Throws:
      DfException
    • getExecRetriedCount

      int getExecRetriedCount() throws DfException
      Returns value of the r_exec_retried_count attribute.
      Returns:
      The exec retried count.
      Throws:
      DfException