wt.workflow.definer
Class WfTemplateVerification

java.lang.Object
  extended bywt.workflow.definer.WfTemplateVerification
All Implemented Interfaces:
Serializable

public class WfTemplateVerification
extends Object
implements Serializable

Class that encapsulates the verification of a container template. It is a transient class. To use it simply instantiate it and retrieve the global verification report. Also access to individual attributes is possible.

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private  Vector danglingActivities
           
private  Vector danglingConnectors
           
private  Vector dataFlowDefects
           
private  Vector inaccessibleActivities
           
private  Vector inaccessibleConnectors
           
private  Vector invalidLinks
           
private  boolean recurse
           
private static String RESOURCE
           
private  WfContainerTemplate template
           
private  Vector unmappedVariableDefects
           
private  Vector unusedEventDefects
           
 
Constructor Summary
WfTemplateVerification(WfContainerTemplate template, boolean recurse)
          Constructor of the class.
 
Method Summary
private  void addDefects(WfTemplateVerification template_verification)
          Adds defects found in a given template to the current ones.
private  Vector addVector(Vector to_add_to, Vector to_add_from)
          Adds one vector to the other.
private  Vector findDanglingActivities()
          Returns all activities from which one can't access an END or GROUND node.
private  Vector findDanglingConnectors()
          Returns all connectors from which one can't access an END or GROUND node.
private  Vector findDataFlowDefects()
          Returns all data flow defects for a given process templaet.
private  Vector findInaccessibleActivities()
          Returns all activities that can't be reached from the START node.
private  Vector findInaccessibleConnectors()
          Returns all connectors that can't be reached from the START node.
private  Vector findInvalidLinks()
          Returns all "invalid" links in the process template.
private  Vector findUnmappedVariableDefects()
          Returns all INPUT/OUTPUT/INOUT variables that are not mapped.
private  Vector findUnusedEventDefects()
          Returns all user events that are not used.
protected  Vector getAccessibleNodes(WfContainerTemplate template, WfNodeTemplate start_template)
          Returns all nodes (activities and connectors) that can be reached from the node passed as argument.
 Vector getDanglingActivities()
          Gets the value of the attribute: danglingActivities; List of activities from which one can't reach an end node.
 Vector getDanglingConnectors()
          Gets the value of the attribute: danglingConnectors; List of connectors from which one can't reach an end node.
 Vector getDataFlowDefects()
          Gets the value of the attribute: dataFlowDefects; List of defects in the flow of data.
private  Enumeration getGroundConnectorTemplates()
          Returns all ground connectors in the process template.
 Vector getInaccessibleActivities()
          Gets the value of the attribute: inaccessibleActivities; List of activities that can't be reached from the start node.
 Vector getInaccessibleConnectors()
          Gets the value of the attribute: inaccessibleConnectors; List of connectors that can't be reached from the start node.
 Vector getInvalidLinks()
          Gets the value of the attribute: invalidLinks; List of links that don't have or have a bad event-action mapping.
private  Vector getNonDanglingNodes()
          Returns all nodes (activities and connectors) from which one can reach an END or a GROUND node.
 String getReport()
          Returns a defect report.
 WfContainerTemplate getTemplate()
          Gets the value of the attribute: template; Container that is being verified.
 Vector getUnmappedVariableDefects()
          Gets the value of the attribute: unmappedVariableDefects; List of variables whose type (INPUT or OUTPUT) is inconsistent with the variable mapping of the activity to which it belongs.
 Vector getUnusedEventDefects()
          Gets the value of the attribute: unusedEventDefects; List of user defined events that are not used in any outgoing link.
private  Enumeration getValidPredecessors(WfNodeTemplate node)
          Returns all valid predecessor nodes of a given node.
private  Enumeration getValidSuccessors(WfNodeTemplate node)
          Returns all valid successor nodes of a given node.
 boolean isRecurse()
          Gets the value of the attribute: recurse; Controls whether to recurse into contained blocks.
private  boolean isUsedByTemplate(Object event, WfTemplateObject node)
          Returns all data flow defects for a given process templaet.
private  String linkToString(NodeTemplateLink link)
          Returns condensed readable identity of the link.
private  String nodeToString(WfNodeTemplate node)
          Returns condensed readable identity of the node.
 void setDanglingActivities(Vector a_DanglingActivities)
          Sets the value of the attribute: danglingActivities; List of activities from which one can't reach an end node.
 void setDanglingConnectors(Vector a_DanglingConnectors)
          Sets the value of the attribute: danglingConnectors; List of connectors from which one can't reach an end node.
 void setDataFlowDefects(Vector a_DataFlowDefects)
          Sets the value of the attribute: dataFlowDefects; List of defects in the flow of data.
 void setInaccessibleActivities(Vector a_InaccessibleActivities)
          Sets the value of the attribute: inaccessibleActivities; List of activities that can't be reached from the start node.
 void setInaccessibleConnectors(Vector a_InaccessibleConnectors)
          Sets the value of the attribute: inaccessibleConnectors; List of connectors that can't be reached from the start node.
 void setInvalidLinks(Vector a_InvalidLinks)
          Sets the value of the attribute: invalidLinks; List of links that don't have or have a bad event-action mapping.
protected  void setRecurse(boolean a_Recurse)
          Sets the value of the attribute: recurse; Controls whether to recurse into contained blocks.
protected  void setTemplate(WfContainerTemplate a_Template)
          Sets the value of the attribute: template; Container that is being verified.
 void setUnmappedVariableDefects(Vector a_UnmappedVariableDefects)
          Sets the value of the attribute: unmappedVariableDefects; List of variables whose type (INPUT or OUTPUT) is inconsistent with the variable mapping of the activity to which it belongs.
 void setUnusedEventDefects(Vector a_UnusedEventDefects)
          Sets the value of the attribute: unusedEventDefects; List of user defined events that are not used in any outgoing link.
 
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

template

private WfContainerTemplate template

recurse

private boolean recurse

invalidLinks

private Vector invalidLinks

inaccessibleActivities

private Vector inaccessibleActivities

danglingActivities

private Vector danglingActivities

inaccessibleConnectors

private Vector inaccessibleConnectors

danglingConnectors

private Vector danglingConnectors

dataFlowDefects

private Vector dataFlowDefects

unusedEventDefects

private Vector unusedEventDefects

unmappedVariableDefects

private Vector unmappedVariableDefects
Constructor Detail

WfTemplateVerification

public WfTemplateVerification(WfContainerTemplate template,
                              boolean recurse)
                       throws WTException
Constructor of the class. Populates all the attributes that corresponds to template defects.

Supported API: false

Parameters:
template -
recurse -
Throws:
WTException
Method Detail

getTemplate

public WfContainerTemplate getTemplate()
Gets the value of the attribute: template; Container that is being verified.

Supported API: false

Returns:
WfContainerTemplate

setTemplate

protected void setTemplate(WfContainerTemplate a_Template)
                    throws WTPropertyVetoException
Sets the value of the attribute: template; Container that is being verified.

Supported API: false

Parameters:
a_Template -
Throws:
WTPropertyVetoException

isRecurse

public boolean isRecurse()
Gets the value of the attribute: recurse; Controls whether to recurse into contained blocks.

Supported API: false

Returns:
boolean

setRecurse

protected void setRecurse(boolean a_Recurse)
                   throws WTPropertyVetoException
Sets the value of the attribute: recurse; Controls whether to recurse into contained blocks.

Supported API: false

Parameters:
a_Recurse -
Throws:
WTPropertyVetoException

getInvalidLinks

public Vector getInvalidLinks()
Gets the value of the attribute: invalidLinks; List of links that don't have or have a bad event-action mapping.

Supported API: false

Returns:
Vector

setInvalidLinks

public void setInvalidLinks(Vector a_InvalidLinks)
                     throws WTPropertyVetoException
Sets the value of the attribute: invalidLinks; List of links that don't have or have a bad event-action mapping.

Supported API: false

Parameters:
a_InvalidLinks -
Throws:
WTPropertyVetoException

getInaccessibleActivities

public Vector getInaccessibleActivities()
Gets the value of the attribute: inaccessibleActivities; List of activities that can't be reached from the start node.

Supported API: false

Returns:
Vector

setInaccessibleActivities

public void setInaccessibleActivities(Vector a_InaccessibleActivities)
                               throws WTPropertyVetoException
Sets the value of the attribute: inaccessibleActivities; List of activities that can't be reached from the start node.

Supported API: false

Parameters:
a_InaccessibleActivities -
Throws:
WTPropertyVetoException

getDanglingActivities

public Vector getDanglingActivities()
Gets the value of the attribute: danglingActivities; List of activities from which one can't reach an end node.

Supported API: false

Returns:
Vector

setDanglingActivities

public void setDanglingActivities(Vector a_DanglingActivities)
                           throws WTPropertyVetoException
Sets the value of the attribute: danglingActivities; List of activities from which one can't reach an end node.

Supported API: false

Parameters:
a_DanglingActivities -
Throws:
WTPropertyVetoException

getInaccessibleConnectors

public Vector getInaccessibleConnectors()
Gets the value of the attribute: inaccessibleConnectors; List of connectors that can't be reached from the start node.

Supported API: false

Returns:
Vector

setInaccessibleConnectors

public void setInaccessibleConnectors(Vector a_InaccessibleConnectors)
                               throws WTPropertyVetoException
Sets the value of the attribute: inaccessibleConnectors; List of connectors that can't be reached from the start node.

Supported API: false

Parameters:
a_InaccessibleConnectors -
Throws:
WTPropertyVetoException

getDanglingConnectors

public Vector getDanglingConnectors()
Gets the value of the attribute: danglingConnectors; List of connectors from which one can't reach an end node.

Supported API: false

Returns:
Vector

setDanglingConnectors

public void setDanglingConnectors(Vector a_DanglingConnectors)
                           throws WTPropertyVetoException
Sets the value of the attribute: danglingConnectors; List of connectors from which one can't reach an end node.

Supported API: false

Parameters:
a_DanglingConnectors -
Throws:
WTPropertyVetoException

getDataFlowDefects

public Vector getDataFlowDefects()
Gets the value of the attribute: dataFlowDefects; List of defects in the flow of data. A data flow defect can be one of:

Supported API: false

Returns:
Vector

setDataFlowDefects

public void setDataFlowDefects(Vector a_DataFlowDefects)
                        throws WTPropertyVetoException
Sets the value of the attribute: dataFlowDefects; List of defects in the flow of data. A data flow defect can be one of:

Supported API: false

Parameters:
a_DataFlowDefects -
Throws:
WTPropertyVetoException

getUnusedEventDefects

public Vector getUnusedEventDefects()
Gets the value of the attribute: unusedEventDefects; List of user defined events that are not used in any outgoing link.

Supported API: false

Returns:
Vector

setUnusedEventDefects

public void setUnusedEventDefects(Vector a_UnusedEventDefects)
                           throws WTPropertyVetoException
Sets the value of the attribute: unusedEventDefects; List of user defined events that are not used in any outgoing link.

Supported API: false

Parameters:
a_UnusedEventDefects -
Throws:
WTPropertyVetoException

getUnmappedVariableDefects

public Vector getUnmappedVariableDefects()
Gets the value of the attribute: unmappedVariableDefects; List of variables whose type (INPUT or OUTPUT) is inconsistent with the variable mapping of the activity to which it belongs.

Supported API: false

Returns:
Vector

setUnmappedVariableDefects

public void setUnmappedVariableDefects(Vector a_UnmappedVariableDefects)
                                throws WTPropertyVetoException
Sets the value of the attribute: unmappedVariableDefects; List of variables whose type (INPUT or OUTPUT) is inconsistent with the variable mapping of the activity to which it belongs.

Supported API: false

Parameters:
a_UnmappedVariableDefects -
Throws:
WTPropertyVetoException

getReport

public String getReport()
Returns a defect report.

Supported API: false

Returns:
String

findInvalidLinks

private Vector findInvalidLinks()
                         throws WTException
Returns all "invalid" links in the process template. An invalid link has no event-action pair defined in it.

Returns:
Enumeration - list of invalid links
Throws:
WTException

findInaccessibleActivities

private Vector findInaccessibleActivities()
                                   throws WTException
Returns all activities that can't be reached from the START node.

Returns:
Enumeration - list of non accessible activities
Throws:
WTException

findInaccessibleConnectors

private Vector findInaccessibleConnectors()
                                   throws WTException
Returns all connectors that can't be reached from the START node.

Returns:
Enumeration - list of non accessible connectors
Throws:
WTException

getValidSuccessors

private Enumeration getValidSuccessors(WfNodeTemplate node)
                                throws WTException
Returns all valid successor nodes of a given node. A valid successor node is one that can be reached through a valid link.

Parameters:
node - - node to be expanded
Returns:
Enumeration - list of valid successor nodes
Throws:
WTException

findDanglingActivities

private Vector findDanglingActivities()
                               throws WTException
Returns all activities from which one can't access an END or GROUND node.

Returns:
Enumeration - list of dangling activities
Throws:
WTException

findDanglingConnectors

private Vector findDanglingConnectors()
                               throws WTException
Returns all connectors from which one can't access an END or GROUND node.

Returns:
Enumeration - list of dangling connectors
Throws:
WTException

getNonDanglingNodes

private Vector getNonDanglingNodes()
                            throws WTException
Returns all nodes (activities and connectors) from which one can reach an END or a GROUND node.

Returns:
Vector - list of accessible nodes
Throws:
WTException

getGroundConnectorTemplates

private Enumeration getGroundConnectorTemplates()
                                         throws WTException
Returns all ground connectors in the process template.

Returns:
Vector - list of ground connectors
Throws:
WTException

getValidPredecessors

private Enumeration getValidPredecessors(WfNodeTemplate node)
                                  throws WTException
Returns all valid predecessor nodes of a given node. A valid predecessor node is one from which the given node can be reached through a valid link.

Parameters:
node - - node to be expanded
Returns:
Enumeration - list of valid predecessor nodes
Throws:
WTException

findDataFlowDefects

private Vector findDataFlowDefects()
                            throws WTException
Returns all data flow defects for a given process templaet.

Returns:
Enumeration - (type = DataFlowDefect) list of data flow defects
Throws:
WTException

findUnusedEventDefects

private Vector findUnusedEventDefects()
                               throws WTException
Returns all user events that are not used.

Returns:
Enumeration - (type = EventDefect) list of event defects
Throws:
WTException

findUnmappedVariableDefects

private Vector findUnmappedVariableDefects()
                                    throws WTException
Returns all INPUT/OUTPUT/INOUT variables that are not mapped.

Returns:
Enumeration - (type = VariableDefect) list variable defects
Throws:
WTException

getAccessibleNodes

protected Vector getAccessibleNodes(WfContainerTemplate template,
                                    WfNodeTemplate start_template)
                             throws WTException
Returns all nodes (activities and connectors) that can be reached from the node passed as argument.

Supported API: false

Parameters:
template -
start_template -
Returns:
Vector
Throws:
WTException

addDefects

private void addDefects(WfTemplateVerification template_verification)
                 throws WTException
Adds defects found in a given template to the current ones.

Parameters:
template_verification - - source of more defects
Throws:
WTException

addVector

private Vector addVector(Vector to_add_to,
                         Vector to_add_from)
Adds one vector to the other.

Parameters:
to_add_to - - Vector that receives new objects
Returns:
to_add_from - Vector from which objects are added

isUsedByTemplate

private boolean isUsedByTemplate(Object event,
                                 WfTemplateObject node)
                          throws WTException
Returns all data flow defects for a given process templaet.

Returns:
Enumeration - (type = DataFlowDefect) list of data flow defects
Throws:
WTException

nodeToString

private String nodeToString(WfNodeTemplate node)
Returns condensed readable identity of the node. For debugging purposes.

Parameters:
node - - WfNode to be printed out

linkToString

private String linkToString(NodeTemplateLink link)
Returns condensed readable identity of the link. For debugging purposes.

Parameters:
link - - WfLink to be printed out