wt.workflow.engine
Class SynchedWorkflow

java.lang.Object
  extended bywt.workflow.engine.SynchedWorkflow
All Implemented Interfaces:
Externalizable, RemoteAccess, Serializable

public class SynchedWorkflow
extends Object
implements Externalizable, RemoteAccess

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private  String eventKey
           
static long EXTERNALIZATION_VERSION_UID
           
private static String FC_RESOURCE
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
(package private) static boolean SERVER
           
private static String SYNCH_ROBOT_NAME
           
private static String SYNCH_WF_NAME
           
private  Notifiable targetObject
           
private  String templateName
           
 
Fields inherited from interface wt.method.RemoteAccess
versionID
 
Constructor Summary
SynchedWorkflow()
          No arg constructor.
 
Method Summary
private  void checkParameters()
           
 WfBlockTemplate createBlockTemplate(String name)
           
private  WfSynchRobotTemplate createSynchRobotTemplate(WfBlockTemplate block_template)
           
private  void eventKeyValidate(String a_EventKey)
           
 String getEventKey()
          Gets the value of the attribute: eventKey; Key of the event to be listened to.
private  String getStringRepresentation(Object value)
          Constructs a String representation of the object passed as parameter.
 Notifiable getTargetObject()
          Gets the value of the attribute: targetObject; Target object against what events are listened to.
private  WfProcessTemplateMaster getTemplateMaster()
           
 String getTemplateName()
          Gets the value of the attribute: templateName; Name of the workflow template to start when the event happens to target object.
static void main(String[] args)
          Testing method.
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
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(SynchedWorkflow thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void setEventKey(String a_EventKey)
          Sets the value of the attribute: eventKey; Key of the event to be listened to.
 void setTargetObject(Notifiable a_TargetObject)
          Sets the value of the attribute: targetObject; Target object against what events are listened to.
 void setTemplateName(String a_TemplateName)
          Sets the value of the attribute: templateName; Name of the workflow template to start when the event happens to target object.
 void setVariableMap(ProcessStepTemplateLink link)
           
 void start(RoleHolder project, int priority)
          Starts event listening.
 void startSynchedWorkflow(WfProcessTemplateMaster template_master, RoleHolder role_holder, int priority)
           
private  void templateNameValidate(String a_TemplateName)
           
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

templateName

private String templateName

eventKey

private String eventKey

targetObject

private Notifiable targetObject

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

SERVER

static final boolean SERVER

FC_RESOURCE

private static final String FC_RESOURCE
See Also:
Constant Field Values

SYNCH_WF_NAME

private static final String SYNCH_WF_NAME
See Also:
Constant Field Values

SYNCH_ROBOT_NAME

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

SynchedWorkflow

public SynchedWorkflow()
No arg constructor.

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
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
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

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

getTemplateName

public String getTemplateName()
Gets the value of the attribute: templateName; Name of the workflow template to start when the event happens to target object.

Returns:
String

setTemplateName

public void setTemplateName(String a_TemplateName)
                     throws WTPropertyVetoException
Sets the value of the attribute: templateName; Name of the workflow template to start when the event happens to target object.

Parameters:
a_TemplateName -
Throws:
WTPropertyVetoException

templateNameValidate

private void templateNameValidate(String a_TemplateName)
                           throws WTPropertyVetoException
Parameters:
a_TemplateName -
Throws:
WTPropertyVetoException

getEventKey

public String getEventKey()
Gets the value of the attribute: eventKey; Key of the event to be listened to. Occurrence of the event on the target object triggers start of the workflow whose template's name is given.

Returns:
String

setEventKey

public void setEventKey(String a_EventKey)
                 throws WTPropertyVetoException
Sets the value of the attribute: eventKey; Key of the event to be listened to. Occurrence of the event on the target object triggers start of the workflow whose template's name is given.

Parameters:
a_EventKey -
Throws:
WTPropertyVetoException

eventKeyValidate

private void eventKeyValidate(String a_EventKey)
                       throws WTPropertyVetoException
Parameters:
a_EventKey -
Throws:
WTPropertyVetoException

getTargetObject

public Notifiable getTargetObject()
Gets the value of the attribute: targetObject; Target object against what events are listened to.

Returns:
Notifiable

setTargetObject

public void setTargetObject(Notifiable a_TargetObject)
                     throws WTPropertyVetoException
Sets the value of the attribute: targetObject; Target object against what events are listened to.

Parameters:
a_TargetObject -
Throws:
WTPropertyVetoException

start

public void start(RoleHolder project,
                  int priority)
           throws WTException
Starts event listening. The template's roleHolder is passed as argument as is the execution priority. The user responsible is the current principal at the time the method is called.

Parameters:
project -
priority -
Throws:
WTException

main

public static void main(String[] args)
Testing method. Listens for modifications of WTUser objects. The name of the user and the template to be started are passed as arguments to the method (in this order).

Parameters:
args -

checkParameters

private void checkParameters()
                      throws WTException
Throws:
WTException

getTemplateMaster

private WfProcessTemplateMaster getTemplateMaster()
                                           throws WTException
Throws:
WTException

startSynchedWorkflow

public void startSynchedWorkflow(WfProcessTemplateMaster template_master,
                                 RoleHolder role_holder,
                                 int priority)
                          throws WTException
Throws:
WTException

createBlockTemplate

public WfBlockTemplate createBlockTemplate(String name)
                                    throws WTException
Throws:
WTException

createSynchRobotTemplate

private WfSynchRobotTemplate createSynchRobotTemplate(WfBlockTemplate block_template)
                                               throws WTException
Throws:
WTException

getStringRepresentation

private String getStringRepresentation(Object value)
Constructs a String representation of the object passed as parameter.

If the value is not a WTObject, calls 'toString()'; otherwise produces the object's identity.

Parameters:
value - object passed as parameter
Returns:
String Windchill's string representation of the object

setVariableMap

public void setVariableMap(ProcessStepTemplateLink link)
                    throws WTException
Throws:
WTException