ALBPM Process API

fuego.papi
Class InstanceInfo

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

public abstract class InstanceInfo
extends InstanceId
implements Serializable

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()
          Return the activity for this instance
abstract  Time getActivityDeadline()
          Returns the deadline to complete the current activity
abstract  String getActivityId()
          Returns the activity identification of this instance
abstract  String getActivityName()
          Returns the activity name of this instance
abstract  int getAuthor()
          Return the instance creator.
abstract  String getAuthorId()
          Return the instance author id.
 Time getCreationTime()
          Instance creation time.
abstract  Time getDeadline()
          Returns the deadline for this instance in its current activity
abstract  String getDescription()
          Returns the instance description
abstract  String getId()
          Return the instance identification.
abstract  InstanceActivityPair getInstanceActivityPair()
          Deprecated. Do not use this method.
abstract  int getInternalState()
           
 long getKey()
           
static long getKey(String instanceId)
           
abstract  int getNumberOfThreads()
          Returns the number of threads (copies) this instance has.
abstract  int getParentThreadIn()
          Returns the parent instance thread identification number
abstract  String getParticipantId()
          Returns the participant selecting this instance.
abstract  int getParticipantIn()
          Returns the participant identification number of this instance
abstract  int getPendingTaskIn()
          Gets the pending task number of the task that must be re-run.
abstract  int getPriority()
          Returns the instance's priority
abstract  Process getProcess()
          Deprecated. use ProcessServiceSession.processGet(String)
or ProcessServiceSession.processGet(int) instead
abstract  Time getProcessDeadline()
          Returns the instance process deadline.
abstract  String getProcessId()
          Rerturns the process Id of this instance.
abstract  Time getReceptionTime()
          Time when this process instance reached the current activity
abstract  String getRoleId()
          Returns the role identification of this instance
abstract  int getRoleIn()
          Returns the role identification number of this instance
abstract  InstanceStamp getStamp()
          Deprecated. Do not use this method. Use getInstanceActivityPair() instead.
static InstanceStamp getStamp(String stampId)
          Deprecated. Use InstanceActivityPair.valueOf(String) instead.
static InstanceStamp getStamp(String instanceId, String activityName)
          Deprecated. Use InstanceActivityPair.valueOf(String, String) instead.
abstract  InstanceStamp getStampForActivity(String activityName)
          Deprecated. Use getInstanceActivityPair() instead.
abstract  int getStatus()
          Returns the instance status
abstract  String getStatusDescription(Locale locale)
          Returns the instance status desciption
abstract  Task getTask(int taskNumber)
          Returns the metadata task for the specific task index
abstract  Task getTask(String taskId)
          Returns the metadata task for the specific task id
abstract  int getTaskCount()
          This method returns the current task
abstract  int getTaskIn(int taskNumber)
          Returns the task identification number for the task number.
abstract  int getTaskInternalStatus(int taskNumber)
           
abstract  String getTaskLastExecutionParticipant(int taskNumber)
          Return the last participant UID that execute the specific task.
abstract  Time getTaskLastExecutionTime(int taskNumber)
          Return the last time execution of the specific task.
abstract  String getTaskParticipantId(int taskNumber)
          Rerturns the participant selecting the task.
abstract  int getTaskRetryCounter(int taskNumber)
          Returns the retryCounter for the passed task
abstract  Task[] getTasks()
          Returns the metadata task for the task in this instace
abstract  String getTaskStatusDescription(int taskNumber, Locale locale)
          Returns the task status desciption
abstract  Object getVar(String variableId)
          Deprecated. use getVariable(String) instead
abstract  Object getVar(String variableId, Locale locale)
          Deprecated. use getVariable(String, java.util.Locale) instead
abstract  Object getVariable(String variableId)
          Returns the value of any variable by id.
abstract  Object getVariable(String variableId, Locale locale)
          Returns the value of any variable by id for a given locale.
abstract  boolean hasPendingTasks()
          This methods returns true if the process instance has mandatory items that still need to be runned.
abstract  boolean hasRepeatableTasks()
          This methods returns true if the process instance has any repeatable item.
abstract  void invalidateTask(int taskNumber)
          This method invalidates the specific task index
abstract  boolean isAborted()
          Returns whether or not the process instance is aborted
abstract  boolean isActivityCompleted()
          Returns whether or not the process instance has the activity completed
abstract  boolean isCompleted()
          Returns whether or not the process instance is completed
abstract  boolean isException()
          Returns whether or not the process instance is an exception
abstract  boolean isExecuting()
          Returns if this instance is executing or not.
abstract  boolean isGrabbed()
          Returns whether or not the process instance is grabbed
abstract  boolean isPending()
          Returns whether or not the process instance is pending
abstract  boolean isRunning()
          Returns whether or not the process instance is running
abstract  boolean isSelected()
          Returns if this instance is selected or not.
 boolean isSelectedBy(String participantId)
          Package method
abstract  boolean isSuspended()
          Returns whether or not the process instance is suspended
abstract  boolean isTaskCompleted(int taskNumber)
          Returns whether or not this process instance item is already completed
abstract  boolean isTaskRunning(int taskNumber)
          Returns whether or not the process instance item is being executed
abstract  boolean isTaskSelected(int taskNumber)
          Returns whether or not this process instance item is currently selected Note: Repeatable items can be selected even if they have already been completed
abstract  boolean isTaskValid(int taskNumber)
          Returns if the specific task index is valid or not in this instance
static String makeGlobalId(String organization, String processId, int instanceIn, int threadIn)
          Builds the id in the way instanceId+ORGANIZATION_SEPARATOR+organization.
If it is needed to build an instanceId, use makeId() instead.
To get the Organization use getOrganization, to obtain the instanceId alone use getInstanceId.
static String makeId(String processId, int instanceIn, int threadIn)
          Build the instance id based on the different values.
instanceId = "PrcessId/InstanceIn/ThreadIn"
static long makeKey(int instanceIn, int threadIn)
           
 String toString()
          Returns a string representation of the object.
 
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()
Return the activity for this instance

Returns:
Activity
See Also:
Activity

isActivityCompleted

public abstract boolean isActivityCompleted()
Returns whether or not the process instance has the activity completed

Returns:
true if the process instance has the activity completed

getActivityDeadline

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

Returns:
a Time object representing the deadline to complete the current activity

getActivityId

public abstract String getActivityId()
Returns the activity identification of this instance


getActivityName

public abstract String getActivityName()
Returns the activity name of this instance


getAuthor

public abstract int getAuthor()
Return the instance creator. -1 means no Participant 0 means automatic/engine participant

Returns:
participant identification

getAuthorId

public abstract String getAuthorId()
Return the instance author id. null means no Participant "ENGINE" means automatic/engine participant


isCompleted

public abstract boolean isCompleted()
Returns whether or not the process instance is completed

Returns:
true if the process instance is completed

getDeadline

public abstract Time getDeadline()
Returns the deadline for this instance in its current activity

Returns:
deadline for instance in current activity

getDescription

public abstract String getDescription()
Returns the instance description


isException

public abstract boolean isException()
Returns whether or not the process instance is an exception

Returns:
true if the process instance is an exception

isExecuting

public abstract boolean isExecuting()
Returns if this instance is executing or not.


isGrabbed

public abstract boolean isGrabbed()
Returns whether or not the process instance is grabbed

Returns:
true if the process instance is grabbed

getId

public abstract String getId()
Return the instance identification. instanceId = "PrcessId/I nstanceIn/ThreadIn"

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

getInternalState

public abstract int getInternalState()

getNumberOfThreads

public abstract int getNumberOfThreads()
Returns the number of threads (copies) this instance has.


getParentThreadIn

public abstract int getParentThreadIn()
Returns the parent instance thread identification number


getParticipantId

public abstract String getParticipantId()
Returns the participant selecting this instance.

Returns:
Participant UID or null if not selected.

getParticipantIn

public abstract int getParticipantIn()
Returns the participant identification number of this instance

Returns:
Return the participant in or 0 if the instance is not selected.

isPending

public abstract boolean isPending()
Returns whether or not the process instance is pending

Returns:
true if the process instance is pending

getPendingTaskIn

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


getPriority

public abstract int getPriority()
Returns the instance's priority


getProcess

@Deprecated
public abstract Process getProcess()
Deprecated. use ProcessServiceSession.processGet(String)
or ProcessServiceSession.processGet(int) instead

Returns the process of this instance.
WARNING: Do not invoke this method without previously initializate the ProcessService.


getProcessDeadline

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

Returns:
time process deadline.

getProcessId

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


getReceptionTime

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

Returns:
time when this process instance reached the current activity

getRoleId

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


getRoleIn

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


isRunning

public abstract boolean isRunning()
Returns whether or not the process instance is running

Returns:
true if the process instance is running||activity_completed||exception

isSelected

public abstract boolean isSelected()
Returns if this instance is selected or not.


getStamp

@Deprecated
public abstract InstanceStamp getStamp()
Deprecated. Do not use this method. Use getInstanceActivityPair() instead.

This method creates and returns an object (InstanceStamp) which is needed in order to perform any operation with this instance. This stamp will carry the instance information, and the activity where this instance is suposed to be. This method set the stamp with with the instanceInfo current activity.

Returns:
InstanceStamp The stamp containing just the info needed by the engine.

getInstanceActivityPair

public abstract InstanceActivityPair getInstanceActivityPair()
Deprecated. Do not use this method.

This method creates and returns an InstanceActivityPair which is needed in order to perform any operation with this instance. This object will carry the instance information, and the activity where this instance is suposed to be.

Returns:
InstanceActivityPair The object containing the info needed by the engine to perform an execution over this instance.

getTaskCount

public abstract int getTaskCount()
This method returns the current task


getTaskIn

public abstract int getTaskIn(int taskNumber)
Returns the task identification number for the task number.

Parameters:
taskNumber - Task Number to obtein the Task Identification Number.
Returns:
Task Identification Number

getTaskInternalStatus

public abstract int getTaskInternalStatus(int taskNumber)

getTaskLastExecutionParticipant

public abstract String getTaskLastExecutionParticipant(int taskNumber)
Return the last participant UID that execute the specific task.

Parameters:
taskNumber - Task Number to obtein the participant Id
Returns:
Participant UID or null if not executed

getTaskLastExecutionTime

public abstract Time getTaskLastExecutionTime(int taskNumber)
Return the last time execution of the specific task.

Parameters:
taskNumber - Task Number to obtein the Time
Returns:
Time or null if not executed

getTaskParticipantId

public abstract String getTaskParticipantId(int taskNumber)
Rerturns the participant selecting the task.

Parameters:
taskNumber - Task Number to obtein the participant Id
Returns:
Participant UID or null if not selected

getTaskRetryCounter

public abstract int getTaskRetryCounter(int taskNumber)
Returns the retryCounter for the passed task


isTaskRunning

public abstract boolean isTaskRunning(int taskNumber)
Returns whether or not the process instance item is being executed

Parameters:
taskNumber -
Returns:
true if the process instance item is being executed

isTaskSelected

public abstract boolean isTaskSelected(int taskNumber)
Returns whether or not this process instance item is currently selected Note: Repeatable items can be selected even if they have already been completed

Parameters:
taskNumber -
Returns:
true if this process instance item is currently selected

getTaskStatusDescription

public abstract String getTaskStatusDescription(int taskNumber,
                                                Locale locale)
Returns the task status desciption

Parameters:
taskNumber - The task number.
locale - The locale for the description of the status.
Returns:
String The localized status. description.

isTaskValid

public abstract boolean isTaskValid(int taskNumber)
Returns if the specific task index is valid or not in this instance


getTasks

public abstract Task[] getTasks()
Returns the metadata task for the task in this instace

Returns:
Task array
See Also:
Task

getVar

@Deprecated
public abstract Object getVar(String variableId,
                                         Locale locale)
Deprecated. use getVariable(String, java.util.Locale) instead

Returns the value of any variable by id for a given locale. Remember that the type of the variable is specified in the VarDefinition object, which can be obtained from the DirectoryServiceSession or the Process.

Parameters:
variableId - The id of the variable whose value is required.
locale - The locale to use for those variables which can be localized. List of localizable variables: @see VarDefinition#ACTIVITY_ID
Returns:
Object The LOCALIZED value of the variable identificated by the id argument. If the variable was not found (because it does not exists in the process) a fuego.lang.Void object will be returned.

getVariable

public abstract Object getVariable(String variableId,
                                   Locale locale)
Returns the value of any variable by id for a given locale. Remember that the type of the variable is specified in the VarDefinition object, which can be obtained from the DirectoryServiceSession or the Process.

Parameters:
variableId - The id of the variable whose value is required.
locale - The locale to use for those variables which can be localized. List of localizable variables: @see VarDefinition#ACTIVITY_ID
Returns:
Object The LOCALIZED value of the variable identificated by the id argument. If the variable was not found (because it does not exists in the process) a fuego.lang.Void object will be returned.

getVar

@Deprecated
public abstract Object getVar(String variableId)
Deprecated. use getVariable(String) instead

Returns the value of any variable by id. Remember that the type of the variable is specified in the VarDefinition object, which can be obtained from the DirectoryServiceSession or the Process. IMPORTANT: Some variables, such as @see VarDefinition#ACTIVITY_ID, can be localized, but through this method you will get always it default value. In order to get them localized, use this method @see InstanceInfo#getVar(String, Locale)

Parameters:
variableId - The id of the variable whose value is required
Returns:
Object The NOT LOCALIZED value of the variable identificated by the id argument. If the variable was not found (because it does not exists in the process) a fuego.lang.Void object will be returned.

getVariable

public abstract Object getVariable(String variableId)
Returns the value of any variable by id. Remember that the type of the variable is specified in the VarDefinition object, which can be obtained from the DirectoryServiceSession or the Process. IMPORTANT: Some variables, such as @see VarDefinition#ACTIVITY_ID, can be localized, but through this method you will get always it default value. In order to get them localized, use this method @see InstanceInfo#getVar(String, Locale)

Parameters:
variableId - The id of the variable whose value is required
Returns:
Object The NOT LOCALIZED value of the variable identificated by the id argument. If the variable was not found (because it does not exists in the process) a fuego.lang.Void object will be returned.

hasPendingTasks

public abstract boolean hasPendingTasks()
This methods returns true if the process instance has mandatory items that still need to be runned.

Returns:
True if there is any pending task in this instance.

hasRepeatableTasks

public abstract boolean hasRepeatableTasks()
This methods returns true if the process instance has any repeatable item.

Returns:
boolean True if there is any repeatable item in this instance.

isAborted

public abstract boolean isAborted()
Returns whether or not the process instance is aborted

Returns:
true if the process instance is aborted

getStampForActivity

@Deprecated
public abstract InstanceStamp getStampForActivity(String activityName)
Deprecated. Use getInstanceActivityPair() instead.

This method creates and returns an object (InstanceStamp) which is needed in order to perform any operation with this instance. This stamp will carry the instance information, and the activity where this instance is suposed to be.

Parameters:
activityName - The name of the activity where this instance is suposed to be.
Returns:
InstanceStamp The stamp containing just the info needed by the engine.

getStatus

public abstract int getStatus()
Returns the instance status

Returns:
instance's status as defined by fuego.papi.ProcessInstanceState.
See Also:
ProcessInstanceState

getStatusDescription

public abstract String getStatusDescription(Locale locale)
Returns the instance status desciption

Parameters:
locale - The locale for the description of the status.
Returns:
String The localized status. description.

isSuspended

public abstract boolean isSuspended()
Returns whether or not the process instance is suspended

Returns:
true if the process instance is suspended

getTask

public abstract Task getTask(int taskNumber)
Returns the metadata task for the specific task index

Parameters:
taskNumber - Task index for obtein the metadata.
Returns:
Task
See Also:
Task

getTask

public abstract Task getTask(String taskId)
Returns the metadata task for the specific task id

Parameters:
taskId - Task identification
Returns:
Task
See Also:
Task

isTaskCompleted

public abstract boolean isTaskCompleted(int taskNumber)
Returns whether or not this process instance item is already completed

Parameters:
taskNumber -
Returns:
true if the process instance item is already completed

invalidateTask

public abstract void invalidateTask(int taskNumber)
This method invalidates the specific task index

Parameters:
taskNumber - Task index in the task array

makeGlobalId

public static String makeGlobalId(String organization,
                                  String processId,
                                  int instanceIn,
                                  int threadIn)
Builds the id in the way instanceId+ORGANIZATION_SEPARATOR+organization.
If it is needed to build an instanceId, use makeId() instead.
To get the Organization use getOrganization, to obtain the instanceId alone use getInstanceId.

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

makeId

public static String makeId(String processId,
                            int instanceIn,
                            int threadIn)
Build the instance id based on the different values.
instanceId = "PrcessId/InstanceIn/ThreadIn"

Parameters:
processId -
instanceIn -
threadIn -
Returns:
instanceId
See Also:
getId()

getStamp

@Deprecated
public static InstanceStamp getStamp(String instanceId,
                                                String activityName)
Deprecated. Use InstanceActivityPair.valueOf(String, String) instead.

This method creates and returns an object (InstanceStamp) which is needed in order to perform any operation with this instance. This stamp will carry the instance information, and the activity where this instance is suposed to be.

Parameters:
instanceId - The is of the instance that will be inside the stamp.
activityName - The name of the activity where this instance is suposed to be.
Returns:
InstanceStamp The stamp containing just the info needed by the engine.

getStamp

@Deprecated
public static InstanceStamp getStamp(String stampId)
Deprecated. Use InstanceActivityPair.valueOf(String) instead.

This method creates and returns an object (InstanceStamp) which is needed in order to perform any operation with this instance. This stamp will carry the instance information, and the activity where this instance is suposed to be.

Parameters:
stampId - The identificator of the stamp (instanceId/activityName).
Returns:
InstanceStamp The stamp containing just the info needed by the engine.

getKey

public static long getKey(String instanceId)

makeKey

public static long makeKey(int instanceIn,
                           int threadIn)

getCreationTime

public Time getCreationTime()
Instance creation time.

Returns:
creation time

isSelectedBy

public final boolean isSelectedBy(String participantId)
Package method


getKey

public long getKey()

toString

public String toString()
Description copied from class: InstanceId
Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read.

Overrides:
toString in class InstanceId

ALBPM Process API

© Copyright 1996/2005 Fuego Inc. All Rights Reserved