Class NESTWorkflowValidatorImpl
- java.lang.Object
-
- de.uni_trier.wi2.procake.data.object.nest.utils.impl.NESTGraphValidatorImpl
-
- de.uni_trier.wi2.procake.data.object.nest.utils.impl.NESTWorkflowValidatorImpl
-
- All Implemented Interfaces:
NESTGraphValidator,NESTWorkflowValidator
public class NESTWorkflowValidatorImpl extends NESTGraphValidatorImpl implements NESTWorkflowValidator
Implementation of theNESTWorkflowValidator.
-
-
Field Summary
Fields Modifier and Type Field Description protected NESTWorkflowObjectworkflow-
Fields inherited from class de.uni_trier.wi2.procake.data.object.nest.utils.impl.NESTGraphValidatorImpl
errorMessage, isValidGraph, logger
-
-
Constructor Summary
Constructors Constructor Description NESTWorkflowValidatorImpl(NESTWorkflowObject workflow)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckControlflowBlocks()This method checks all controlflow blocks in the workflow.booleancheckSemanticDescriptors()This method checks if the classes at the semantic descriptors of the nodes and edges are valid.NESTWorkflowObjectgetGraph()This method returns the graph object for which the validator was created.booleanhasCorrectControlflowEdges()This method checks all controlflow edges in the workflow.booleanhasCorrectDataflowEdges()This method verifies that all dataflow edges connect a task node to a data node.booleanhasCorrectPartOfEdges()This method checks all part of edges.booleanhasFullyConnectedAndNoDuplicateEdges()This method checks that all edges have connections and that no edge is duplicated.booleanhasNoUnconnectedDataNodes()This method checks that all data nodes are connected to other elements of the workflow via dataflow edges.booleanhasSingleStartEndNode()This method verifies that the workflow has only one start node and only one end node.booleanhasUniqueWorkflowNode()This method verifies that the workflow node exists and is unique.booleanisAllowEmptyControlflowBlocks()booleanisBlockOrientedWorkflow()This method checks whether the workflow is block-oriented.booleanisExpectPartOfEdges()booleanisExpectWorkflowNode()booleanisValidWorkflow()This method checks if the workflow is a valid nest workflow.voidreset()The method resets all values stored in the validator.voidsetAllowEmptyControlflowBlocks(boolean allowEmptyControlflowBlocks)voidsetExpectPartOfEdges(boolean expectPartOfEdges)voidsetExpectWorkflowNode(boolean expectWorkflowNode)-
Methods inherited from class de.uni_trier.wi2.procake.data.object.nest.utils.impl.NESTGraphValidatorImpl
getErrorMessage, getUniqueEdgeIDs, getUniqueNodeIDs, hasUniqueEdgeIDs, hasUniqueNodeIDs, hasValidSemanticDescriptors, isValidGraph, log
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.uni_trier.wi2.procake.data.object.nest.utils.NESTGraphValidator
getErrorMessage, hasUniqueEdgeIDs, hasUniqueNodeIDs, hasValidSemanticDescriptors, isValidGraph
-
-
-
-
Field Detail
-
workflow
protected NESTWorkflowObject workflow
-
-
Constructor Detail
-
NESTWorkflowValidatorImpl
public NESTWorkflowValidatorImpl(NESTWorkflowObject workflow)
-
-
Method Detail
-
isAllowEmptyControlflowBlocks
public boolean isAllowEmptyControlflowBlocks()
- Specified by:
isAllowEmptyControlflowBlocksin interfaceNESTWorkflowValidator- Returns:
- Flag, whether controlflow blocks without any containing elements are allowed.
-
setAllowEmptyControlflowBlocks
public void setAllowEmptyControlflowBlocks(boolean allowEmptyControlflowBlocks)
- Specified by:
setAllowEmptyControlflowBlocksin interfaceNESTWorkflowValidator- Parameters:
allowEmptyControlflowBlocks- Flag, whether controlflow blocks without any containing * elements are allowed.
-
isExpectPartOfEdges
public boolean isExpectPartOfEdges()
- Specified by:
isExpectPartOfEdgesin interfaceNESTWorkflowValidator- Returns:
- Flag, whether part-of edges are expected.
-
setExpectPartOfEdges
public void setExpectPartOfEdges(boolean expectPartOfEdges)
- Specified by:
setExpectPartOfEdgesin interfaceNESTWorkflowValidator- Parameters:
expectPartOfEdges- Flag, whether part-of edges are expected.
-
isExpectWorkflowNode
public boolean isExpectWorkflowNode()
- Specified by:
isExpectWorkflowNodein interfaceNESTWorkflowValidator- Returns:
- Flag, whether a workflow node is expected.
-
setExpectWorkflowNode
public void setExpectWorkflowNode(boolean expectWorkflowNode)
- Specified by:
setExpectWorkflowNodein interfaceNESTWorkflowValidator- Parameters:
expectWorkflowNode- Flag, whether a workflow node is expected.
-
reset
public void reset()
Description copied from interface:NESTGraphValidatorThe method resets all values stored in the validator. This method is to be used when changes have been made to the graph object after validation by the validator.- Specified by:
resetin interfaceNESTGraphValidator- Overrides:
resetin classNESTGraphValidatorImpl
-
isValidWorkflow
public boolean isValidWorkflow()
Description copied from interface:NESTWorkflowValidatorThis method checks if the workflow is a valid nest workflow. It checks if it is a valid graph, has a unique workflow node, has correct part of, controlflow and dataflow edges, no data nodes are unconnected and the controlflow blocks are correct. See methodsNESTGraphValidator.isValidGraph()},NESTWorkflowValidator.hasUniqueWorkflowNode(),NESTWorkflowValidator.hasCorrectPartOfEdges(),NESTWorkflowValidator.hasCorrectControlflowEdges(),NESTWorkflowValidator.hasCorrectDataflowEdges(),NESTWorkflowValidator.hasNoUnconnectedDataNodes()andNESTWorkflowValidator.checkControlflowBlocks().A flag can be set with method
NESTWorkflowValidator.setAllowEmptyControlflowBlocks(boolean)()} to allow controlflow blocks without any containing elements.- Specified by:
isValidWorkflowin interfaceNESTWorkflowValidator- Returns:
- True, if nest workflow is valid.
-
isBlockOrientedWorkflow
public boolean isBlockOrientedWorkflow()
Description copied from interface:NESTWorkflowValidatorThis method checks whether the workflow is block-oriented. This is a valid workflow that also has only one start and one end node. See methodsNESTWorkflowValidator.isValidWorkflow()andNESTWorkflowValidator.hasSingleStartEndNode().A flag can be set with method
NESTWorkflowValidator.setAllowEmptyControlflowBlocks(boolean)()} to allow controlflow blocks without any containing elements.- Specified by:
isBlockOrientedWorkflowin interfaceNESTWorkflowValidator- Returns:
- True, if nest workflow is valid and block oriented.
-
hasFullyConnectedAndNoDuplicateEdges
public boolean hasFullyConnectedAndNoDuplicateEdges()
Description copied from interface:NESTGraphValidatorThis method checks that all edges have connections and that no edge is duplicated.- Specified by:
hasFullyConnectedAndNoDuplicateEdgesin interfaceNESTGraphValidator- Overrides:
hasFullyConnectedAndNoDuplicateEdgesin classNESTGraphValidatorImpl- Returns:
- True, if all edges are valid.
-
hasCorrectPartOfEdges
public boolean hasCorrectPartOfEdges()
Description copied from interface:NESTWorkflowValidatorThis method checks all part of edges. These must connect a workflow or a subworkflow node as a post node with other nodes of the workflow and may only occur once for each workflow node.- Specified by:
hasCorrectPartOfEdgesin interfaceNESTWorkflowValidator- Returns:
- True, if all part of edges are valid.
-
hasCorrectDataflowEdges
public boolean hasCorrectDataflowEdges()
Description copied from interface:NESTWorkflowValidatorThis method verifies that all dataflow edges connect a task node to a data node.- Specified by:
hasCorrectDataflowEdgesin interfaceNESTWorkflowValidator- Returns:
- True, if all dataflow edges are valid.
-
hasNoUnconnectedDataNodes
public boolean hasNoUnconnectedDataNodes()
Description copied from interface:NESTWorkflowValidatorThis method checks that all data nodes are connected to other elements of the workflow via dataflow edges.- Specified by:
hasNoUnconnectedDataNodesin interfaceNESTWorkflowValidator- Returns:
- True, if all data nodes are connected to the workflow.
-
hasCorrectControlflowEdges
public boolean hasCorrectControlflowEdges()
Description copied from interface:NESTWorkflowValidatorThis method checks all controlflow edges in the workflow. These must run between two sequence nodes and must be unique from node to node if the nodes are not controlflow nodes.- Specified by:
hasCorrectControlflowEdgesin interfaceNESTWorkflowValidator- Returns:
- True, if controlflow edges are valid.
-
hasUniqueWorkflowNode
public boolean hasUniqueWorkflowNode()
Description copied from interface:NESTWorkflowValidatorThis method verifies that the workflow node exists and is unique.- Specified by:
hasUniqueWorkflowNodein interfaceNESTWorkflowValidator- Returns:
- True, if workflow node is unique.
-
hasSingleStartEndNode
public boolean hasSingleStartEndNode()
Description copied from interface:NESTWorkflowValidatorThis method verifies that the workflow has only one start node and only one end node.- Specified by:
hasSingleStartEndNodein interfaceNESTWorkflowValidator- Returns:
- True, if start and end node are unique.
-
checkControlflowBlocks
public boolean checkControlflowBlocks()
Description copied from interface:NESTWorkflowValidatorThis method checks all controlflow blocks in the workflow. These are valid if all controlflow pairs are of the same controlflow type, each node has a corresponding partner node (start and end node) and there are no interleaved controlflows. In addition, for And nodes it is checked that there are exactly two branches. If allowEmptyControlflowBlocks=false, it is checked that both branches are not empty. For Or or Xor nodes, there must be also two branches, but one may be empty. If allowEmptyControlflowBlocks=true, also both branches can be empty. For Loop nodes, only one non-empty branch is allowed. If allowEmptyControlflowBlocks=false, the branch can be empty as well.The flag allowEmptyControlflowBlocks can be set with method
NESTWorkflowValidator.setAllowEmptyControlflowBlocks(boolean)()} to allow controlflow blocks without any containing elements.- Specified by:
checkControlflowBlocksin interfaceNESTWorkflowValidator- Returns:
- True, if all controlflow blocks are valid.
-
checkSemanticDescriptors
public boolean checkSemanticDescriptors()
Description copied from interface:NESTWorkflowValidatorThis method checks if the classes at the semantic descriptors of the nodes and edges are valid.- Specified by:
checkSemanticDescriptorsin interfaceNESTWorkflowValidator- Returns:
- True, if all semantic descriptors are valid.
-
getGraph
public NESTWorkflowObject getGraph()
Description copied from interface:NESTGraphValidatorThis method returns the graph object for which the validator was created.- Specified by:
getGraphin interfaceNESTGraphValidator- Specified by:
getGraphin interfaceNESTWorkflowValidator- Overrides:
getGraphin classNESTGraphValidatorImpl- Returns:
- The graph object for which the validator was created.
-
-