wt.workflow.work
Class StandardWorkflowService

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.workflow.work.StandardWorkflowService
All Implemented Interfaces:
Manager, NetFactor, Serializable, 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:
Serialized Form

Field Summary
private static String CLASSNAME
           
private static String DEFAULT_NOTIFICATION_SENDER
           
private static String DEFAULT_ROLE
           
private static boolean DO_DYNAMIC_UPDATE
           
private static char END_VARIABLE
           
private static char ESCAPE_CHARACTER
           
private static String OVERDUE_TASK_NAME
           
private static String REASSIGN_PRINCIPAL_VARIABLE_NAME
           
private static String RESOURCE
           
private static String ROBOT_NOTIFICATION_TEMPLATE
           
private static String SERVICE_NAME
           
private static char START_VARIABLE
           
private static String URL_PROCESSOR_METHOD
           
private static boolean VERBOSE
           
private static String WORK_NOTIFICATION_TEMPLATE
           
 
Fields inherited from class wt.services.StandardManager
 
Fields inherited from interface wt.services.Manager
MANAGER_SERVICE, STARTUP_AUTOMATIC, STARTUP_MANUAL, STATUS_EMERGENCY_SHUTDOWN, STATUS_EMERGENCY_SHUTTING_DOWN, STATUS_SHUTDOWN, STATUS_SHUTDOWN_ERRORS, STATUS_SHUTDOWN_FAILURE, STATUS_SHUTTING_DOWN, STATUS_STARTED, STATUS_STARTED_ERRORS, STATUS_STARTING_UP, STATUS_STARTUP_FAILURE
 
Constructor Summary
StandardWorkflowService()
           
 
Method Summary
 void acceptAssignment(WorkItem workItem, WTUser user)
          

Supported API: true
private  void addElementNoDup(Vector v, Object obj)
           
private  void addElementsNoDup(Vector v, Enumeration e)
           
private  void addTeamPrincipals(TeamTemplate teamT, Vector recipients, WfProcess process)
          Add principals to recipients that are resolved from team template.
private  void addTeamPrincipals(Team team, Vector recipients)
          Add principals to recipients that are resolved from team.
private  void addTeamPrincipals(Vector teams, Vector recipients, WfProcess process)
          Add principals to recipients that are resolved from teams.
private  void addVariablePrincipals(Vector variables, Vector recipients, Vector roles, Vector actor_roles, ObjectReference act_ref)
          Add principals to recipients that are resolved from teams.
private  WTDistributionList buildDistributionList(WfProcess p, Vector recipients, Vector roles, Vector actorRoles)
           
private  QuerySpec buildOwnerQuery(WTPrincipal p)
          This is a new buildOwnerQuery implementing a WHERE IN clause.
 void checkoutTo(WTObject object, WTPrincipalReference pRef, Role role, ActorRole actorRole, ObjectReference activityRef)
          checkout a business object to a principal.
private  TemplateNotification createNotification(WTDistributionList aDL, String subject, String msgBody, WfProcess p, ObjectReference activityReference)
           
 void createOverdueWorkItem(WfExecutionObject exec_obj)
          Creates a work item corresponding to the actions to be taken on an overdue execution object.
 WTTableModel createTableModel(String loadAction)
          This method is used to construct a worklist on the server and return it to the client.
 WTTableModel createTableModel(String loadAction, Vector groupBy, Vector sortBy)
          This method is used to construct a worklist on the server and return it to the client.
 WTTableModel createTableModel(String loadAction, Vector groupBy, Vector sortBy, WTObject contextObject)
          This method is used to construct a worklist on the server and return it to the client.
 WfWorkListModel createWorkListModel(String loadAction)
          This method is used to construct a worklist on the server and return it to the client.
 WfWorkListModel createWorkListModel(String loadAction, Vector groupBy, Vector sortBy)
          This method is used to construct a worklist on the server and return it to the client.
 void delegate(WorkItem workItem, WTPrincipal principal)
          Delegate a work item to a new owner

Supported API: true
 void delegate(WorkItem workItem, WTPrincipal principal, boolean bypassAccess)
           
 void doDynamicUpdate(TeamReference team)
          Causes the workflow process instances using this team to re-resolve their actors and roles.
 void doDynamicUpdate(WfProcess process)
          Causes the workflow process instance passed in to re-resolve actors and roles from its associated Team.
private  Enumeration getAssignedActivities(WfProcess process, WfState state)
           
 Vector getAssignees(WfAssignedActivity activity)
          Answer a vector of principals assigned to the activity

Supported API: true
private  WTPrincipal getCheckoutUser(WTPrincipalReference pRef, Role role, ActorRole actor, ObjectReference activityRef)
          Checkout robot support
 String getConceptualClassname()
          Deprecated.  
private static ObjectIdentifier getOid(Object obj)
           
private  WfProcess getParentProcess(ObjectReference activityReference)
          Utilities *
private  String getStringRepresentation(Object value)
          Constructs a String representation of the object passed as parameter.
 QueryResult getUncompletedWorkItems()
          Answer an enumeration of all pending work items for all users

Supported API: true
 QueryResult getUncompletedWorkItems(Integer query_limit, String sort_by_str)
          Answer an enumeration of all pending work items for all users, sorted and only the first nnn number of workitems returned.
 QueryResult getUncompletedWorkItems(Persistable object, Role role)
          Get pending work by object & role

Supported API: true
 QueryResult getUncompletedWorkItems(Persistable object, String task)
          Get incomplete work items by object & task

Supported API: true
 QueryResult getUncompletedWorkItems(Project2 context)
          Deprecated. use instead getUncompletedWorkItems (WTContainerRef.newWTContainerRef (project))
 QueryResult getUncompletedWorkItems(WTContainerRef context_ref)
          Answer an enumeration of incomplete work items for a project

Supported API: false
 QueryResult getUncompletedWorkItems(WTPrincipal principal)
          Answer an enumeration of incomplete work items for a principal

Supported API: true
 QueryResult getUncompletedWorkItems(WTPrincipal principal, Integer query_limit, String sort_by_str)
          Answer an enumeration of incomplete work items for a principal, sorted and only the first nnn number of workitems returned.
 QueryResult getUncompletedWorkItems(WTPrincipal principal, Project2 context)
          Deprecated. use instead getUncompletedWorkItems (WTUser, WTContainerRef.newWTContainerRef (project))
 QueryResult getUncompletedWorkItems(WTPrincipal principal, WTContainerRef context_ref)
          Answer an enumeration of incomplete work items for a principal within a project

Supported API: false
 QueryResult getUncompletedWorkItems(WTPrincipal principal, WTContainerRef context_ref, Integer query_limit, String sort_by_str)
          Answer an enumeration of incomplete work items for a principal within a WTContainer, sorted and only the first nnn number of workitems returned.
private  String getValue(ProcessData vars, String var_name)
           
private  ProcessData getVariables(ObjectReference exec_obj_ref)
          Returns variables associated to execution object referenced by argument.
private  WorkItem getWorkItem(Persistable object, WTPrincipal owner, Role role)
           
 QueryResult getWorkItems()
          Answer an enumeration of all pending work items for all users

Supported API: true
 QueryResult getWorkItems(Persistable object)
          Answer an enumeration of work items for an object

Supported API: true
 QueryResult getWorkItems(Persistable object, Role role)
          Get work by object & role

Supported API: true
 QueryResult getWorkItems(Persistable object, String source)
          Answer an enumeration of work items for an object & source

Supported API: true
 QueryResult getWorkItems(Persistable object, WTPrincipal principal)
          Get work by object & principa

Supported API: true
 QueryResult getWorkItems(Persistable object, WTPrincipal principal, Role role)
          Get work by object & principal & role

Supported API: true
 QueryResult getWorkItems(Persistable object, WTPrincipal principal, String task)
          Get work by object & principal & task

Supported API: true
 QueryResult getWorkItems(String source)
          Answer an enumeration of work items created by a specific source

Supported API: true
 QueryResult getWorkItems(WTPrincipal principal)
          Answer an enumeration of work items for a principal

Supported API: true
 QueryResult getWorkItems(WTPrincipal principal, Role role)
          Answer an enumeration of work items for a principal for a specific role

Supported API: true
 boolean isOffered(WorkItem workItem)
          This is the method that indicates whether a WorkItem is offered and capable of being Accepted.
 void markWorkItemComplete(Persistable object, WTPrincipal completedBy, Role role)
          Mark the work item defined by user, object & role as complete.
 void markWorkItemComplete(Persistable object, WTPrincipal completedBy, String task)
          Mark the work item defined by user, object & task as complete.
 void markWorkItemComplete(WorkItem workItem, WTPrincipalReference completedBy)
          Deprecated. Since R2 Mark the work item complete.
 void markWorkItemIncomplete(Persistable object, WTPrincipal completedBy, Role role)
          Mark the work item defined by user, object & role as NOT complete.
static StandardWorkflowService newStandardWorkflowService()
          Default factory for the class.
private  SearchCondition onIncomplete()
           
private  SearchCondition onObject(Persistable object)
           
private  SearchCondition onOwner(WTPrincipal p)
           
private  SearchCondition onProject2Dom(AdministrativeDomain object)
           
private  SearchCondition onRole(Role role)
           
private  SearchCondition onSource(String source)
           
private  SearchCondition onTask(String task)
           
private  SearchCondition onWAA(WfAssignedActivity object)
           
protected  void performStartupProcess()
          Override the method from StandardManager to provide WorkflowService with custom startup for event subscription.
 void reassignActivity(WfAssignedActivity activity)
          Reassigns activity to principal referred to by special activity variable.
 void reassignActivity(WfAssignedActivity activity, WTPrincipal principal)
          Reassigns activity to principal referred to principal passed as parameter.
private  void reassignWorkItems(WTContainerRef context_ref, WTUser replacedUser, WTUser newUser)
           
protected  void registerAsListener()
          Register as a listener for dispatched events.
 String replaceVariables(String txt, ProcessData variables)
          Utility method that replaces values for variables whenever they occur.
private  WTPrincipal resolveActor(ActorRole actor, WfProcess parent)
           
private  void resolveActors(Vector actorRoles, WfProcess parent, WTDistributionList aDL)
           
private  WTPrincipal resolveSingletonRole(Role role, WfProcess parentProcess)
          Role resolution methods *
 void revokeTaskBasedRights(WorkItem wi)
          Revoke rights that were granted for the execution of a task for each variable in the activity.
private  void revokeTaskBasedRights(WTObject wt_obj, WTPrincipal user, Vector set, long oid)
           
 void sendNotification(String subject, String msgBody, Vector recipients, Vector roles, Vector actorRoles, Vector projects, Vector variables, ObjectReference activityReference)
          sendNotification resolves the principals and sends notification to them.
 void sendNotification(String msgBody, Vector recipients, Vector roles, Vector actorRoles, ObjectReference activityReference)
          send email to a recipient list

Supported API: true
 void setTaskBasedRights(WorkItem wi, WTPrincipalReference p_ref)
          Add rights to assignee that are defined in activity variables the reference persistable objects.
private  boolean setTaskBasedRights(WorkItem wi, WTPrincipalReference p_ref, WfVariable var)
           
 boolean tally(WfAssignedActivity self, WfTallyType policy, String operator, int value, String event)
          This is the tally method that is called from the Custom Routing Event/...Event Firing Expression.
 void workComplete(ObjectReference workItemRef, WTPrincipalReference principalRef, Vector eventList)
          Declare a workItem complete and transmit the event(s) to trigger.
 void workComplete(WorkItem workItem, WTPrincipalReference principalRef, Vector eventList)
          Declare a workItem complete and transmit the event(s) to trigger.
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, registerEvents, setManagerService, shutdown, shutdownFailure, shutdownSuccess, shuttingDown, started, startedErrors, startingUp, startup, startupFailure, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

DEFAULT_ROLE

private static final String DEFAULT_ROLE
See Also:
Constant Field Values

OVERDUE_TASK_NAME

private static final String OVERDUE_TASK_NAME
See Also:
Constant Field Values

REASSIGN_PRINCIPAL_VARIABLE_NAME

private static final String REASSIGN_PRINCIPAL_VARIABLE_NAME
See Also:
Constant Field Values

URL_PROCESSOR_METHOD

private static final String URL_PROCESSOR_METHOD
See Also:
Constant Field Values

WORK_NOTIFICATION_TEMPLATE

private static final String WORK_NOTIFICATION_TEMPLATE
See Also:
Constant Field Values

ROBOT_NOTIFICATION_TEMPLATE

private static final String ROBOT_NOTIFICATION_TEMPLATE
See Also:
Constant Field Values

START_VARIABLE

private static final char START_VARIABLE

END_VARIABLE

private static final char END_VARIABLE

ESCAPE_CHARACTER

private static final char ESCAPE_CHARACTER
See Also:
Constant Field Values

VERBOSE

private static final boolean VERBOSE

DEFAULT_NOTIFICATION_SENDER

private static final String DEFAULT_NOTIFICATION_SENDER

SERVICE_NAME

private static final String SERVICE_NAME
See Also:
Constant Field Values

DO_DYNAMIC_UPDATE

private static final boolean DO_DYNAMIC_UPDATE
Constructor Detail

StandardWorkflowService

public StandardWorkflowService()
Method Detail

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Overrides:
getConceptualClassname in class StandardManager
Returns:
String

newStandardWorkflowService

public static StandardWorkflowService newStandardWorkflowService()
                                                          throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardWorkflowService
Throws:
WTException

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

checkoutTo

public void checkoutTo(WTObject object,
                       WTPrincipalReference pRef,
                       Role role,
                       ActorRole actorRole,
                       ObjectReference activityRef)
                throws WTException
checkout a business object to a principal. Intended for robot usage

Supported API: true

Specified by:
checkoutTo in interface WorkflowService
Parameters:
object -
pRef -
role -
actorRole -
activityRef -
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 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 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 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:

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

getUncompletedWorkItems

public QueryResult getUncompletedWorkItems(WTContainerRef context_ref)
                                    throws WTException,
                                           WfException
Answer an enumeration of incomplete work items for a project

Supported API: false

Specified by:
getUncompletedWorkItems in interface WorkflowService
Parameters:
context_ref -
Returns:
QueryResult
Throws:
WTException
WfException

getUncompletedWorkItems

public QueryResult getUncompletedWorkItems(Project2 context)
                                    throws WTException
Deprecated. use instead getUncompletedWorkItems (WTContainerRef.newWTContainerRef (project))



Supported API: false

Specified by:
getUncompletedWorkItems in interface WorkflowService
Parameters:
context -
Returns:
QueryResult
Throws:
WTException

getUncompletedWorkItems

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

Supported API: false

Specified by:
getUncompletedWorkItems in interface WorkflowService
Parameters:
principal - the assigned-to WTPrincipal used as search criteria
context_ref -
Returns:
QueryResult
Throws:
WTException
WfException

getUncompletedWorkItems

public QueryResult getUncompletedWorkItems(WTPrincipal principal,
                                           Project2 context)
                                    throws WTException
Deprecated. use instead getUncompletedWorkItems (WTUser, WTContainerRef.newWTContainerRef (project))



Supported API: false

Specified by:
getUncompletedWorkItems in interface WorkflowService
Parameters:
principal -
context -
Returns:
QueryResult
Throws:
WTException

doDynamicUpdate

public void doDynamicUpdate(TeamReference team)
                     throws WTException
Causes the workflow process instances using this team to re-resolve their actors and roles. This method will immediately update the assignments of all WfAssignedActivities.

Supported API: false

Specified by:
doDynamicUpdate in interface WorkflowService
Parameters:
team -
Throws:
WTException

doDynamicUpdate

public void doDynamicUpdate(WfProcess process)
                     throws WTException
Causes the workflow process instance passed in to re-resolve actors and roles from its associated Team. This method will immediately update all assignments for open, running WfAssignedActivities.

Supported API: false

Specified by:
doDynamicUpdate in interface WorkflowService
Parameters:
process -
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(WTPrincipal principal,
                                           WTContainerRef context_ref,
                                           Integer query_limit,
                                           String sort_by_str)
                                    throws WTException,
                                           WfException
Answer an enumeration of incomplete work items for a principal within a WTContainer, sorted and only the first nnn number of workitems returned.

Supported API: false

Specified by:
getUncompletedWorkItems in interface WorkflowService
Parameters:
principal - the assigned-to WTPrincipal used as search criteria
context_ref -
query_limit -
sort_by_str -
Returns:
QueryResult
Throws:
WTException
WfException

getUncompletedWorkItems

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

Supported API: false

Specified by:
getUncompletedWorkItems in interface WorkflowService
Parameters:
principal - the assigned-to WTPrincipal used as search criteria
query_limit -
sort_by_str -
Returns:
QueryResult
Throws:
WTException
WfException

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

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

addVariablePrincipals

private void addVariablePrincipals(Vector variables,
                                   Vector recipients,
                                   Vector roles,
                                   Vector actor_roles,
                                   ObjectReference act_ref)
                            throws WTException
Add principals to recipients that are resolved from teams. A variable may contain one of: Depending on the type of the variable, its content is added to the appropriate list, as follows: principals are added to recipients, roles to roles, actor roles to actor_roles. Teams are resolved to principals and added to recipients.

Parameters:
variables - - vector of WfVariableInfo objects
recipients - - vector of WTPrincipal objects
roles - - vector of Role objects
Throws:
WTException

getVariables

private ProcessData getVariables(ObjectReference exec_obj_ref)
                          throws WTException
Returns variables associated to execution object referenced by argument.

Throws:
WTException

addTeamPrincipals

private void addTeamPrincipals(Team team,
                               Vector recipients)
                        throws WTException
Add principals to recipients that are resolved from team.

Throws:
WTException

addTeamPrincipals

private void addTeamPrincipals(TeamTemplate teamT,
                               Vector recipients,
                               WfProcess process)
                        throws WTException
Add principals to recipients that are resolved from team template.

Throws:
WTException

addTeamPrincipals

private void addTeamPrincipals(Vector teams,
                               Vector recipients,
                               WfProcess process)
                        throws WTException
Add principals to recipients that are resolved from teams.

Throws:
WTException

getStringRepresentation

private String getStringRepresentation(Object value)
Constructs a String representation of the object passed as parameter.

If the value is not a WTObject, calls 'toString () '; otherwise produces the object's identity.

Parameters:
value - object passed as parameter
Returns:
String Windchill's string representation of the object

getCheckoutUser

private WTPrincipal getCheckoutUser(WTPrincipalReference pRef,
                                    Role role,
                                    ActorRole actor,
                                    ObjectReference activityRef)
                             throws WTException
Checkout robot support

Throws:
WTException

resolveSingletonRole

private WTPrincipal resolveSingletonRole(Role role,
                                         WfProcess parentProcess)
                                  throws WTException
Role resolution methods *

Throws:
WTException

resolveActor

private WTPrincipal resolveActor(ActorRole actor,
                                 WfProcess parent)
                          throws WTException
Throws:
WTException

resolveActors

private void resolveActors(Vector actorRoles,
                           WfProcess parent,
                           WTDistributionList aDL)
                    throws WTException
Throws:
WTException

getParentProcess

private WfProcess getParentProcess(ObjectReference activityReference)
                            throws WTException
Utilities *

Throws:
WTException

getWorkItem

private WorkItem getWorkItem(Persistable object,
                             WTPrincipal owner,
                             Role role)
                      throws WTException
Throws:
WTException

getAssignedActivities

private Enumeration getAssignedActivities(WfProcess process,
                                          WfState state)
                                   throws WTException
Throws:
WTException

buildOwnerQuery

private QuerySpec buildOwnerQuery(WTPrincipal p)
                           throws WTException
This is a new buildOwnerQuery implementing a WHERE IN clause. It should be much more proficient, use less open oracle cursors, and do so in one trip to the db.

Throws:
WTException

onObject

private SearchCondition onObject(Persistable object)
                          throws WTException
Throws:
WTException

onOwner

private SearchCondition onOwner(WTPrincipal p)
                         throws WTException
Throws:
WTException

onRole

private SearchCondition onRole(Role role)
                        throws WTException
Throws:
WTException

onSource

private SearchCondition onSource(String source)
                          throws WTException
Throws:
WTException

onTask

private SearchCondition onTask(String task)
                        throws WTException
Throws:
WTException

onIncomplete

private SearchCondition onIncomplete()
                              throws WTException
Throws:
WTException

performStartupProcess

protected void performStartupProcess()
                              throws ManagerException
Override the method from StandardManager to provide WorkflowService with custom startup for event subscription. When subscribing create an anonymous inner class adapter per subscription to handle each specific event being subscribed to.

Overrides:
performStartupProcess in class StandardManager
Throws:
ManagerException

registerAsListener

protected void registerAsListener()
                           throws ManagerException
Register as a listener for dispatched events. This method registers for:
 1. Team.RETEAM
 

Throws:
ManagerException

buildDistributionList

private WTDistributionList buildDistributionList(WfProcess p,
                                                 Vector recipients,
                                                 Vector roles,
                                                 Vector actorRoles)
                                          throws WTException
Throws:
WTException

createNotification

private TemplateNotification createNotification(WTDistributionList aDL,
                                                String subject,
                                                String msgBody,
                                                WfProcess p,
                                                ObjectReference activityReference)
                                         throws WTException
Throws:
WTException

addElementsNoDup

private void addElementsNoDup(Vector v,
                              Enumeration e)

addElementNoDup

private void addElementNoDup(Vector v,
                             Object obj)

setTaskBasedRights

private boolean setTaskBasedRights(WorkItem wi,
                                   WTPrincipalReference p_ref,
                                   WfVariable var)
                            throws WTException
Throws:
WTException

revokeTaskBasedRights

private void revokeTaskBasedRights(WTObject wt_obj,
                                   WTPrincipal user,
                                   Vector set,
                                   long oid)
                            throws WTException
Throws:
WTException

onProject2Dom

private SearchCondition onProject2Dom(AdministrativeDomain object)
                               throws WTException
Throws:
WTException

onWAA

private SearchCondition onWAA(WfAssignedActivity object)
                       throws WTException
Throws:
WTException

reassignWorkItems

private void reassignWorkItems(WTContainerRef context_ref,
                               WTUser replacedUser,
                               WTUser newUser)
                        throws WTException
Throws:
WTException

delegate

public void delegate(WorkItem workItem,
                     WTPrincipal principal,
                     boolean bypassAccess)
              throws WTException,
                     WfException
Throws:
WTException
WfException

getOid

private static ObjectIdentifier getOid(Object obj)

getValue

private String getValue(ProcessData vars,
                        String var_name)