atg.process
Interface ProcessManager


public interface ProcessManager

A process manager manages processes of a certain type (such as scenarios). It can be queried about various process-related information, or used to update processes.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static int DISABLED
          DISABLED status
static int RUNNING
          RUNNING status
static int UNREGISTERED
          UNREGISTERED status
 
Method Summary
 java.lang.String[] getAllProcessNames()
          Returns the names of all processes known to this process manager, null if no processes are registered.
 java.lang.String[] getAllProcessNames(int pStatus)
          Returns the names of all processes with the given status (RUNNING or DISABLED) known to this process manager, null if no processes with the given status are registered.
 java.lang.String getProcessAuthor(java.lang.String pProcessName)
          Returns the author of the given process.
 long getProcessCreationTime(java.lang.String pProcessName)
          Returns the creation time of the given process.
 java.util.Collection getProcessInstanceInfos(boolean pIndividualInstances, boolean pCollectiveInstances)
          Returns all the existing process instances, as a Collection of ProcessInstanceInfo objects.
 java.util.Collection getProcessInstanceInfos(ProcessWaitState[] pWaitStates, boolean pIndividualInstances, boolean pCollectiveInstances)
          Returns all the process instances which are waiting at any of the given wait states, as a Collection of ProcessInstanceInfo objects.
 java.util.Collection getProcessInstanceInfos(java.lang.String pSubjectId)
          Returns all the individual process instances associated with a given subject, as a Collection of ProcessInstanceInfo objects.
 java.util.Collection getProcessInstanceInfos(java.lang.String pSubjectId, ProcessWaitState[] pWaitStates)
          Returns all the individual process instances associated with the given subject which are waiting at any of the given wait states, as a Collection of ProcessInstanceInfo objects.
 java.util.Collection getProcessInstanceInfos(java.lang.String pProcessName, java.lang.String pSegmentName, boolean pIndividualInstances, boolean pCollectiveInstances)
          Returns all the process instances for the given process segment, as a Collection of ProcessInstanceInfo objects.
 java.util.Collection getProcessInstanceInfos(java.lang.String pSubjectId, java.lang.String pProcessName, java.lang.String pSegmentName)
          Returns all the individual process instances associated with the given subject and the given process segment, as a Collection of ProcessInstanceInfo objects.
 java.lang.String getProcessLastModifiedBy(java.lang.String pProcessName)
          Returns the user who last modified the given process.
 long getProcessModificationTime(java.lang.String pProcessName)
          Returns the modification time of the given process.
 int getProcessStatus(java.lang.String pProcessName)
          Returns the status of the given process, to the best of this process manager's knowledge.
 boolean isEditOnlyMode()
          Returns true if this server is in editOnly mode, false otherwise.
 boolean isProcessEditorServer()
          Returns true if this server is the process editor server, false otherwise.
 void updateAllProcesses()
          Updates all processes.
 boolean updateProcess(java.lang.String pProcessName)
          Updates the given process, based on the information from a trusted source.
 

Field Detail

CLASS_VERSION

static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

UNREGISTERED

static final int UNREGISTERED
UNREGISTERED status

See Also:
Constant Field Values

DISABLED

static final int DISABLED
DISABLED status

See Also:
Constant Field Values

RUNNING

static final int RUNNING
RUNNING status

See Also:
Constant Field Values
Method Detail

isEditOnlyMode

boolean isEditOnlyMode()
Returns true if this server is in editOnly mode, false otherwise. EditOnly mode effectively disables the running of processes on this ProcessManager instance, and is not considered a traditional ProcessManager type such as global, individual or process editor servers


isProcessEditorServer

boolean isProcessEditorServer()
Returns true if this server is the process editor server, false otherwise.


getAllProcessNames

java.lang.String[] getAllProcessNames()
Returns the names of all processes known to this process manager, null if no processes are registered.


getAllProcessNames

java.lang.String[] getAllProcessNames(int pStatus)
Returns the names of all processes with the given status (RUNNING or DISABLED) known to this process manager, null if no processes with the given status are registered.


getProcessStatus

int getProcessStatus(java.lang.String pProcessName)
Returns the status of the given process, to the best of this process manager's knowledge. The value returned is one of:


getProcessModificationTime

long getProcessModificationTime(java.lang.String pProcessName)
Returns the modification time of the given process. Returns -1 if the process is not registered, or if the modification time is unknown.


getProcessCreationTime

long getProcessCreationTime(java.lang.String pProcessName)
Returns the creation time of the given process. Returns -1 if the process is not registered, or if the creation time is unknown.


getProcessAuthor

java.lang.String getProcessAuthor(java.lang.String pProcessName)
Returns the author of the given process. Returns null if the process is not registered, or if the author is unknown.


getProcessLastModifiedBy

java.lang.String getProcessLastModifiedBy(java.lang.String pProcessName)
Returns the user who last modified the given process. Returns null if the process is not registered, or if the user who last modified the process is unknown.


updateProcess

boolean updateProcess(java.lang.String pProcessName)
                      throws ProcessException
Updates the given process, based on the information from a trusted source. If this is the process editor server, the new process information is obtained from the process registry. Otherwise, it is obtained from the repository, where it was put by the process editor server.

If the process no longer exists, makes sure it is stopped and unregistered with the process manager.

If the process is new, registers it. If the new process is enabled, starts it running.

If the definition of the process has changed, unregisters the process, and registers it again using the new definition. If both the old and the new versions of the process are enabled, then any migratable process segments are migrated; the rest are stopped and restarted.

It's ok to call this method even if the process is already up to date; in that case, no actual work is done.

Returns:
true if the process was updated, false if it is already up to date
Throws:
ProcessException - if there is a problem updating the process

updateAllProcesses

void updateAllProcesses()
                        throws ProcessException
Updates all processes. If this is the process editor server, the new process information is obtained from the process registry. Otherwise, it is obtained from the repository, where it was put by the process editor server.

Attempts to update all the processes, even if some of the updates result in errors. All the errors are logged. At the end, if any errors were encountered during any of the updates, an exception is thrown as well.

It's ok to call this method even if all of the processes are already up to date; in that case, no actual work is done.

Throws:
ProcessException - if any of the processes could not be updated

getProcessInstanceInfos

java.util.Collection getProcessInstanceInfos(boolean pIndividualInstances,
                                             boolean pCollectiveInstances)
                                             throws ProcessException
Returns all the existing process instances, as a Collection of ProcessInstanceInfo objects.

Warning: this is a potentially expensive operation. The result set could be very large, depending on the number of process instances created for this type of process.

Parameters:
pIndividualInstances - a boolean indicating whether individual instances should be included in the result set
pCollectiveInstances - a boolean indicating whether collective instances should be included in the result set
Throws:
ProcessException - if the process instance information cannot be obtained
See Also:
ProcessInstanceInfo

getProcessInstanceInfos

java.util.Collection getProcessInstanceInfos(java.lang.String pProcessName,
                                             java.lang.String pSegmentName,
                                             boolean pIndividualInstances,
                                             boolean pCollectiveInstances)
                                             throws ProcessException
Returns all the process instances for the given process segment, as a Collection of ProcessInstanceInfo objects.

Warning: this is a potentially expensive operation. The result set could be very large, depending on the number of process instances created for the given process segment.

Parameters:
pProcessName - name of the process for which process instances should be returned
pSegmentName - name of the process segment for which process instances should be returned; if null, instances for all segments in the given process will be returned
pIndividualInstances - a boolean indicating whether individual instances should be included in the result set
pCollectiveInstances - a boolean indicating whether collective instances should be included in the result set
Throws:
ProcessException - if the process instance information cannot be obtained
See Also:
ProcessInstanceInfo

getProcessInstanceInfos

java.util.Collection getProcessInstanceInfos(ProcessWaitState[] pWaitStates,
                                             boolean pIndividualInstances,
                                             boolean pCollectiveInstances)
                                             throws ProcessException
Returns all the process instances which are waiting at any of the given wait states, as a Collection of ProcessInstanceInfo objects.

Warning: this is a potentially expensive operation. The result set could be very large, depending on the number of process instances created for this type of process.

Parameters:
pWaitStates - an array of ProcessWaitStates, each describing a location in the process where process instances may be waiting
pIndividualInstances - a boolean indicating whether individual instances should be included in the result set
pCollectiveInstances - a boolean indicating whether collective instances should be included in the result set
Throws:
ProcessException - if the process instance information cannot be obtained
See Also:
ProcessInstanceInfo

getProcessInstanceInfos

java.util.Collection getProcessInstanceInfos(java.lang.String pSubjectId)
                                             throws ProcessException
Returns all the individual process instances associated with a given subject, as a Collection of ProcessInstanceInfo objects.

Parameters:
pSubjectId - repository id of the process subject
Throws:
ProcessException - if the process instance information cannot be obtained
See Also:
ProcessInstanceInfo

getProcessInstanceInfos

java.util.Collection getProcessInstanceInfos(java.lang.String pSubjectId,
                                             java.lang.String pProcessName,
                                             java.lang.String pSegmentName)
                                             throws ProcessException
Returns all the individual process instances associated with the given subject and the given process segment, as a Collection of ProcessInstanceInfo objects.

Parameters:
pSubjectId - repository id of the process subject
pProcessName - name of the process for which process instances should be returned
pSegmentName - name of the process segment for which process instances should be returned; if null, instances for all segments in the given process will be returned
Throws:
ProcessException - if the process instance information cannot be obtained
See Also:
ProcessInstanceInfo

getProcessInstanceInfos

java.util.Collection getProcessInstanceInfos(java.lang.String pSubjectId,
                                             ProcessWaitState[] pWaitStates)
                                             throws ProcessException
Returns all the individual process instances associated with the given subject which are waiting at any of the given wait states, as a Collection of ProcessInstanceInfo objects.

Parameters:
pSubjectId - repository id of the process subject
pWaitStates - an array of ProcessWaitStates, each describing a location in the process where process instances may be waiting
Throws:
ProcessException - if the process instance information cannot be obtained
See Also:
ProcessInstanceInfo