wt.workflow.work
Class WfAssignedActivity

java.lang.Object
  extended bywt.fc.WTObject
      extended bywt.enterprise.Simple
          extended bywt.workflow.engine.WfExecutionObject
              extended bywt.workflow.engine.WfActivity
                  extended bywt.workflow.work.WfAssignedActivity
All Implemented Interfaces:
AccessControlled, BusinessInformation, DisplayIdentification, DomainAdministered, Externalizable, NetFactor, Notifiable, ObjectMappable, Persistable, RecentlyVisited, Serializable, WfNode, WTContained
Direct Known Subclasses:
ProjectActivity, WfAdHocActivity

public class WfAssignedActivity
extends WfActivity
implements Externalizable

A WfActivity> represent work that can be assigned to resources. WfActivity implements a variety of collaboration patterns, including:

Use the newWfAssignedActivity static factory method(s), not the WfAssignedActivity constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private static char END_VARIABLE
           
private static char ESCAPE_CHARACTER
           
static long EXTERNALIZATION_VERSION_UID
           
private  String instructions
           
static String INSTRUCTIONS
          Label for the attribute; Holds instructions to the participant of how to perform task.
private static int INSTRUCTIONS_UPPER_LIMIT
           
static String INSTRUCTIONS_VARIABLE_NAME
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private static String SERVICE_NAME
           
private static char START_VARIABLE
           
private static boolean VERBOSE
           
 
Fields inherited from class wt.workflow.engine.WfActivity
INPUT_VARIABLE_MAP, OUTPUT_VARIABLE_MAP, ROUTER_TYPE, TRIP_COUNT, USER_EVENT_LIST
 
Fields inherited from class wt.workflow.engine.WfExecutionObject
AD_SQEN, ALERT_TIME, CHANGE_STATE_TIME, CONTAINER, CONTEXT, D_SQEN, DEADLINE, DEADLINE_DURATION, DESCRIPTION, END_TIME, EVENT_CONFIGURATION, EXCEPTION_MESSAGE, KEY, NAME, PD_SQEN, PRIORITY, START_TIME, STATE, SUSPEND_TIME, TEMPLATE, TIME_PAST_DEADLINE, TIME_TO_DEADLINE, TIME_TO_START
 
Fields inherited from class wt.enterprise.Simple
 
Fields inherited from class wt.fc.WTObject
CREATE_TIMESTAMP, MODIFY_TIMESTAMP
 
Fields inherited from interface wt.workflow.engine.WfNode
PARENT_PROCESS_REF
 
Fields inherited from interface wt.inf.container.WTContained
CONTAINER_ID, CONTAINER_NAME, CONTAINER_REFERENCE
 
Fields inherited from interface wt.fc.Persistable
IDENTITY, PERSIST_INFO, TYPE
 
Fields inherited from interface wt.admin.DomainAdministered
DOMAIN_REF, INHERITED_DOMAIN
 
Fields inherited from interface wt.fc.BusinessInformation
BUSINESS_TYPE, IDENTITY
 
Fields inherited from interface wt.notify.Notifiable
EVENT_SET
 
Fields inherited from interface wt.identity.DisplayIdentification
DISPLAY_IDENTIFIER, DISPLAY_IDENTITY, DISPLAY_TYPE
 
Constructor Summary
WfAssignedActivity()
           
 
Method Summary
 void acceptAssignment(WorkItem workItem, WTUser user)
          Mark the assignment accepted and remove other work items associated with the assignment.
private  void addElementNoDup(Vector v, Object obj)
           
private  void addElementsNoDup(Vector v, Enumeration e)
           
private  void addElementsNoDup(Vector v1, Vector v2)
           
private  void addPrincipal(Vector v, WTPrincipalReference pRef)
           
private  void addPrincipals(Vector v, Enumeration e)
           
private  void cleanUpFromLastTrip()
           
protected  WfAssignment createWfAssignment(WfAssignee assignee)
          Returns a persistented assignment object given the assignee.
protected  void createWorkAssignment()
          

Supported API: false
 void deleteActivity()
          Delete myself.
 void doAbortTransition()
          Performs specific tasks associated with the ABORT transition.This transition removes worklist entries.
 void doCompleteTransition()
          Performs specific tasks associated with the COMPLETE transition.
 void doResetTransition()
          

Supported API: false
 void doSkipTransition()
          Performs specific tasks associated with the SKIP transition.
 void doStartTransition()
          Performs specific tasks associated with the START transition.
 void doTerminateTransition()
          Performs specific tasks associated with the TERMINATE transition.
 boolean equals(Object obj)
          Indicates whether the given object is equal to this object from a persistence perspective, by comparing the two objects ObjectIdentifiers.
protected  void finalizeAssignments()
          Call finalize on current assignments.
 Enumeration getAllAssignments()
           
protected  Vector getAllBallots()
           
 Vector getAllEvents()
          

Supported API: false
 Enumeration getAssignments()
           
 Enumeration getAssignments(int tripNbr)
           
 String getConceptualClassname()
          Deprecated.  
 Enumeration getDefaultParticipants()
          Returns default activity participants.
 String getInstructions()
          Gets the value of the attribute: INSTRUCTIONS.
private  Team getLocalTeam(WfAssignedActivityTemplate aat)
           
private  String getMailToLink(WTUser user)
           
private  String getStringRepresentation(Object value)
           
private  String getValue(ProcessData vars, String var_name)
           
 int hashCode()
          Returns a hash code for this object based upon its ObjectIdentifier.
private  void instructionsValidate(String a_Instructions)
           
 boolean isComplete()
          

Supported API: false
static WfAssignedActivity newWfAssignedActivity(WfContainer container)
          

Supported API: false
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
 void readExternal(PersistentRetrieveIfc input)
          Used by Persistent Data Service to populate the persistent attributes of this class from a persistent store.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
 void readValues()
          Overwrites WfActivity.readValues so it can update instructions attribute after values are read.
protected  boolean readVersion(WfAssignedActivity thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void recreateWorkAssignment()
          

Supported API: false
 String replaceVariables(String txt, ProcessData variables)
           
private  WTPrincipalReference resolveActorRole(WfProcess myParent, ActorRole aRole)
           
private  Vector resolveAssignee(WfAssignee assignee, WfAssignedActivityTemplate template)
           
private  Vector resolveAssignees(WfAssignedActivityTemplate t)
           
 Vector resolveAssigneesToPRefs()
           
private  Vector resolveFromVariable(String var_name, WfAssignedActivityTemplate template, WfProcess myParent, Team localTeam, Vector pv)
           
private  Enumeration resolveGroup(WTGroup wg)
           
private  Enumeration resolveRole(WfAssignedActivityTemplate t, WfProcess myParent, Team localTeam, Role aRole)
           
 void restartActivity()
          This method's intended usage is to cleanup workitems and ballots after a failed expression evaluation.
 void setInstructions(String a_Instructions)
          Sets the value of the attribute: INSTRUCTIONS.
 boolean tally(WfAssignedActivity self, WfTallyType policy, String operator, int value, String event)
          This is the tally method that is called from the Custom Routing Event/...Event Firing Expression.
protected  boolean tallyByActivity(WfTallyType tType, String operator, int value, String event)
           
protected  boolean tallyByAssignment(WfTallyType tType, String operator, int value, String event)
           
 String toString()
          Retruns a string representation of the execution object.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 void writeExternal(PersistentStoreIfc output)
          Used by Persistent Data Service to obtain the values of the persistent attributes of this class, so they can be written to a persistent store.
 
Methods inherited from class wt.workflow.engine.WfActivity
changeState, changeState, changeState, checkSuspendedProcess, complete, computeDeadline, computeDeadline, computeTimeToStart, doDisableTransition, doEnableTransition, doResumeTransition, doSuspendTransition, doWork, evaluateRouterExpression, getInputVariableMap, getOutputVariableMap, getParentProcess, getParentProcessReadOnly, getParentProcessRef, getRouterEvent, getRouterType, getTemplateReference, getTripCount, getUserEventList, getWfException, hasRouterExpression, initialize, propagateEvent, readVersion, registerEvent, setInputVariableMap, setOutputVariableMap, setParentProcessRef, setRouterType, setTripCount, setUserEventList, updateWfAssigneeNotification, updateWfDueDate, updateWfDuration, writeValues
 
Methods inherited from class wt.workflow.engine.WfExecutionObject
calculateTimePastDeadline, calculateTimeToDeadline, changeDeadline, changeStateAttributes, computeTimePastDeadline, computeTimeToDeadline, evaluateExpression, getAdSQEN, getAlertTime, getChangeStateTime, getContainer, getContainerName, getContainerReference, getContext, getDeadline, getDeadlineDuration, getDescription, getDSQEN, getEndTime, getEventConfiguration, getIdentity, getKey, getName, getPdSQEN, getPriority, getStartTime, getState, getSuspendTime, getTemplate, getTimePastDeadline, getTimeToDeadline, getTimeToStart, getVarDueDate, getVarDuration, getVarNotification, initialize, initialize, isOverdue, readVersion, removeDeadlineQueueEntries, resetValues, setAdSQEN, setAlertTime, setChangeStateTime, setContainer, setContainerReference, setContext, setDeadline, setDeadlineDuration, setDescription, setDSQEN, setEndTime, setEventConfiguration, setKey, setName, setPdSQEN, setPriority, setStartTime, setState, setSuspendTime, setTemplate, setTimePastDeadline, setTimeToDeadline, setTimeToStart, validTransitions
 
Methods inherited from class wt.enterprise.Simple
getBusinessType, getDomainRef, getEventSet, isInheritedDomain, readVersion, setDomainRef, setEventSet, setInheritedDomain
 
Methods inherited from class wt.fc.WTObject
checkAttributes, duplicate, finalize, getClassInfo, getCreateTimestamp, getDisplayIdentifier, getDisplayIdentity, getDisplayType, getModifyTimestamp, getPersistInfo, getType, readVersion, setPersistInfo
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface wt.fc.Persistable
checkAttributes, getPersistInfo, getType, setPersistInfo
 
Methods inherited from interface wt.fc.NetFactor
getClassInfo
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

INSTRUCTIONS

public static final String INSTRUCTIONS
Label for the attribute; Holds instructions to the participant of how to perform task. The actual instructions are generated through variable substitution in every place a variable name occurs within curly brackets ('{' and '}'). Also HTML formatting is also allowed.

Supported API: false

See Also:
Constant Field Values

INSTRUCTIONS_UPPER_LIMIT

private static int INSTRUCTIONS_UPPER_LIMIT

instructions

private String instructions

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

INSTRUCTIONS_VARIABLE_NAME

public static final String INSTRUCTIONS_VARIABLE_NAME
See Also:
Constant Field Values

START_VARIABLE

private static final char START_VARIABLE

END_VARIABLE

private static final char END_VARIABLE

ESCAPE_CHARACTER

private static final char ESCAPE_CHARACTER
See Also:
Constant Field Values

VERBOSE

private static final boolean VERBOSE

SERVICE_NAME

private static final String SERVICE_NAME
See Also:
Constant Field Values
Constructor Detail

WfAssignedActivity

public WfAssignedActivity()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class WfActivity
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class WfActivity
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(WfAssignedActivity thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(PersistentStoreIfc output)
                   throws SQLException,
                          DatastoreException
Used by Persistent Data Service to obtain the values of the persistent attributes of this class, so they can be written to a persistent store.

(Not intended for general use.)

Supported API: false

Specified by:
writeExternal in interface ObjectMappable
Overrides:
writeExternal in class WfActivity
Parameters:
output -
Throws:
SQLException
DatastoreException

readExternal

public void readExternal(PersistentRetrieveIfc input)
                  throws SQLException,
                         DatastoreException
Used by Persistent Data Service to populate the persistent attributes of this class from a persistent store.

(Not intended for general use.)

Supported API: false

Specified by:
readExternal in interface ObjectMappable
Overrides:
readExternal in class WfActivity
Parameters:
input -
Throws:
SQLException
DatastoreException

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Returns:
String

getInstructions

public String getInstructions()
Gets the value of the attribute: INSTRUCTIONS. Holds instructions to the participant of how to perform task. The actual instructions are generated through variable substitution in every place a variable name occurs within curly brackets ('{' and '}'). Also HTML formatting is also allowed.

Supported API: false

Returns:
String

setInstructions

public void setInstructions(String a_Instructions)
                     throws WTPropertyVetoException
Sets the value of the attribute: INSTRUCTIONS. Holds instructions to the participant of how to perform task. The actual instructions are generated through variable substitution in every place a variable name occurs within curly brackets ('{' and '}'). Also HTML formatting is also allowed.

Supported API: false

Parameters:
a_Instructions -
Throws:
WTPropertyVetoException

instructionsValidate

private void instructionsValidate(String a_Instructions)
                           throws WTPropertyVetoException
Parameters:
a_Instructions -
Throws:
WTPropertyVetoException

newWfAssignedActivity

public static WfAssignedActivity newWfAssignedActivity(WfContainer container)
                                                throws WTException


Supported API: false

Parameters:
container -
Returns:
WfAssignedActivity
Throws:
WTException

toString

public String toString()
Retruns a string representation of the execution object. Used mostly for debugging purposes: not appropriate for GUI use.

Supported API: false

Overrides:
toString in class WfActivity
Returns:
String

doStartTransition

public void doStartTransition()
                       throws WTException
Performs specific tasks associated with the START transition. For WfAssignedActivity , this includes role resolution and the creation of work items

Supported API: false

Overrides:
doStartTransition in class WfActivity
Throws:
WTException

doCompleteTransition

public void doCompleteTransition()
                          throws WTException
Performs specific tasks associated with the COMPLETE transition. It is called before the values are written to the containing process. This step removes uncompleted worklist entries.

Supported API: false

Overrides:
doCompleteTransition in class WfActivity
Throws:
WTException

doTerminateTransition

public void doTerminateTransition()
                           throws WTException
Performs specific tasks associated with the TERMINATE transition. This transition removes worklist entries.

Supported API: false

Overrides:
doTerminateTransition in class WfActivity
Throws:
WTException

doAbortTransition

public void doAbortTransition()
                       throws WTException
Performs specific tasks associated with the ABORT transition.This transition removes worklist entries.

Supported API: false

Overrides:
doAbortTransition in class WfActivity
Throws:
WTException

doResetTransition

public void doResetTransition()
                       throws WTException


Supported API: false

Overrides:
doResetTransition in class WfActivity
Throws:
WTException

createWorkAssignment

protected void createWorkAssignment()
                             throws WfException


Supported API: false

Throws:
WfException

acceptAssignment

public void acceptAssignment(WorkItem workItem,
                             WTUser user)
                      throws WTException
Mark the assignment accepted and remove other work items associated with the assignment.

Supported API: false

Parameters:
workItem -
user -
Throws:
WTException

finalizeAssignments

protected void finalizeAssignments()
                            throws WTException
Call finalize on current assignments.

Supported API: false

Throws:
WTException

tally

public boolean tally(WfAssignedActivity self,
                     WfTallyType policy,
                     String operator,
                     int value,
                     String event)
              throws WfException
This is the tally method that is called from the Custom Routing Event/...Event Firing Expression.

Supported API: false

Parameters:
self -
policy -
operator -
value -
event -
Returns:
boolean
Throws:
WfException

isComplete

public boolean isComplete()
                   throws WfException


Supported API: false

Returns:
boolean
Throws:
WfException

getAllEvents

public Vector getAllEvents()
                    throws WfException


Supported API: false

Returns:
Vector
Throws:
WfException

restartActivity

public void restartActivity()
                     throws WTException
This method's intended usage is to cleanup workitems and ballots after a failed expression evaluation. The workitems are removed but the ballots are archived; and we start a new trip through the activity - just as we would if on a loopback link. Please note that the use of the Trasition method calls is a misnomer. We are not changing state - we're still RUNNING. These two methods quite simply perform the tasks we need done; so, we reuse them.

Supported API: false

Throws:
WTException

readValues

public void readValues()
                throws WTException
Overwrites WfActivity.readValues so it can update instructions attribute after values are read. Instructions attribute are updated by performing variable substitutions where appropriate.

Supported API: false

Overrides:
readValues in class WfActivity
Throws:
WTException

getDefaultParticipants

public Enumeration getDefaultParticipants()
                                   throws WTException
Returns default activity participants.

Supported API: false

Returns:
Enumeration
Throws:
WTException

recreateWorkAssignment

public void recreateWorkAssignment()
                            throws WTException


Supported API: false

Throws:
WTException

equals

public boolean equals(Object obj)
Indicates whether the given object is equal to this object from a persistence perspective, by comparing the two objects ObjectIdentifiers. Changed or stale copies are still considered equal by this method. Delegates to PersistenceHelper.equals(Persistable,Object).

Warning: Certain core Windchill operations may depend upon equals being ObjectIdentifier-based. Changes to the default implementation should be done with care, if at all.

Supported API: false

Overrides:
equals in class WfActivity
Parameters:
obj -
Returns:
boolean

hashCode

public int hashCode()
Returns a hash code for this object based upon its ObjectIdentifier. Delegates to PersistenceHelper.hashCode(Persistable).

Warning: Certain core Windchill operations may depend upon hashCode being ObjectIdentifier-based. Changes to the default implementation should be done with care, if at all.

Supported API: false

Overrides:
hashCode in class WfActivity
Returns:
int

getAllBallots

protected Vector getAllBallots()
                        throws WfException
Throws:
WfException

addElementsNoDup

private void addElementsNoDup(Vector v,
                              Enumeration e)

addElementsNoDup

private void addElementsNoDup(Vector v1,
                              Vector v2)

addElementNoDup

private void addElementNoDup(Vector v,
                             Object obj)

resolveAssignees

private Vector resolveAssignees(WfAssignedActivityTemplate t)
                         throws WfException
Throws:
WfException

deleteActivity

public void deleteActivity()
                    throws WTException
Description copied from class: WfActivity
Delete myself. This must be public because of subclasses in different packages.

Overrides:
deleteActivity in class WfActivity
Throws:
WTException

cleanUpFromLastTrip

private void cleanUpFromLastTrip()
                          throws WTException
Throws:
WTException

tallyByAssignment

protected boolean tallyByAssignment(WfTallyType tType,
                                    String operator,
                                    int value,
                                    String event)
                             throws WfException
Throws:
WfException

tallyByActivity

protected boolean tallyByActivity(WfTallyType tType,
                                  String operator,
                                  int value,
                                  String event)
                           throws WfException
Throws:
WfException

getAssignments

public Enumeration getAssignments()
                           throws WTException
Throws:
WTException

getAssignments

public Enumeration getAssignments(int tripNbr)
                           throws WTException
Throws:
WTException

getAllAssignments

public Enumeration getAllAssignments()
                              throws WTException
Throws:
WTException

doSkipTransition

public void doSkipTransition()
                      throws WTException
Description copied from class: WfActivity
Performs specific tasks associated with the SKIP transition. To be superseded by the subclasses of WfActivity. Default implementation of WfActivity does nothing.

Supported API: false

Overrides:
doSkipTransition in class WfActivity
Throws:
WTException

resolveAssigneesToPRefs

public Vector resolveAssigneesToPRefs()
                               throws WfException
Throws:
WfException

resolveAssignee

private Vector resolveAssignee(WfAssignee assignee,
                               WfAssignedActivityTemplate template)
                        throws WfException
Throws:
WfException

resolveFromVariable

private Vector resolveFromVariable(String var_name,
                                   WfAssignedActivityTemplate template,
                                   WfProcess myParent,
                                   Team localTeam,
                                   Vector pv)
                            throws WTException
Throws:
WTException

resolveRole

private Enumeration resolveRole(WfAssignedActivityTemplate t,
                                WfProcess myParent,
                                Team localTeam,
                                Role aRole)
                         throws WTException
Throws:
WTException

resolveGroup

private Enumeration resolveGroup(WTGroup wg)
                          throws WTException
Throws:
WTException

resolveActorRole

private WTPrincipalReference resolveActorRole(WfProcess myParent,
                                              ActorRole aRole)
                                       throws WTException
Throws:
WTException

addPrincipals

private void addPrincipals(Vector v,
                           Enumeration e)

addPrincipal

private void addPrincipal(Vector v,
                          WTPrincipalReference pRef)

getLocalTeam

private Team getLocalTeam(WfAssignedActivityTemplate aat)
                   throws WTException
Throws:
WTException

createWfAssignment

protected WfAssignment createWfAssignment(WfAssignee assignee)
                                   throws WTException
Returns a persistented assignment object given the assignee. Also generates and persists workitems associated with the assignment.

Throws:
WTException

replaceVariables

public String replaceVariables(String txt,
                               ProcessData variables)
                        throws WTException
Throws:
WTException

getValue

private String getValue(ProcessData vars,
                        String var_name)

getStringRepresentation

private String getStringRepresentation(Object value)

getMailToLink

private String getMailToLink(WTUser user)