Class StandardWorkflowService

java.lang.Object
wt.services.StandardManager
wt.workflow.work.StandardWorkflowService
All Implemented Interfaces:
Serializable, wt.fc._NetFactor, NetFactor, wt.services.Manager, WorkflowService, WorkflowServiceSvr

public class StandardWorkflowService extends StandardManager implements WorkflowService, WorkflowServiceSvr, Serializable
Standard implementation of the workflow service interfaces

Use the newStandardWorkflowService static factory method(s), not the StandardWorkflowService constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: true

Extendable: false

See Also:
  • Method Details

    • getWorkItems

      public QueryResult getWorkItems(WTPrincipal principal) throws WTException, WfException
      Answer an enumeration of work items for a principal

      Supported API: true
      Specified by:
      getWorkItems in interface WorkflowService
      Parameters:
      principal - the assigned-to WTPrincipal used as search criteria
      Returns:
      QueryResult
      Throws:
      WTException
      WfException
    • getUncompletedWorkItems

      public QueryResult getUncompletedWorkItems(WTPrincipal principal) throws WTException, WfException
      Answer an enumeration of incomplete work items for a principal

      Supported API: true
      Specified by:
      getUncompletedWorkItems in interface WorkflowService
      Parameters:
      principal - the assigned-to WTPrincipal used as search criteria
      Returns:
      QueryResult
      Throws:
      WTException
      WfException
    • getWorkItems

      public QueryResult getWorkItems(WTPrincipal principal, Role role) throws WTException, WfException
      Answer an enumeration of work items for a principal for a specific role

      Supported API: true
      Specified by:
      getWorkItems in interface WorkflowService
      Parameters:
      principal - the assigned-to WTPrincipal used as search criteria
      role - the Role object used as search criteria
      Returns:
      QueryResult
      Throws:
      WTException
      WfException
    • getWorkItems

      public QueryResult getWorkItems(String source) throws WTException, WfException
      Answer an enumeration of work items created by a specific source

      Supported API: true
      Specified by:
      getWorkItems in interface WorkflowService
      Parameters:
      source - the name of the process (theLifeCycleTemplate) that created the WorkItem used as a search criteria
      Returns:
      QueryResult
      Throws:
      WTException
      WfException
    • getWorkItems

      public QueryResult getWorkItems(Persistable object) throws WTException, WfException
      Answer an enumeration of work items for an object

      Supported API: true
      Specified by:
      getWorkItems in interface WorkflowService
      Parameters:
      object - the persistable lifecyclemanaged object that is used as the search criteria
      Returns:
      QueryResult
      Throws:
      WTException
      WfException
    • getWorkItems

      public QueryResult getWorkItems(Persistable object, String source) throws WTException, WfException
      Answer an enumeration of work items for an object & source

      Supported API: true
      Specified by:
      getWorkItems in interface WorkflowService
      Parameters:
      object - the persistable lifecyclemanaged object that is used as the search criteria
      source - the name of the process (the LifeCycleTemplate name) that caused the work item to be created used as search criteria
      Returns:
      QueryResult
      Throws:
      WTException
      WfException
    • getWorkItems

      public QueryResult getWorkItems(Persistable object, WTPrincipal principal, Role role) throws WTException, WfException
      Get work by object & principal & role

      Supported API: true
      Specified by:
      getWorkItems in interface WorkflowService
      Parameters:
      object - the persistable lifecyclemanaged object that is used as search criteria
      principal - the assigned-to WTPrincipal that is used as search critieria
      role - the role object that is used as search criteria
      Returns:
      QueryResult
      Throws:
      WTException
      WfException
    • getWorkItems

      public QueryResult getWorkItems(Persistable object, WTPrincipal principal, String task) throws WTException, WfException
      Get work by object & principal & task

      Supported API: true
      Specified by:
      getWorkItems in interface WorkflowService
      Parameters:
      object - the persistable lifecyclemanaged object that is used as search criteria
      principal - the assigned-to WTPrincipal that is used as search critieria
      task - the task that is used as search criteria
      Returns:
      QueryResult
      Throws:
      WTException
      WfException
    • getWorkItems

      public QueryResult getWorkItems(Persistable object, WTPrincipal principal) throws WTException, WfException
      Get work by object & principa

      Supported API: true
      Specified by:
      getWorkItems in interface WorkflowService
      Parameters:
      object - the persistable lifecyclemanaged object that is used as search criteria
      principal - the assigned-to WTPrincipal that is used as search critieria
      Returns:
      QueryResult
      Throws:
      WTException
      WfException
    • getWorkItems

      public QueryResult getWorkItems(Persistable object, Role role) throws WTException, WfException
      Get work by object & role

      Supported API: true
      Specified by:
      getWorkItems in interface WorkflowService
      Parameters:
      object - the persistable lifecyclemanaged object that is used as search criteria
      role - the role object that is used as search criteria
      Returns:
      QueryResult
      Throws:
      WTException
      WfException
    • getUncompletedWorkItems

      public QueryResult getUncompletedWorkItems(Persistable object, Role role) throws WTException, WfException
      Get pending work by object & role

      Supported API: true
      Specified by:
      getUncompletedWorkItems in interface WorkflowService
      Parameters:
      object - the persistable lifecyclemanaged object that is used as search criteria
      role - the role object that is used as search criteria
      Returns:
      QueryResult
      Throws:
      WTException
      WfException
    • getWorkItems

      public QueryResult getWorkItems() throws WTException, WfException
      Answer an enumeration of all pending work items for all users

      Supported API: true
      Specified by:
      getWorkItems in interface WorkflowService
      Returns:
      QueryResult
      Throws:
      WTException
      WfException
    • getUncompletedWorkItems

      public QueryResult getUncompletedWorkItems() throws WTException, WfException
      Answer an enumeration of all pending work items for all users

      Supported API: true
      Specified by:
      getUncompletedWorkItems in interface WorkflowService
      Returns:
      QueryResult
      Throws:
      WTException
      WfException
    • getUncompletedWorkItems

      public QueryResult getUncompletedWorkItems(Persistable object, String task) throws WTException, WfException
      Get incomplete work items by object & task

      Supported API: true
      Specified by:
      getUncompletedWorkItems in interface WorkflowService
      Parameters:
      object - the persistable lifecyclemanaged object that is used as search criteria
      task - the task that is used as search criteria
      Returns:
      QueryResult
      Throws:
      WTException
      WfException
    • getAssignees

      public Vector getAssignees(WfAssignedActivity activity) throws WTException, WfException
      Answer a vector of principals assigned to the activity

      Supported API: true
      Specified by:
      getAssignees in interface WorkflowService
      Parameters:
      activity -
      Returns:
      Vector
      Throws:
      WTException
      WfException
    • workComplete

      public void workComplete(WorkItem workItem, WTPrincipalReference principalRef, Vector eventList) throws WTException, WfException
      Declare a workItem complete and transmit the event(s) to trigger.

      Supported API: true
      Specified by:
      workComplete in interface WorkflowService
      Parameters:
      workItem -
      principalRef -
      eventList -
      Throws:
      WTException
      WfException
    • workComplete

      public void workComplete(ObjectReference workItemRef, WTPrincipalReference principalRef, Vector eventList) throws WTException, WfException
      Declare a workItem complete and transmit the event(s) to trigger.

      Supported API: true
      Specified by:
      workComplete in interface WorkflowService
      Parameters:
      workItemRef -
      principalRef -
      eventList -
      Throws:
      WTException
      WfException
    • markWorkItemComplete

      public void markWorkItemComplete(WorkItem workItem, WTPrincipalReference completedBy) throws WTException, WfException
      Deprecated.
      Since R2 Mark the work item complete.


      Supported API: true
      Specified by:
      markWorkItemComplete in interface WorkflowService
      Parameters:
      workItem -
      completedBy - the performer of the work
      Throws:
      WTException
      WfException
    • markWorkItemComplete

      public void markWorkItemComplete(Persistable object, WTPrincipal completedBy, Role role) throws WTException, WfException
      Mark the work item defined by user, object & role as complete.

      Supported API: true
      Specified by:
      markWorkItemComplete in interface WorkflowService
      Parameters:
      object - the life cycle managed object associated with the work item
      completedBy - the performer of the work
      role - the role played by the actor
      Throws:
      WTException
      WfException
    • markWorkItemComplete

      public void markWorkItemComplete(Persistable object, WTPrincipal completedBy, String task) throws WTException, WfException
      Mark the work item defined by user, object & task as complete.

      Supported API: true
      Specified by:
      markWorkItemComplete in interface WorkflowService
      Parameters:
      object - the life cycle managed object associated with the work item
      completedBy - the performer of the work
      task - the role played by the actor
      Throws:
      WTException
      WfException
    • markWorkItemIncomplete

      public void markWorkItemIncomplete(Persistable object, WTPrincipal completedBy, Role role) throws WTException, WfException
      Mark the work item defined by user, object & role as NOT complete.

      Supported API: true
      Specified by:
      markWorkItemIncomplete in interface WorkflowService
      Parameters:
      object - the life cycle managed object associated with the work item
      completedBy - the performer of the work
      role - the role played by the completedBy principal
      Throws:
      WTException
      WfException
    • acceptAssignment

      public void acceptAssignment(WorkItem workItem, WTUser user) throws WTException, WfException


      Supported API: true
      Specified by:
      acceptAssignment in interface WorkflowService
      Parameters:
      workItem -
      user -
      Throws:
      WTException
      WfException
    • delegate

      public void delegate(WorkItem workItem, WTPrincipal principal) throws WTException, WfException
      Delegate a work item to a new owner

      Supported API: true
      Specified by:
      delegate in interface WorkflowService
      Parameters:
      workItem -
      principal -
      Throws:
      WTException
      WfException
    • sendNotification

      public void sendNotification(String msgBody, Vector recipients, Vector roles, Vector actorRoles, ObjectReference activityReference) throws WTException
      send email to a recipient list

      Supported API: true
      Specified by:
      sendNotification in interface WorkflowService
      Parameters:
      msgBody -
      recipients -
      roles -
      actorRoles -
      activityReference -
      Throws:
      WTException
    • sendNotification

      public void sendNotification(String subject, String msgBody, Vector recipients, Vector roles, Vector actorRoles, Vector projects, Vector variables, ObjectReference activityReference) throws WTException
      sendNotification resolves the principals and sends notification to them.

      Supported API: true
      Specified by:
      sendNotification in interface WorkflowService
      Parameters:
      subject -
      msgBody -
      recipients -
      roles -
      actorRoles -
      projects -
      variables -
      activityReference -
      Throws:
      WTException
    • createWorkListModel

      public WfWorkListModel createWorkListModel(String loadAction) throws WTException
      This method is used to construct a worklist on the server and return it to the client. The created worklist will contain either work items for all users, or work items for the current user.

      Supported API: true
      Specified by:
      createWorkListModel in interface WorkflowService
      Parameters:
      loadAction - The type of load action to be performed on the work list. Valid values are 'worklist-load-user' to load work items for the current user, or 'worklist-load-admin' to load work items for all users.
      Returns:
      WfWorkListModel
      Throws:
      WTException
    • createWorkListModel

      public WfWorkListModel createWorkListModel(String loadAction, Vector groupBy, Vector sortBy) throws WTException
      This method is used to construct a worklist on the server and return it to the client. The created worklist will contain either work items for all users, or work items for the current user.

      Supported API: true
      Specified by:
      createWorkListModel in interface WorkflowService
      Parameters:
      loadAction - The type of load action to be performed on the work list. Valid values are 'worklist-load-user' to load work items for the current user, or 'worklist-load-admin' to load work items for all users.
      groupBy - The ordered list of columns to be grouped for the work list. If no grouping is required then this parameter may be set to 'null' or an empty Vector may be sent in. Otherwise, this parameter takes a vector (of Strings) of column names to be grouped. The first column listed in the vector will be the first column grouped.
      sortBy - The ordered list of columns to be sorted for the work list. If no sorting is required then this parameter may be set to 'null' or an empty Vector may be sent in. Otherwise, this parameter takes a vector (of Strings) of column names to be sorted. The first column listed in the vector will be the first column sorted.
      Returns:
      WfWorkListModel
      Throws:
      WTException
    • createOverdueWorkItem

      public void createOverdueWorkItem(WfExecutionObject exec_obj) throws WTException
      Creates a work item corresponding to the actions to be taken on an overdue execution object.

      Supported API: true
      Specified by:
      createOverdueWorkItem in interface WorkflowService
      Parameters:
      exec_obj -
      Throws:
      WTException
    • reassignActivity

      public void reassignActivity(WfAssignedActivity activity) throws WTException
      Reassigns activity to principal referred to by special activity variable.

      Supported API: true
      Specified by:
      reassignActivity in interface WorkflowService
      Parameters:
      activity -
      Throws:
      WTException
    • reassignActivity

      public void reassignActivity(WfAssignedActivity activity, WTPrincipal principal) throws WTException
      Reassigns activity to principal referred to principal passed as parameter.

      Supported API: true
      Specified by:
      reassignActivity in interface WorkflowService
      Parameters:
      activity -
      principal -
      Throws:
      WTException
    • createTableModel

      public wt.clients.beans.table.WTTableModel createTableModel(String loadAction) throws WTException
      This method is used to construct a worklist on the server and return it to the client. The created worklist will contain either work items for all users, or work items for the current user.

      Supported API: true
      Specified by:
      createTableModel in interface WorkflowService
      Parameters:
      loadAction - The type of load action to be performed on the work list. Valid values are 'worklist-load-user' to load work items for the current user, or 'worklist-load-admin' to load work items for all users.
      Returns:
      WTTableModel
      Throws:
      WTException
    • createTableModel

      public wt.clients.beans.table.WTTableModel createTableModel(String loadAction, Vector groupBy, Vector sortBy) throws WTException
      This method is used to construct a worklist on the server and return it to the client. The created worklist will contain either work items for all users, or work items for the current user.

      Supported API: true
      Specified by:
      createTableModel in interface WorkflowService
      Parameters:
      loadAction - The type of load action to be performed on the work list. Valid values are 'worklist-load-user' to load work items for the current user, or 'worklist-load-admin' to load work items for all users.
      groupBy - The ordered list of columns to be grouped for the work list. If no grouping is required then this parameter may be set to 'null' or an empty Vector may be sent in. Otherwise, this parameter takes a vector (of Strings) of column names to be grouped. The first column listed in the vector will be the first column grouped.
      sortBy - The ordered list of columns to be sorted for the work list. If no sorting is required then this parameter may be set to 'null' or an empty Vector may be sent in. Otherwise, this parameter takes a vector (of Strings) of column names to be sorted. The first column listed in the vector will be the first column sorted.
      Returns:
      WTTableModel
      Throws:
      WTException
    • createTableModel

      public wt.clients.beans.table.WTTableModel createTableModel(String loadAction, Vector groupBy, Vector sortBy, WTObject contextObject) throws WTException
      This method is used to construct a worklist on the server and return it to the client. The created worklist will contain either work items for all users, or work items for the current user.

      Supported API: true
      Specified by:
      createTableModel in interface WorkflowService
      Parameters:
      loadAction - The type of load action to be performed on the work list. Valid values are 'worklist-load-user' to load work items for the current user, or 'worklist-load-admin' to load work items for all users.
      groupBy - The ordered list of columns to be grouped for the work list. If no grouping is required then this parameter may be set to 'null' or an empty Vector may be sent in. Otherwise, this parameter takes a vector (of Strings) of column names to be grouped. The first column listed in the vector will be the first column grouped.
      sortBy - The ordered list of columns to be sorted for the work list. If no sorting is required then this parameter may be set to 'null' or an empty Vector may be sent in. Otherwise, this parameter takes a vector (of Strings) of column names to be sorted. The first column listed in the vector will be the first column sorted.
      contextObject -
      Returns:
      WTTableModel
      Throws:
      WTException
    • tally

      public boolean tally(WfAssignedActivity self, WfTallyType policy, String operator, int value, String event) throws WTException
      This is the tally method that is called from the Custom Routing Event/...Event Firing Expression. It is exposed here for future client customization.

      Supported API: true
      Specified by:
      tally in interface WorkflowService
      Parameters:
      self -
      policy -
      operator -
      value -
      event -
      Returns:
      boolean
      Throws:
      WTException
    • replaceVariables

      public String replaceVariables(String txt, ProcessData variables) throws WTException
      Utility method that replaces values for variables whenever they occur. The parameters are a text String and a ProcessData object that holds the variables whose values must be replaced. In the text, a variable occurrence is represented by {var_name}, where:
      • var_name is the name of the variable
      • the delimiter characters '{' and '}' can be escaped by preceding hem by '\'

      The delimiter characters can be defined in wt.properties. The default are open and close curly braces ('{' and '}').

      Supported API: true

      Specified by:
      replaceVariables in interface WorkflowService
      Parameters:
      txt -
      variables -
      Returns:
      String
      Throws:
      WTException
    • isOffered

      public boolean isOffered(WorkItem workItem) throws WTException
      This is the method that indicates whether a WorkItem is offered and capable of being Accepted.

      Supported API: true
      Specified by:
      isOffered in interface WorkflowService
      Parameters:
      workItem -
      Returns:
      boolean
      Throws:
      WTException
    • getUncompletedWorkItems

      public QueryResult getUncompletedWorkItems(Integer query_limit, String sort_by_str) throws WTException, WfException
      Answer an enumeration of all pending work items for all users, sorted and only the first nnn number of workitems returned.

      Supported API: true
      Specified by:
      getUncompletedWorkItems in interface WorkflowService
      Parameters:
      query_limit -
      sort_by_str -
      Returns:
      QueryResult
      Throws:
      WTException
      WfException
    • sendNotification

      public void sendNotification(String subject, String msgBody, Vector recipients, Vector roles, Vector actorRoles, Vector projects, Vector variables, ObjectReference activityReference, String notificationTemplateName, WfExternalRecipientList emailAddrs, WfEmailAttachments attachments) throws WTException
      sendNotification resolves the principals and sends notification to them.

      Supported API: true
      Specified by:
      sendNotification in interface WorkflowService
      Parameters:
      subject -
      msgBody -
      recipients -
      roles -
      actorRoles -
      projects -
      variables -
      activityReference -
      notificationTemplateName -
      emailAddrs -
      attachments -
      Throws:
      WTException
    • setTaskBasedRights

      public void setTaskBasedRights(WorkItem wi, WTPrincipalReference p_ref) throws WTException
      Add rights to assignee that are defined in activity variables the reference persistable objects. For each variable it adds to the object the privileges specified in the variable template only if necessary, that is the participant doesn't have the privilege. If the the privilege is actually added, this is registered with the variable. Returns true if the workitem is changed.

      The privileges are added by changing the ad hoc ACL of the object. This means that this method only works if the object is ad hoc controlled.

      Supported API: true

      Specified by:
      setTaskBasedRights in interface WorkflowServiceSvr
      Parameters:
      wi -
      p_ref -
      Throws:
      WTException
    • revokeTaskBasedRights

      public void revokeTaskBasedRights(WorkItem wi) throws WTException
      Revoke rights that were granted for the execution of a task for each variable in the activity.

      Supported API: true
      Specified by:
      revokeTaskBasedRights in interface WorkflowServiceSvr
      Parameters:
      wi -
      Throws:
      WTException
    • getParticipantRolesInProcess

      public List<Role> getParticipantRolesInProcess(ObjectReference wfExecObjectRef) throws WTException
      API to return list of Participant Role for current Process/Activity/Block.

      Supported API: true

      Specified by:
      getParticipantRolesInProcess in interface WorkflowService
      Parameters:
      ObjectReference - : Referrence to current Process/Activity/Block
      Returns:
      List
      Throws:
      WTException
    • getParticipantRolePermissions

      public HashMap<Object,List<WTRolePermission>> getParticipantRolePermissions(ObjectReference wfExecObjRef) throws WTException
      API to return list of participant Roles with permissions to assignee on each Role for current Process/Activity/Block.

      Supported API: true

      Specified by:
      getParticipantRolePermissions in interface WorkflowService
      Parameters:
      ObjectReference - : Referrence to current Process/Activity/Block
      Returns:
      HashMap<Object, List Object: It will be ActorRole and Role. WTRolePermission: Custom object holding curerent Role and it's permissions.
      Throws:
      WTException