wt.workflow.engine
Class WfProcessRequester

java.lang.Object
  extended bywt.fc.WTObject
      extended bywt.workflow.engine.WfProcessRequester
All Implemented Interfaces:
DisplayIdentification, Externalizable, NetFactor, ObjectMappable, Persistable, Serializable, WfRequester

public class WfProcessRequester
extends WTObject
implements WfRequester, Externalizable

The WfProcessRequester class implements WfRequester to allow processes to be used by external applications. The external behavior implemented by this class is the 'receiveEvent' method, which is called by the associated process to communicate relevant events (mostly state changes).

Implementation note: it is suggested that the external client be represented by an URL. The receiveEvent translates the event into a suitable get/post action using the URL.

Note: This class is not implemented as of R2.

Use the newWfProcessRequester static factory method(s), not the WfProcessRequester 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
static String ABORT_URL
          Label for the attribute; URL to be called by the process requester if the associated process undergoes the 'abort' transition.
private static int ABORT_URL_UPPER_LIMIT
           
private  String abortURL
           
static String APPLICATION_ID
          Label for the attribute; Identifier of the application that owns the process.
private static int APPLICATION_ID_UPPER_LIMIT
           
private  String applicationId
           
private static String CLASSNAME
           
static String COMPLETE_URL
          Label for the attribute; URL to be called by the process requester if the associated process undergoes the 'complete' transition.
private static int COMPLETE_URL_UPPER_LIMIT
           
private  String completeURL
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private  WfContainerReference performerRef
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private static boolean VERBOSE
           
 
Fields inherited from class wt.fc.WTObject
CREATE_TIMESTAMP, MODIFY_TIMESTAMP
 
Fields inherited from interface wt.workflow.engine.WfRequester
PERFORMER_REF
 
Fields inherited from interface wt.fc.Persistable
IDENTITY, PERSIST_INFO, TYPE
 
Fields inherited from interface wt.identity.DisplayIdentification
DISPLAY_IDENTIFIER, DISPLAY_IDENTITY, DISPLAY_TYPE
 
Constructor Summary
WfProcessRequester()
           
 
Method Summary
private  void abortURLValidate(String a_AbortURL)
           
 WfExecutionObject changeState(WfTransition transition)
          This method is used by containing process of application to force the process to undergo state changes.
private  void completeURLValidate(String a_CompleteURL)
           
 boolean equals(Object obj)
          Indicates whether the given object is equal to this object from a persistence perspective, by comparing the two objects ObjectIdentifiers.
 String getAbortURL()
          Gets the value of the attribute: ABORT_URL.
 String getApplicationId()
          Gets the value of the attribute: APPLICATION_ID.
 String getCompleteURL()
          Gets the value of the attribute: COMPLETE_URL.
 String getConceptualClassname()
          Deprecated.  
 WfContainer getPerformer()
          Returns the process associated with the requester.
 WfContainerReference getPerformerRef()
          Gets the value of the attribute: PERFORMER_REF.
 int hashCode()
          Returns a hash code for this object based upon its ObjectIdentifier.
protected  void initialize(String application_id)
          Supports initialization, following construction of an instance.
static WfProcessRequester newWfProcessRequester(String application_id)
          

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.
protected  boolean readVersion(WfProcessRequester thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void receiveEvent(Object event)
          This operation is used by the associated WfProcess to notify its requester of workflow events.
protected  void setAbortURL(String a_AbortURL)
          Sets the value of the attribute: ABORT_URL.
 void setApplicationId(String a_ApplicationId)
          Sets the value of the attribute: APPLICATION_ID.
protected  void setCompleteURL(String a_CompleteURL)
          Sets the value of the attribute: COMPLETE_URL.
 void setPerformerRef(WfContainerReference a_PerformerRef)
          Sets the value of the attribute: PERFORMER_REF.
 void start(ProcessData input, long priority)
          Starts the process with a given input data.
 String toString()
          Returns a string representation of the process requester.
 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.fc.WTObject
checkAttributes, duplicate, finalize, getClassInfo, getCreateTimestamp, getDisplayIdentifier, getDisplayIdentity, getDisplayType, getIdentity, getModifyTimestamp, getPersistInfo, getType, initialize, readVersion, setPersistInfo
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

APPLICATION_ID

public static final String APPLICATION_ID
Label for the attribute; Identifier of the application that owns the process.

Supported API: false

See Also:
Constant Field Values

APPLICATION_ID_UPPER_LIMIT

private static int APPLICATION_ID_UPPER_LIMIT

applicationId

private String applicationId

COMPLETE_URL

public static final String COMPLETE_URL
Label for the attribute; URL to be called by the process requester if the associated process undergoes the 'complete' transition.

Supported API: false

See Also:
Constant Field Values

COMPLETE_URL_UPPER_LIMIT

private static int COMPLETE_URL_UPPER_LIMIT

completeURL

private String completeURL

ABORT_URL

public static final String ABORT_URL
Label for the attribute; URL to be called by the process requester if the associated process undergoes the 'abort' transition.

Supported API: false

See Also:
Constant Field Values

ABORT_URL_UPPER_LIMIT

private static int ABORT_URL_UPPER_LIMIT

abortURL

private String abortURL

performerRef

private WfContainerReference performerRef

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

VERBOSE

private static boolean VERBOSE
Constructor Detail

WfProcessRequester

public WfProcessRequester()
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 WTObject
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 WTObject
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(WfProcessRequester 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 WTObject
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 WTObject
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

getApplicationId

public String getApplicationId()
Gets the value of the attribute: APPLICATION_ID. Identifier of the application that owns the process.

Supported API: false

Returns:
String

setApplicationId

public void setApplicationId(String a_ApplicationId)
Sets the value of the attribute: APPLICATION_ID. Identifier of the application that owns the process.

Supported API: false

Parameters:
a_ApplicationId -

getCompleteURL

public String getCompleteURL()
Gets the value of the attribute: COMPLETE_URL. URL to be called by the process requester if the associated process undergoes the 'complete' transition.

Supported API: false

Returns:
String

setCompleteURL

protected void setCompleteURL(String a_CompleteURL)
                       throws WTPropertyVetoException
Sets the value of the attribute: COMPLETE_URL. URL to be called by the process requester if the associated process undergoes the 'complete' transition.

Supported API: false

Parameters:
a_CompleteURL -
Throws:
WTPropertyVetoException

completeURLValidate

private void completeURLValidate(String a_CompleteURL)
                          throws WTPropertyVetoException
Parameters:
a_CompleteURL -
Throws:
WTPropertyVetoException

getAbortURL

public String getAbortURL()
Gets the value of the attribute: ABORT_URL. URL to be called by the process requester if the associated process undergoes the 'abort' transition.

Supported API: false

Returns:
String

setAbortURL

protected void setAbortURL(String a_AbortURL)
                    throws WTPropertyVetoException
Sets the value of the attribute: ABORT_URL. URL to be called by the process requester if the associated process undergoes the 'abort' transition.

Supported API: false

Parameters:
a_AbortURL -
Throws:
WTPropertyVetoException

abortURLValidate

private void abortURLValidate(String a_AbortURL)
                       throws WTPropertyVetoException
Parameters:
a_AbortURL -
Throws:
WTPropertyVetoException

start

public void start(ProcessData input,
                  long priority)
           throws WTException
Starts the process with a given input data.

Supported API: false

Parameters:
input -
priority -
Throws:
WTException

toString

public String toString()
Returns a string representation of the process requester. Used mostly for debugging purposes: not appropriate for GUI use.

Supported API: false

Overrides:
toString in class WTObject
Returns:
String

newWfProcessRequester

public static WfProcessRequester newWfProcessRequester(String application_id)
                                                throws WTException


Supported API: false

Parameters:
application_id -
Returns:
WfProcessRequester
Throws:
WTException

initialize

protected void initialize(String application_id)
                   throws WTException
Supports initialization, following construction of an instance. Invoked by "new" factory having the same signature.

Supported API: false

Parameters:
application_id -
Throws:
WTException

getPerformerRef

public WfContainerReference getPerformerRef()
Gets the value of the attribute: PERFORMER_REF. Reference to the performer object associated with the requester.

Supported API: false

Specified by:
getPerformerRef in interface WfRequester
Returns:
WfContainerReference

setPerformerRef

public void setPerformerRef(WfContainerReference a_PerformerRef)
Sets the value of the attribute: PERFORMER_REF. Reference to the performer object associated with the requester.

Supported API: false

Specified by:
setPerformerRef in interface WfRequester
Parameters:
a_PerformerRef -

receiveEvent

public void receiveEvent(Object event)
                  throws WTException
This operation is used by the associated WfProcess to notify its requester of workflow events. In particular the WfProcess must notify the requester of complete, terminate or abort events or the transition to a closed state.

Supported API: false

Specified by:
receiveEvent in interface WfRequester
Parameters:
event - WfProcess event; contains the source of the event.
Throws:
WTException

changeState

public WfExecutionObject changeState(WfTransition transition)
                              throws WTException
This method is used by containing process of application to force the process to undergo state changes. Returns the updated (and persisted) object. For example, changeState (WfTransition.START) causes the start of the process.

Supported API: false

Specified by:
changeState in interface WfRequester
Parameters:
transition -
Returns:
WfExecutionObject
Throws:
WTException

getPerformer

public WfContainer getPerformer()
                         throws WTException
Returns the process associated with the requester.

Supported API: false

Specified by:
getPerformer in interface WfRequester
Returns:
WfContainer
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 WTObject
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 WTObject
Returns:
int