wt.workflow.engine
Class StandardWfEngineService

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.workflow.engine.StandardWfEngineService
All Implemented Interfaces:
Manager, NetFactor, Serializable, 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
(package private)  class StandardWfEngineService.ChangeState
          Runnable class that implements the state transition.
(package private)  class StandardWfEngineService.PropagateEvent
          Runnable class that implements the propagation of events to successor nodes.
(package private)  class StandardWfEngineService.RestoreState
          Runnable class that implements restoring objects associated with an activity.
(package private)  class StandardWfEngineService.RobotWork
          Runnable class that implements the actual work done by all sort of robots.
(package private)  class StandardWfEngineService.SendNotification
          Runnable class that implements the sending of notification if exception occurs.
(package private)  class StandardWfEngineService.SynchEventListener
           
static class StandardWfEngineService.SynchRobotCache
          Internal class for creation of distributed cache that maps event keys to oids of synchronization robots.
 
Field Summary
private static String ABORT_NOTIFICATION_TEMPLATE
           
private static String APPROACHING_DEADLINE_TEMPLATE
           
private static String CLASSNAME
           
private static String COMPLETE_NOTIFICATION_TEMPLATE
           
private static boolean CONCAT_NESTED_PROCESS_NAME
           
private static int DEDICATED_QUEUE_LIMIT
           
private static String DEDICATED_QUEUE_MODE
          Stores dedicated queue "mode," which can be one of: none - all queues are shared propagation - propagation queue may be dedicated userWork - user work queue may be dedicated all - both propagation and userWork may be shared
private static boolean DEDICATED_QUEUE_PER_PROCESS
           
private static boolean DOMAIN_BASED_WORKFLOW
           
private static String EXCEPTION_NOTIFICATION_TEMPLATE
           
private static String FOLDER_SEPARATOR
           
private static Object IGNORE_DELETE_KEY
           
private static String NAME_SEPARATOR
           
private static int NAME_SIZE
           
private static int NAME_SUFFIX
           
private static int nextPropagationQueue
           
private static int nextUserWorkQueue
           
private static boolean NO_DEDICATED_PROPAGATION
          Is true if mode is none or userWork.
private static boolean NO_DEDICATED_USER_WORK
          Is true if mode is none or propagation.
private static String NOTIFICATION_SENDER
          Sender of email notification.
private static int NRETRIES
           
private  int numberOfDedicatedQueues
          Current number of dedicated queues associated with running processes.
private static String OVERDUE_NOTIFICATION_TEMPLATE
           
private static String OVERDUE_NOTIFICATION_TEMPLATE_FOR_ROLES
           
private static String PAST_DEADLINE_TEMPLATE
           
private static String PBO_CLASSES
          String read from wt.properties containing the list of classes that are not LifeCycleManaged and may be a primary business object in a wf process.
private  HashMap pboClasses
          Holds primary business classes not LifeCycleManaged.
private static String PRIM_BUS_OBJ_VAR_NAME
           
private static String PROCESS_CLASS_NAME
           
private static int PROPAGATION_POOL_SIZE
           
private static int PROPAGATION_QUEUE_INTERVAL
           
private static String RESOURCE
           
private static String SHARED_PROPAGATION_QUEUE_NAME
           
private static String SHARED_USER_WORK_QUEUE_NAME
           
private static int SLEEPTIME
           
private static int SYNCH_RESCHEDULE_INTERVAL
           
private static StandardWfEngineService.SynchRobotCache synchRobotCache
           
private static boolean TERMINATE_OBJECTS_RUNNING_WORKFLOWS
           
private static int threadNumber
           
private static String URL_PROCESSOR_METHOD
           
private static boolean USE_QUEUE
           
private static int USER_WORK_POOL_SIZE
           
private static int USER_WORK_QUEUE_INTERVAL
           
private static boolean VERBOSE
           
private static String WORKFLOW_PROPAGATION_QUEUE_NAME
          Name of the queue to hold event internal tasks in the execution of a workflow.
private static String WORKFLOW_SCHEDULE_QUEUE_NAME
          Name of the queue that holds timing and delays requests.
private static String WORKFLOW_USER_WORK_QUEUE_NAME
          Name of the queue that holds user work requests.
private  ProcessingQueue workflowPropagationQueue
           
private  ScheduleQueue workflowScheduleQueue
           
private  ProcessingQueue workflowUserWorkQueue
           
 
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
StandardWfEngineService()
           
 
Method Summary
private  void abortHostProcess(WfExecutionObject obj)
          Abort host process.
 void addEventListener(WfSynchRobot robot)
          Creates and adds a new event listener for the event key passed as argument.
private  void addPRefs(Vector v, Enumeration e)
           
private  void addPrin(Vector v, WTPrincipalReference pRef)
           
private  void appendAnd(QuerySpec qs)
          Conditionally appends an 'AND' to a query spec.
static WTDistributionList buildDistributionList(WfExecutionObject execObj, boolean notifyAssignees, boolean notifyRespRole, boolean notifyTemplateRoles)
           
 void changeAssignmentEvent(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 changeDataEvent(WfExecutionObject obj, ProcessData old_data, Role role, String instructions)
          Method called in order to emit a change of data event in an activity.
 void changeEventConfiguration(WfProcess process, 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.
static void changeState(ObjectIdentifier exec_obj_id, WfTransition transition, Boolean propagate)
          Method queued to perform a change of state in an execution object.
 WfExecutionObject changeState(WfExecutionObject exec_object, WfTransition transition)
          Changes the state of a process or activity.
 void changeStateEvent(WfExecutionObject obj, WfState old_state, Vector events)
          Method called in order to emit a change of state event.
private  void checkProcessDeletion(WTCollection collection)
          Throws exception if container is embedded.
private  void checkStartAdHocProcess(WfAdHocActivity requester)
          Checks whether is valid to create and start an ad hoc process associated with the ad hoc activity passed as argument.
 WfActivity complete(WfActivity activity, Vector selected_events)
          Completes activity and generates events.
static void completeTransition(ObjectIdentifier obj_id, Vector events)
          

Supported API: false
private  WfBlockTemplate createAdHocBlock(WfTemplateObject template, WTContainerRef context_ref)
          Creates a block template given an activity template.
 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.
 WfRequesterActivity createBlockProcess(WfBlockTemplate template, WfContainer container)
          Creates a block process and requester activity given the block template and containing process.
protected  Folder createNestedFolder(String folder_path, AdminDomainRef aDomObj)
           
 WfRequesterActivity createNestedProcess(WfProcessTemplate template, WfContainer container)
          Creates an activity requester and an associated process from the template.
 WfProcess createProcess(WfProcessDefinition template, Object team_spec)
          Deprecated. use method with WTContainerRef
 WfProcess createProcess(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.
 WTValuedMap createProcesses(WTValuedMap objToWfDefMap, WTKeyedMap objToWfNameMap, WTCollection collection, boolean setTeamFromPbo, long priority)
          Creates and returns a WTValuedMap of objects to WfProcess.
 WTValuedMap createProcesses(WTValuedMap objToWfDefMap, WTKeyedMap objToWfNameMap, WTCollection collection, boolean setTeamFromPbo, long priority, WTContainerRef context_ref)
          Creates and returns a WTValuedMap of objects to WfProcess.
 void createProcessEvent(WfProcess obj)
          Used to notify the service that a process was created.
private  WfProcess createProcessInstance(WfContainerTemplate process_def, Object team_spec, WTContainerRef context_ref)
           
private  WfProcess createProcessInstance(WfContainerTemplate process_def, Object team_spec, WTContainerRef context_ref, boolean persist)
           
 ProcessingQueue createPropagationQueue(WfProcess process)
          Creates a queue to hold internal work (propagation, state changes) associated with the process passed as argument.
private  ProcessingQueue createQueue(String queue_name, int queue_interval)
          Creates, sets and starts processing queues.
private  ScheduleQueue createScheduleQueue(String queue_name)
          Creates, sets and starts schedule queues.
 WfContainer createStartAdHocProcess(WfAdHocActivity requester, 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.
private  void deleteContainedObjects(WTCollection collection)
          Deletes all contained objects in a given process.
 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(TeamReference teamRef)
          Method called by lifecycle to cause the WfProcess to add it's roles to the Team.
 void doRobotWork(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 emitCustomEvent(String event_type, Object target, Hashtable value_map)
          Creates and emits a custom event.
 void emitPastDeadlineEvent(WfExecutionObject object)
          Emits event that a deadline has come and gone for the execution object passed as argument.
 void executionErrorEvent(WfExecutionObject obj, Exception exception)
          Used to notify the service that an exception occurred.
private  WfActivity getActivity(ObjectIdentifier container_id, WfNodeTemplate template)
           
 WTCollection getAssignmentEvents(WfProcess process, Role role, WTPrincipalReference new_assignee_ref, WTPrincipalReference old_assignee_ref, WTReference bus_obj_ref)
          Returns all the reassignment events for the process, role, old assignee, new assignee and business object passed as argument.
 Enumeration getAssociatedProcesses(Persistable object, WfState state)
          Deprecated. use method with WTContainerRef argument.
 QueryResult getAssociatedProcesses(Persistable object, 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(TeamReference team, WfState state)
          Deprecated. use method that takes WTContainerRef as argument.
 QueryResult getAssociatedProcesses(TeamReference team, WfState state, WTContainerRef context_ref)
          

Supported API: false
 WTCollection getAssociatedProcesses(WTCollection col, WfState state)
           
 String getConceptualClassname()
          Deprecated.  
private  WfNode getConnector(ObjectIdentifier container_id, WfNodeTemplate template)
           
private  WfContainer getContainer(WfNode node, WfNodeTemplate template)
          Returns container instance corresponding to destination container template.
 QueryResult getContainerNodes(WfContainer container)
           
private static WfExecutionObject getCulprit(WfNode node)
          Returns the execution object to be blamed for the occurrence of an exception.
 WTCollection getDataEvents(WfExecutionObject exec_obj, Role role, WTPrincipalReference user_ref, WTReference bus_obj_ref)
          Returns all the data events for the execution object (process or activity), role, assignee, and business object passed as arguments.
private static WTContainerRef getDefaultContainer()
           
private  WfExecutionObject getExecObject(ObjectIdentifier container_id, WfNodeTemplate template)
           
 Enumeration getHistory(WfEventAuditType eventType)
          Returns a list of all events of a given type associated with execution objects.
 Enumeration getHistory(WfExecutionObject obj, WfEventAuditType eventType)
          Returns a list of all events associated with a given execution object of a given type.
private  String getHTMLErrorMessage(Exception e)
          Capture an exception's stack trace and message in a single String; format using HTML tags.
private static long getId(Object object)
          Helper method that extracts object db id.
private  Object getIgnoreDelete()
           
private  Vector getLoopNodes(WfNode node)
          Returns the set of nodes in the same loop as the link passed as argument.
private static ObjectIdentifier getOid(Object object)
          Helper method that extracts object identifier.
 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.
private static WfProcess getParent(WfExecutionObject obj)
          Returns the parent process of the execution object.
 WfNode getPersistentNode(WfNode trans_node)
          Returns the persistent node that corresponds to a transient node, constructed for propagation purposes.
 Enumeration getPredecessors(WfNode node)
          Returns all predecessor nodes to a node passed as argument.
private  WTCollection getPrimaryBusinessObjects(WTCollection collection)
           
private static WfProcess getProcess(Object wf_obj)
           
 Enumeration getProcessConnectors(WfContainer container)
          Returns all connectors contained in a given process.
 Enumeration getProcesses(WfProcessTemplate template, WfState state)
          Returns all processes instantianted from a given template that are in a given state.
 Enumeration getProcesses(WfState state)
          Deprecated. use method with WTContainerRef as argument.
 QueryResult getProcesses(WfState state, WTContainerRef context_ref)
          Returns all existing processes in a given state and WTContainer.
 HashMap getProcessNodeDueDates(WfProcess process)
          Returns a HashMap.
 HashMap getProcessNodeDueDates(WfProcessTemplate pt)
          Returns a HashMap.
 HashMap getProcessNodeDurations(WfProcess process)
          Returns a HashMap.
 HashMap getProcessNodeDurations(WfProcessTemplate pt)
          Returns a HashMap.
 HashMap getProcessNodeInstructions(WfProcess process)
          Returns a HashMap.
 HashMap getProcessNodeInstructions(WfProcessTemplate processTemplate)
          Returns a HashMap.
 HashMap getProcessNodeNotifications(WfProcess process)
          Returns a HashMap.
 HashMap getProcessNodeNotifications(WfProcessTemplate pt)
          Returns a HashMap.
 Vector getProcessRoles(WfProcess process)
          Answer a vector of role objects declared by the process

Supported API: true
 Enumeration getProcessSteps(WfContainer container, WfState state)
          Returns all instantiated process steps in a given state.
 String getProjectName(WfContainer container)
          Returns the name of the project associated with the given process.
private  ProcessingQueue getPropagationQueue(Object wf_obj)
          Gets the propagation queue associated with the workflow object passed as argument
private  WTKeyedHashMap getPropagationQueue(WTCollection collection)
          Gets a map of propagation queue->collection of worfklow objects from the collection of workflow objects passed in as the argument
 WtQueueEntry getQueueEntry(WtQueue queue, long entryNumber)
           
private  Vector getReachableNodeRefs(WfNodeTemplate node_template, String role)
          Returns the set of connector templates that can be reached from the node template passed as argument in a given direction.
 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.
protected  Vector getRobotEventKeys()
          Returns all event keys that can be listened by synch robots.
private  WfConnector getStartConnector(ObjectIdentifier container_id)
          Returns the start connector given the id of the container.
private  WfLink getSuccessor(WfNode node, NodeTemplateLink template_link)
          Instantiates the successor of a node and the link to it, given the template link.
 Enumeration getSuccessors(WfNode node)
          Instantiates the successors of a given workflow node.
private  WfNode getSuccNode(WfContainer container, WfNodeTemplate template)
          Instantiates a surrogate for the successor of a node given the template link and the process.
private  StandardWfEngineService.SynchRobotCache getSynchRobotCache()
          Construct the singleton cache on demand in thread-safe manner
 String getTeamName(WfContainer container)
          Returns the name of the team associated with the given process.
private  ProcessingQueue getUserWorkQueue(Object wf_obj)
          Gets the user work queue associated with the workflow object passed as argument
 WTCollection getVotingEvents(WfProcess process, Role role, WTPrincipalReference user_ref, WTReference bus_obj_ref)
          Returns all the voting events for the process, role, assignee and business object passed as argument.
 AdminDomainRef getWfDomain(WTObject pbo, WTContainerRef context_ref)
          Gets the AdminDomainRef given the associated business object and the context.
 Folder getWfFolder(String folder_name)
          Deprecated. use method with the same name with two additional parameters: the primary business object and the container of the process.
 Folder getWfFolder(String folder_path, WTObject pbo, WTContainerRef context_ref)
          Gets folder given its relative path, associated business object and the context.
private  ProcessingQueue initializeQueue(String queue_name, int queue_interval)
          Initializes queues: retrieves (or creates), sets interval and starts,
private static boolean isPboActive(WfExecutionObject exec_obj)
          Determines whether there is a business object associated with the process of the execution object passed as argument and this object hasn't been deleted.
private  boolean isPrimaryBusinessObject(Persistable object)
          Returns whether the object passed as argument may be a primary business object of a workflow.
private  boolean isProcess(Object object)
          Returns all event keys that can be listened by synch robots.
private static boolean isProjectLink(WfExecutionObject obj)
          Returns whether the workflow is part of ProjectLink.
private static String linkToString(WfLink link)
          Returns condensed readable identity of the link.
static StandardWfEngineService newStandardWfEngineService()
          Default factory for the class.
private static String nodeToString(WfNode node)
          Returns condensed readable identity of the node.
protected  void performStartupProcess()
          Initialization tasks performed by the engine service.
static void processDeadline(ObjectIdentifier exec_obj_id)
          Checks if the deadline for the executioon object whose reference has been passed as parameter has been reached.
static void processDeadline(ObjectIdentifier exec_obj_id, Timestamp orig_deadline)
          Checks if the deadline for the executioon object whose reference has been passed as parameter has been reached.
static void processTimePastDeadline(ObjectIdentifier exec_obj_id)
          Checks if the timepast deadline for the executioon object whose reference has been passed as parameter has been reached.
static void processTimePastDeadline(ObjectIdentifier exec_obj_id, Timestamp orig_deadline)
          Checks if the timepast deadline for the executioon object whose reference has been passed as parameter has been reached.
static void processTimeToDeadline(ObjectIdentifier exec_obj_id)
          Checks if the time to deadline for the executioon object whose reference has been passed as parameter has been reached.
static void processTimeToDeadline(ObjectIdentifier exec_obj_id, Timestamp orig_deadline)
          Checks if the time to deadline for the executioon object whose reference has been passed as parameter has been reached.
static void propagateEvent(ObjectIdentifier node_id, Serializable event)
          This method does the actual event propagation from one node to the successor nodes.
 void queueCompleteTransition(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(WfActivity activity, boolean new_thread)
          Queues the restoration of the state of objects associated with activity passed as argument.
 void queueStateChange(WfExecutionObject obj, WfTransition transition, boolean new_thread, boolean propagate)
          Queues the state change.
 void queueStateChange(WTCollection collection, WfTransition transition, boolean new_thread, boolean propagate)
          Queues the state change for a collection of execution objects.
 void queueSynchCheck(WfSynchRobot robot)
          Queues the a synchronization checking request.
 void queueTimeEvent(WfExecutionObject obj, Timestamp time, 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.
private static Persistable refreshObject(ObjectIdentifier obj_id)
          Refreshes object given its object identifier.
private  void registerAsListener()
          Register as listener to the following events: all synch robot events PersistenceManagerEvent.PRE_DELETE FolderServiceEvent.PRE_CHANGE_FOLDER The objects of interest are workflow objects, more specifically, node templates (processes, activities and connectors) and expressions.
 void registerEvents(ManagerService ms)
          Register events with the passed ManagerService.
 void removeEventListener(WfSynchRobot robot)
          Removes an event listener for the event key passed as argument that is also associated to the robot.
 WfNode resetReachableNodes(WfNode start_node)
          Resets all nodes that can be reached from node passed as argument.
private static Enumeration resolveAssignment(WfProcess process, WfTemplateObject template)
          Resolves the roles of the overdue notification list into a vector of principals.
private  Enumeration resolveGroup(WTGroup wg)
           
static void restoreState(ObjectIdentifier activity_id)
          Restores state of objects associated with activity passed as argument.
static void runRobot(ObjectIdentifier robot_id)
          Method called by robot activities to do the work associated with the robot in the 'run' method.
private  boolean sameContainer(NodeTemplateLink link)
          Returns 'true' if source and destination belong to the same container template; 'false' otherwise.
private  WfContainer saveProcess(WfContainer container)
          Saves process persistently.
private  WTCollection saveProcesses(WTCollection collection)
          Saves processes persistently.
private  WfNode saveWfNode(WfNode node, AdminDomainRef domain_ref)
          Saves a workflow node that was created during process execution.
private  void sendAbortMessage(WfExecutionObject obj, Timestamp event_time, WfState old_state)
          Send message to process creator (initiator) notifying that execution object aborted.
private static void sendApproachingDeadlineMessage(WfExecutionObject obj)
          Send message to process creator (initiator) notifying that execution object is near deadline.
private static void sendApproachingDeadlineMessage(WfExecutionObject obj, WTDistributionList distList)
          Send message to distribution list passed notifying that execution object is near deadline.
private  void sendCompletionMessage(WfExecutionObject obj, Timestamp event_time, WfState old_state)
          Send message to process creator (initiator) notifying that execution object completed.
 void sendEventToSuccessors(ObjectReference node_ref, Object event, boolean is_immediate)
          Propagate event to successors of the given node.
private  void sendExceptionMessage(WfExecutionObject obj, Exception exception, Timestamp event_time)
          Send exception message to process creator (initiator).
private static void sendOverdueMessage(WfExecutionObject exec_obj)
          Send notification that the execution object is overdue.
private static void sendOverdueNotification(WfExecutionObject exec_obj, WTDistributionList distList, WfTemplateProcessor tp)
          Send notification that the execution object is overdue using the pased distribution list and Template processor.
private static void sendOverdueNotificationToRoles(WfExecutionObject exec_obj, WTDistributionList distList, WfTemplateProcessor tp)
          Send notification that the execution object is overdue using the passed distribution list and Template processor.
private static void sendPastDeadlineMessage(WfExecutionObject obj)
          Send message to process creator (initiator) notifying that execution object is past deadline.
private static void sendPastDeadlineMessage(WfExecutionObject obj, WTDistributionList distList)
          Send message to distribution list passed notifying that execution object is past deadline.
 void setIgnoreDelete(Object obj)
          

Supported API: false
private  void setPboClasses()
          Initializes the pboClasses map.
 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.
 void setProcessNodeDueDates(ObjectReference process, HashMap hash)
          Takes an ObjectReference to a process and a HashMap of ObjectReference->WfDueDate paris.
 void setProcessNodeDurations(ObjectReference process, HashMap hash)
          Takes an ObjectReference to a process and a HashMap of ObjectReference->WfDuration paris.
 void setProcessNodeInstructions(ObjectReference process, HashMap hash)
          Takes an ObjectReference to a process and a HashMap of ObjectReference->WfInstructions pairs.
 void setProcessNodeNotifications(ObjectReference process, HashMap hash)
          Takes an ObjectReference to a process and a HashMap of ObjectReference->WfAssigneeNotification paris.
 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.
 WTCollection startProcesses(WTCollection processes)
          Queues the start of all WfProcess objects in the given WTCollection.
 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.
private  void synchProcessToObjectsDomain(WTCollection collection)
          The Process' PBO has changes its domain location.
static void synchRobotToEvent(ObjectIdentifier robot_id, KeyedEvent event)
          Processes event for the robot whose id is passed as argument.
static StatusInfo synchronize(ObjectIdentifier robot_id)
          Method called to perform robot synchronization.
 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.
private static WTArrayList toWTArrayList(QueryResult qr)
          Returns a WTCollection from a QueryResult consisting only of persistables.
static String trimToProcessParentPath(String str)
           
static String trimToProcessSubPath(String str)
           
 Vector whereUsed(ProjectReference project, boolean returnOnlyFirstOccurrence)
          Returns a vector of references to any defintion objects that use a particular Project object

Supported API: false
 Vector whereUsed(TeamReference teamRef, boolean returnOnlyFirstOccurrence)
          Returns a vector of references to any defintion objects that use a particular Team object

Supported API: false
 Vector whereUsed(TeamTemplateReference teamTemplateRef, boolean returnOnlyFirstOccurrence)
          Returns a vector of references to any defintion objects that use a particular TeamTemplate object

Supported API: false
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, 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

WORKFLOW_PROPAGATION_QUEUE_NAME

private static final String WORKFLOW_PROPAGATION_QUEUE_NAME
Name of the queue to hold event internal tasks in the execution of a workflow.

See Also:
Constant Field Values

WORKFLOW_SCHEDULE_QUEUE_NAME

private static final String WORKFLOW_SCHEDULE_QUEUE_NAME
Name of the queue that holds timing and delays requests.

See Also:
Constant Field Values

WORKFLOW_USER_WORK_QUEUE_NAME

private static final String WORKFLOW_USER_WORK_QUEUE_NAME
Name of the queue that holds user work requests. This string is also used to form dedicated queue names, in which case the name is obtained appending the process id associated with the process to the string.

See Also:
Constant Field Values

workflowPropagationQueue

private ProcessingQueue workflowPropagationQueue

workflowUserWorkQueue

private ProcessingQueue workflowUserWorkQueue

workflowScheduleQueue

private ScheduleQueue workflowScheduleQueue

PROCESS_CLASS_NAME

private static final String PROCESS_CLASS_NAME

PRIM_BUS_OBJ_VAR_NAME

private static final String PRIM_BUS_OBJ_VAR_NAME
See Also:
Constant Field Values

IGNORE_DELETE_KEY

private static final Object IGNORE_DELETE_KEY

synchRobotCache

private static StandardWfEngineService.SynchRobotCache synchRobotCache

threadNumber

private static int threadNumber

EXCEPTION_NOTIFICATION_TEMPLATE

private static final String EXCEPTION_NOTIFICATION_TEMPLATE
See Also:
Constant Field Values

ABORT_NOTIFICATION_TEMPLATE

private static final String ABORT_NOTIFICATION_TEMPLATE
See Also:
Constant Field Values

OVERDUE_NOTIFICATION_TEMPLATE

private static final String OVERDUE_NOTIFICATION_TEMPLATE
See Also:
Constant Field Values

OVERDUE_NOTIFICATION_TEMPLATE_FOR_ROLES

private static final String OVERDUE_NOTIFICATION_TEMPLATE_FOR_ROLES
See Also:
Constant Field Values

COMPLETE_NOTIFICATION_TEMPLATE

private static final String COMPLETE_NOTIFICATION_TEMPLATE
See Also:
Constant Field Values

APPROACHING_DEADLINE_TEMPLATE

private static final String APPROACHING_DEADLINE_TEMPLATE
See Also:
Constant Field Values

PAST_DEADLINE_TEMPLATE

private static final String PAST_DEADLINE_TEMPLATE
See Also:
Constant Field Values

URL_PROCESSOR_METHOD

private static final String URL_PROCESSOR_METHOD
See Also:
Constant Field Values

FOLDER_SEPARATOR

private static final String FOLDER_SEPARATOR

PROPAGATION_QUEUE_INTERVAL

private static int PROPAGATION_QUEUE_INTERVAL

USER_WORK_QUEUE_INTERVAL

private static int USER_WORK_QUEUE_INTERVAL

SYNCH_RESCHEDULE_INTERVAL

private static int SYNCH_RESCHEDULE_INTERVAL

DEDICATED_QUEUE_LIMIT

private static int DEDICATED_QUEUE_LIMIT

SHARED_PROPAGATION_QUEUE_NAME

private static final String SHARED_PROPAGATION_QUEUE_NAME
See Also:
Constant Field Values

SHARED_USER_WORK_QUEUE_NAME

private static final String SHARED_USER_WORK_QUEUE_NAME
See Also:
Constant Field Values

PROPAGATION_POOL_SIZE

private static int PROPAGATION_POOL_SIZE

USER_WORK_POOL_SIZE

private static int USER_WORK_POOL_SIZE

nextPropagationQueue

private static int nextPropagationQueue

nextUserWorkQueue

private static int nextUserWorkQueue

DOMAIN_BASED_WORKFLOW

private static final boolean DOMAIN_BASED_WORKFLOW

DEDICATED_QUEUE_MODE

private static String DEDICATED_QUEUE_MODE
Stores dedicated queue "mode," which can be one of:

If mode is different from "none" then whether or not the queue is shared depends on the dedicatedQueue flag of the event configuration attribute.


NO_DEDICATED_PROPAGATION

private static boolean NO_DEDICATED_PROPAGATION
Is true if mode is none or userWork. Computed at initialization time.


NO_DEDICATED_USER_WORK

private static boolean NO_DEDICATED_USER_WORK
Is true if mode is none or propagation. Computed at initialization time.


NOTIFICATION_SENDER

private static String NOTIFICATION_SENDER
Sender of email notification. Value read from wt.properties.


NAME_SEPARATOR

private static final String NAME_SEPARATOR
See Also:
Constant Field Values

NAME_SIZE

private static final int NAME_SIZE

NAME_SUFFIX

private static int NAME_SUFFIX

USE_QUEUE

private static final boolean USE_QUEUE

VERBOSE

private static final boolean VERBOSE

CONCAT_NESTED_PROCESS_NAME

private static final boolean CONCAT_NESTED_PROCESS_NAME

TERMINATE_OBJECTS_RUNNING_WORKFLOWS

private static final boolean TERMINATE_OBJECTS_RUNNING_WORKFLOWS

DEDICATED_QUEUE_PER_PROCESS

private static final boolean DEDICATED_QUEUE_PER_PROCESS

PBO_CLASSES

private static final String PBO_CLASSES
String read from wt.properties containing the list of classes that are not LifeCycleManaged and may be a primary business object in a wf process. Only for those classes is that the workflow is automatically terminated when the object is deleted.


pboClasses

private HashMap pboClasses
Holds primary business classes not LifeCycleManaged. Initilaized from the PBO_CLASSES string.


numberOfDedicatedQueues

private int numberOfDedicatedQueues
Current number of dedicated queues associated with running processes. This number should always be less than or equals 'DEDICATED_QUEUE_LIMIT.'


NRETRIES

private static final int NRETRIES
See Also:
Constant Field Values

SLEEPTIME

private static final int SLEEPTIME
See Also:
Constant Field Values
Constructor Detail

StandardWfEngineService

public StandardWfEngineService()
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

performStartupProcess

protected void performStartupProcess()
                              throws ManagerException
Initialization tasks performed by the engine service. Includes queue activation and event subscription.

Supported API: false

Overrides:
performStartupProcess in class StandardManager
Throws:
ManagerException

propagateEvent

public static void propagateEvent(ObjectIdentifier node_id,
                                  Serializable event)
                           throws WTException
This method does the actual event propagation from one node to the successor nodes. It is public because it may be queued.

Supported API: false

Parameters:
node_id -
event -
Throws:
WTException

runRobot

public static void runRobot(ObjectIdentifier robot_id)
                     throws WTException
Method called by robot activities to do the work associated with the robot in the 'run' method.

Supported API: false

Parameters:
robot_id -
Throws:
WTException

changeState

public static void changeState(ObjectIdentifier exec_obj_id,
                               WfTransition transition,
                               Boolean propagate)
                        throws WTException
Method queued to perform a change of state in an execution object. If propagate is 'false' and execution object is activity, then transition event is not propagated to successor nodes.

Supported API: false

Parameters:
exec_obj_id -
transition -
propagate -
Throws:
WTException

processDeadline

public static void processDeadline(ObjectIdentifier exec_obj_id)
                            throws WTException
Checks if the deadline for the executioon object whose reference has been passed as parameter has been reached. If not the checkDeadline is queued again; otherwise the overdue actions specified in the event configurations are carried out.

Supported API: false

Parameters:
exec_obj_id -
Throws:
WTException

processTimeToDeadline

public static void processTimeToDeadline(ObjectIdentifier exec_obj_id)
                                  throws WTException
Checks if the time to deadline for the executioon object whose reference has been passed as parameter has been reached. If not the checkTimeToDeadline is queued again; otherwise the notification of the event is sent to the responsible role.

Supported API: false

Parameters:
exec_obj_id -
Throws:
WTException

processTimePastDeadline

public static void processTimePastDeadline(ObjectIdentifier exec_obj_id)
                                    throws WTException
Checks if the timepast deadline for the executioon object whose reference has been passed as parameter has been reached. If not the checkTimePastDeadline is queued again; otherwise the notification of the event is sent to the responsible role.

Supported API: false

Parameters:
exec_obj_id -
Throws:
WTException

completeTransition

public static void completeTransition(ObjectIdentifier obj_id,
                                      Vector events)
                               throws WTException


Supported API: false

Parameters:
obj_id -
events -
Throws:
WTException

restoreState

public static void restoreState(ObjectIdentifier activity_id)
                         throws WTException
Restores 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). This method is queued by 'queueRestoreState' method, accessible in the server API.

Supported API: false

Parameters:
activity_id -
Throws:
WTException

synchronize

public static StatusInfo synchronize(ObjectIdentifier robot_id)
                              throws WTException
Method called to perform robot synchronization. It may return the status "RESCHEDULE" in which case the request is requeued with a new time.

Supported API: false

Parameters:
robot_id -
Returns:
StatusInfo
Throws:
WTException

processDeadline

public static void processDeadline(ObjectIdentifier exec_obj_id,
                                   Timestamp orig_deadline)
                            throws WTException
Checks if the deadline for the executioon object whose reference has been passed as parameter has been reached. If not the checkDeadline is queued again; otherwise the overdue actions specified in the event configurations are carried out.

Supported API: false

Parameters:
exec_obj_id -
orig_deadline -
Throws:
WTException

processTimePastDeadline

public static void processTimePastDeadline(ObjectIdentifier exec_obj_id,
                                           Timestamp orig_deadline)
                                    throws WTException
Checks if the timepast deadline for the executioon object whose reference has been passed as parameter has been reached. If not the checkTimePastDeadline is queued again; otherwise the notification of the event is sent to the responsible role.

Supported API: false

Parameters:
exec_obj_id -
orig_deadline -
Throws:
WTException

processTimeToDeadline

public static void processTimeToDeadline(ObjectIdentifier exec_obj_id,
                                         Timestamp orig_deadline)
                                  throws WTException
Checks if the time to deadline for the executioon object whose reference has been passed as parameter has been reached. If not the checkTimeToDeadline is queued again; otherwise the notification of the event is sent to the responsible role.

Supported API: false

Parameters:
exec_obj_id -
orig_deadline -
Throws:
WTException

newStandardWfEngineService

public static StandardWfEngineService newStandardWfEngineService()
                                                          throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardWfEngineService
Throws:
WTException

changeStateEvent

public void changeStateEvent(WfExecutionObject obj,
                             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(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(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(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(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 WfNode resetReachableNodes(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,
                             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

queueStateChange

public void queueStateChange(WTCollection collection,
                             WfTransition transition,
                             boolean new_thread,
                             boolean propagate)
                      throws WTException
Queues the state change for a collection of execution objects. The collection 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: false

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

queueTimeEvent

public void queueTimeEvent(WfExecutionObject obj,
                           Timestamp time,
                           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(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(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(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 WfNode getPersistentNode(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(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(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

emitPastDeadlineEvent

public void emitPastDeadlineEvent(WfExecutionObject object)
                           throws WTException
Emits event that a deadline has come and gone for the execution object passed as argument.

Supported API: false

Specified by:
emitPastDeadlineEvent in interface WfEngineServiceSvr
Parameters:
object -
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

emitCustomEvent

public void emitCustomEvent(String event_type,
                            Object target,
                            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: false

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

doReteamProcess

public void doReteamProcess(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(TeamReference team,
                                          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

getAssociatedProcesses

public QueryResult getAssociatedProcesses(TeamReference team,
                                          WfState state,
                                          WTContainerRef context_ref)
                                   throws WTException


Supported API: false

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

changeDataEvent

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

Supported API: false

Specified by:
changeDataEvent in interface WfEngineServiceSvr
Parameters:
obj -
old_data -
role -
instructions -
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

setIgnoreDelete

public void setIgnoreDelete(Object obj)
                     throws WTException


Supported API: false

Specified by:
setIgnoreDelete in interface WfEngineService
Parameters:
obj -
Throws:
WTException

getProcesses

public Enumeration getProcesses(WfState state)
                         throws WTException
Deprecated. use method with WTContainerRef as argument.

Returns all existing processes in a given state. For example, one can ask for all OPEN processes (irrespective of its substates). If state is null all processes are returned irrespective of their states.

Supported API: false

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

getProcesses

public Enumeration getProcesses(WfProcessTemplate template,
                                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(WfContainer container,
                                   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

getProcessNodeDueDates

public HashMap getProcessNodeDueDates(WfProcessTemplate pt)
                               throws WTException
Returns a HashMap. The key being a WfAssignedActifvityTemplate's ObjectReference. The value is the WfDueDate object associatedwith this activity.

Supported API: false

Specified by:
getProcessNodeDueDates in interface WfEngineService
Parameters:
pt -
Returns:
HashMap
Throws:
WTException

getProcessConnectors

public Enumeration getProcessConnectors(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,
                                     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,
                              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 WfActivity complete(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(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(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:


createNestedProcess

public WfRequesterActivity createNestedProcess(WfProcessTemplate template,
                                               WfContainer container)
                                        throws WTException
Creates an activity requester and an associated process from the template.

Supported API: false

Specified by:
createNestedProcess in interface WfEngineService
Parameters:
template -
container -
Returns:
WfRequesterActivity
Throws:
WTException

getHistory

public Enumeration getHistory(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,
                                     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

createBlockProcess

public WfRequesterActivity createBlockProcess(WfBlockTemplate template,
                                              WfContainer container)
                                       throws WTException
Creates a block process and requester activity given the block template and containing process. Returns requester activity.

Supported API: false

Specified by:
createBlockProcess in interface WfEngineService
Parameters:
template -
container -
Returns:
WfRequesterActivity
Throws:
WTException

createStartAdHocProcess

public WfContainer createStartAdHocProcess(WfAdHocActivity requester,
                                           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,
                                          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

whereUsed

public Vector whereUsed(ProjectReference project,
                        boolean returnOnlyFirstOccurrence)
                 throws WTException
Returns a vector of references to any defintion objects that use a particular Project object

Supported API: false

Specified by:
whereUsed in interface WfEngineService
Parameters:
project -
returnOnlyFirstOccurrence - this boolean parameter determines whether to return all objects that use the Project object or only the first usage. This parameter was added for performance reasons and the occasional need to only know that the project is used.
Returns:
Vector
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(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

whereUsed

public Vector whereUsed(TeamTemplateReference teamTemplateRef,
                        boolean returnOnlyFirstOccurrence)
                 throws WTException
Returns a vector of references to any defintion objects that use a particular TeamTemplate object

Supported API: false

Specified by:
whereUsed in interface WfEngineService
Parameters:
teamTemplateRef -
returnOnlyFirstOccurrence - this boolean parameter determines whether to return all objects that use the TeamTemplate object or only the first usage. This parameter was added for performance reasons and the occasional need to only know that the team template is used.
Returns:
Vector
Throws:
WTException

whereUsed

public Vector whereUsed(TeamReference teamRef,
                        boolean returnOnlyFirstOccurrence)
                 throws WTException
Returns a vector of references to any defintion objects that use a particular Team object

Supported API: false

Specified by:
whereUsed in interface WfEngineService
Parameters:
teamRef -
returnOnlyFirstOccurrence - this boolean parameter determines whether to return all objects that use the Team object or only the first usage. This parameter was added for performance reasons and the occasional need to only know that the team is used.
Returns:
Vector
Throws:
WTException

getTeamName

public String getTeamName(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,
                                          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

getProcesses

public QueryResult getProcesses(WfState state,
                                WTContainerRef context_ref)
                         throws WTException
Returns all existing processes in a given state and WTContainer. For example, one can ask for all OPEN processes (irrespective of its substates). If state is null all processes are returned irrespective of their states.

Supported API: false

Specified by:
getProcesses in interface WfEngineService
Parameters:
state -
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

getWfFolder

public Folder getWfFolder(String folder_name)
                   throws WTException
Deprecated. use method with the same name with two additional parameters: the primary business object and the container of the process.



Supported API: false

Specified by:
getWfFolder in interface WfEngineService
Parameters:
folder_name -
Returns:
Folder
Throws:
WTException

createProcesses

public WTValuedMap createProcesses(WTValuedMap objToWfDefMap,
                                   WTKeyedMap objToWfNameMap,
                                   WTCollection collection,
                                   boolean setTeamFromPbo,
                                   long priority)
                            throws WTException
Creates and returns a WTValuedMap of objects to WfProcess.

Supported API: false

Specified by:
createProcesses in interface WfEngineService
Parameters:
objToWfDefMap - Object to WfProcessDefinition map
objToWfNameMap - Object to Workflow Process name map.
collection - Collection of target objects
setTeamFromPbo - set TeamTemplate from target object
priority - WfProcess priority value
Returns:
WTValuedMap
Throws:
WTException

createProcesses

public WTValuedMap createProcesses(WTValuedMap objToWfDefMap,
                                   WTKeyedMap objToWfNameMap,
                                   WTCollection collection,
                                   boolean setTeamFromPbo,
                                   long priority,
                                   WTContainerRef context_ref)
                            throws WTException
Creates and returns a WTValuedMap of objects to WfProcess.

Supported API: false

Specified by:
createProcesses in interface WfEngineService
Parameters:
objToWfDefMap - Object to WfProcessDefinition map
objToWfNameMap - Object to Workflow Process name map.
collection - Collection of target objects
setTeamFromPbo - set TeamTemplate from target object
priority - WfProcess priority value
context_ref - WTContainerRef to be used for newly created Workflow Processes.
Returns:
WTValuedMap
Throws:
WTException

startProcesses

public WTCollection startProcesses(WTCollection processes)
                            throws WTException
Queues the start of all WfProcess objects in the given WTCollection. Returns the collection of WfProcess objects.

Supported API: false

Specified by:
startProcesses in interface WfEngineService
Parameters:
processes - collection of WfProcess objects
Returns:
WTCollection
Throws:
WTException

getAssignmentEvents

public WTCollection getAssignmentEvents(WfProcess process,
                                        Role role,
                                        WTPrincipalReference new_assignee_ref,
                                        WTPrincipalReference old_assignee_ref,
                                        WTReference bus_obj_ref)
                                 throws WTException
Returns all the reassignment events for the process, role, old assignee, new assignee and business object passed as argument. It is expected that the execution object be an assigned activity or a process (other than that an empty collection is returned). Any number of arguments may be null, in which case the null argument is ignored in the query.

Note

The business object is passed as argument as a WTReference, which can be an ObjectReference or a wt.fc.VersionReference. In case of Iterated objects a wt.fc.VersionReference needs to be passed as argument, otherwise the events will not be found.

Supported API: false

Specified by:
getAssignmentEvents in interface WfEngineService
Parameters:
process -
role -
new_assignee_ref -
old_assignee_ref -
bus_obj_ref -
Returns:
WTCollection
Throws:
WTException

getVotingEvents

public WTCollection getVotingEvents(WfProcess process,
                                    Role role,
                                    WTPrincipalReference user_ref,
                                    WTReference bus_obj_ref)
                             throws WTException
Returns all the voting events for the process, role, assignee and business object passed as argument. It is expected that the execution object be an assigned activity or a process (other than that an empty collection is returned). Any number of arguments may be null, in which case the null argument is ignored in the query.

Note

The business object is passed as argument as a WTReference, which can be an ObjectReference or a wt.fc.VersionReference. In case of Iterated objects a wt.fc.VersionReference needs to be passed as argument, otherwise the events will not be found.

Supported API: false

Specified by:
getVotingEvents in interface WfEngineService
Parameters:
process -
role -
user_ref -
bus_obj_ref -
Returns:
WTCollection
Throws:
WTException

getDataEvents

public WTCollection getDataEvents(WfExecutionObject exec_obj,
                                  Role role,
                                  WTPrincipalReference user_ref,
                                  WTReference bus_obj_ref)
                           throws WTException
Returns all the data events for the execution object (process or activity), role, assignee, and business object passed as arguments. Any number of arguments except the execution object may be null, in which case the null argument is ignored in the query. The WTReference passed as argument is either an ObjectReference (for non-iterated objects) or a VersionReference if the business object is iterated. Note: The API is the same both for process and activity variables. If the execution object passed as argument is a process, the method returns process variable updates, otherwise, if it is an activity, it returns activity variable updates.

Supported API: false

Specified by:
getDataEvents in interface WfEngineService
Parameters:
exec_obj -
role -
user_ref -
bus_obj_ref -
Returns:
WTCollection
Throws:
WTException

getProcessNodeDueDates

public HashMap getProcessNodeDueDates(WfProcess process)
                               throws WTException
Returns a HashMap. The key being an ObjectReference of either a WfAssignedActifvityTemplate(if the activity has yet to be instantiated) or a WfAssignedActivity. The value is the WfDueDate object associatedwith this activity.

Supported API: false

Specified by:
getProcessNodeDueDates in interface WfEngineService
Parameters:
process -
Returns:
HashMap
Throws:
WTException

setProcessNodeDueDates

public void setProcessNodeDueDates(ObjectReference process,
                                   HashMap hash)
                            throws WTException
Takes an ObjectReference to a process and a HashMap of ObjectReference->WfDueDate paris. The key if the HashMap is an ObjectReference of either a WfAssignedActivityTemplate (if the activity has yet to be instantiated) or a WfAssignedActivity. The value is the WfDueDate object associated with this activity. Returns a HashMap. The key being a WfAssignedActifvityTemplate's ObjectReference. The value is the WfDueDate object associatedwith this activity.

Supported API: false

Specified by:
setProcessNodeDueDates in interface WfEngineService
Parameters:
process -
hash -
Throws:
WTException

getProcessNodeInstructions

public HashMap getProcessNodeInstructions(WfProcess process)
                                   throws WTException
Returns a HashMap. The key being an ObjectReference of either a WfAssignedActifvityTemplate(if the activity has yet to be instantiated) or a WfAssignedActivity. The value is the WfInstruction object associatedwith this activity.

Supported API: false

Specified by:
getProcessNodeInstructions in interface WfEngineService
Parameters:
process -
Returns:
HashMap
Throws:
WTException

getProcessNodeInstructions

public HashMap getProcessNodeInstructions(WfProcessTemplate processTemplate)
                                   throws WTException
Returns a HashMap. The key being an ObjectReference of a WfAssignedActifvityTemplate. The value is the WfInstruction object associatedwith this activity.

Supported API: false

Specified by:
getProcessNodeInstructions in interface WfEngineService
Parameters:
processTemplate -
Returns:
HashMap
Throws:
WTException

setProcessNodeInstructions

public void setProcessNodeInstructions(ObjectReference process,
                                       HashMap hash)
                                throws WTException
Takes an ObjectReference to a process and a HashMap of ObjectReference->WfInstructions pairs. The key if the HashMap is an ObjectReference of either a WfAssignedActivityTemplate (if the activity has yet to be instantiated) or a WfAssignedActivity. The value is the WfInstruction object associated with this activity.

Supported API: false

Specified by:
setProcessNodeInstructions in interface WfEngineService
Parameters:
process -
hash -
Throws:
WTException

getWfDomain

public AdminDomainRef getWfDomain(WTObject pbo,
                                  WTContainerRef context_ref)
                           throws WTException
Gets the AdminDomainRef given the associated business object and the context. The business object may be null, but assumes context reference is not null.

Supported API: false

Specified by:
getWfDomain in interface WfEngineService
Parameters:
pbo -
context_ref -
Returns:
AdminDomainRef
Throws:
WTException

getProcessNodeDurations

public HashMap getProcessNodeDurations(WfProcessTemplate pt)
                                throws WTException
Returns a HashMap. The key being a WfAssignedActifvityTemplate's ObjectReference. The value is the WfDuration object associatedwith this activity.

Supported API: false

Specified by:
getProcessNodeDurations in interface WfEngineService
Parameters:
pt -
Returns:
HashMap
Throws:
WTException

getProcessNodeDurations

public HashMap getProcessNodeDurations(WfProcess process)
                                throws WTException
Returns a HashMap. The key being an ObjectReference of either a WfAssignedActifvityTemplate(if the activity has yet to be instantiated) or a WfAssignedActivity. The value is the WfDuration object associatedwith this activity.

Supported API: false

Specified by:
getProcessNodeDurations in interface WfEngineService
Parameters:
process -
Returns:
HashMap
Throws:
WTException

getProcessNodeNotifications

public HashMap getProcessNodeNotifications(WfProcessTemplate pt)
                                    throws WTException
Returns a HashMap. The key being a WfAssignedActifvityTemplate's ObjectReference. The value is the WfAssigneeNotificationobject associatedwith this activity.

Supported API: false

Specified by:
getProcessNodeNotifications in interface WfEngineService
Parameters:
pt -
Returns:
HashMap
Throws:
WTException

getProcessNodeNotifications

public HashMap getProcessNodeNotifications(WfProcess process)
                                    throws WTException
Returns a HashMap. The key being an ObjectReference of either a WfAssignedActifvityTemplate(if the activity has yet to be instantiated) or a WfAssignedActivity. The value is the WfAssigneeNotification object associatedwith this activity.

Supported API: false

Specified by:
getProcessNodeNotifications in interface WfEngineService
Parameters:
process -
Returns:
HashMap
Throws:
WTException

setProcessNodeDurations

public void setProcessNodeDurations(ObjectReference process,
                                    HashMap hash)
                             throws WTException
Takes an ObjectReference to a process and a HashMap of ObjectReference->WfDuration paris. The key if the HashMap is an ObjectReference of either a WfAssignedActivityTemplate (if the activity has yet to be instantiated) or a WfAssignedActivity. The value is the WfDuration object associated with this activity. Returns a HashMap. The key being a WfAssignedActifvityTemplate's ObjectReference. The value is the WfDuration object associatedwith this activity.

Supported API: false

Specified by:
setProcessNodeDurations in interface WfEngineService
Parameters:
process -
hash -
Throws:
WTException

setProcessNodeNotifications

public void setProcessNodeNotifications(ObjectReference process,
                                        HashMap hash)
                                 throws WTException
Takes an ObjectReference to a process and a HashMap of ObjectReference->WfAssigneeNotification paris. The key if the HashMap is an ObjectReference of either a WfAssignedActivityTemplate (if the activity has yet to be instantiated) or a WfAssignedActivity. The value is the WfAssigneeNotification object associated with this activity. Returns a HashMap. The key being a WfAssignedActifvityTemplate's ObjectReference. The value is the WfAssigneeNotification object associatedwith this activity.

Supported API: false

Specified by:
setProcessNodeNotifications in interface WfEngineService
Parameters:
process -
hash -
Throws:
WTException

getActivity

private WfActivity getActivity(ObjectIdentifier container_id,
                               WfNodeTemplate template)
                        throws WTException
Throws:
WTException

getExecObject

private WfExecutionObject getExecObject(ObjectIdentifier container_id,
                                        WfNodeTemplate template)
                                 throws WTException
Throws:
WTException

getConnector

private WfNode getConnector(ObjectIdentifier container_id,
                            WfNodeTemplate template)
                     throws WTException
Throws:
WTException

setPboClasses

private void setPboClasses()
                    throws WTException,
                           ClassNotFoundException
Initializes the pboClasses map.

Throws:
WTException
ClassNotFoundException

isPrimaryBusinessObject

private boolean isPrimaryBusinessObject(Persistable object)
                                 throws WTException
Returns whether the object passed as argument may be a primary business object of a workflow. Need to terminate workflows only for those objects that may be a business object.

Throws:
WTException

getPrimaryBusinessObjects

private WTCollection getPrimaryBusinessObjects(WTCollection collection)
                                        throws WTException
Throws:
WTException

getContainerNodes

public QueryResult getContainerNodes(WfContainer container)
                              throws WTException
Throws:
WTException

registerEvents

public void registerEvents(ManagerService ms)
Register events with the passed ManagerService.

Specified by:
registerEvents in interface Manager
Overrides:
registerEvents in class StandardManager
Parameters:
ms - the ManagerService with which to register events.

getUserWorkQueue

private ProcessingQueue getUserWorkQueue(Object wf_obj)
                                  throws WTException
Gets the user work queue associated with the workflow object passed as argument

Throws:
WTException

getPropagationQueue

private ProcessingQueue getPropagationQueue(Object wf_obj)
                                     throws WTException
Gets the propagation queue associated with the workflow object passed as argument

Throws:
WTException

getPropagationQueue

private WTKeyedHashMap getPropagationQueue(WTCollection collection)
                                    throws WTException
Gets a map of propagation queue->collection of worfklow objects from the collection of workflow objects passed in as the argument

Throws:
WTException

nodeToString

private static String nodeToString(WfNode node)
Returns condensed readable identity of the node. For debugging purposes.

Parameters:
node - - WfNode to be printed out

linkToString

private static String linkToString(WfLink link)
Returns condensed readable identity of the link. For debugging purposes.

Parameters:
link - - WfLink to be printed out

checkProcessDeletion

private void checkProcessDeletion(WTCollection collection)
                           throws WTException
Throws exception if container is embedded.

Throws:
WTException

deleteContainedObjects

private void deleteContainedObjects(WTCollection collection)
                             throws WTException
Deletes all contained objects in a given process. The contained objects are nodes and connectors. This method is called when an event of process deletion is captured. In case of ad hoc process, also the associated template object is deleted.

Throws:
WTException

getSuccessor

private WfLink getSuccessor(WfNode node,
                            NodeTemplateLink template_link)
                     throws WTException
Instantiates the successor of a node and the link to it, given the template link. Returns the link to the successor node. Checks whether the successor hasn't been instantiated already.

Parameters:
node -
Returns:
WfLink
Throws:
WTException

getSuccNode

private WfNode getSuccNode(WfContainer container,
                           WfNodeTemplate template)
                    throws WTException
Instantiates a surrogate for the successor of a node given the template link and the process. What is returned is a transient object which is need in order to create the propagation link. A representative connector or activity is returned. A requester activity was chose to represent activities because it requires the least number of attributes to be filled out. Any activity would be equally good.

Parameters:
template -
Returns:
WfNode
Throws:
WTException

saveWfNode

private WfNode saveWfNode(WfNode node,
                          AdminDomainRef domain_ref)
                   throws WTException
Saves a workflow node that was created during process execution.

Parameters:
node - - WfNode to be saved
Returns:
persisted WfNode
Throws:
WTException

checkStartAdHocProcess

private void checkStartAdHocProcess(WfAdHocActivity requester)
                             throws WTException
Checks whether is valid to create and start an ad hoc process associated with the ad hoc activity passed as argument. Throws exception if this is not the case.

Cases in which it is valid:

Parameters:
requester - - ad hoc activity
Throws:
WTException

abortHostProcess

private void abortHostProcess(WfExecutionObject obj)
                       throws WTException
Abort host process.

Throws:
WTException

sendCompletionMessage

private void sendCompletionMessage(WfExecutionObject obj,
                                   Timestamp event_time,
                                   WfState old_state)
                            throws WTException
Send message to process creator (initiator) notifying that execution object completed.

Throws:
WTException

isProjectLink

private static boolean isProjectLink(WfExecutionObject obj)
                              throws WTException
Returns whether the workflow is part of ProjectLink.

Throws:
WTException

sendApproachingDeadlineMessage

private static void sendApproachingDeadlineMessage(WfExecutionObject obj)
                                            throws WTException
Send message to process creator (initiator) notifying that execution object is near deadline.

Throws:
WTException

sendPastDeadlineMessage

private static void sendPastDeadlineMessage(WfExecutionObject obj)
                                     throws WTException
Send message to process creator (initiator) notifying that execution object is past deadline.

Throws:
WTException

sendAbortMessage

private void sendAbortMessage(WfExecutionObject obj,
                              Timestamp event_time,
                              WfState old_state)
                       throws WTException
Send message to process creator (initiator) notifying that execution object aborted.

Throws:
WTException

sendExceptionMessage

private void sendExceptionMessage(WfExecutionObject obj,
                                  Exception exception,
                                  Timestamp event_time)
                           throws WTException
Send exception message to process creator (initiator).

Throws:
WTException

getHTMLErrorMessage

private String getHTMLErrorMessage(Exception e)
Capture an exception's stack trace and message in a single String; format using HTML tags.

Parameters:
e - - exception

getCulprit

private static WfExecutionObject getCulprit(WfNode node)
                                     throws WTException
Returns the execution object to be blamed for the occurrence of an exception. If the node is an execution object then it is the culprit, otherwise it is the host process.

Throws:
WTException

refreshObject

private static Persistable refreshObject(ObjectIdentifier obj_id)
                                  throws WTException
Refreshes object given its object identifier. Tries NRETRIES times, waiting SLEEPTIME seconds between tries.

Parameters:
obj_id - - id of the object to be refreshed
Returns:
refreshed object
Throws:
WTException

saveProcess

private WfContainer saveProcess(WfContainer container)
                         throws WTException
Saves process persistently. Throws exception if user can't create process.

Returns:
WfProcess: saved process
Throws:
WTException

saveProcesses

private WTCollection saveProcesses(WTCollection collection)
                            throws WTException
Saves processes persistently. Throws exception if user can't create a process.

Parameters:
collection - - WTCollection of processes to be saved
Returns:
WTCollection: WTCollection of saved processes
Throws:
WTException

sendOverdueMessage

private static void sendOverdueMessage(WfExecutionObject exec_obj)
                                throws WTException
Send notification that the execution object is overdue.

Parameters:
exec_obj - - overdue execution object
Throws:
WTException

sendOverdueNotification

private static void sendOverdueNotification(WfExecutionObject exec_obj,
                                            WTDistributionList distList,
                                            WfTemplateProcessor tp)
                                     throws WTException
Send notification that the execution object is overdue using the pased distribution list and Template processor.

Parameters:
distList - - distribution list
tp - - template processor
Throws:
WTException

sendOverdueNotificationToRoles

private static void sendOverdueNotificationToRoles(WfExecutionObject exec_obj,
                                                   WTDistributionList distList,
                                                   WfTemplateProcessor tp)
                                            throws WTException
Send notification that the execution object is overdue using the passed distribution list and Template processor.

Parameters:
distList - - distribution list
tp - - template processor
Throws:
WTException

resolveAssignment

private static Enumeration resolveAssignment(WfProcess process,
                                             WfTemplateObject template)
                                      throws WTException
Resolves the roles of the overdue notification list into a vector of principals.

Parameters:
process - - container process
template - - template object containing the overdue notification list
Returns:
Vector vector of (resolved) principals
Throws:
WTException

createAdHocBlock

private WfBlockTemplate createAdHocBlock(WfTemplateObject template,
                                         WTContainerRef context_ref)
                                  throws WTException
Creates a block template given an activity template.

Parameters:
template - - activity template
Returns:
WfBlockTemplate - constructed block template
Throws:
WTException

createQueue

private ProcessingQueue createQueue(String queue_name,
                                    int queue_interval)
                             throws WTException
Creates, sets and starts processing queues.

Parameters:
queue_name - - queue name
queue_interval - - queue polling interval
Throws:
WTException

createScheduleQueue

private ScheduleQueue createScheduleQueue(String queue_name)
                                   throws WTException
Creates, sets and starts schedule queues.

Parameters:
queue_name - - queue name
Throws:
WTException

initializeQueue

private ProcessingQueue initializeQueue(String queue_name,
                                        int queue_interval)
                                 throws WTException
Initializes queues: retrieves (or creates), sets interval and starts,

Parameters:
queue_name - - queue name
queue_interval - - queue polling interval
Throws:
WTException

getParent

private static WfProcess getParent(WfExecutionObject obj)
Returns the parent process of the execution object. Returns null if it doesn't exist.

Parameters:
obj - - execution object (activity or process)
Returns:
Wfprocess

registerAsListener

private void registerAsListener()
                         throws ManagerException
Register as listener to the following events: The objects of interest are workflow objects, more specifically, node templates (processes, activities and connectors) and expressions.

Throws:
ManagerException

isProcess

private boolean isProcess(Object object)
Returns all event keys that can be listened by synch robots. These keys are listed in the wt.workflow.robots.synchEventResource resource bundle.


getRobotEventKeys

protected Vector getRobotEventKeys()
Returns all event keys that can be listened by synch robots. These keys are listed in the wt.workflow.robots.synchEventResource resource bundle.


synchRobotToEvent

public static void synchRobotToEvent(ObjectIdentifier robot_id,
                                     KeyedEvent event)
                              throws WTException
Processes event for the robot whose id is passed as argument. Basically checks whether the robot is waiting for the event for the target class. After that executes user expression. Vetoes event if exception is thrown during expression evaluation.

Throws:
WTException

synchProcessToObjectsDomain

private void synchProcessToObjectsDomain(WTCollection collection)
                                  throws WTException
The Process' PBO has changes its domain location. We need to put the all processes, having this as it's PBO, into the same domain.

Throws:
WTException

getSynchRobotCache

private StandardWfEngineService.SynchRobotCache getSynchRobotCache()
                                                            throws WTException
Construct the singleton cache on demand in thread-safe manner

Throws:
WTException

getStartConnector

private WfConnector getStartConnector(ObjectIdentifier container_id)
                               throws WTException
Returns the start connector given the id of the container.

Throws:
WTException

getLoopNodes

private Vector getLoopNodes(WfNode node)
                     throws WTException
Returns the set of nodes in the same loop as the link passed as argument.

Throws:
WTException

getReachableNodeRefs

private Vector getReachableNodeRefs(WfNodeTemplate node_template,
                                    String role)
                             throws WTException
Returns the set of connector templates that can be reached from the node template passed as argument in a given direction.

Throws:
WTException

addPRefs

private void addPRefs(Vector v,
                      Enumeration e)

addPrin

private void addPrin(Vector v,
                     WTPrincipalReference pRef)

resolveGroup

private Enumeration resolveGroup(WTGroup wg)
                          throws WTException
Throws:
WTException

sameContainer

private boolean sameContainer(NodeTemplateLink link)
Returns 'true' if source and destination belong to the same container template; 'false' otherwise.


getContainer

private WfContainer getContainer(WfNode node,
                                 WfNodeTemplate template)
                          throws WTException
Returns container instance corresponding to destination container template. Assumes there is a one-to-one correspondence between templates and instances (true only for project management).

Throws:
WTException

getIgnoreDelete

private Object getIgnoreDelete()

getOid

private static ObjectIdentifier getOid(Object object)
Helper method that extracts object identifier.


getId

private static long getId(Object object)
Helper method that extracts object db id.


getProcess

private static WfProcess getProcess(Object wf_obj)
                             throws WTException
Throws:
WTException

createNestedFolder

protected Folder createNestedFolder(String folder_path,
                                    AdminDomainRef aDomObj)
                             throws WTException
Throws:
WTException

trimToProcessSubPath

public static String trimToProcessSubPath(String str)

trimToProcessParentPath

public static String trimToProcessParentPath(String str)

createProcessInstance

private WfProcess createProcessInstance(WfContainerTemplate process_def,
                                        Object team_spec,
                                        WTContainerRef context_ref,
                                        boolean persist)
                                 throws WTException
Throws:
WTException

createProcessInstance

private WfProcess createProcessInstance(WfContainerTemplate process_def,
                                        Object team_spec,
                                        WTContainerRef context_ref)
                                 throws WTException
Throws:
WTException

getDefaultContainer

private static WTContainerRef getDefaultContainer()
                                           throws WTException
Throws:
WTException

isPboActive

private static boolean isPboActive(WfExecutionObject exec_obj)
                            throws WTException
Determines whether there is a business object associated with the process of the execution object passed as argument and this object hasn't been deleted. Returns 'true' if this is the case; 'false' otherwise. If the business object is null, return true.

Throws:
WTException

getAssociatedProcesses

public WTCollection getAssociatedProcesses(WTCollection col,
                                           WfState state)
                                    throws WTException
Throws:
WTException

toWTArrayList

private static WTArrayList toWTArrayList(QueryResult qr)
Returns a WTCollection from a QueryResult consisting only of persistables.


appendAnd

private void appendAnd(QuerySpec qs)
Conditionally appends an 'AND' to a query spec.


getQueueEntry

public WtQueueEntry getQueueEntry(WtQueue queue,
                                  long entryNumber)

buildDistributionList

public static WTDistributionList buildDistributionList(WfExecutionObject execObj,
                                                       boolean notifyAssignees,
                                                       boolean notifyRespRole,
                                                       boolean notifyTemplateRoles)
                                                throws WTException
Throws:
WTException

sendApproachingDeadlineMessage

private static void sendApproachingDeadlineMessage(WfExecutionObject obj,
                                                   WTDistributionList distList)
                                            throws WTException
Send message to distribution list passed notifying that execution object is near deadline.

Throws:
WTException

sendPastDeadlineMessage

private static void sendPastDeadlineMessage(WfExecutionObject obj,
                                            WTDistributionList distList)
                                     throws WTException
Send message to distribution list passed notifying that execution object is past deadline.

Throws:
WTException