Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.fujitsu.iflow.model.workflow
Interface ProcessInstance

All Superinterfaces:
  DataAccessor

public interface ProcessInstance
extends DataAccessor

The `ProcessInstance` interface represents all of the aspects of a process instance. It can be created from the process definition (`Plan`) or the `ProcessInstantiator` interface.

Creating a process instance: The standard way of constructing a new `ProcessInstance` object is to call the method `Plan.createProcessInstance`. This method copies the process definition's structure and attributes to a process instance, making it appear as if it had been instantiated.

When a process definition is copied to a new process instance, the components of the process definition are also copied as components of the new process instance. Thus, a `Node` object in the process definition is copied to a `NodeInstance` object in the new process instance.

Modifying an active process instance. The attributes of a process instance can only be modified when it is in edit-mode. The process instance offers two kinds of edit-mode:

1. structural edit-mode
2. enactment edit-mode

The structural edit-mode is used to change the structure of the process instance. New components, such as new `NodeInstances` can be added to the process instance when it is in structural edit-mode.

The enactment edit-mode is a functionality that the process instance has inherited from the `DataAccessor`. That kind of edit-mode is necessary to change attributes like the name or description or to add a new attachment to the process instance.

Process Ownership. Process Owners are the users who can access the process instance as administrators. Normally the process ownership is defined at design-time of a process definition, but it is also possible to change ownership while the process instance is instantiated using the method `setOwners`.

The Process Owner is determined through setting the Owner Role attribute or using a Process Owner role `JavaActionSet`. Both the Owner Role attribute and the Process Owner role `JavaActionSet` are evaluated by the server before activating a new process instance.

If evaluating the Owner Role attribute and the Process Owner role `JavaActionSet` does not specify a Process Owner, the process definition owner becomes the Process Owner by default. This can also occur if there is no intersection between the set of individuals specified by `JavaActionSet` and by role assignment.

Process size. The total amount of memory to be used by `ProcessInstance` (process size) is limited to 4 Megabytes. The `process size` is calculated by adding up the size of all of its elements such as node instances, arrow instances and data items. If the size of a process instance exceeds the limit, an exception is thrown by the next logical commit operation. `ProcInstanceSizeCalculator` calculates the current size of a process instance.

`String` parameters. `String` parameters of all methods in this class have a length limit. This limit is documented in the Javadoc description for every parameter. If the length of a value supplied for such a parameter exceeds this limit, or the value is `null`, an exception is thrown. This exception is a subclass of `ModelException`. For future compatibility, only `ModelException` should be caught explicitly.

If the signature of a method does not allow the throwing of exceptions, any value supplied to this method that exceeds the length limit is truncated to the maximum length supported. `null` values are ignored in this case. Any method’s behaviour that differs from the behaviour described above is explained in this method’s Javadoc description.

Exceptions. Three kinds of exceptions are commonly thrown within this class: `WFServerException`, `WFInternalException`, and `ModelInternalException`. All of these exceptions are instances of `ModelException`. In the methods that directly throw a `ModelException`, this exception usually wraps one of the former three exceptions. `WFServerException` indicates that the server failed to operate normally. `WFInternalException` indicates a problem in the communication between client and server. As its name suggests, `util.ModelInternalException` denotes other problems that are internal to the Model API.

See Also:
  `Plan`, `NodeInstance`, `ArrowInstance`, `DataItem`, `JavaActionSet`

Field Summary
`static int` | `HISTORY_CONSUMER_ID` Represents the history field that contains the ID of the target of the event.
`static int` | `HISTORY_CONSUMER_TYPE` Represents the history field that contains what type of object was the target of the event, whether a `NodeInstance`, `ArrowInstance` or `ProcessInstance` object.
`static int` | `HISTORY_ERROR_MESSAGE` Represents the error message, when the process is in error state.
`static int` | `HISTORY_EVENT_TYPE` Represents the history field that contains what type of event occurred.
`static int` | `HISTORY_EVENTDATA` Represents the history field that contains the event data.
`static int` | `HISTORY_ID` Represents the history field that contains the unique ID of the history event.
`static int` | `HISTORY_ISHANDLED` Represents the history field that contains the status of the event.
`static int` | `HISTORY_MODIFIED_TRACKEDUDAS` Represents the list of uda objects `TrackedUDARecord`, which keeps the information about the uda's being modified during the Process Instance state transition.
`static int` | `HISTORY_PROCESSINSTANCE_ID` Represents the history field that contains the ID of the `ProcessInstance` in which the event occurred.
`static int` | `HISTORY_PRODUCER_ID` Represents the history field that contains the ID of the source of the event.
`static int` | `HISTORY_PRODUCER_TYPE` Represents the history field that contains what type of object was the source of the event.
`static int` | `HISTORY_RESPONSIBLE` Represents the history field that contains whether the event signifies user action, for example a user committing a choice, and who was responsible.
`static int` | `HISTORY_TIME_STAMP` Represents the history field that contains the time of the event.
`static int` | `MAX_PROCESS_DESCRIPTION_LENGTH` Specifies the maximum length of process instance description; currently 256 characters
`static int` | `MAX_PROCESS_INSTANCE_INITIATOR_LENGTH` Specifies the maximum length of process inititor' names; set to 30 characters currently.
`static int` | `MAX_PROCESS_NAME_LENGTH` Specifies the maximum length of process instance name; currently 30 characters
`static int` | `MAX_PROCESS_TITLE_LENGTH` Specifies the maximum length of process instance title; currently 80 characters
`static int` | `PRIORITY_HIGH` Indicates that this process instance is to be treated with high priority.
`static int` | `PRIORITY_LOW` Indicates that this process instance is to be treated with low priority.
`static int` | `PRIORITY_MEDIUM` Indicates that this process instance is to be treated with medium priority.
`static int` | `STATE_ABORTED` Indicates that the process instance is in an aborted state.
`static int` | `STATE_CLOSED` Indicates that this process instance is completed successfully.
`static int` | `STATE_CREATED` Indicates that this process instance is created new and that it is not started until yet.
`static int` | `STATE_ERROR` Indicates that execution of this process instance failed with an error.
`static int` | `STATE_OPEN` Indicates that this process instance is in an open state.
`static int` | `STATE_RUNNING` Indicates that this process instance is running.
`static int` | `STATE_SUSPENDED` Indicates that the process instance is in a suspended state.

Method Summary
`void` | `abort()` Aborts this process instance if it is in running mode.
`void` | `activateNodeInstance(NodeInstance ni)` Deprecated. Use the "activate" method on the NodeInstance directly
`ArrowInstance` | `addArrowInstance(java.lang.String arrowInstanceName, int arrowInstanceType, NodeInstance sourceNodeInstance, NodeInstance targetNodeInstance)` Deprecated. Replaced by method `addArrowInstance(String, NodeInstance, NodeInstance)`
`ArrowInstance` | `addArrowInstance(java.lang.String arrowInstanceName, NodeInstance sourceNodeInstance, NodeInstance targetNodeInstance)` Adds an arrow instance to connect the specified source and target nodes in this process instance.
`AttachmentRef` | `addAttachment(java.lang.String attachmentName, java.lang.String attachmentPath)` Adds an `AttachmentRef` to this process instance.
`DataItem` | `addDataItem(java.lang.String dataItemName, java.lang.String dataItemType, java.lang.String dataItemValue)` Adds a new User Defined Attribute (UDA) to this process instance.
`FormRef` | `addForm(java.lang.String formName, java.lang.String formPath, NodeInstance nodeInstance)` Deprecated. Use the "addForm" method on Node & NodeInstance directly.
`NodeInstance` | `addNodeInstance(java.lang.String name, int type)` Adds a new node instance specified by the supplied name and type to this process instance.
`void` | `addObserver(java.lang.String uri, int protocol)` Adds the specified URI to the list of process instance observers.
`void` | `addProcessInstanceListener(ProcessInstanceListener listener)` Adds the specified listener to this process instance.
`TimerDef` | `addTimer(TimerDef timer)` Adds a timer to this process instance.
`TriggerDef` | `addTrigger(java.lang.String name, int type)` Adds a new trigger definition with the given name and type to this process instance (adds the trigger definition to the private process definition of this process instance).
`void` | `cancelStructuralEdit()` Unlocks this process instance from edit-mode without committing any done changes.
`void` | `commitStructuralEdit()` Makes the modifications on this process instance permanent by saving the modified process instance to the database.
`void` | `deactivateArrowInstance(ArrowInstance ai)` Deprecated. Use the "deactivate" method on the ArrowInstance directly.
`ArrowInstance` | `getArrowInstance(long aiId)` Returns a arrow instance in this process instance regarding to the supplied ID.
`ArrowInstance[]` | `getArrowInstances()` Deprecated. This method is replaced by `getMemberArrowInstances()`
`AttachmentRef` | `getAttachment(java.lang.String attachmentName)` Returns the `AttachmentRef` of the specified attachment associated with this process.
`AttachmentRef[]` | `getAttachments()` Deprecated. This method is replaced by `getProcessAttachments()`.
`long` | `getClosedTime()` Returns the time when this process instance was closed.
`long` | `getCreationTime()` Returns the time when this process instance was created.
`java.lang.String` | `getDataItemType(java.lang.String dataItemName)` Deprecated. This method is replaced by `getDataItem.getType`.
`java.lang.String` | `getDescription()` Returns the description of this process instance.
`IflowEnumeration` | `getHistory(int[] processHistoryFields)` Returns all history records of this process instance.
`long` | `getId()` Returns this process instance's unique identifier.
`ArrowInstance[]` | `getInArrowInstances(long niId)` Returns all arrow instance which are incoming arrows of the specified node of this process instance.
`java.lang.String` | `getInitialDescription()` Deprecated. This method is replaced by `getPlan.getDesc`.
`java.lang.String` | `getInitialName()` Deprecated. This method is replaced by `getPlan.getName`.
`java.lang.String` | `getInitialTitle()` Deprecated. This method is replaced by getPlan.getTitle.
`java.lang.String` | `getInitiator()` Returns the login name of the user who created this process instance.
`ArrowInstance[]` | `getMemberArrowInstances()` Returns all arrow instance of this process instance.
`NodeInstance[]` | `getMemberNodeInstances()` Returns all node instances of this process instance.
`java.lang.String` | `getName()` Returns the name of this process instance.
`NodeInstance` | `getNodeInstance(long id)` Returns a node instance in this process instance.
`NodeInstance` | `getNodeInstance(Node node)` Returns a node instance in this process to corresponds to a particular `Node` object of the regarding process definition.
`NodeInstance[]` | `getNodeInstances()` Deprecated. This method is replaced by `getMemberNodeInstances()`.
`ArrowInstance[]` | `getOutArrowInstances(long niId)` Returns all arrow instance which are outgoing arrows of the specified node of this process instance.
`java.lang.String[]` | `getOwners()` Returns the list of owners of this process instance.
`long` | `getParentProcessId()` Returns the unique identifier of the parent process instance.
`java.lang.String` | `getParentProcessURI()` Returns the `URI` of the remote parent process instance of this process instance.
`Plan` | `getPlan()` Returns the process definition from which this process instance was instantiated.
`java.lang.String` | `getPlanDescription()` Deprecated. This method is replaced by `getPlan().getDesc`.
`long` | `getPlanId()` Deprecated. Replaced by `getPlan().getId`.
`java.lang.String` | `getPlanName()` Deprecated. This method is replaced by `getPlan().getName`.
`java.lang.String` | `getPlanTitle()` Deprecated. This method is replaced by `getPlan().getTitle`.
`int` | `getPriority()` Returns the current priority of this process instance as defined in the `ProcessInstance` interface by constants such as `PRIORITY_HIGH`.
`AttachmentRef[]` | `getProcessAttachments()` Returns the references to all the attachments associated with this process instance.
`int` | `getProcessPriority()` Deprecated. Replaced by `getPriority()`
`java.lang.String` | `getProcessURI()` Returns the URI of this process instance.
`int` | `getSequenceId()` Returns the sequence number of this process instance.
`int` | `getState()` Returns the current state of this process instance as defined in the `ProcessInstance` interface by constants such as `STATE_RUNNING`.
`TimerStatus[]` | `getStatusOfTimers()` Returns the attribute sets of all active process timers attached to this process instance as `TimerStatus` objects.
`long` | `getTemplateId()` Deprecated. This method is replaced by `getPlan.getId`.
`TimerDef` | `getTimer(long tdid)` Returns the timer definition added to this process instance that has the specified ID.
`TimerDef[]` | `getTimers()` Returns a list of all timer definitions added to this process instance.
`java.lang.String` | `getTitle()` Returns the title of this process instance.
`TriggerDef` | `getTrigger(long triggerId)` Retrieves the specified trigger definition.
`TriggerDef[]` | `getTriggers()` Retrieves all the triggers defined for the process definition of this process instance.
`TriggerDef[]` | `getTriggers(int type)` Retrieves all the trigger definitions of the given type for the process definition this process instances belongs to.
`DataItem[]` | `getWorklistDataItems()` Returns an array of `DataItem` objects.
`boolean` | `isInEditMode()` Checks whether this process instance is in enactment edit-mode.
`boolean` | `isInStructuralEditMode()` Checks whether this process instance is in structural edit-mode.
`void` | `removeArrowInstance(long aiId)` Removes the specified `ArrowInstance` from this process instance matching to the ID.
`void` | `removeAttachment(java.lang.String attachmentName)` Removes a designated attachment from this process instance.
`void` | `removeDataItem(java.lang.String dataItemName)` Removes the User Defined Attribute (UDA) from this process instance matching the UDA's name.
`void` | `removeForm(java.lang.String formName, NodeInstance nodeInstance)` Deprecated. Use the "removeForm" method on Node & NodeInstance directly.
`void` | `removeNodeInstance(long niId)` Removes the specified `NodeInstance` from this process instance.
`void` | `removeObserver(java.lang.String uri, int protocol)` Removes the specified URI from the list of process instance observers.
`void` | `removeProcessInstanceListener(ProcessInstanceListener listener)` Removes the specified listener from this process instance.
`void` | `removeTimer(long timerInstanceId)` Removes an active timer (TimerStatus) object from this process instance.
`void` | `removeTimer(TimerDef td)` Removes the specified timer and its corresponding active timer (if any) from this process instance.
`void` | `removeTrigger(long triggerId)` Deletes the specified trigger definition.
`void` | `removeTriggers()` Deletes all trigger definitions from the private process definition this process instance belongs to.
`void` | `resetNodeInstance(NodeInstance ni)` Deprecated. Use the "reset" method on the NodeInstance directly.
`void` | `resume()` Resumes this process instance if it is in a suspended state and puts it in a running state.
`void` | `setAttachments(AttachmentRef[] attachments)` Adds an array of `AttachmentRefs` to this process instance.
`void` | `setDataItems(DataItem[] dataItems)` Adds an array of User Defined Attributes (UDAs) to this process instance.
`void` | `setDataItemValues(java.util.Properties nvlist)` Sets the values of a group of User Defined Attributes (UDA).
`void` | `setDescription(java.lang.String description)` Sets the description of this process instance.
`void` | `setForms(FormRef[] forms, NodeInstance nodeInstance)` Deprecated. Use the "setForms" method on Node & NodeInstance directly.
`void` | `setName(java.lang.String name)` Sets the name of this process instance, which should be short and descriptive.
`void` | `setOwners(java.lang.String[] owners)` Sets the specified array of users as owners of this process instance.
`void` | `setPriority(int priority)` Sets the priority of this process instance.
`void` | `setTitle(java.lang.String title)` Sets the title of this process instance.
`void` | `start()` Starts this process instance.
`void` | `startStructuralEdit()` Sets this process instance to structural edit-mode and locks it for modifications by someone else.
`void` | `suspend()` Suspends this process instance.

Methods inherited from interface com.fujitsu.iflow.model.workflow.DataAccessor
`cancelEdit, commitEdit, getDataItem, getDataItems, getDataItemValue, hasDataItem, isLockedForEdit, startEdit`

Field Detail

### PRIORITY_HIGH

    public static final int PRIORITY_HIGH

  Indicates that this process instance is to be treated with high priority.

  See Also:
    Constant Field Values

### PRIORITY_MEDIUM

    public static final int PRIORITY_MEDIUM

  Indicates that this process instance is to be treated with medium priority.

  See Also:
    Constant Field Values

### PRIORITY_LOW

    public static final int PRIORITY_LOW

  Indicates that this process instance is to be treated with low priority.

  See Also:
    Constant Field Values

### STATE_OPEN

    public static final int STATE_OPEN

  Indicates that this process instance is in an open state.

  See Also:
    Constant Field Values

### STATE_CREATED

    public static final int STATE_CREATED

  Indicates that this process instance is created new and that it is not started until yet.

  See Also:
    Constant Field Values

### STATE_RUNNING

    public static final int STATE_RUNNING

  Indicates that this process instance is running.

  See Also:
    Constant Field Values

### STATE_CLOSED

    public static final int STATE_CLOSED

  Indicates that this process instance is completed successfully.

  See Also:
    Constant Field Values

### STATE_SUSPENDED

    public static final int STATE_SUSPENDED

  Indicates that the process instance is in a suspended state.

  See Also:
    Constant Field Values

### STATE_ERROR

    public static final int STATE_ERROR

  Indicates that execution of this process instance failed with an error.

  See Also:
    Constant Field Values

### STATE_ABORTED

    public static final int STATE_ABORTED

  Indicates that the process instance is in an aborted state.

  See Also:
    Constant Field Values

### MAX_PROCESS_INSTANCE_INITIATOR_LENGTH

    public static final int MAX_PROCESS_INSTANCE_INITIATOR_LENGTH

  Specifies the maximum length of process inititor' names; set to 30 characters currently.

  See Also:
    Constant Field Values

### MAX_PROCESS_NAME_LENGTH

    public static final int MAX_PROCESS_NAME_LENGTH

  Specifies the maximum length of process instance name; currently 30 characters

  See Also:
    Constant Field Values

### MAX_PROCESS_TITLE_LENGTH

    public static final int MAX_PROCESS_TITLE_LENGTH

  Specifies the maximum length of process instance title; currently 80 characters

  See Also:
    Constant Field Values

### MAX_PROCESS_DESCRIPTION_LENGTH

    public static final int MAX_PROCESS_DESCRIPTION_LENGTH

  Specifies the maximum length of process instance description; currently 256 characters

  See Also:
    Constant Field Values

### HISTORY_ID

    public static final int HISTORY_ID

  Represents the history field that contains the unique ID of the history event.

  See Also:
    Constant Field Values

### HISTORY_TIME_STAMP

    public static final int HISTORY_TIME_STAMP

  Represents the history field that contains the time of the event.

  See Also:
    Constant Field Values

### HISTORY_EVENT_TYPE

    public static final int HISTORY_EVENT_TYPE

  Represents the history field that contains what type of event occurred.

  See Also:
    Constant Field Values

### HISTORY_RESPONSIBLE

    public static final int HISTORY_RESPONSIBLE

  Represents the history field that contains whether the event signifies user action, for example a user committing a choice, and who was responsible.

  See Also:
    Constant Field Values

### HISTORY_PRODUCER_TYPE

    public static final int HISTORY_PRODUCER_TYPE

  Represents the history field that contains what type of object was the source of the event.

  See Also:
    Constant Field Values

### HISTORY_PRODUCER_ID

    public static final int HISTORY_PRODUCER_ID

  Represents the history field that contains the ID of the source of the event.

  See Also:
    Constant Field Values

### HISTORY_CONSUMER_TYPE

    public static final int HISTORY_CONSUMER_TYPE

  Represents the history field that contains what type of object was the target of the event, whether a `NodeInstance`, `ArrowInstance` or `ProcessInstance` object.

  See Also:
    Constant Field Values

### HISTORY_CONSUMER_ID

    public static final int HISTORY_CONSUMER_ID

  Represents the history field that contains the ID of the target of the event.

  See Also:
    Constant Field Values

### HISTORY_PROCESSINSTANCE_ID

    public static final int HISTORY_PROCESSINSTANCE_ID

  Represents the history field that contains the ID of the `ProcessInstance` in which the event occurred.

  See Also:
    Constant Field Values

### HISTORY_ISHANDLED

    public static final int HISTORY_ISHANDLED

  Represents the history field that contains the status of the event.

  See Also:
    Constant Field Values

### HISTORY_EVENTDATA

    public static final int HISTORY_EVENTDATA

  Represents the history field that contains the event data.

  See Also:
    Constant Field Values

### HISTORY_ERROR_MESSAGE

    public static final int HISTORY_ERROR_MESSAGE

  Represents the error message, when the process is in error state.

  See Also:
    Constant Field Values

### HISTORY_MODIFIED_TRACKEDUDAS

    public static final int HISTORY_MODIFIED_TRACKEDUDAS

  Represents the list of uda objects `TrackedUDARecord`, which keeps the information about the uda's being modified during the Process Instance state transition.

  See Also:
    Constant Field Values

Method Detail

### isInEditMode

    public boolean isInEditMode()

  Checks whether this process instance is in enactment edit-mode. The edit-mode is entered by calling `startEdit` which is part of super interface `DataAccessord`. For example this edit-mode is needed when an attachment is added or the name of the process instance is changed.

  Returns:
    `true` when this process instance is in enactment edit-mode; `false` otherwise.
  See Also:
    `DataAccessor.startEdit()`, `DataAccessor.commitEdit()`

### isInStructuralEditMode

    public boolean isInStructuralEditMode()

  Checks whether this process instance is in structural edit-mode. The structural edit-mode is entered by calling `startStructuralEdit`. The structural edit-mode is necessary when the structure of a process instance is changed, for example if a new arrow instance is added.

  Returns:
    `true` when this process instance is in structural edit-mode; `false` otherwise.
  See Also:
    `startStructuralEdit()`, `commitStructuralEdit()`

### startStructuralEdit

    public void startStructuralEdit()
                             throws WFInternalException,
                                    WFServerException,
                                    ModelInternalException

  Sets this process instance to structural edit-mode and locks it for modifications by someone else. Once the process is locked, you can add, modify or delete structural elements of the process instance like node instances, arrow instances and User Defined Attributes. No structural element of a process instance can be changed without first calling this method.

  The change of those elements must be committed by calling method `commitStructuralEdit`.

  Throws:
    `WFInternalException`
    `WFServerException`
    `ModelInternalException` - Thrown when the process instance is already in structural or in enactment edit-mode when calling this method. Should be caught as `ModelException` for future compatibility.
  See Also:
    `commitStructuralEdit()`

### commitStructuralEdit

    public void commitStructuralEdit()
                              throws WFInternalException,
                                     WFServerException,
                                     ModelInternalException

  Makes the modifications on this process instance permanent by saving the modified process instance to the database. This method also unlocks the process instance for continued use or for editing.

  The process instance has to be in structural edit-mode before calling `cancelStructuralEdit`. Edit-mode is entered by calling `startStructuralEdit`.

  This operation cancels the edit session in case a failure is encountered.

  Throws:
    `WFInternalException`
    `WFServerException`
    `ModelInternalException` - Thrown when the process instance is not in structural edit-mode when calling this method. Should be caught as `ModelException` for future compatibility.
  See Also:
    `startStructuralEdit()`

### cancelStructuralEdit

    public void cancelStructuralEdit()
                              throws WFInternalException,
                                     WFServerException,
                                     ModelInternalException

  Unlocks this process instance from edit-mode without committing any done changes. All changes made to this `ProcessInstance` since calling method `startStructuralEdit` are discarded.

  The process instance has to be in structural edit-mode before calling `cancelStructuralEdit`. Edit-mode is entered by calling `startStructuralEdit`.

  Throws:
    `WFInternalException`
    `WFServerException`
    `ModelInternalException` - Thrown when the process instance is not in structural edit-mode when calling this method. Should be caught as `ModelException` for future compatibility.
  See Also:
    `startStructuralEdit()`

### getId

    public long getId()

  Returns this process instance's unique identifier. Each process instance contains an unique ID number it can be identified by. The ID is allocated automatically by the server when the process instance is created. You can use this ID number to reference this process instance later.

  Returns:
    This process instance's unique identifier.

### getParentProcessId

    public long getParentProcessId()

  Returns the unique identifier of the parent process instance. For example a process instance has a parent process instance if it is started as subprocess. Returns `-1` if this process instance has no parent process instance.

  Returns:
    The parent process instance's unique identifier, that is -1 if this process instance has no parent process.

### getParentProcessURI

    public java.lang.String getParentProcessURI()
                                         throws ModelException

  Returns the `URI` of the remote parent process instance of this process instance. Returns an empty `String` if this process instance has no remote parent process.

  Returns:
    the URI that represents the remote parent process instance of this process instance.
  Throws:
    `ModelException`

### addObserver

    public void addObserver(java.lang.String uri,
                            int protocol)
                     throws ModelException

  Adds the specified URI to the list of process instance observers. This URI will then receive SWAP or ASAP COMPLETE and STATECHANGED notifications from this process instance at the appropriate times. The parameter protocol specifies whether this observer wants to receive the notifications in the SWAP protocol or the ASAP protocol.

  The process instance has to be in structural edit-mode or in enactment edit-mode before calling this method. Structural edit-mode is entered by calling `startStructuralEdit` and enactment edit-mode is entered by calling method `startEdit`.

  Parameters:
    `uri` - The URI to be added as an observer.
    `protocol` - Valid values are WFObjectFactory.PROTOCOL_SWAP or WFObjectFactory.PROTOCOL_ASAP The observer will receive the notification in the specified protocol.
  Throws:
    `ModelException` - Thrown when the process instance is not in strucutural or enactment edit-mode when this method is called. Furthermore, this exception is thrown if the supplied uri is invalid (e.g. the length is 0) or `null`.
  See Also:
    `startStructuralEdit()`, `DataAccessor.startEdit()`

### removeObserver

    public void removeObserver(java.lang.String uri,
                               int protocol)
                        throws ModelException

  Removes the specified URI from the list of process instance observers. This URI will then receive no longer receive COMPLETE and STATECHANGED notifications from this process instance. The parameter protocol specifies whether this is a SWAP or an ASAP observer.

  The process instance has to be in structural edit-mode or in enactment edit-mode before calling this method. Structural edit-mode is entered by calling `startStructuralEdit` and enactment edit-mode is entered by calling method `startEdit`.

  Parameters:
    `uri` - The observer URI to be removed.
    `protocol` - Valid values are 0, or WFObjectFactory.PROTOCOL_SWAP or WFObjectFactory.PROTOCOL_ASAP. Specifies whether this URI is an ASAP or a SWAP URI. If this value is 0, then this URI will removed from the observer list, regardless of whether it is a SWAP or an ASAP URI. If this URI is registered as both SWAP and ASAP observers, then both will be removed.
  Throws:
    `ModelException` - Thrown when the process instance is not in strucutural or enactment edit-mode when this method is called.
  See Also:
    `startStructuralEdit()`, `DataAccessor.startEdit()`

### getName

    public java.lang.String getName()

  Returns the name of this process instance. The current name of the process instance is what appears when a list of process instances is retrieved. The name of the process instance defaults to the process definition name when the process is first created from a process instance.

  Returns:
    The process instance's name.
  See Also:
    `setName(String)`

### getDescription

    public java.lang.String getDescription()

  Returns the description of this process instance. This description is copied from the process definition description when the process instance is created from the process definition.

  Returns an empty `String` if no description is defined.

  Returns:
    The process instance's description or `null` in case of an exception.
  See Also:
    `setDescription(String)`

### getTitle

    public java.lang.String getTitle()

  Returns the title of this process instance. The initial process instance title is inherited from the process definition from which the process instance was created.

  Returns:
    The process instance's title.
  See Also:
    `setTitle(String)`

### setName

    public void setName(java.lang.String name)

  Sets the name of this process instance, which should be short and descriptive. The process instance inherits the name of the process definition when it is first created. This method allows you to modify the process instance name.

  The name must not be longer than specified in `MAX_PROCESS_NAME_LENGTH` and must not contain any of the following characters: `\ | / : * ? " < >`. If the length exceeds the limitation, the name is truncated to the maximum number of characters. If the supplied value is invalid e.g. if it contains one of the invalid characters or the length of name is 0 or the name value is `null`, the identifier will not be changed.

  The name can only be set in enactment edit-mode or in structural edit-mode. Enactment edit-mode is entered by calling `startEdit`. Structural edit-mode is entered by calling method `startStructuralEdit`. When not in edit-mode, calling this method will have no effect.

  Parameters:
    `name` - The new name of this process instance.
  See Also:
    `DataAccessor.startEdit()`, `startStructuralEdit()`

### setDescription

    public void setDescription(java.lang.String description)

  Sets the description of this process instance. By default, the process instance inherits the description of the process definition when the process instance is first created. This method allows you to modify this description.

  The description must not be longer than specified in `MAX_PROCESS_DESCRIPTION_LENGTH`. If the length exceeds the limitation, the description is truncated to the maximum number of characters. If the supplied value is `null`, the description will not be changed.

  The description can only be set in enactment edit-mode or in structural edit-mode. Enactment edit-mode is entered by calling `startEdit`. Structural edit-mode is entered by calling method `startStructuralEdit`. When not in edit-mode, calling this method will have no effect.

  Parameters:
    `description` - The new description of this process instance.
  See Also:
    `DataAccessor.startEdit()`, `startStructuralEdit()`

### setTitle

    public void setTitle(java.lang.String title)

  Sets the title of this process instance. By default, the title of the process instance is inherited from the process definition from which the process instance was copied. This method allows you to modify the process instance title.

  The title must not be longer than specified in `MAX_PROCESS_TITLE_LENGTH`. If the length exceeds the limitation, the title is truncated to the maximum number of characters. If the supplied value is `null`, the title will not be changed.

  The title can only be set in enactment edit-mode or in structural edit-mode. Enactment edit-mode can be entered by calling `startEdit`. Structural edit-mode is entered by calling method `startStructuralEdit`. When not in edit-mode, calling this method will have no effect.

  Parameters:
    `title` - The new title of this process instance.
  See Also:
    `DataAccessor.startEdit()`, `startStructuralEdit()`

### start

    public void start()
               throws WFServerException,
                      WFInternalException,
                      ModelInternalException

  Starts this process instance. When a process instance is first created, it is not running. The `start` method must be called to start the process execution.

  The thrown exceptions should be caught as `ModelException` for future compatibility.

  Throws:
    `WFServerException` - The most probable server error messages wrapped in this exception are:
    - Process locked by someone else.
    - Failed to get Read Transaction.
    - Failed to Commit Edit.
    - Could not start a running process.
    - Could not start process.
    `WFInternalException`
    `ModelInternalException` - Thrown when the process instance is in structural or in enactment edit-mode when this method is called.

### abort

    public void abort()
               throws WFServerException,
                      WFInternalException,
                      ModelInternalException

  Aborts this process instance if it is in running mode. The state of this `ProcessInstance` is changed to `STATE_ABORTED`. If this process instance has any work items, they are removed. If this process instance has any running subprocesses, then they are also aborted.

  Note: This method can only be used by an Interstage BPM administrative user or the Process Owner. Other Interstage BPM users are not allowed to abort a process instance.

  If, however, you add the `AllowAbortForAllUsers` parameter to the Interstage BPM Configuration File and set it =true, the access control check implemented on this method is bypassed, and any user can abort processes.

  Throws:
    `WFServerException`
    `WFInternalException`
    `ModelInternalException` - Thrown when the process instance is in structural or in enactment edit-mode when calling this method. Should be caught as `ModelException` for future compatibility.

### suspend

    public void suspend()
                 throws WFServerException,
                        WFInternalException,
                        ModelInternalException

  Suspends this process instance. The state of the `ProcessInstance` is changed to `STATE_SUSPENDED`. If this process instance has any work items, they are put in suspended state. If this process instance has any running subprocesses, then they are also suspended.

  Throws:
    `WFServerException`
    `WFInternalException`
    `ModelInternalException` - Thrown when the process instance is in structural or in enactment edit-mode when calling this method. Should be caught as `ModelException` for future compatibility.

### resume

    public void resume()
                throws WFServerException,
                       WFInternalException,
                       ModelInternalException

  Resumes this process instance if it is in a suspended state and puts it in a running state. The state of the `ProcessInstance` is changed to `STATE_RUNNING`. If this process instance has any suspended work items, they are put into active state. If this process instance has any suspended subprocesses, then they are also resumed.

  Throws:
    `WFServerException`
    `WFInternalException`
    `ModelInternalException` - Thrown when the process instance is in structural or in enactment edit-mode when calling this method. Should be caught as `ModelException` for future compatibility.

### addProcessInstanceListener

    public void addProcessInstanceListener(ProcessInstanceListener listener)
                                    throws WFServerException,
                                           WFInternalException,
                                           ModelInternalException

  Adds the specified listener to this process instance.

  Instances of `ProcessInstanceListener` listen for events in the current process instance that occur on the server. In other words, it monitors and identifies on-line state changes in the process instance that do not necessarily originate locally.

  Process instances are typically available to more than one user through the server. `ProcessInstanceListener` supports proactive notification, so that when the state of the process instance is changed by one user on the server, that change is reflected in all representations of the process instance that have listeners registered.

  Not all operations of a process instance generate an event. A `ProcessInstanceEvent` is only generated for the following operations:

  - addArrowInstance
  - removeArrowInstance
  - addNodeInstance
  - removeNodeInstance
  - setAttachments
  - addAttachment
  - removeAttachment

  Parameters:
    `listener` - The listener to add.
  Throws:
    `WFServerException`
    `WFInternalException`
    `ModelInternalException`

### removeProcessInstanceListener

    public void removeProcessInstanceListener(ProcessInstanceListener listener)
                                       throws WFInternalException,
                                              WFServerException,
                                              ModelInternalException

  Removes the specified listener from this process instance.

  Parameters:
    `listener` - The listener to remove.
  Throws:
    `WFInternalException`
    `WFServerException`
    `ModelInternalException`

### addNodeInstance

    public NodeInstance addNodeInstance(java.lang.String name,
                                        int type)
                                 throws WFInternalException,
                                        WFServerException,
                                        ModelInternalException

  Adds a new node instance specified by the supplied name and type to this process instance.

  The name is a link to a `NodeInstance` (extension of interface `Node`), so the value must not be longer than specified in `Node.MAX_NODE_NAME_LENGTH` and must not contain any of the following characters: `\ | / : * ? " < >`. The type value of this new node must be one of the defined constants of the `Node` interface such as `TYPE_ACTIVITY`.

  The process instance has to be in structural edit-mode before calling method `addNodeInstance`. Structural edit-mode is entered by calling `startStructuralEdit`.

  This method generates a `ProcessInstanceEvent` that notifies the added `ProcessInstanceListener`s about changes of this process instance.

  Parameters:
    `name` - The name of the new node.
    `type` - An integer which specifies the type of the node, defined in the `Node` interface by constants like `TYPE_ACTIVITY`.
  Returns:
    The new created and added node instance.
  Throws:
    `WFInternalException`
    `WFServerException`
    `ModelInternalException` - Thrown when the process instance is not in structural edit-mode when this method is called, or the supplied name is invalid (e.g. the length of name is 0) or `null`. Furthermore an exception is thrown if the type of node does not comply with one of the defined constants in `Node` interface. Should be caught as `ModelException` for future compatibility.
  See Also:
    `startStructuralEdit()`, `Node`

### getNodeInstances

    public NodeInstance[] getNodeInstances()

  Deprecated. This method is replaced by `getMemberNodeInstances()`.

### getNodeInstance

    public NodeInstance getNodeInstance(long id)
                                 throws ModelInternalException

  Returns a node instance in this process instance. Every node instance in a process instance has a unique id. This method allows you to retrieve the node instance based on the specified ID. Note, this is the ID of the node instance, not the ID of the defining node from process definition.

  Parameters:
    `id` - The ID of the node instance you would like to retrieve.
  Returns:
    The node instance regarding to the ID.
  Throws:
    `ModelInternalException` - Thrown when no node instance is found for the supplied id.

### getNodeInstance

    public NodeInstance getNodeInstance(Node node)
                                 throws ModelInternalException

  Returns a node instance in this process to corresponds to a particular `Node` object of the regarding process definition.

  Parameters:
    `node` - The corresponding node definition object in the process definition.
  Returns:
    The node instance regarding to the node of process definition.
  Throws:
    `ModelInternalException` - Thrown when no node instance is found for the supplied `Node` object.

### removeNodeInstance

    public void removeNodeInstance(long niId)
                            throws WFInternalException,
                                   WFServerException,
                                   ModelInternalException

  Removes the specified `NodeInstance` from this process instance.

  The process instance has to be in structural edit-mode before calling method `removeNodeInstance`. Structural edit-mode is entered by calling `startStructuralEdit`.

  This method generates a `ProcessInstanceEvent` that notifies the added `ProcessInstanceListener`s about changes of this process instance.

  Parameters:
    `niId` - the ID of the `NodeInstance` object to be removed.
  Throws:
    `WFServerException`
    `WFInternalException`
    `ModelInternalException` - Thrown when a `NodeInstance` object with the specified ID cannot be found. Furthermore this exception is thrown when this process instance is not in structural edit-mode when this method is called.
  See Also:
    `startStructuralEdit()`, `addNodeInstance(String, int)`

### addArrowInstance

    public ArrowInstance addArrowInstance(java.lang.String arrowInstanceName,
                                          int arrowInstanceType,
                                          NodeInstance sourceNodeInstance,
                                          NodeInstance targetNodeInstance)
                                   throws WFInternalException,
                                          WFServerException,
                                          ModelInternalException

  Deprecated. Replaced by method `addArrowInstance(String, NodeInstance, NodeInstance)`

  Throws:
    `WFInternalException`
    `WFServerException`
    `ModelInternalException`

### addArrowInstance

    public ArrowInstance addArrowInstance(java.lang.String arrowInstanceName,
                                          NodeInstance sourceNodeInstance,
                                          NodeInstance targetNodeInstance)
                                   throws ModelException

  Adds an arrow instance to connect the specified source and target nodes in this process instance.

  The fundamental purpose of an arrow is to control the flow within a process instance. When a node completes, the process instance moves from the tail of an arrow to the head of an arrow. There is no limit to the number of arrows you can have entering and leaving any node type (except for start nodes, which can only have unlimited arrows leaving them, or exit nodes, which can only have unlimited arrows entering them).

  In the case of an activity node, in addition to controlling the flow of the process instance, the outgoing arrows act as choices for a user. What choice the user makes will control which arrow is taken for further execution of the process instance. Another unique situation is with conditional nodes. Here the outgoing arrows signify the path that will be taken when a specific condition is met.

  The name of arrow instance is a link to an `ArrowInstance` objects (extension of `Arrow` interface), so the values must not be longer than specified in `Arrow.MAX_ARROW_NAME_LENGTH`.

  The process instance has to be in structural edit-mode when calling method `addArrowInstance`. Structural edit-mode is entered by calling `startStructuralEdit`.

  This method generates a `ProcessInstanceEvent` that notifies the added `ProcessInstanceListener`s about changes of this process instance.

  Parameters:
    `arrowInstanceName` - The name of new arrow in the process instance.
    `sourceNodeInstance` - The source `NodeInstance` object in this process instance that will be the start node for this arrow.
    `targetNodeInstance` - The target `NodeInstance` object in this process instance that will be the destination node for the created arrow.
  Returns:
    An arrow instance object with the specified name, source and target nodes.
  Throws:
    `ModelException` - Thrown when the process instance is not in structural edit-mode when this method is called, or the supplied name is invalid (e.g. the length of name is 0) or `null`. Furthermore the exception is thrown when the type is invalid.
  See Also:
    `startStructuralEdit()`

### getArrowInstance

    public ArrowInstance getArrowInstance(long aiId)

  Returns a arrow instance in this process instance regarding to the supplied ID. Returns `null` if no arrow instance exist for the supplied id.

  Parameters:
    `aiId` - The unique identifier of the arrow instance in this process instance.
  Returns:
    The `ArrowInstance` object for the specified arrow ID or `null` if no arrow instance exist for the identifier.

### getArrowInstances

    public ArrowInstance[] getArrowInstances()

  Deprecated. This method is replaced by `getMemberArrowInstances()`

### removeArrowInstance

    public void removeArrowInstance(long aiId)
                             throws WFInternalException,
                                    WFServerException,
                                    ModelInternalException

  Removes the specified `ArrowInstance` from this process instance matching to the ID.

  The process instance has to be in structural edit-mode before calling method `removeArrowInstance`. Structural edit-mode is entered by calling `startStructuralEdit`.

  This method generates a `ProcessInstanceEvent` that notifies the added `ProcessInstanceListener`s about changes of this process instance.

  Parameters:
    `aiId` - The unique identifier of the arrow instance to remove.
  Throws:
    `WFServerException`
    `WFInternalException`
    `ModelInternalException` - Thrown when the `ArrowInstance` object with the specified ID is not found. Furthermore this exception is thrown when the process instance is not in structural edit-mode when this method is called. Should be caught as `ModelException` for future compatibility.
  See Also:
    `startStructuralEdit()`

### addForm

    public FormRef addForm(java.lang.String formName,
                           java.lang.String formPath,
                           NodeInstance nodeInstance)
                    throws WFServerException,
                           WFInternalException,
                           ModelInternalException

  Deprecated. Use the "addForm" method on Node & NodeInstance directly.

  Throws:
    `WFServerException`
    `WFInternalException`
    `ModelInternalException`
  See Also:
    `getNodeInstance(long)`, `Node.addForm(String, String)`

### removeForm

    public void removeForm(java.lang.String formName,
                           NodeInstance nodeInstance)
                    throws WFServerException,
                           WFInternalException,
                           ModelInternalException

  Deprecated. Use the "removeForm" method on Node & NodeInstance directly.

  Throws:
    `WFServerException`
    `WFInternalException`
    `ModelInternalException`
  See Also:
    `getNodeInstance(long)`, `Node.removeForm(String)`

### setForms

    public void setForms(FormRef[] forms,
                         NodeInstance nodeInstance)
                  throws WFServerException,
                         WFInternalException,
                         ModelInternalException

  Deprecated. Use the "setForms" method on Node & NodeInstance directly.

  Throws:
    `WFServerException`
    `WFInternalException`
    `ModelInternalException`
  See Also:
    `getNodeInstance(long)`, `Node.setForms(FormRef[])`

### getAttachments

    public AttachmentRef[] getAttachments()

  Deprecated. This method is replaced by `getProcessAttachments()`.

### addAttachment

    public AttachmentRef addAttachment(java.lang.String attachmentName,
                                       java.lang.String attachmentPath)
                                throws WFServerException,
                                       WFInternalException,
                                       ModelInternalException

  Adds an `AttachmentRef` to this process instance. Attachments are global to the process instance; any activity in a process instance can access the attachment.

  The name of attachment is limited to the number of characters specified by the constant `AttachmentRef.MAX_ATTACHMENT_NAME_LENGTH`. The attachment's must not be longer than specified by `AttachmentRef.MAX_ATTACHMENT_PATH_LENGTH`.

  The process instance has to be in enactment edit-mode or in structural edit-mode when calling method `addAttachment`. Enactment edit-mode is entered by calling `startEdit` which is part of super interface `DataAccessor`. Structural edit-mode is entered by calling `startStructuralEdit`.

  This method generates a `ProcessInstanceEvent` that notifies the added `ProcessInstanceListener`s about changes of this process instance.

  Parameters:
    `attachmentName` - The attachment's name.
    `attachmentPath` - The fully qualified path and filename of the attachment.
  Returns:
    An `AttachmentRef` object representing the added attachment.
  Throws:
    `WFServerException`
    `WFInternalException`
    `ModelInternalException` - Thrown when the process instance is not in enactment edit-mode nor in structural edit-mode when this method is called, or the supplied name or path is invalid or `null`. Furthermore This exception is thrown when the attachment already exists. Should be caught as `ModelException` for future compatibility.
  See Also:
    `DataAccessor.startEdit()`, `startStructuralEdit()`, `getAttachment(String)`

### getAttachment

    public AttachmentRef getAttachment(java.lang.String attachmentName)
                                throws ModelInternalException

  Returns the `AttachmentRef` of the specified attachment associated with this process. Once retrieved actions can be taken on the attachment object.

  The name of attachment must not be longer than specified by `AttachmentRef.MAX_ATTACHMENT_NAME_LENGTH`.

  Parameters:
    `attachmentName` - The attachment's name.
  Returns:
    An attachment object that has been added to this process instance.
  Throws:
    `ModelInternalException` - Thrown when no attachment exist for the supplied attachment name.

### setAttachments

    public void setAttachments(AttachmentRef[] attachments)
                        throws WFInternalException,
                               WFServerException,
                               ModelInternalException

  Adds an array of `AttachmentRefs` to this process instance. There is no limit to the number of attachments that can be associated with a process instance. In addition, there are no restrictions to the type of attachments other than that each attachment must be an individual object.

  Note that this method will overwrite any array of attachments that are already added to the process instance. To avoid this, you might first call `getProcessAttachments` and then add new attachments to the existing array.

  The process instance has to be in enactment edit-mode or in structural edit-mode before calling method `setAttachments`. Enactment edit-mode is entered by calling `startEdit` of super interface `DataAccessor`. Structural edit-mode is entered by calling method `startStructuralEdit`.

  This method generates a `ProcessInstanceEvent` that notifies the added `ProcessInstanceListener`s about changes of this process instance.

  Parameters:
    `attachments` - the array of `AttachmentRefs` to be added to the process instance.
  Throws:
    `WFInternalException`
    `WFServerException`
    `ModelInternalException` - Thrown when the process instance is not in enactment edit-mode nor in structural edit-mode when this method is called. Should be caught as `ModelException` for future compatibility.
  See Also:
    `DataAccessor.startEdit()`, `startStructuralEdit()`, `getAttachment(String)`, `getProcessAttachments()`, `DataAccessor.startEdit()`

### removeAttachment

    public void removeAttachment(java.lang.String attachmentName)
                          throws WFServerException,
                                 WFInternalException,
                                 ModelInternalException

  Removes a designated attachment from this process instance. A process instance does not have any limits to the number of attachments that can be associated with it beside the maximum size of a process instance.

  The name of attachment is limited to number of characters specified by the constant `AttachmentRef.MAX_ATTACHMENT_NAME_LENGTH`.

  The process instance has to be in enactment edit-mode or in structural edit-mode before calling method `removeAttachment`. Enactment edit-mode is entered by calling `startEdit` of super interface `DataAccessor`. Structural edit-mode is entered by calling method `startStructuralEdit`.

  This method generates a `ProcessInstanceEvent` that notifies the added `ProcessInstanceListener`s about changes of this process instance.

  Parameters:
    `attachmentName` - The attachment's name to be removed from this process instance.
  Throws:
    `WFServerException`
    `WFInternalException`
    `ModelInternalException` - Thrown when the process instance is not in enactment edit-mode nor in structural edit-mode when this method is called. Should be caught as `ModelException` for future compatibility.
  See Also:
    `DataAccessor.startEdit()`, `startStructuralEdit()`

### addDataItem

    public DataItem addDataItem(java.lang.String dataItemName,
                                java.lang.String dataItemType,
                                java.lang.String dataItemValue)
                         throws WFServerException,
                                WFInternalException,
                                ModelInternalException

  Adds a new User Defined Attribute (UDA) to this process instance.

  The name of the UDA is limited to the number of characters specified by the constant `DataItemRef.MAX_DATA_REF_NAME_LENGTH`.

  The process instance has to be in structural edit-mode when calling method `addDataItem`. Structural edit-mode is entered by calling `startStructuralEdit`.

  Parameters:
    `dataItemName` - The name assigned of the UDA.
    `dataItemType` - An integer which specifies the type of the UDA, defined in the `DataItemRef` interface by constants like `TYPE_INTEGER`.
    `dataItemValue` - The value of the UDA.
  Returns:
    The new create `DataItem` object.
  Throws:
    `WFServerException`
    `WFInternalException`
    `ModelInternalException` - Thrown when the process instance is not in structural edit-mode when this method is called, or when the supplied values are invalid (e.g. the length of dataItemName is 0) or `null`. Should be caught as `ModelException` for future compatibility.
  See Also:
    `startStructuralEdit()`, `DataAccessor.getDataItem(String)`, `DataAccessor.getDataItems()`, `DataItemRef`

### setDataItems

    public void setDataItems(DataItem[] dataItems)
                      throws WFServerException,
                             WFInternalException,
                             ModelInternalException

  Adds an array of User Defined Attributes (UDAs) to this process instance.

  The process instance has to be in structural edit-mode or in enactment edit- mode when calling method `addDataItem`. Structural edit-mode is entered by calling `startStructuralEdit`. Enactment edit-mode is entered by calling `startEdit` of super interface `DataAccessor`.

  Parameters:
    `dataItems` - The list of UDAs to be added.
  Throws:
    `WFServerException`
    `WFInternalException`
    `ModelInternalException` - Thrown when the process instance is not in structural nor in enactment edit-mode when this method is called. Should be caught as `ModelException` for future compatibility.
  See Also:
    `startStructuralEdit()`, `DataAccessor.startEdit()`, `DataAccessor.getDataItem(String)`, `DataAccessor.getDataItems()`

### getDataItemType

    public java.lang.String getDataItemType(java.lang.String dataItemName)
                                     throws ModelInternalException

  Deprecated. This method is replaced by `getDataItem.getType`.

  Returns the data type for a specific User Defined Attribute (UDA). UDAs are created during the creation of a process definition. This method returns the data type for the specified UDA.

  See list of types in the `DataItemRef` class description.

  Specified by:
    `getDataItemType` in interface `DataAccessor`
  Parameters:
    `dataItemName` - The name of the UDA. This is the name that was used when the UDA for the process defintion was created.
  Returns:
    A string representation of the UDA type. See list of types in the `DataItemRef` class description.
  Throws:
    `ModelInternalException`
  See Also:
    `DataAccessor.getDataItem(String)`, `DataItemRef.getType()`

### removeDataItem

    public void removeDataItem(java.lang.String dataItemName)
                        throws WFServerException,
                               WFInternalException,
                               ModelInternalException

  Removes the User Defined Attribute (UDA) from this process instance matching the UDA's name.

  The name of UDA is a link to a `DataItem` objects (extension of interface `DataItemRef`), so the value must not be longer than specified in `DataItemRef.MAX_DATA_REF_NAME_LENGTH`.

  The process instance has to be in structural edit-mode when calling method `addDataItem`. Structural edit-mode is entered by calling `startStructuralEdit`.

  Parameters:
    `dataItemName` - The UDA's name to be removed.
  Throws:
    `WFServerException`
    `WFInternalException`
    `ModelInternalException` - Thrown if there is no UDA matching the name. Furthermore the exception is thrown when process instance is not in structural edit-mode when this method is called. Should be caught as `ModelException` for future compatibility.
  See Also:
    `startStructuralEdit()`, `addDataItem(String, String, String)`

### setDataItemValues

    public void setDataItemValues(java.util.Properties nvlist)
                           throws WFInternalException,
                                  WFServerException,
                                  ModelInternalException

  Deprecated. Replaced by `super.setDataItemValues`

  Description copied from interface: `DataAccessor`

  Sets the values of a group of User Defined Attributes (UDA). The values of existing UDAs are set by using 'UDA name' (key) and 'UDA value' (value) as pairs in a `java.util.Properties` array.

  The length of properties key (UDA name) is limited to the length specified by `DataItemRef.MAX_DATA_REF_NAME_LENGTH`.

  The data accessor has to be in edit-mode before calling `setDataItemValues`. Edit-mode is entered by calling `DataAccessor.startEdit`.

  All the thrown exceptions should be caught as `ModelException` for future compatibility.

  Specified by:
    `setDataItemValues` in interface `DataAccessor`
  Parameters:
    `nvlist` - list of UDA name and UDA value groups.
  Throws:
    `WFServerException`
    `ModelInternalException`
    `WFInternalException` - Thrown when the data accessor is not in edit-mode when this method is called.
  See Also:
    `DataAccessor.setDataItemValues(Properties)`

### getCreationTime

    public long getCreationTime()

  Returns the time when this process instance was created. The time is measured in milliseconds since January 1, 1970, 00:00:00. You can convert this long value into a recognizable representation of the date using methods in`java.util.Date`.

  A process instance will always have a creation time, so the returned value will never become invalid.

  Returns:
    The time when this process instance was created in milliseconds, or -1 in case of an internal error.

### getClosedTime

    public long getClosedTime()

  Returns the time when this process instance was closed. The time is measured in milliseconds since January 1, 1970, 00:00:00. You can convert this long value into a recognizable representation of the date using methods in`java.util.Date`.

  A process instance is considered to be closed when it is either completed or aborted. Returns `-1` if the process instance is neither in completed nor aborted state.

  Returns:
    The time when this process instance was closed in milliseconds, or -1 if process instance is not closed yet.

### getInitiator

    public java.lang.String getInitiator()

  Returns the login name of the user who created this process instance. Normally this name can never be invalid, because a process instance can only be created with a valid session. In case of an internal exception the returned value can be `null`.

  Returns:
    The user's name.

### getOwners

    public java.lang.String[] getOwners()

  Returns the list of owners of this process instance. Only an owner of a process instance is allowed to modify the process instance. There is no limit to the number of owners that can exist for a process instance. With initialisation the owners of process instance are the same as the owners of process definition.

  Returns:
    A list of the process owner's user names.

### getPriority

    public int getPriority()

  Returns the current priority of this process instance as defined in the `ProcessInstance` interface by constants such as `PRIORITY_HIGH`.

  When the process instance is first created, it inherits the priority of the process definition it is based on. During the execution of the process instance, the priority of the process instance can be changed. Changing the running process priority will have no effect on the base process definition.

  Returns:
    The integer constant specifying the current priority of this process instance.

### setPriority

    public void setPriority(int priority)

  Sets the priority of this process instance. The process priority can be any value between plus or minus 32,767.

  However, process priorities is separated in three categories: high (High), medium (Med), and low (Low).
  This categorization of priorities is made according to the following rules:

  - HIGHT: Any number greater than or equal to 16.
  - MEDIUM: Any number between eight and 16 (including eight)
  - LOW: Any number less than eight.

  It is recommended to set the priority to one of the three categories by using the constants: `PRIORITY_HIGH`, `PRIORITY_MEDIUM`, or `PRIORITY_LOW`.

  The priority can only be set in enactment edit-mode or in structural edit-mode. Enactment edit-mode can be entered by calling `startEdit` of super interface `DataAccessor`. Structural edit-mode is entered by calling method `startStructuralEdit`. When not in edit-mode, calling this method will have no effect.

  Parameters:
    `priority` - The new priority of this process instance as as defined the `PRIORITY_`... constants.
  See Also:
    `DataAccessor.startEdit()`, `startStructuralEdit()`

### setOwners

    public void setOwners(java.lang.String[] owners)
                   throws WFInternalException,
                          WFServerException,
                          ModelInternalException

  Sets the specified array of users as owners of this process instance. Only administrators users and the current process owners can change the ownership of the process instance.

  The owner's name must not be longer than specified by `DirectoryServices.MAX_DIR_NAME_LENGTH` and must not contain the characters '`,`'.

  The process instance has to be in enactment edit-mode when calling method `setOwners`. Enactment edit-mode is entered by calling `startEdit` of super interface `DataAccessor`.

  Parameters:
    `owners` - A list of user names to be assigned as new owners.
  Throws:
    `WFInternalException`
    `WFServerException`
    `ModelInternalException` - Thrown when the process instance is not in enactment edit-mode when this method is called or the list of user names is invalid. Should be caught as `ModelException` for future compatibility.
  See Also:
    `DataAccessor.startEdit()`

### getHistory

    public IflowEnumeration getHistory(int[] processHistoryFields)
                                throws WFInternalException,
                                       WFServerException,
                                       ModelInternalException

  Returns all history records of this process instance. The returned enumeration contains a list of hash tables, each representing one record from the respective database table. The hash tables contain the history fields as defined in the `processHistoryFields` parameter. Valid values for the history fields such as `HISTORY_ID` are defined as constants in the `ProcessInstance` interface.

  Using the returned `IflowEnumeration` you can access the single history entries of this process instance. The ID of each `IflowEnumeration` entry is the history ID. This means the history ID must be used if the ID is a parameter of the `IflowEnumeration` access methods. E.g. the parameter `endId` of the method `IflowEnumeration.getPreviousBatch(endId, howMany)` is the history ID of the last entry that shall be returned.

  .

  The mentioned exceptions should be caught as `ModelException` for future compatibility.

  Parameters:
    `processHistoryFields` - List of integer constant specifying the history fields to return.
  Returns:
    Enumeration of hash tables representing the history records of this process instance.
  Throws:
    `WFInternalException`
    `WFServerException`
    `ModelInternalException` - Thrown when the supplied list of history fields is `null` or if the list contains invalid history fields.

### getState

    public int getState()

  Returns the current state of this process instance as defined in the `ProcessInstance` interface by constants such as `STATE_RUNNING`. When the process instance is created new it has the state `STATE_CREATED`.

  Returns:
    The integer constant specifying the current state of this process instance.

### getPlan

    public Plan getPlan()
                 throws WFServerException,
                        WFInternalException,
                        ModelInternalException

  Returns the process definition from which this process instance was instantiated.

  Returns:
    The process defintion which is the base of this process instance.
  Throws:
    `WFServerException`
    `WFInternalException`
    `ModelInternalException`

### getPlanId

    public long getPlanId()

  Deprecated. Replaced by `getPlan().getId`.

  See Also:
    `getPlan()`, `Plan.getId()`

### getPlanName

    public java.lang.String getPlanName()

  Deprecated. This method is replaced by `getPlan().getName`.

  See Also:
    `getPlan()`, `Plan.getName()`

### getPlanTitle

    public java.lang.String getPlanTitle()

  Deprecated. This method is replaced by `getPlan().getTitle`.

  See Also:
    `getPlan()`, `Plan.getId()`

### getPlanDescription

    public java.lang.String getPlanDescription()

  Deprecated. This method is replaced by `getPlan().getDesc`.

  See Also:
    `getPlan()`, `Plan.getDesc()`

### activateNodeInstance

    public void activateNodeInstance(NodeInstance ni)
                              throws WFServerException,
                                     WFInternalException,
                                     ModelInternalException

  Deprecated. Use the "activate" method on the NodeInstance directly

  Throws:
    `WFServerException`
    `WFInternalException`
    `ModelInternalException`
  See Also:
    `NodeInstance.activate().`

### resetNodeInstance

    public void resetNodeInstance(NodeInstance ni)
                           throws WFServerException,
                                  WFInternalException,
                                  ModelInternalException

  Deprecated. Use the "reset" method on the NodeInstance directly.

  Throws:
    `WFServerException`
    `WFInternalException`
    `ModelInternalException`
  See Also:
    `NodeInstance.reset()`

### deactivateArrowInstance

    public void deactivateArrowInstance(ArrowInstance ai)
                                 throws WFInternalException,
                                        WFServerException,
                                        ModelInternalException

  Deprecated. Use the "deactivate" method on the ArrowInstance directly.

  Throws:
    `WFInternalException`
    `WFServerException`
    `ModelInternalException`
  See Also:
    `ArrowInstance.deactivate()`

### getMemberNodeInstances

    public NodeInstance[] getMemberNodeInstances()
                                          throws ModelException

  Returns all node instances of this process instance. If there are none, the returned list is empty.

  Returns:
    The node instances in this process instance, or an empty array if this process instance has none.
  Throws:
    `ModelException`

### getMemberArrowInstances

    public ArrowInstance[] getMemberArrowInstances()
                                            throws ModelException

  Returns all arrow instance of this process instance. If there are none, the returned list is empty.

  Returns:
    The arrows in this process instance or an empty array if the process instance has none.
  Throws:
    `ModelException`

### getInArrowInstances

    public ArrowInstance[] getInArrowInstances(long niId)
                                        throws ModelException

  Returns all arrow instance which are incoming arrows of the specified node of this process instance. Returns an empty array if there are none.

  Parameters:
    `niId` - The unique identifier of the node in this process instance.
  Returns:
    An array of the incoming arrows of the specified, that is empty if no arrays are defined.
  Throws:
    `ModelException`

### getOutArrowInstances

    public ArrowInstance[] getOutArrowInstances(long niId)
                                         throws ModelException

  Returns all arrow instance which are outgoing arrows of the specified node of this process instance. Returns an empty array if there are none.

  Parameters:
    `niId` - The unique identifier of the node in this process instance.
  Returns:
    An array of the outgoing arrows of the specified node, that is empty if this process instance has none.
  Throws:
    `ModelException`

### getProcessAttachments

    public AttachmentRef[] getProcessAttachments()
                                          throws ModelException

  Returns the references to all the attachments associated with this process instance. Attachments are added to a process instance while it is running. There is no limit to the number of attachments that can be added to a process instance. An empty array is returned if there are no attachments associated with this process instance.

  Returns:
    The attachment references associated with this process instance, or an empty array if this process instance has none.
  Throws:
    `ModelException`

### getProcessPriority

    public int getProcessPriority()
                           throws ModelException

  Deprecated. Replaced by `getPriority()`

  Throws:
    `ModelException`

### getTemplateId

    public long getTemplateId()
                       throws ModelException

  Deprecated. This method is replaced by `getPlan.getId`.

  Returns the ID of the process definition from which this process instance was created.

  Throws:
    `ModelException`
  See Also:
    `getPlan()`, `Plan.getId()`

### getInitialName

    public java.lang.String getInitialName()
                                    throws ModelException

  Deprecated. This method is replaced by `getPlan.getName`.

  Returns the name of the process definition from which this process instance was created.

  Throws:
    `ModelException`
  See Also:
    `getPlan()`, `Plan.getName()`

### getInitialTitle

    public java.lang.String getInitialTitle()
                                     throws ModelException

  Deprecated. This method is replaced by getPlan.getTitle.

  Returns the title of the process definition from which this process instance was created.

  Throws:
    `ModelException`
  See Also:
    `getPlan()`, `Plan.getTitle()`

### getInitialDescription

    public java.lang.String getInitialDescription()
                                           throws ModelException

  Deprecated. This method is replaced by `getPlan.getDesc`.

  Returns the description of the process definition from which this process instance was created.

  Throws:
    `ModelException`
  See Also:
    `getPlan()`, `Plan.getDesc()`

### getStatusOfTimers

    public TimerStatus[] getStatusOfTimers()
                                    throws ModelException

  Returns the attribute sets of all active process timers attached to this process instance as `TimerStatus` objects. Timers are considered active when they (1) have not fired yet, or (2) have fired but their related timer action has not been executed yet. The `HISTORY_ISHANDLED` field of the history entries related to these timers will have a value of 0 or 1, respectively, in these cases. History entries can be retrieved through `getHistory(int[])`.

  The returned list does not include status information for timers whose related activities have never been executed, or for timers that a user has deactivated.

  `timerInstanceIDs` and expiration times, which are a part of the returned `TimerStatus` objects are different every time a periodic timer enters a new cycle. Furthermore, a process will never contain more than one active timer instance for any single `TimerDef` object.

  Returns an empty array if no timers exist.

  Returns:
    Attributes of all of this process instance's active timers as an array of `TimerStatus` objects, that is empty if there are none.
  Throws:
    `ModelException`
  See Also:
    `addTimer(TimerDef)`

### addTimer

    public TimerDef addTimer(TimerDef timer)
                      throws ModelException

  Adds a timer to this process instance.

  The process instance has to be in structural edit-mode when calling method `addTimer`. Structural edit-mode is entered by calling `startStructuralEdit`.

  Parameters:
    `timer` - The `TimerDef` object to be added.
  Returns:
    The new added `TimerDef` object.
  Throws:
    `ModelException` - Thrown when the process instance is not in structural edit-mode when this method is called.
  See Also:
    `startStructuralEdit()`, `getTimer(long)`, `getTimers()`, `removeTimer(long)`, `removeTimer(TimerDef)`

### removeTimer

    public void removeTimer(TimerDef td)
                     throws ModelException

  Removes the specified timer and its corresponding active timer (if any) from this process instance.

  The process instance has to be in structural edit-mode when calling method `removeTimer`. Structural edit-mode is entered by calling `startStructuralEdit`.

  Parameters:
    `td` - The `TimerDef` object to be removed.
  Throws:
    `ModelException` - Thrown when the process instance is not in structural edit-mode when this method is called or if the Timer removal fails.
  See Also:
    `startStructuralEdit()`, `addTimer(TimerDef)`

### removeTimer

    public void removeTimer(long timerInstanceId)
                     throws ModelException

  Removes an active timer (TimerStatus) object from this process instance.

  The process instance has to be in structural edit-mode when calling method `removeTimer`. Structural edit-mode is entered by calling `startStructuralEdit`.

  Parameters:
    `timerInstanceId` - the ID of the `TimerInstance`object to be removed.
  Throws:
    `ModelException` - Thrown when the process instance is not in structural edit-mode when this method is called or if the timer removal fails.
  See Also:
    `startStructuralEdit()`, `addTimer(TimerDef)`

### getTimers

    public TimerDef[] getTimers()
                         throws ModelException

  Returns a list of all timer definitions added to this process instance. Returns an empty array if no timers are defined.

  Returns:
    An array of all timer definition of this process, that is empty if this process instance has none.
  Throws:
    `ModelException`
  See Also:
    `addTimer(TimerDef)`

### getTimer

    public TimerDef getTimer(long tdid)
                      throws ModelException

  Returns the timer definition added to this process instance that has the specified ID. Returns `null` if no timer exist for the supplied ID.

  Parameters:
    `tdid` - The `TimerDef`'s unique identifier.
  Returns:
    The Timer identified by the supplied id or `null` if that timer does not exist.
  Throws:
    `ModelException`

### getSequenceId

    public int getSequenceId()
                      throws ModelException

  Returns the sequence number of this process instance. The sequence id is allocated automatically by the server.

  Returns:
    int The sequence number of this process instance.
  Throws:
    `ModelException`

### addTrigger

    public TriggerDef addTrigger(java.lang.String name,
                                 int type)
                          throws ModelException

  Adds a new trigger definition with the given name and type to this process instance (adds the trigger definition to the private process definition of this process instance). The name must not be longer than `TriggerDef.MAX_TRIGGER_NAME_LENGTH`. The type must be one of the types defined within the `TriggerDef` object, like `TriggerDef.START_PROCESS`.

  Structural edit-mode of process instance is required. Edit-mode is entered by calling `ProcessInstance.startStructuralEdit`.

  Parameters:
    `name` - The name of the trigger to be added.
    `type` - The type of the trigger to be added.
  Returns:
    The new trigger definition of the supplied type with the given name.
  Throws:
    `ModelException` - Thrown when this process instance is not in structural edit mode. Furthermore this exception is thrown when the supplied name of trigger is invalid (e.g. the length is 0) or `null` or if the type is invalid.
  See Also:
    `startStructuralEdit()`

### getTrigger

    public TriggerDef getTrigger(long triggerId)
                          throws ModelException

  Retrieves the specified trigger definition.

  Parameters:
    `triggerId` - The identifier of the trigger.
  Returns:
    The specified trigger definition.
  Throws:
    `ModelException` - Thrown when no trigger exists for the specified ID.

### getTriggers

    public TriggerDef[] getTriggers()
                             throws ModelException

  Retrieves all the triggers defined for the process definition of this process instance.

  Returns:
    An array of all the trigger definitions associate with the process definition, this process instance belongs to.
  Throws:
    `ModelException`

### getTriggers

    public TriggerDef[] getTriggers(int type)
                             throws ModelException

  Retrieves all the trigger definitions of the given type for the process definition this process instances belongs to.

  Parameters:
    `type` - The type of the trigger.
  Returns:
    An array of all the trigger definitions.
  Throws:
    `ModelException`

### removeTrigger

    public void removeTrigger(long triggerId)
                       throws ModelException

  Deletes the specified trigger definition.

  Structural edit-mode of the process instance is required. Edit-mode is entered by calling `ProcessInstance.startStructuralEdit`.

  Parameters:
    `triggerId` - The unique identifier of the trigger to be removed.
  Throws:
    `ModelException`
  See Also:
    `startStructuralEdit()`

### removeTriggers

    public void removeTriggers()
                        throws ModelException

  Deletes all trigger definitions from the private process definition this process instance belongs to.

  Structural edit-mode of the process instance is required. Edit-mode is entered by calling `ProcessInstance.startStructuralEdit`.

  Throws:
    `ModelException`
  See Also:
    `startStructuralEdit()`

### getProcessURI

    public java.lang.String getProcessURI()
                                   throws ModelException

  Returns the URI of this process instance. This URI identifies this process instance to a remote server. A remote server can use this URI to send ASAP messages to this process instance. Also, this URI will be used in ASAP messages sent by this process instance.

  Returns:
    This process instance's URI
  Throws:
    `ModelException`

### getWorklistDataItems

    public DataItem[] getWorklistDataItems()
                                    throws ModelException

  Returns an array of `DataItem` objects. This method returns an array of all worklist User Defined Attributes (UDAs) and their values. If there are none, an empty array is returned.

  worklist data items are delivered with the ProcessInstance, and are fast to retrieve and use within processlists. This method does not retrieve all the process instance UDA variables, but only those variables that have been designated as worklist variables.

  Returns:
    An array of UDAs with their values, or an empty array, if there are no UDAs.
  Throws:
    `ModelException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD