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 NodeInstance

All Superinterfaces:
  Node

public interface NodeInstance
extends Node

The `NodeInstance` interface includes all the methods that can be used with node instances.

It is always used in the context of the process instance that contains the node instance. `NodeInstance` objects are generated automatically when the process instance is created. It is an instance of the `Node` interface. The `Node` interface is added at design-time to a process definition. When a process instance is in structural edit-mode, you can add new `NodeInstance` objects to it.

The standard way of adding `NodeInstance` objects to active process instances is to call the method `ProcessInstance.addNodeInstance`. This method creates and returns a new `NodeInstance` and adds it directly to the process instance. The new node instance will consist of the two minimum required attributes: name and type of node. All of the other attributes of the object can then be set with additional methods associated with the `NodeInstance` interface.

Exceptions. Three kinds of exceptions are commonly thrown within this class: `WFServerException`, `WFInternalException`, and `ModelInternalException`, all of which 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` denots other problems that are internal to the Model API.

See Also:
  `ProcessInstance`

Field Summary
`static int` | `STATE_COMPLETED` Indicates that a node instance has been completed successfully.
`static int` | `STATE_ERROR` Indicates that the node instance failed to execute because of an error.
`static int` | `STATE_INITIAL` Indicates that the node instance has been created and that it has not been used in the context of process execution until now.
`static int` | `STATE_RUNNING` Indicates that the node instance is in a running state.
`static int` | `STATE_SUSPENDED` Indicates that the node instance is in a suspended state.
`static int` | `STATE_WAITING_ON_SUB_PROCESS` Indicates that the node instance is in a state of waiting for a subprocess to complete.

Fields inherited from interface com.fujitsu.iflow.model.workflow.Node
`MAX_CUSTOM_NODE_TYPE_LENGTH, MAX_NODE_DESCRIPTION_LENGTH, MAX_NODE_NAME_LENGTH, MAX_PLAN_URI_LENGTH, ON_EVERY_VOTE, TYPE_ACTIVITY, TYPE_AND, TYPE_CHAINED_PROCESS, TYPE_CONDITION, TYPE_DELAY, TYPE_EXIT, TYPE_OR, TYPE_REMOTE_SUB_PROCESS, TYPE_START, TYPE_SUB_PROCESS, TYPE_VOTING_ACTIVITY, WHEN_ALL_VOTES_ARE_CAST`

Method Summary
`void` | `activate()` Updates this node with data from the server and changes the state of the node instance to the `STATE_RUNNING` state.
`boolean` | `equals(NodeInstance nodeInstance)` Deprecated. Use `getNodeInstanceId() == nodeInstance.getNodeInstanceId()` instead
`long` | `getChainedProcessId()` Deprecated. This method is replaced by `getChainedProcessInstance().getId`.
`ProcessInstance` | `getChainedProcessInstance()` Returns the chained process that is created (and started) by this node.
`java.util.Date` | `getDueDate()` Returns the due date for this node instance.
`ArrowInstance[]` | `getIncomingArrowInstances()` Returns an array of the incoming arrow instances associated with this node instance.
`long` | `getNodeInstanceId()` Returns this node instance's unique identifier.
`ArrowInstance[]` | `getOutgoingArrowInstances()` Returns an array of the outgoing arrow instances associated with this node instance.
`ProcessInstance` | `getProcessInstance()` Returns the process instance (`ProcessInstance` object) that contains this node instance.
`long` | `getProcessInstanceId()` Deprecated. This method is replaced by `getProcessInstance().getId`.
`int` | `getState()` Returns the state of this node instance.
`TimerStatus[]` | `getStatusOfTimers()` Returns the attribute sets of all active timers attached to this node instance as `TimerStatus` objects.
`long` | `getSubProcessId()` Deprecated. This method is replaced by `getSubProcessInstance().getId`
`ProcessInstance` | `getSubProcessInstance()` Returns the subprocess that is created (and started) by this node.
`java.lang.String` | `getSubProcessURI()` Deprecated. This method is replaced by `getSubProcessInstance().getProcessURI`.
`void` | `removeTimer(long timerInstanceId)` Removes the specified timer from this node instance.
`void` | `reset()` Updates this node instance with data from the server and resets the state to `STATE_COMPLETED`.
`void` | `setDueDate(java.util.Date newDueDate)` Deprecated. This method is not supported.
`void` | `setState(int state)` Deprecated. Client should not perform this operation. It is done automatically by the Interstage BPM server.
`void` | `subProcessCompleted(java.lang.String option, java.util.Properties dataItemProperties)` Deprecated. A client need not call this method. Informing the waiting remote subprocess node that the remote subprocess has completed is handled internally.

Methods inherited from interface com.fujitsu.iflow.model.workflow.Node
`addArrow, addArrow, addDataMappingElement, addForm, addTimer, addTrigger, equals, getChainedPlanId, getChainedPlanName, getConditionSpec, getCustomNodeType, getDataItemRefs, getDataMappingElements, getDefaultChoice, getDesc, getDueDateDef, getEpilogueJavaActionSet, getEpilogueScript, getEvaluateRulesMode, getEvaluationOrder, getExtendedAttributes, getForm, getForms, getIncomingArrows, getName, getNodeId, getNodeTxnStatus, getOutgoingArrows, getPlan, getPlanDescription, getPlanName, getPlanTitle, getPosition, getPrologueJavaActionSet, getPrologueScript, getRole, getRoleJavaActionSet, getRoleScript, getSubPlanId, getSubPlanName, getSubPlanURI, getTimers, getTrigger, getTriggers, getTriggers, getType, getUpperLeftPoint, getVotingRule, getVotingRules, isCustomNodeType, removeArrow, removeDataMappingElement, removeEpilogueJavaActionSet, removeForm, removePrologueJavaActionSet, removeRoleJavaActionSet, removeTimer, removeTrigger, removeTriggers, reorderTimers, setChainedPlanId, setChainedPlanName, setConditionSpec, setCustomNodeType, setDefaultChoice, setDesc, setDueDateDef, setEpilogueJavaActionSet, setEpilogueScript, setEvaluateRulesMode, setEvaluationOrder, setExtendedAttributes, setForms, setName, setNodeInTxn, setPosition, setPrologueJavaActionSet, setPrologueScript, setRole, setRoleJavaActionSet, setRoleScript, setSubPlanId, setSubPlanName, setSubPlanURI, setTimers, setUpperLeftPoint, setVotingRule, supportChainedProcess, supportConditionSpec, supportDelay, supportEpilogueJavaActionSet, supportEpilogueScript, supportForm, supportPrologueJavaActionSet, supportPrologueScript, supportRemoteSubProcess, supportRole, supportRoleJavaActionSet, supportRoleScript, supportSubProcess, supportTimer, supportTrigger, supportVoting`

Field Detail

### STATE_INITIAL

    public static final int STATE_INITIAL

  Indicates that the node instance has been created and that it has not been used in the context of process execution until now.

  See Also:
    Constant Field Values

### STATE_RUNNING

    public static final int STATE_RUNNING

  Indicates that the node instance is in a running state.

  See Also:
    Constant Field Values

### STATE_WAITING_ON_SUB_PROCESS

    public static final int STATE_WAITING_ON_SUB_PROCESS

  Indicates that the node instance is in a state of waiting for a subprocess to complete.

  See Also:
    Constant Field Values

### STATE_COMPLETED

    public static final int STATE_COMPLETED

  Indicates that a node instance has been completed successfully.

  See Also:
    Constant Field Values

### STATE_ERROR

    public static final int STATE_ERROR

  Indicates that the node instance failed to execute because of an error.

  See Also:
    Constant Field Values

### STATE_SUSPENDED

    public static final int STATE_SUSPENDED

  Indicates that the node instance is in a suspended state.

  See Also:
    Constant Field Values

Method Detail

### getNodeInstanceId

    public long getNodeInstanceId()

  Returns this node instance's unique identifier. The ID is allocated automatically by the server when the associated process instance is created.

  Returns:
    This node instance's unique identifier.

### getState

    public int getState()

  Returns the state of this node instance. Each node instance within a process instance progresses through several states. This method allows the programmer to retrieve the current state of this node instance as defined in the `NodeInstance` interface. The integer value returned corresponds to the node state constants like `STATE_RUNNING`.

  With initialisation the node has the state `STATE_INITIAL`. The state is changed automatically with process execution.

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

### setState

    public void setState(int state)

  Deprecated. Client should not perform this operation. It is done automatically by the Interstage BPM server.

  Sets the state of the node instance (Enactment Editing). Each node instance within a process instance progresses through several states. This method allows the programmer to set the current state of the node instance, using the integer constants listed in this interface.

### getProcessInstance

    public ProcessInstance getProcessInstance()
                                       throws ModelException

  Returns the process instance (`ProcessInstance` object) that contains this node instance. Node instances exist only in the context of a running process instance. This method allows the programmer access to the process instance that contains this node instance.

  With initializing the node instance is automatically added to a process definition.

  Returns:
    The process instance that this node instance belongs to.
  Throws:
    `ModelException`

### getProcessInstanceId

    public long getProcessInstanceId()

  Deprecated. This method is replaced by `getProcessInstance().getId`.

  Returns the ID of the process instance that contains this node instance. Node instances exist only in the context of a running process instance. This method allows the programmer to obtain the ID of the process instance for which this node instance is a member.

  Returns:
    The ID of process instance that this node instance belongs to.
  See Also:
    `getProcessInstance()`, `ProcessInstance.getId()`

### equals

    public boolean equals(NodeInstance nodeInstance)

  Deprecated. Use `getNodeInstanceId() == nodeInstance.getNodeInstanceId()` instead

  Compares this node instance with another one.

  See Also:
    `getNodeInstanceId()`

### getIncomingArrowInstances

    public ArrowInstance[] getIncomingArrowInstances()

  Returns an array of the incoming arrow instances associated with this node instance. If there are none, an empty array is returned.

  Returns:
    An array of `ArrowInstance` objects representing the incoming arrows of this node instance.

### getOutgoingArrowInstances

    public ArrowInstance[] getOutgoingArrowInstances()

  Returns an array of the outgoing arrow instances associated with this node instance. If there are none, an empty array is returned.

  Returns:
    An array of `ArrowInstance` objects representing the outgoing arrows of this node instance.

### activate

    public void activate()
                  throws WFServerException,
                         WFInternalException,
                         ModelInternalException

  Updates this node with data from the server and changes the state of the node instance to the `STATE_RUNNING` state. This method is supported for all nodes that have one ore more incoming arrows expect AND Nodes (type `Node.TYPE_AND`). AND Nodes are not supported, because it counts the activate events that it gets from various arrows, and it does not know what to do with that one that is not associated with an arrow.

  The containing process instance does not have to be in structural edit-mode when calling the `activate` method. Structural edit-mode is entered by calling `ProcessInstance.startStructuralEdit`.

  Throws:
    `WFServerException`
    `WFInternalException`
    `ModelInternalException` - Thrown when the process instance is not in structural edit-mode or this node instance is not an activity node. Should be caught as `ModelException` for future compatibility.
  See Also:
    `ProcessInstance.startStructuralEdit()`, `reset()`

### reset

    public void reset()
               throws WFServerException,
                      WFInternalException,
                      ModelInternalException

  Updates this node instance with data from the server and resets the state to `STATE_COMPLETED`. This method is only supported if this node is of the activity type. This means that it must be of type `Node.TYPE_ACTIVITY` or `Node.TYPE_VOTING_ACTIVITY`.

  The containing process instance does not have to be in structural edit-mode when calling the `reset` method. Structural edit-mode is entered by calling `ProcessInstance.startStructuralEdit`.

  Throws:
    `WFServerException`
    `WFInternalException`
    `ModelInternalException` - Thrown when the process instance is not in structural edit-mode or this node instance is not an activity node. Should be caught as `ModelException` for future compatibility.
  See Also:
    `ProcessInstance.startStructuralEdit()`, `activate()`

### getSubProcessInstance

    public ProcessInstance getSubProcessInstance()
                                          throws WFServerException,
                                                 WFInternalException,
                                                 ModelInternalException

  Returns the subprocess that is created (and started) by this node.

  If the exception is thrown it can indicate that enactment has not yet fully created the subprocess, or that the definition for the subprocess to be created by this node either does not exist or has not been specified correctly. A wait loop on this API should be used to wait for enactment as required.

  Note that this method is applicable only when this is a subprocess-type node. This means that it must be of type `Node.TYPE_SUB_PROCESS`.

  Returns:
    The process instance which is created by this node as subprocess.
  Throws:
    `WFServerException`
    `WFInternalException`
    `ModelInternalException` - Thrown when this node does not support subprocess. Furthermore this exception is thrown if the sub process is not created yet.
  See Also:
    `Node.supportSubProcess()`

### getSubProcessId

    public long getSubProcessId()
                         throws ModelInternalException

  Deprecated. This method is replaced by `getSubProcessInstance().getId`

  Returns the ID of the subprocess that is created (and started) by this node.

  If enactment has not yet fully created the subprocess or there is no subprocess to be created by this node, `-1` will be returned indicating this error condition. A wait loop should be used to obtain the actual id when it becomes available.

  Returns:
    The ID of the process instance which is created by this node as subprocess.
  Throws:
    `ModelInternalException` - This exception returns the `SUB_PROCESS_NOT_SUPPORTED` error-code constant if the node does not support subprocesses.
  See Also:
    `Node.supportSubProcess()`, `getSubProcessInstance()`, `ProcessInstance.getId()`

### getSubProcessURI

    public java.lang.String getSubProcessURI()
                                      throws ModelException

  Deprecated. This method is replaced by `getSubProcessInstance().getProcessURI`.

  Returns URI of the remote subprocess which was created by this node. An empty string "" will be returned if enactment has not yet fully created the remote subprocess. A wait loop should be used to get the actual URI when it is available.

  Throws:
    `ModelException` - This exception returns the `REMOTE_SUB_PROCESS_NOT_SUPPORTED` error-code constant if the node does not support subprocesses.
  See Also:
    `Node.supportChainedProcess()`, `Node.supportSubProcess()`, `getSubProcessInstance()`, `ProcessInstance.getProcessURI()`

### subProcessCompleted

    public void subProcessCompleted(java.lang.String option,
                                    java.util.Properties dataItemProperties)
                             throws ModelException

  Deprecated. A client need not call this method. Informing the waiting remote subprocess node that the remote subprocess has completed is handled internally.

  Informs the waiting remote subprocess node that the remote subprocess has completed. This method is only valid for node instances of type remote subprocess. It is to be called when the remote subprocess completes.

  Parameters:
    `option` - The name of one of the outgoing arrows of the remote subprocess node. It defines the option with which the remote subprocess completed.
    `dataItemProperties` - Contains name-value pairs of data items returned by the remote subprocess when it completed.
  Throws:
    `ModelException` - Thrown when the remote subprocess is not supported.
  See Also:
    `Node.supportRemoteSubProcess()`

### getStatusOfTimers

    public TimerStatus[] getStatusOfTimers()
                                    throws ModelException

  Returns the attribute sets of all active timers attached to this node 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 just been executed or is in the process of being executed. 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 `ProcessInstance.getHistory(int[])`.

  If this node instance does not contain any timer, an empty array is returned.

  Returns:
    Attributes of all of this node instance's active timers as an array of `TimerStatus` objects.
  Throws:
    `ModelException`
  See Also:
    `ProcessInstance.getStatusOfTimers()`

### removeTimer

    public void removeTimer(long timerInstanceId)
                     throws ModelException

  Removes the specified timer from this node instance.

  Note that the Model API does not include a `TimerInstance` interface. `TimerInstance` objects can be accessed through the `TimerStatus` interface.

  The containing process instance must be in structural edit-mode when calling the `removeTimer` method. Structural edit-mode is entered by calling `ProcessInstance.startStructuralEdit`.

  Parameters:
    `timerInstanceId` - The ID of the `TimerInstance` object to be removed.
  Throws:
    `ModelException` - When the process instance is not in structural edit-mode when this method is called.
  See Also:
    `ProcessInstance.startStructuralEdit()`

### getDueDate

    public java.util.Date getDueDate()
                              throws ModelException

  Returns the due date for this node instance.

  Note that this method is applicable only when this is an activity-type node. This means that it must be of type `Node.TYPE_ACTIVITY` or `Node.TYPE_VOTING_ACTIVITY`.

  Returns:
    The due date of this node instance or `null` if no due date is defined.
  Throws:
    `ModelException` - When this node is not a kind of activity node.
    `java.lang.UnsupportedOperationException` - Thrown when the current type of node is neither `Node.Type_ACTIVITY` nor `Node.TYPE_VOTING_ACTIVITY`.

### setDueDate

    public void setDueDate(java.util.Date newDueDate)
                    throws ModelException

  Deprecated. This method is not supported.

  Sets or clears the due date for this activity instance (Enactment Editing). The process instance must be in structural edit-mode for this to work. Only Process Owners and administrators may set or clear a due date.

  Parameters:
    `newDueDate` - A date object specifying the new due date. Passing a null will clear out the due date and may remove any pending timer actions to be executed for the previously defined due date.
  Throws:
    `ModelException`

### getChainedProcessInstance

    public ProcessInstance getChainedProcessInstance()
                                              throws ModelInternalException

  Returns the chained process that is created (and started) by this node.

  If the exception is thrown it can indicate that enactment has not yet fully created the chained process, or that the definition for the chained process to be created by this node either does not exist or has not been specified correctly. A wait loop on this API should be used to wait for enactment as required.

  Note that this method is applicable only when this is a subprocess-type node. This means that it must be of type `Node.TYPE_CHAINED_PROCESS`.

  Returns:
    The process instance which is created by this node as chained process.
  Throws:
    `ModelInternalException` - Thrown when this node does not support chained process. Furthermore this exception is thrown if the chained process instance is not created yet.
  See Also:
    `Node.supportChainedProcess()`

### getChainedProcessId

    public long getChainedProcessId()
                             throws ModelInternalException

  Deprecated. This method is replaced by `getChainedProcessInstance().getId`.

  Returns the ID of the process instance which is created by this node instance.

  A `-1` will be returned if enactment has not yet fully created the chained process, or there is no chained process to be created by this node. A wait loop should be used to get the actual id when it is available.

  Note, only when this node supports chained process this method is applicable.

  Throws:
    `ModelInternalException` - If the chained process has not been set for this node, or if chained process is not supported
  See Also:
    `getChainedProcessInstance()`, `ProcessInstance.getId()`

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