ALBPM Process API (PAPI)

fuego.papi
Class InstanceInfo

java.lang.Object
  extended byfuego.papi.InstanceId
      extended byfuego.papi.InstanceInfo
All Implemented Interfaces:
Comparable, Serializable

public abstract class InstanceInfo
extends InstanceId
implements Serializable

Contains information about Process instances.

To get an individual InstanceInfo, use ProcessServiceNESession.getInstance(String).
To get an array of instances from a View, use ProcessServiceNESession.getInstancesByView(InstancesView).

See Also:
Serialized Form

Field Summary
 
Fields inherited from class fuego.papi.InstanceId
NAME_SEPARATOR, ORGANIZATION_SEPARATOR
 
Constructor Summary
InstanceInfo()
           
 
Method Summary
abstract  Activity getActivity()
          Gets the Activity for this instance.
abstract  Time getActivityDeadline()
          Gets the deadline to complete the current activity.
abstract  String getActivityId()
          Gets the Id of the Activity for this instance.
abstract  String getActivityName()
          Gets the name of the Activity for this instance.
abstract  int getAuthor()
          Gets the identification number of the instance creator.
abstract  String getAuthorId()
          Gets the Participant Uid of the instance author.
 Time getCreationTime()
          Gets the instance creation time.
abstract  Time getDeadline()
          Gets the deadline for this instance in its current activity.
The deadline is the minor between the activity deadline and the process deadline.
abstract  String getDescription()
          Gets the instance description.
abstract  String getId()
          Gets the instance Id.
abstract  int getInternalState()
          For internal use only.
abstract  int getNumberOfThreads()
          Gets the number of threads (copies) this instance has.
abstract  int getParentThreadIn()
          Gets the thread identification number of the parent thread.
abstract  String getParticipantId()
          Gets the Uid of the participant who has selected this instance.
abstract  int getParticipantIn()
          Gets the identification number of the participant who has selected this instance.
abstract  int getPendingTaskIn()
          Gets the Task identification number of the pending Task that must be re-run.
This is only used when this instance is in an automatic activity.
abstract  int getPriority()
          Gets the instance priority.
abstract  Process getProcess()
          Deprecated. Method getProcess is deprecated. WARNING: Do not invoke this method without previously initializing the ProcessService. Use getProcessId() and then ProcessServiceNESession.getProcess(String) instead.
abstract  Time getProcessDeadline()
          Gets the instance process deadline.
abstract  String getProcessId()
          Gets the process Id of this instance.
WARNING: Do not invoke this method without previously initializating the ProcessService.
abstract  Time getReceptionTime()
          Gets the Time when this process instance reached the current activity.
abstract  String getRoleId()
          Gets the role identification of this instance.
abstract  int getRoleIn()
          Gets the role identification number of this instance
abstract  InstanceStamp getStamp()
          Gets the instanceStamp.
static InstanceStamp getStamp(String stampId)
          Creates an InstanceStamp from the specified stampId.
static InstanceStamp getStamp(String instanceId, String activityName)
          Creates an InstanceStamp for the specified instanceId and activityName.
abstract  InstanceStamp getStampForActivity(String activityName)
          Creates an InstanceStamp for the specified activityName.
abstract  int getStatus()
          Gets the instance status.
abstract  String getStatusDescription(Locale locale)
          Gets the instance status description for the specified locale.
abstract  Task getTask(int taskNumber)
          Gets the Task corresponding to taskNumber.
abstract  Task getTask(String taskId)
          Gets the Task corresponding to the specified taskId.
abstract  int getTaskCount()
          Gets the current taskIndex.
abstract  int getTaskIn(int taskNumber)
          Gets the Task identification number for the specified taskNumber.
abstract  int getTaskInternalStatus(int taskNumber)
          For internal use only.
abstract  String getTaskLastExecutionParticipant(int taskNumber)
          Gets the UID of the last participant UID to execute the specified Task.
abstract  Time getTaskLastExecutionTime(int taskNumber)
          Gets the last time execution of the specified Task.
abstract  String getTaskParticipantId(int taskNumber)
          Gets the UID of the participant who has selected the specified Task.
abstract  int getTaskRetryCounter(int taskNumber)
          Gets the retryCounter for the specified Task.
Retry counter is the quantity of times that the task was executed and failed.
abstract  Task[] getTasks()
          Gets the Tasks associated with this process instance.
abstract  String getTaskStatusDescription(int taskNumber, Locale locale)
          Gets the Task status description for the specified taskNumber and locale.
abstract  Object getVar(String variableId)
          Gets the not localized value of the VarDefinition specified by variableId.
abstract  Object getVar(String variableId, Locale locale)
          Gets the localized value of the VarDefinition specified by locale and variableId.
abstract  boolean hasPendingTasks()
          Returns true if the process instance has mandatory Tasks that have not been run.
abstract  boolean hasRepeatableTasks()
          Returns true if the process instance has any repeatable Tasks.
abstract  void invalidateTask(int taskNumber)
          Invalidates the specific task index
abstract  boolean isAborted()
          Returns true if this process instance is aborted.
abstract  boolean isActivityCompleted()
          Returns true if the Activity for this instance has been completed.
abstract  boolean isCompleted()
          Returns true if this process instance has been completed.
Completed means that the process instance is in the End activity.
abstract  boolean isException()
          Returns true if this instance is an Exception.
An instance could be in an Exception if the instance is in an Exception, Grab or Interrupted flow.
abstract  boolean isExecuting()
          Returns true if this instance is executing.
An instance is executing if the instance is processing at this moment.
abstract  boolean isGrabbed()
          Returns true if this instance is grabbed.
abstract  boolean isPending()
          Returns true if this instance is pending.
An instance is pending if not all mandatory task for the activity where the instance is were executed.
abstract  boolean isRunning()
          Returns true if the process instance is running.
abstract  boolean isSelected()
          Returns true if the process instance is selected.
 boolean isSelectedBy(String participantId)
          Returns true if this instance is selected by the Participant specified by participantId.
abstract  boolean isSuspended()
          Returns true if this process instance is suspended.
abstract  boolean isTaskCompleted(int taskNumber)
          Returns true if the Task specified by taskNumber has been completed.
abstract  boolean isTaskRunning(int taskNumber)
          Returns true if the specified Task is running.
abstract  boolean isTaskSelected(int taskNumber)
          Returns true if the specified Task has been selected.
abstract  boolean isTaskValid(int taskNumber)
          Returns true if the specified taskNumber is valid.
static String makeGlobalId(String organization, String processId, int instanceIn, int threadIn)
          Returns a String in the format of makeId() + ORGANIZATION_SEPARATOR + organization.
static String makeId(String processId, int instanceIn, int threadIn)
          Returns a String in the format processId + NAME_SEPARATOR + instanceIn + NAME_SEPARATOR + threadIn.
 String toString()
          Returns a String containing the process identification number, the instance identification number, and the thread identification number.
 
Methods inherited from class fuego.papi.InstanceId
compare, compareTo, equals, equals, getInstanceId, getInstanceId, getInstanceIn, getInstanceIn, getOrganization, getProcessId, getProcessIn, getThreadIn, getThreadIn, hashCode, isProcessId, isValidInstanceId, makeGlobalId, makeId, makeId
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InstanceInfo

public InstanceInfo()
Method Detail

getActivity

public abstract Activity getActivity()
Gets the Activity for this instance.

Returns:
Activity for this instance.
See Also:
Activity

isActivityCompleted

public abstract boolean isActivityCompleted()
Returns true if the Activity for this instance has been completed.

Returns:
true if the Activity for this instance has been completed.

getActivityDeadline

public abstract Time getActivityDeadline()
Gets the deadline to complete the current activity.

Returns:
Deadline to complete the current activity, or null if there is no deadline for the current activity.

getActivityId

public abstract String getActivityId()
Gets the Id of the Activity for this instance.

Returns:
Id of the Activity for this instance
See Also:
Activity.getId()

getActivityName

public abstract String getActivityName()
Gets the name of the Activity for this instance.

Returns:
name of the Activity for this instance.

getAuthor

public abstract int getAuthor()
Gets the identification number of the instance creator. -1 means no Participant and 0 means automatic or engine Participant.

Returns:
Identification number of the instance creator.

getAuthorId

public abstract String getAuthorId()
Gets the Participant Uid of the instance author. Null means no Participant and "ENGINE" means the automatic or engine Participant.

Returns:
Participant Uid of the instance author.

isCompleted

public abstract boolean isCompleted()
Returns true if this process instance has been completed.
Completed means that the process instance is in the End activity.

Returns:
true if this process instance has been completed.

getDeadline

public abstract Time getDeadline()
Gets the deadline for this instance in its current activity.
The deadline is the minor between the activity deadline and the process deadline.

Returns:
deadline for instance in current activity.

getDescription

public abstract String getDescription()
Gets the instance description. The instance description in usually set programatically in a Fuego Business Language method.

Returns:
Instance description.

isException

public abstract boolean isException()
Returns true if this instance is an Exception.
An instance could be in an Exception if the instance is in an Exception, Grab or Interrupted flow.

Returns:
true if this instance is an Exception.

isExecuting

public abstract boolean isExecuting()
Returns true if this instance is executing.
An instance is executing if the instance is processing at this moment.

Returns:
true if this instance is executing.

isGrabbed

public abstract boolean isGrabbed()
Returns true if this instance is grabbed.

Returns:
true if this instance is grabbed.

getId

public abstract String getId()
Gets the instance Id. The instanceId is in the format "ProcessId/InstanceIn/ThreadIn".

Returns:
instanceId
See Also:
makeId(java.lang.String,int,int)

getInternalState

public abstract int getInternalState()
For internal use only.


getNumberOfThreads

public abstract int getNumberOfThreads()
Gets the number of threads (copies) this instance has. An instance will have more than one thread it is part of a split-join.

Returns:
Number of threads (copies) this instance has.

getParentThreadIn

public abstract int getParentThreadIn()
Gets the thread identification number of the parent thread.

Returns:
the thread identification number of the parent thread or -1 if the instance does not have parent thread.

getParticipantId

public abstract String getParticipantId()
Gets the Uid of the participant who has selected this instance.

Returns:
Uid of the participant who has selected this instance, or null if the instance is not selected.

getParticipantIn

public abstract int getParticipantIn()
Gets the identification number of the participant who has selected this instance.

Returns:
Identification number of the participant who has selected this instance, or 0 if the instance is not selected.

isPending

public abstract boolean isPending()
Returns true if this instance is pending.
An instance is pending if not all mandatory task for the activity where the instance is were executed.

Returns:
true if the process instance is pending

getPendingTaskIn

public abstract int getPendingTaskIn()
Gets the Task identification number of the pending Task that must be re-run.
This is only used when this instance is in an automatic activity.

Returns:
Task identification number of the pending Task that must be re-run

getPriority

public abstract int getPriority()
Gets the instance priority.

Returns:
ance priority, where the returned int is one of the static fields in fuego.papi.Priority.

getProcess

public abstract Process getProcess()
Deprecated. Method getProcess is deprecated. WARNING: Do not invoke this method without previously initializing the ProcessService. Use getProcessId() and then ProcessServiceNESession.getProcess(String) instead.

Gets the Process associated with this instance.

Returns:
Process associated with this instance.

getProcessDeadline

public abstract Time getProcessDeadline()
Gets the instance process deadline.

Returns:
Instance process deadline.

getProcessId

public abstract String getProcessId()
Gets the process Id of this instance.
WARNING: Do not invoke this method without previously initializating the ProcessService.

Returns:
Process Id of this instance

getReceptionTime

public abstract Time getReceptionTime()
Gets the Time when this process instance reached the current activity.

Returns:
Time when this process instance reached the current activity.

getRoleId

public abstract String getRoleId()
Gets the role identification of this instance.

Returns:
role identification of this instance

getRoleIn

public abstract int getRoleIn()
Gets the role identification number of this instance

Returns:
role identification number of this instance

isRunning

public abstract boolean isRunning()
Returns true if the process instance is running.

Returns:
true if the process instance is running. An instance is running if it is running, the activity has been completed, or if this instances is an Exception.

isSelected

public abstract boolean isSelected()
Returns true if the process instance is selected.

Returns:
true if the process instance is selected.

getStamp

public abstract InstanceStamp getStamp()
Gets the instanceStamp. The InstanceStamp contains the InstanceId and the Activity name.

Returns:
InstanceStamp

getTaskCount

public abstract int getTaskCount()
Gets the current taskIndex.

Returns:
Current taskIndex.
Throws:
InstanceOutOfSyncException - if the instance is out of sync with the engine. This could happen if you set the property 'Do not load tasks when a filter is executed'.

getTaskIn

public abstract int getTaskIn(int taskNumber)
Gets the Task identification number for the specified taskNumber.

Parameters:
taskNumber - task index.
Returns:
Task identification number for the specified taskNumber.
Throws:
InstanceOutOfSyncException - if the instance is out of sync with the engine. This could happen if you set the property 'Do not load tasks when a filter is executed'.

getTaskInternalStatus

public abstract int getTaskInternalStatus(int taskNumber)
For internal use only.

Parameters:
taskNumber -
Returns:
an int describing the current state of the process instance item
Throws:
InstanceOutOfSyncException - if the instance is out of sync with the engine. This could happen if you set the property 'Do not load tasks when a filter is executed'.

getTaskLastExecutionParticipant

public abstract String getTaskLastExecutionParticipant(int taskNumber)
Gets the UID of the last participant UID to execute the specified Task.

Parameters:
taskNumber - Task index.
Returns:
UID of the last participant UID to execute the specified Task, or null if the Task has not been executed.
Throws:
InstanceOutOfSyncException - if the instance is out of sync with the engine. This could happen if you set the property 'Do not load tasks when a filter is executed'.

getTaskLastExecutionTime

public abstract Time getTaskLastExecutionTime(int taskNumber)
Gets the last time execution of the specified Task.

Parameters:
taskNumber - Task index.
Returns:
the last time execution of the specified Task, or null if the Task has not been executed.
Throws:
InstanceOutOfSyncException - if the instance is out of sync with the engine. This could happen if you set the property 'Do not load tasks when a filter is executed'.

getTaskParticipantId

public abstract String getTaskParticipantId(int taskNumber)
Gets the UID of the participant who has selected the specified Task.

Parameters:
taskNumber - Task index.
Returns:
UID of the participant who has selected the specified Task, or null if the specified Task has not been selected.
Throws:
InstanceOutOfSyncException - if the instance is out of sync with the engine. This could happen if you set the property 'Do not load tasks when a filter is executed'.

getTaskRetryCounter

public abstract int getTaskRetryCounter(int taskNumber)
Gets the retryCounter for the specified Task.
Retry counter is the quantity of times that the task was executed and failed.

Parameters:
taskNumber - task number
Returns:
retryCounter for the passed task.
Throws:
InstanceOutOfSyncException - if the instance is out of sync with the engine. This could happen if you set the property 'Do not load tasks when a filter is executed'.

isTaskRunning

public abstract boolean isTaskRunning(int taskNumber)
Returns true if the specified Task is running.

Parameters:
taskNumber - task index.
Returns:
true true if the specified Task is running.
Throws:
InstanceOutOfSyncException - if the instance is out of sync with the engine. This could happen if you set the property 'Do not load tasks when a filter is executed'.

isTaskSelected

public abstract boolean isTaskSelected(int taskNumber)
Returns true if the specified Task has been selected.

Parameters:
taskNumber - task index.
Returns:
true if the specified task has been selected.
Throws:
InstanceOutOfSyncException - if the instance is out of sync with the engine. This could happen if you set the property 'Do not load tasks when a filter is executed'.

getTaskStatusDescription

public abstract String getTaskStatusDescription(int taskNumber,
                                                Locale locale)
Gets the Task status description for the specified taskNumber and locale.

Parameters:
taskNumber - task index.
locale - Locale to use
Returns:
Task status description for the specified taskNumber and locale.
Throws:
InstanceOutOfSyncException - if the instance is out of sync with the engine. This could happen if you set the property 'Do not load tasks when a filter is executed'.

isTaskValid

public abstract boolean isTaskValid(int taskNumber)
Returns true if the specified taskNumber is valid.

Parameters:
taskNumber - task index.
Returns:
true if the specified taskNumber is >= 0 && <= getTasks().length.
Throws:
InstanceOutOfSyncException - if the instance is out of sync with the engine. This could happen if you set the property 'Do not load tasks when a filter is executed'.

getTasks

public abstract Task[] getTasks()
Gets the Tasks associated with this process instance.

Returns:
Tasks associated with this process instance.

getVar

public abstract Object getVar(String variableId,
                              Locale locale)
Gets the localized value of the VarDefinition specified by locale and variableId.

Parameters:
variableId - VarDefinition Id.
locale - Locale to use
Returns:
Localized value of the VarDefinition specified by variableId, or fuego.lang.Void if there is no matching VarDefinition.

getVar

public abstract Object getVar(String variableId)
Gets the not localized value of the VarDefinition specified by variableId.

Parameters:
variableId - VarDefinition Id.
Returns:
Not localized value of the VarDefinition specified by variableId, or fuego.lang.Void if there is no matching VarDefinition.

hasPendingTasks

public abstract boolean hasPendingTasks()
Returns true if the process instance has mandatory Tasks that have not been run.

Returns:
true if the process instance has mandatory Tasks that have not been run.
Throws:
InstanceOutOfSyncException - if the instance is out of sync with the engine. This could happen if you set the property 'Do not load tasks when a filter is executed'.

hasRepeatableTasks

public abstract boolean hasRepeatableTasks()
Returns true if the process instance has any repeatable Tasks.

Returns:
true if the process instance has any repeatable Tasks.
Throws:
InstanceOutOfSyncException - if the instance is out of sync with the engine. This could happen if you set the property 'Do not load tasks when a filter is executed'.

isAborted

public abstract boolean isAborted()
Returns true if this process instance is aborted.

Returns:
true if the process instance is aborted

getStampForActivity

public abstract InstanceStamp getStampForActivity(String activityName)
Creates an InstanceStamp for the specified activityName.

Parameters:
activityName - activity name to use for the returned InstanceStamp.
Returns:
InstanceStamp for the specified activityName.

getStatus

public abstract int getStatus()
Gets the instance status.

Returns:
Instance status, where the returned int is one of the static fields in fuego.papi.ProcessInstanceState.
See Also:
ProcessInstanceState

getStatusDescription

public abstract String getStatusDescription(Locale locale)
Gets the instance status description for the specified locale.

Parameters:
locale - locale to use for status description.
Returns:
Instance status description for the specified locale.

isSuspended

public abstract boolean isSuspended()
Returns true if this process instance is suspended.

Returns:
true if this process instance is suspended.

getTask

public abstract Task getTask(int taskNumber)
Gets the Task corresponding to taskNumber.

Parameters:
taskNumber - Task index.
Returns:
Task corresponding to taskNumber.
See Also:
Task

getTask

public abstract Task getTask(String taskId)
Gets the Task corresponding to the specified taskId.

Parameters:
taskId - Task identification
Returns:
Task corresponding to the specified taskId.
See Also:
Task

isTaskCompleted

public abstract boolean isTaskCompleted(int taskNumber)
Returns true if the Task specified by taskNumber has been completed.

Parameters:
taskNumber - task index.
Returns:
true if the Task specified by taskNumber has been completed.
Throws:
InstanceOutOfSyncException - if the instance is out of sync with the engine. This could happen if you set the property 'Do not load tasks when a filter is executed'.

invalidateTask

public abstract void invalidateTask(int taskNumber)
Invalidates the specific task index

Parameters:
taskNumber - Task index.

makeGlobalId

public static String makeGlobalId(String organization,
                                  String processId,
                                  int instanceIn,
                                  int threadIn)
Returns a String in the format of makeId() + ORGANIZATION_SEPARATOR + organization.

Parameters:
organization - organization name.
processId - process identification.
instanceIn - instance identification number.
threadIn - thread identification number.
Returns:
String in the format of makeId() + ORGANIZATION_SEPARATOR + organization.
See Also:
makeId(java.lang.String,int,int)

makeId

public static String makeId(String processId,
                            int instanceIn,
                            int threadIn)
Returns a String in the format processId + NAME_SEPARATOR + instanceIn + NAME_SEPARATOR + threadIn.

Parameters:
processId - process identification.
instanceIn - instance identification number.
threadIn - thread identification number.
Returns:
String in the format processId + NAME_SEPARATOR + instanceIn + NAME_SEPARATOR + threadIn.
See Also:
InstanceId.makeId(String, int, int)

getStamp

public static InstanceStamp getStamp(String instanceId,
                                     String activityName)
Creates an InstanceStamp for the specified instanceId and activityName.

Parameters:
instanceId - instance Id to use for the returned InstanceStamp.
activityName - activity name to use for the returned InstanceStamp.
Returns:
InstanceStamp for the specified instanceId and activityName.

getStamp

public static InstanceStamp getStamp(String stampId)
Creates an InstanceStamp from the specified stampId.

Parameters:
stampId - Id to use to create the InstanceStamp.
Returns:
InstanceStamp from the specified stampId.

getCreationTime

public Time getCreationTime()
Gets the instance creation time.

Returns:
instance creation time.

isSelectedBy

public final boolean isSelectedBy(String participantId)
Returns true if this instance is selected by the Participant specified by participantId.

Parameters:
participantId - Uid of Participant to check.
Returns:
true if this instance is selected by the Participant specified by participantId.

toString

public String toString()
Returns a String containing the process identification number, the instance identification number, and the thread identification number.

Overrides:
toString in class InstanceId
Returns:
String containing the process identification number, the instance identification number, and the thread identification number.

ALBPM Process API (PAPI)

© Copyright 1996/2005 Fuego Inc. All Rights Reserved