Fuego Process API

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

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  fuego.lang.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.
 fuego.lang.Time getCreationTime()
          Instance creation time.
abstract  fuego.lang.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  int getInternalState()
           
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. WARNING: Do not invoke this method without previously initializate the ProcessService.
abstract  fuego.lang.Time getProcessDeadline()
          Returns the instance process deadline.
abstract  String getProcessId()
          Rerturns the process Id of this instance.
abstract  fuego.lang.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()
          This method creates and returns an object (InstanceStamp) which is needed in order to perform any operation with this instance.
static InstanceStamp getStamp(String stampId)
          This method creates and returns an object (InstanceStamp) which is needed in order to perform any operation with this instance.
static InstanceStamp getStamp(String instanceId, String activityName)
          This method creates and returns an object (InstanceStamp) which is needed in order to perform any operation with this instance.
abstract  InstanceStamp getStampForActivity(String activityName)
          This method creates and returns an object (InstanceStamp) which is needed in order to perform any operation with this instance.
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  fuego.lang.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)
          Returns the value of any variable by id.
abstract  Object getVar(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"
 String toString()
          Gets the String representation of the instance
 
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

makeGlobalId


public static final 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 final 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()

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 fuego.lang.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

Returns:

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 fuego.lang.Time getDeadline()
Returns the deadline for this instance in its current activity

Returns:
deadline for instance in current activity

getCreationTime


public fuego.lang.Time getCreationTime()
Instance creation time.

Returns:
creation time

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

Returns:

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

Returns:

getProcess


public abstract Process getProcess()
Deprecated. WARNING: Do not invoke this method without previously initializate the ProcessService.

Returns the process of this instance.


getProcessDeadline


public abstract fuego.lang.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 fuego.lang.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

Returns:

getRoleIn


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

Returns:

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.

Returns:

getStamp


public abstract InstanceStamp getStamp()
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 actual activity.

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

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 fuego.lang.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


public abstract Object getVar(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


public abstract Object getVar(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.

getStamp


public static InstanceStamp getStamp(String instanceId,
                                     String activityName)
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


public static InstanceStamp getStamp(String stampId)
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.

isAborted


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

Returns:
true if the process instance is aborted

getStampForActivity


public abstract InstanceStamp getStampForActivity(String activityName)
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.Status.
See Also:
Status

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

isSelectedBy


public final boolean isSelectedBy(String participantId)
Package method


toString


public String toString()
Description copied from class: InstanceId
Gets the String representation of the instance

Overrides:
toString in class InstanceId

Fuego Process API

© Copyright 1996/2003 Fuego Inc. All Rights Reserved