wt.workflow.engine
Class StandardWfEngineService

java.lang.Object
  extended by wt.services.StandardManager
      extended by wt.workflow.engine.StandardWfEngineService
All Implemented Interfaces:
Serializable, NetFactor, wt.services.Manager, WfEngineService, WfEngineServiceSvr

public class StandardWfEngineService
extends StandardManager
implements WfEngineServiceSvr, WfEngineService, Serializable

Standard implementation of the workflow engine service. Contains implementation of the client and server APIs.

Use the newStandardWfEngineService static factory method(s), not the StandardWfEngineService 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:
WfEngineService, WfEngineServiceSvr, Serialized Form

Nested Class Summary
static class wt.workflow.engine.StandardWfEngineService.NodeTemplateCache
          Nested static singleton class to implement the caching of NodeTemplate objects.
static class wt.workflow.engine.StandardWfEngineService.NodeTemplateLinkCache
          Nested static singleton class to implement the caching of NodeTemplateLink objects.
static class wt.workflow.engine.StandardWfEngineService.SynchRobotCache
          Internal class for creation of distributed cache that maps event keys and target class name to oids of synchronization robots.
 
Method Summary
 void addEventListener(wt.workflow.robots.WfSynchRobot robot)
          Creates and adds a new event listener for the event key passed as argument.
 void changeAssignmentEvent(wt.workflow.work.WfAssignedActivity obj, WTPrincipal new_assignee, WTPrincipal old_assignee, Role role)
          Used to notify the service that an activity assignment changed.
 void changeDataEvent(WfExecutionObject obj, ProcessData old_data)
          Method called in order to emit a change of data event.
 void changeEventConfiguration(WfProcess process, wt.workflow.engine.WfEventConfiguration evt_cfg)
          Changes the process' event configuration to the one passed as argument.
 void changeResultEvent(WfExecutionObject obj, ProcessData old_data)
          This method is used to communicate that the result of an execution process (mostly activity) was set.
 WfExecutionObject changeState(WfExecutionObject exec_object, wt.workflow.engine.WfTransition transition)
          Changes the state of a process or activity.
 void changeStateEvent(WfExecutionObject obj, wt.workflow.engine.WfState old_state, Vector events)
          Method called in order to emit a change of state event.
 wt.workflow.engine.WfActivity complete(wt.workflow.engine.WfActivity activity, Vector selected_events)
          Completes activity and generates events.
 WfProcess createAdHocProcess(WfTemplateObject template, Object team_spec)
          Deprecated. use method with WTContainerRef
 WfProcess createAdHocProcess(WfTemplateObject template, Object team_spec, WTContainerRef context_ref)
          Creates a process given a template object that can be a process template, a block template or an activity template.
 WfProcess createProcess(wt.workflow.definer.WfProcessDefinition template, Object team_spec)
          Deprecated. use method with WTContainerRef
 WfProcess createProcess(wt.workflow.definer.WfProcessDefinition template, Object team_spec, WTContainerRef context_ref)
          Creates and returns a process from the given template, associated team specification and a reference to the context (@link wt.inf.container.WTContainerRef} where the process is to be created.
 void createProcessEvent(WfProcess obj)
          Used to notify the service that a process was created.
 ProcessingQueue createPropagationQueue(WfProcess process)
          Creates a queue to hold internal work (propagation, state changes) associated with the process passed as argument.
 wt.workflow.engine.WfContainer createStartAdHocProcess(wt.workflow.engine.WfAdHocActivity requester, wt.workflow.definer.WfContainerTemplate template)
          Creates and starts an adh hoc process given the ad hoc activity and the template from which the process should be instantiated.
 ProcessingQueue createUserWorkQueue(WfProcess process)
          Creates a queue to hold user work (robot work) associated with the process passed as argument.
 void deleteClosedProcesses(SearchCondition condition)
          Delete all closed processes that meet the search condition passed as argument.
 void deleteDedicatedQueues(WfProcess process)
          Deletes dedicated queues associated with the process passed as argument if there are no other process using the queues.
 void deleteProcess(WfProcess process)
          Deletes process passed as argument.
 void doReteamProcess(wt.team.TeamReference teamRef)
          Method called by lifecycle to cause the WfProcess to add it's roles to the Team.
 void doRobotWork(wt.workflow.robots.WfRobotActivity robot)
          Method called by robot activities to do the work associated with a robot activity.
 void emitCustomEvent(String event_type, Hashtable value_map)
          Creates and emits a custom event.
 void emitCustomObjectEvent(String event_type, Object target, Hashtable value_map)
          Creates and emits a custom event.
 void executionErrorEvent(WfExecutionObject obj, Exception exception)
          Used to notify the service that an exception occurred.
 Enumeration getAssociatedProcesses(Persistable object, wt.workflow.engine.WfState state)
          Deprecated. use method with WTContainerRef argument.
 QueryResult getAssociatedProcesses(Persistable object, wt.workflow.engine.WfState state, WTContainerRef context_ref)
          Returns all process instances associated with the object passed as argument that are in a given state in the passed WTContainer.
 Enumeration getAssociatedProcesses(wt.team.TeamReference team, wt.workflow.engine.WfState state)
          Deprecated. use method that takes WTContainerRef as argument.
 Enumeration getHistory(wt.workflow.engine.WfEventAuditType eventType)
          Returns a list of all events of a given type associated with execution objects.
 Enumeration getHistory(WfExecutionObject obj, wt.workflow.engine.WfEventAuditType eventType)
          Returns a list of all events associated with a given execution object of a given type.
 Enumeration getOverdueActivities(WfProcess process)
          Returns all overdue activities contained in a given process.
 Enumeration getOverdueProcesses()
          Deprecated. use method with WTContainerRef as argument.
 QueryResult getOverdueProcesses(WTContainerRef context_ref)
          Returns all overdue processes in a given WTContainer.
 wt.workflow.engine.WfNode getPersistentNode(wt.workflow.engine.WfNode trans_node)
          Returns the persistent node that corresponds to a transient node, constructed for propagation purposes.
 Enumeration getPredecessors(wt.workflow.engine.WfNode node)
          Returns all predecessor nodes to a node passed as argument.
 Enumeration getProcessConnectors(wt.workflow.engine.WfContainer container)
          Returns all connectors contained in a given process.
 Enumeration getProcesses(wt.workflow.definer.WfProcessTemplate template, wt.workflow.engine.WfState state)
          Returns all processes instantianted from a given template that are in a given state.
 Vector getProcessRoles(WfProcess process)
          Answer a vector of role objects declared by the process

Supported API: true
 Enumeration getProcessSteps(wt.workflow.engine.WfContainer container, wt.workflow.engine.WfState state)
          Returns all instantiated process steps in a given state.
 String getProjectName(wt.workflow.engine.WfContainer container)
          Returns the name of the project associated with the given process.
 URL getRelatedProcessesURL(WTObject obj)
          Returns a URL to view associated workflow processes given a business object.
 WTPrincipal getResponsible(WfExecutionObject exec_obj)
          Returns principal responsible for the execution object.
 Enumeration getResponsibleParticipants(WfExecutionObject exec_obj)
          Returns an Enumeration of principal references who are responsible for the execution object.
 Enumeration getSuccessors(wt.workflow.engine.WfNode node)
          Instantiates the successors of a given workflow node.
 String getTeamName(wt.workflow.engine.WfContainer container)
          Returns the name of the team associated with the given process.
 Folder getWfFolder(String folder_path, WTObject pbo, WTContainerRef context_ref)
          Gets folder given its relative path, associated business object and the context.
 void queueCompleteTransition(wt.workflow.engine.WfActivity activity, Vector events)
          Queues a request to complete an activity with a set of user defined events.
 void queueDeadlineCheck(WfExecutionObject obj)
          Queues the checking the execution object's deadline.
 void queueRestoreState(wt.workflow.engine.WfActivity activity, boolean new_thread)
          Queues the restoration of the state of objects associated with activity passed as argument.
 void queueStateChange(WfExecutionObject obj, wt.workflow.engine.WfTransition transition, boolean new_thread, boolean propagate)
          Queues the state change.
 void queueSynchCheck(wt.workflow.robots.WfSynchRobot robot)
          Queues the a synchronization checking request.
 void queueTimeEvent(WfExecutionObject obj, Timestamp time, wt.workflow.engine.WfTransition transition)
          Queues a request to effect a state change at a given time to a a given execution object.
 void queueTimePastDeadlineCheck(WfExecutionObject obj)
          Queues the checking the execution object's time past deadline.
 void queueTimeToDeadlineCheck(WfExecutionObject obj)
          Queues the checking the execution object's time to deadline.
 void removeEventListener(wt.workflow.robots.WfSynchRobot robot)
          Removes an event listener for the event key passed as argument that is also associated to the robot.
 wt.workflow.engine.WfNode resetReachableNodes(wt.workflow.engine.WfNode start_node)
          Resets all nodes that can be reached from node passed as argument.
 void sendEventToSuccessors(ObjectReference node_ref, Object event, boolean is_immediate)
          Propagate event to successors of the given node.
 WfProcess setPrimaryBusinessObject(WfProcess process, WTObject object)
          Sets the primary business object to the object passed as argument.
 WfProcess setPrimaryBusinessObject(WfProcess process, WTObject object, boolean persist)
          Sets the primary business object to the object passed as an argument.
 WfProcess startProcess(WfProcess process, ProcessData input, long priority)
          Starts a process with given input data and priority.
 WfProcess startProcess(WfProcess process, ProcessData input, long priority, Timestamp start_time, Timestamp deadline)
          Start a process given, in addition to the input data, absolute start time and deadline.
 WfProcess startProcessImmediate(WfProcess process, ProcessData input, long priority)
          Starts a process with given input data and priority without creation of new thread or queue entries.
 void terminateObjectsRunningWorkflows(Persistable object)
          if terminateObjectsRunningWorkflows=true, terminate all the objects running processes.
 void terminateObjectsRunningWorkflows(WTCollection collection)
          if terminateObjectsRunningWorkflows=true, terminate all the objects running processes.
 
Methods inherited from class wt.services.StandardManager
getManagerService, getManagerStatus, getName, getStartupType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

changeStateEvent

public void changeStateEvent(WfExecutionObject obj,
                             wt.workflow.engine.WfState old_state,
                             Vector events)
                      throws WTException
Method called in order to emit a change of state event.

Supported API: true

Specified by:
changeStateEvent in interface WfEngineServiceSvr
Parameters:
obj -
old_state -
events -
Throws:
WTException

changeDataEvent

public void changeDataEvent(WfExecutionObject obj,
                            ProcessData old_data)
                     throws WTException
Method called in order to emit a change of data event.

Supported API: true

Specified by:
changeDataEvent in interface WfEngineServiceSvr
Parameters:
obj -
old_data -
Throws:
WTException

getSuccessors

public Enumeration getSuccessors(wt.workflow.engine.WfNode node)
                          throws WTException
Instantiates the successors of a given workflow node. Returns a enumeration of instantiated links.

Supported API: true

Specified by:
getSuccessors in interface WfEngineServiceSvr
Parameters:
node -
Returns:
Enumeration
Throws:
WTException

getPredecessors

public Enumeration getPredecessors(wt.workflow.engine.WfNode node)
                            throws WTException
Returns all predecessor nodes to a node passed as argument.

Supported API: true

Specified by:
getPredecessors in interface WfEngineServiceSvr
Parameters:
node -
Returns:
Enumeration
Throws:
WTException

sendEventToSuccessors

public void sendEventToSuccessors(ObjectReference node_ref,
                                  Object event,
                                  boolean is_immediate)
                           throws WTException
Propagate event to successors of the given node. This is accomplished by either queueing the request or (in case queue is not used) by creating a new thread to instantiate the successor nodes and propagate the event to them. If, however, is_immediate is 'true', the event is propagated immediately, that is, without threading or queuing.

Supported API: true

Specified by:
sendEventToSuccessors in interface WfEngineServiceSvr
Parameters:
node_ref -
event -
is_immediate -
Throws:
WTException

createProcessEvent

public void createProcessEvent(WfProcess obj)
                        throws WTException
Used to notify the service that a process was created. Manages event associated with the creation of a new process. This entails either recording an event audit and/or emitting a corresponding keyed event.

Supported API: true

Specified by:
createProcessEvent in interface WfEngineServiceSvr
Parameters:
obj -
Throws:
WTException

changeAssignmentEvent

public void changeAssignmentEvent(wt.workflow.work.WfAssignedActivity obj,
                                  WTPrincipal new_assignee,
                                  WTPrincipal old_assignee,
                                  Role role)
                           throws WTException
Used to notify the service that an activity assignment changed. Manages event associated with the change of assignment for an assigned activity. This entails either recording an event audit and/or emitting a corresponding keyed event.

Supported API: true

Specified by:
changeAssignmentEvent in interface WfEngineServiceSvr
Parameters:
obj -
new_assignee -
old_assignee -
role -
Throws:
WTException

executionErrorEvent

public void executionErrorEvent(WfExecutionObject obj,
                                Exception exception)
Used to notify the service that an exception occurred. Manages event associated with the creation of a new process. This entails the following:

Supported API: true

Specified by:
executionErrorEvent in interface WfEngineServiceSvr
Parameters:
obj -
exception -

changeResultEvent

public void changeResultEvent(WfExecutionObject obj,
                              ProcessData old_data)
                       throws WTException
This method is used to communicate that the result of an execution process (mostly activity) was set.

Supported API: true

Specified by:
changeResultEvent in interface WfEngineServiceSvr
Parameters:
obj -
old_data -
Throws:
WTException

doRobotWork

public void doRobotWork(wt.workflow.robots.WfRobotActivity robot)
                 throws WTException
Method called by robot activities to do the work associated with a robot activity. This work is contained in the 'run' method of the object. The work is queued if USE_QUEUE is true or performed in a separate thread otherwise.

Supported API: true

Specified by:
doRobotWork in interface WfEngineServiceSvr
Parameters:
robot -
Throws:
WTException

resetReachableNodes

public wt.workflow.engine.WfNode resetReachableNodes(wt.workflow.engine.WfNode start_node)
                                              throws WTException
Resets all nodes that can be reached from node passed as argument. Returns an updated version of the start_node. Used in loops, called when a back loop link is traversed.

Supported API: true

Specified by:
resetReachableNodes in interface WfEngineServiceSvr
Parameters:
start_node -
Returns:
WfNode
Throws:
WTException

queueStateChange

public void queueStateChange(WfExecutionObject obj,
                             wt.workflow.engine.WfTransition transition,
                             boolean new_thread,
                             boolean propagate)
                      throws WTException
Queues the state change. The execution object and transition are specified as parameters. This is used to delay the start of the execution of an object until the timeToStart arrives. If propagate is 'false' transition event is not propagated in case the execution object is an activity.

Supported API: true

Specified by:
queueStateChange in interface WfEngineServiceSvr
Parameters:
obj -
transition -
new_thread -
propagate -
Throws:
WTException

queueTimeEvent

public void queueTimeEvent(WfExecutionObject obj,
                           Timestamp time,
                           wt.workflow.engine.WfTransition transition)
                    throws WTException
Queues a request to effect a state change at a given time to a a given execution object.

Supported API: true

Specified by:
queueTimeEvent in interface WfEngineServiceSvr
Parameters:
obj -
time -
transition -
Throws:
WTException

queueDeadlineCheck

public void queueDeadlineCheck(WfExecutionObject obj)
                        throws WTException
Queues the checking the execution object's deadline. The execution object is specified as parameter.

Supported API: true

Specified by:
queueDeadlineCheck in interface WfEngineServiceSvr
Parameters:
obj -
Throws:
WTException

queueTimeToDeadlineCheck

public void queueTimeToDeadlineCheck(WfExecutionObject obj)
                              throws WTException
Queues the checking the execution object's time to deadline. The execution object is specified as parameter.

Supported API: true

Specified by:
queueTimeToDeadlineCheck in interface WfEngineServiceSvr
Parameters:
obj -
Throws:
WTException

queueTimePastDeadlineCheck

public void queueTimePastDeadlineCheck(WfExecutionObject obj)
                                throws WTException
Queues the checking the execution object's time past deadline. The execution object is specified as parameter.

Supported API: true

Specified by:
queueTimePastDeadlineCheck in interface WfEngineServiceSvr
Parameters:
obj -
Throws:
WTException

queueCompleteTransition

public void queueCompleteTransition(wt.workflow.engine.WfActivity activity,
                                    Vector events)
                             throws WTException
Queues a request to complete an activity with a set of user defined events.

Supported API: true

Specified by:
queueCompleteTransition in interface WfEngineServiceSvr
Parameters:
activity -
events -
Throws:
WTException

queueRestoreState

public void queueRestoreState(wt.workflow.engine.WfActivity activity,
                              boolean new_thread)
                       throws WTException
Queues the restoration of the state of objects associated with activity passed as argument. Used when a complete transition fails and associated objects are created and/or modified (for example, work items). The action is queued so that this method can be called in a finalize block when a transaction is being rolled back.

Supported API: true

Specified by:
queueRestoreState in interface WfEngineServiceSvr
Parameters:
activity -
new_thread -
Throws:
WTException

queueSynchCheck

public void queueSynchCheck(wt.workflow.robots.WfSynchRobot robot)
                     throws WTException
Queues the a synchronization checking request. The synchornization robot is specified as parameter. The synchronization expression is retrieved from the robot.

Supported API: true

Specified by:
queueSynchCheck in interface WfEngineServiceSvr
Parameters:
robot -
Throws:
WTException

getPersistentNode

public wt.workflow.engine.WfNode getPersistentNode(wt.workflow.engine.WfNode trans_node)
                                            throws WTException
Returns the persistent node that corresponds to a transient node, constructed for propagation purposes. It looks in the database if the node exists; otherwise it creates and stores the node. From the transient node it uses only the template and the container.

Supported API: true

Specified by:
getPersistentNode in interface WfEngineServiceSvr
Parameters:
trans_node -
Returns:
WfNode
Throws:
WTException

addEventListener

public void addEventListener(wt.workflow.robots.WfSynchRobot robot)
Creates and adds a new event listener for the event key passed as argument. The new listener is associated to the robot also passed as argument. It simply forwards the call to the manager service.

Supported API: true

Specified by:
addEventListener in interface WfEngineServiceSvr
Parameters:
robot -

removeEventListener

public void removeEventListener(wt.workflow.robots.WfSynchRobot robot)
Removes an event listener for the event key passed as argument that is also associated to the robot. It simply forwards the call to the manager service.

Supported API: true

Specified by:
removeEventListener in interface WfEngineServiceSvr
Parameters:
robot -

createUserWorkQueue

public ProcessingQueue createUserWorkQueue(WfProcess process)
                                    throws WTException
Creates a queue to hold user work (robot work) associated with the process passed as argument.

Supported API: true

Specified by:
createUserWorkQueue in interface WfEngineServiceSvr
Parameters:
process -
Returns:
ProcessingQueue
Throws:
WTException

createPropagationQueue

public ProcessingQueue createPropagationQueue(WfProcess process)
                                       throws WTException
Creates a queue to hold internal work (propagation, state changes) associated with the process passed as argument.

Supported API: true

Specified by:
createPropagationQueue in interface WfEngineServiceSvr
Parameters:
process -
Returns:
ProcessingQueue
Throws:
WTException

setPrimaryBusinessObject

public WfProcess setPrimaryBusinessObject(WfProcess process,
                                          WTObject object)
                                   throws WTException
Sets the primary business object to the object passed as argument.

Supported API: true

Specified by:
setPrimaryBusinessObject in interface WfEngineServiceSvr
Parameters:
process -
object -
Returns:
WfProcess
Throws:
WTException

setPrimaryBusinessObject

public WfProcess setPrimaryBusinessObject(WfProcess process,
                                          WTObject object,
                                          boolean persist)
                                   throws WTException
Sets the primary business object to the object passed as an argument.

Supported API: true

Specified by:
setPrimaryBusinessObject in interface WfEngineServiceSvr
Parameters:
process -
object -
persist -
Returns:
WfProcess
Throws:
WTException

deleteDedicatedQueues

public void deleteDedicatedQueues(WfProcess process)
                           throws WTException
Deletes dedicated queues associated with the process passed as argument if there are no other process using the queues.

Supported API: true

Specified by:
deleteDedicatedQueues in interface WfEngineServiceSvr
Parameters:
process -
Throws:
WTException

emitCustomEvent

public void emitCustomEvent(String event_type,
                            Hashtable value_map)
                     throws WTException
Creates and emits a custom event. The type of the event passed as argument must be defined otherwise an exception is thrown.

Supported API: true

Specified by:
emitCustomEvent in interface WfEngineServiceSvr
Parameters:
event_type -
value_map -
Throws:
WTException

doReteamProcess

public void doReteamProcess(wt.team.TeamReference teamRef)
                     throws WTException
Method called by lifecycle to cause the WfProcess to add it's roles to the Team. This is usually used when the Team is changed for a LifeCycleManaged Object (a ReTeam).

Supported API: true

Specified by:
doReteamProcess in interface WfEngineServiceSvr
Parameters:
teamRef -
Throws:
WTException

getAssociatedProcesses

public Enumeration getAssociatedProcesses(wt.team.TeamReference team,
                                          wt.workflow.engine.WfState state)
                                   throws WTException
Deprecated. use method that takes WTContainerRef as argument.

Returns all process instances associated with the team ref.t passed as argument that are in a given state. If state is null, all process instances are returned, irrespective of the state.

Supported API: true

Specified by:
getAssociatedProcesses in interface WfEngineServiceSvr
Parameters:
team -
state -
Returns:
Enumeration
Throws:
WTException

emitCustomObjectEvent

public void emitCustomObjectEvent(String event_type,
                                  Object target,
                                  Hashtable value_map)
                           throws WTException
Creates and emits a custom event. This method can be used to emit object based event. The type of the event passed as argument must be defined otherwise an exception is thrown.

Supported API: true

Specified by:
emitCustomObjectEvent in interface WfEngineServiceSvr
Parameters:
event_type -
target -
value_map -
Throws:
WTException

startProcess

public WfProcess startProcess(WfProcess process,
                              ProcessData input,
                              long priority)
                       throws WTException
Starts a process with given input data and priority. Returns started process.

Supported API: true

Specified by:
startProcess in interface WfEngineService
Parameters:
process -
input -
priority -
Returns:
WfProcess
Throws:
WTException

getProcesses

public Enumeration getProcesses(wt.workflow.definer.WfProcessTemplate template,
                                wt.workflow.engine.WfState state)
                         throws WTException
Returns all processes instantianted from a given template that are in a given state. For example, one can ask for all CLOSED processes (irrespective of its substates). If state is null all processes are returned irrespective of their states.

Supported API: true

Specified by:
getProcesses in interface WfEngineService
Parameters:
template -
state -
Returns:
Enumeration
Throws:
WTException

getProcessSteps

public Enumeration getProcessSteps(wt.workflow.engine.WfContainer container,
                                   wt.workflow.engine.WfState state)
                            throws WTException
Returns all instantiated process steps in a given state. If state is null all steps are returned irrespective of their states.

Supported API: true

Specified by:
getProcessSteps in interface WfEngineService
Parameters:
container -
state -
Returns:
Enumeration
Throws:
WTException

getProcessConnectors

public Enumeration getProcessConnectors(wt.workflow.engine.WfContainer container)
                                 throws WTException
Returns all connectors contained in a given process.

Supported API: true

Specified by:
getProcessConnectors in interface WfEngineService
Parameters:
container -
Returns:
Enumeration
Throws:
WTException

getProcessRoles

public Vector getProcessRoles(WfProcess process)
                       throws WTException
Answer a vector of role objects declared by the process

Supported API: true

Specified by:
getProcessRoles in interface WfEngineService
Parameters:
process -
Returns:
Vector
Throws:
WTException

changeState

public WfExecutionObject changeState(WfExecutionObject exec_object,
                                     wt.workflow.engine.WfTransition transition)
                              throws WTException
Changes the state of a process or activity. Throws exception if transition is not allowed (for example, trying to stop a closed object).

Supported API: true

Specified by:
changeState in interface WfEngineService
Parameters:
exec_object -
transition -
Returns:
WfExecutionObject
Throws:
WTException

getHistory

public Enumeration getHistory(WfExecutionObject obj,
                              wt.workflow.engine.WfEventAuditType eventType)
                       throws WTException
Returns a list of all events associated with a given execution object of a given type. It the type is "null" returns of events associated with the object.

Supported API: true

Specified by:
getHistory in interface WfEngineService
Parameters:
obj -
eventType -
Returns:
Enumeration
Throws:
WTException

deleteClosedProcesses

public void deleteClosedProcesses(SearchCondition condition)
                           throws WTException
Delete all closed processes that meet the search condition passed as argument. Deletes all closed processes if the search condition is "null".

Supported API: true

Specified by:
deleteClosedProcesses in interface WfEngineService
Parameters:
condition -
Throws:
WTException

getOverdueProcesses

public Enumeration getOverdueProcesses()
                                throws WTException
Deprecated. use method with WTContainerRef as argument.

Returns all overdue processes. An overdue process is one that its deadline has passed.

Supported API: true

Specified by:
getOverdueProcesses in interface WfEngineService
Returns:
Enumeration
Throws:
WTException

getOverdueActivities

public Enumeration getOverdueActivities(WfProcess process)
                                 throws WTException
Returns all overdue activities contained in a given process. An overdue activity is one that its deadline has passed.

Supported API: true

Specified by:
getOverdueActivities in interface WfEngineService
Parameters:
process -
Returns:
Enumeration
Throws:
WTException

complete

public wt.workflow.engine.WfActivity complete(wt.workflow.engine.WfActivity activity,
                                              Vector selected_events)
                                       throws WTException
Completes activity and generates events. This method is used to provoke a change of state (transition = COMPLETE) and, at the same time, pass a Vector containing selected user events. If the activity is a manual router (routerType= MANUAL) the event is used to trigger the appropriate successor links; otherwise it is ignored.

Supported API: true

Specified by:
complete in interface WfEngineService
Parameters:
activity -
selected_events -
Returns:
WfActivity
Throws:
WTException

getProjectName

public String getProjectName(wt.workflow.engine.WfContainer container)
                      throws WTException
Returns the name of the project associated with the given process. If there is none (as it can be the case of robot activities) or the role holder object doesn't have a name then the method returns 'null'.

Supported API: true

Specified by:
getProjectName in interface WfEngineService
Parameters:
container -
Returns:
String
Throws:
WTException

createProcess

public WfProcess createProcess(wt.workflow.definer.WfProcessDefinition template,
                               Object team_spec)
                        throws WTException
Deprecated. use method with WTContainerRef

Creates and returns a process from the given template and associated team specification. If name is null the process name is the same as the template.

A team specification can be one of the following:


getHistory

public Enumeration getHistory(wt.workflow.engine.WfEventAuditType eventType)
                       throws WTException
Returns a list of all events of a given type associated with execution objects. It the type is "null" returns of events associated with the object.

Supported API: true

Specified by:
getHistory in interface WfEngineService
Parameters:
eventType -
Returns:
Enumeration
Throws:
WTException

changeEventConfiguration

public void changeEventConfiguration(WfProcess process,
                                     wt.workflow.engine.WfEventConfiguration evt_cfg)
                              throws WTException
Changes the process' event configuration to the one passed as argument. All activities' configurations are changed as well.

Supported API: true

Specified by:
changeEventConfiguration in interface WfEngineService
Parameters:
process -
evt_cfg -
Throws:
WTException

deleteProcess

public void deleteProcess(WfProcess process)
                   throws WTException
Deletes process passed as argument.

Supported API: true

Specified by:
deleteProcess in interface WfEngineService
Parameters:
process -
Throws:
WTException

startProcessImmediate

public WfProcess startProcessImmediate(WfProcess process,
                                       ProcessData input,
                                       long priority)
                                throws WTException
Starts a process with given input data and priority without creation of new thread or queue entries. Returns started process.

Supported API: true

Specified by:
startProcessImmediate in interface WfEngineService
Parameters:
process -
input -
priority -
Returns:
WfProcess
Throws:
WTException

createStartAdHocProcess

public wt.workflow.engine.WfContainer createStartAdHocProcess(wt.workflow.engine.WfAdHocActivity requester,
                                                              wt.workflow.definer.WfContainerTemplate template)
                                                       throws WTException
Creates and starts an adh hoc process given the ad hoc activity and the template from which the process should be instantiated. The template can be either a process or a block template. Returns the running process.

Supported API: true

Specified by:
createStartAdHocProcess in interface WfEngineService
Parameters:
requester -
template -
Returns:
WfContainer
Throws:
WTException

startProcess

public WfProcess startProcess(WfProcess process,
                              ProcessData input,
                              long priority,
                              Timestamp start_time,
                              Timestamp deadline)
                       throws WTException
Start a process given, in addition to the input data, absolute start time and deadline. The values provided (if not null) supersede the default values calculated using the process template. If any of the values is null then the corresponding default value is used.

Supported API: true

Specified by:
startProcess in interface WfEngineService
Parameters:
process -
input -
priority -
start_time -
deadline -
Returns:
WfProcess
Throws:
WTException

getResponsible

public WTPrincipal getResponsible(WfExecutionObject exec_obj)
                           throws WTException
Returns principal responsible for the execution object. First tries to resolve responsibleRole; if this is null, gets the responsible for the host process. Failing these, it returns the principal of the process creator. If more than one principal is resolved for the responsibleRole, it returns the first role.

Supported API: true

Specified by:
getResponsible in interface WfEngineService
Parameters:
exec_obj -
Returns:
WTPrincipal
Throws:
WTException

getAssociatedProcesses

public Enumeration getAssociatedProcesses(Persistable object,
                                          wt.workflow.engine.WfState state)
                                   throws WTException
Deprecated. use method with WTContainerRef argument.

Returns all process instances associated with the object passed as argument that are in a given state. If state is null, all process instances are returned, irrespective of the state.

Supported API: true

Specified by:
getAssociatedProcesses in interface WfEngineService
Parameters:
object -
state -
Returns:
Enumeration
Throws:
WTException

createAdHocProcess

public WfProcess createAdHocProcess(WfTemplateObject template,
                                    Object team_spec)
                             throws WTException
Deprecated. use method with WTContainerRef

Creates a process given a template object that can be a process template, a block template or an activity template. If it is a process template, the createProcess method is called; if it is an activity template, a block template is generated and the process generated from it; finally, if it is a block template, the process is generated directly from the block template.

In case it is an activity template, the block template generated has the same name as the activity template as well as variables. The mapping between the block templates and activity templates is a 1-1 mapping based on the variable names. This has the effect that the block template is completely transparent during execution time.

A team specification can be one of the following:


getRelatedProcessesURL

public URL getRelatedProcessesURL(WTObject obj)
                           throws WTException
Returns a URL to view associated workflow processes given a business object.

Supported API: true

Specified by:
getRelatedProcessesURL in interface WfEngineService
Parameters:
obj -
Returns:
URL
Throws:
WTException

getResponsibleParticipants

public Enumeration getResponsibleParticipants(WfExecutionObject exec_obj)
                                       throws WTException
Returns an Enumeration of principal references who are responsible for the execution object. First tries to resolve responsibleRole; if this is null, gets the principal references responsible for the host process. Failing these, it returns the principal reference for the process creator.

Supported API: true

Specified by:
getResponsibleParticipants in interface WfEngineService
Parameters:
exec_obj -
Returns:
Enumeration
Throws:
WTException

terminateObjectsRunningWorkflows

public void terminateObjectsRunningWorkflows(Persistable object)
                                      throws WTException
if terminateObjectsRunningWorkflows=true, terminate all the objects running processes.

Supported API: true

Specified by:
terminateObjectsRunningWorkflows in interface WfEngineService
Parameters:
object - The object for which you wish to terminate the objects running workflows.
Throws:
WTException

terminateObjectsRunningWorkflows

public void terminateObjectsRunningWorkflows(WTCollection collection)
                                      throws WTException
if terminateObjectsRunningWorkflows=true, terminate all the objects running processes.

Supported API: true

Specified by:
terminateObjectsRunningWorkflows in interface WfEngineService
Parameters:
collection - The collection of objects for which you wish to terminate the running workflows.
Throws:
WTException

createProcess

public WfProcess createProcess(wt.workflow.definer.WfProcessDefinition template,
                               Object team_spec,
                               WTContainerRef context_ref)
                        throws WTException
Creates and returns a process from the given template, associated team specification and a reference to the context (@link wt.inf.container.WTContainerRef} where the process is to be created. If name is null the process name is the same as the template.

A team specification can be one of the following:


createAdHocProcess

public WfProcess createAdHocProcess(WfTemplateObject template,
                                    Object team_spec,
                                    WTContainerRef context_ref)
                             throws WTException
Creates a process given a template object that can be a process template, a block template or an activity template. If it is a process template, the createProcess method is called; if it is an activity template, a block template is generated and the process generated from it; finally, if it is a block template, the process is generated directly from the block template.

In case it is an activity template, the block template generated has the same name as the activity template as well as variables. The mapping between the block templates and activity templates is a 1-1 mapping based on the variable names. This has the effect that the block template is completely transparent during execution time.

Supported API: true

Specified by:
createAdHocProcess in interface WfEngineService
Parameters:
template -
team_spec -
context_ref -
Returns:
WfProcess
Throws:
WTException

getTeamName

public String getTeamName(wt.workflow.engine.WfContainer container)
                   throws WTException
Returns the name of the team associated with the given process. If there is none (as it can be the case of robot activities) then the method returns 'null'.

Supported API: true

Specified by:
getTeamName in interface WfEngineService
Parameters:
container -
Returns:
String
Throws:
WTException

getAssociatedProcesses

public QueryResult getAssociatedProcesses(Persistable object,
                                          wt.workflow.engine.WfState state,
                                          WTContainerRef context_ref)
                                   throws WTException
Returns all process instances associated with the object passed as argument that are in a given state in the passed WTContainer. If state is null, all process instances are returned, irrespective of the state.

Supported API: true

Specified by:
getAssociatedProcesses in interface WfEngineService
Parameters:
object -
state -
context_ref -
Returns:
QueryResult
Throws:
WTException

getOverdueProcesses

public QueryResult getOverdueProcesses(WTContainerRef context_ref)
                                throws WTException
Returns all overdue processes in a given WTContainer. An overdue process is one that its deadline has passed.

Supported API: true

Specified by:
getOverdueProcesses in interface WfEngineService
Parameters:
context_ref -
Returns:
QueryResult
Throws:
WTException

getWfFolder

public Folder getWfFolder(String folder_path,
                          WTObject pbo,
                          WTContainerRef context_ref)
                   throws WTException
Gets folder given its relative path, associated business object and the context. If folder doesn't exit it is created. The business object may be null but assumes context reference is not null.

Creates workflow folder for a given context. The folder path is also passed as argument. Assumes folder_path of the form:

 /System/Workflows/
 
where forder-name is one of {"NotStarted", "Running", ...}

The folder is created as /System/Workflows/, where is the context's default cabinet.

Supported API: true

Specified by:
getWfFolder in interface WfEngineService
Parameters:
folder_path -
pbo -
context_ref -
Returns:
Folder
Throws:
WTException