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 the
NESTWorkflowValidator
.-
Field Summary
Fields inherited from class de.uni_trier.wi2.procake.data.object.nest.utils.impl.NESTGraphValidatorImpl
errorMessage, isValidGraph, logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
This method checks all controlflow blocks in the workflow.boolean
This method checks if the classes at the semantic descriptors of the nodes and edges are valid.getGraph()
This method returns the graph object for which the validator was created.boolean
This method checks all controlflow edges in the workflow.boolean
This method verifies that all dataflow edges connect a task node to a data node.boolean
This method checks all part of edges.boolean
This method checks that all edges have connections and that no edge is duplicated.boolean
This method checks that all data nodes are connected to other elements of the workflow via dataflow edges.boolean
This method verifies that the workflow has only one start node and only one end node.boolean
This method verifies that the workflow node exists and is unique.boolean
boolean
This method checks whether the workflow is block-oriented.boolean
boolean
boolean
This method checks if the workflow is a valid nest workflow.void
reset()
The method resets all values stored in the validator.void
setAllowEmptyControlflowBlocks
(boolean allowEmptyControlflowBlocks) void
setExpectPartOfEdges
(boolean expectPartOfEdges) void
setExpectWorkflowNode
(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 Details
-
workflow
-
-
Constructor Details
-
NESTWorkflowValidatorImpl
-
-
Method Details
-
isAllowEmptyControlflowBlocks
public boolean isAllowEmptyControlflowBlocks()- Specified by:
isAllowEmptyControlflowBlocks
in interfaceNESTWorkflowValidator
- Returns:
- Flag, whether controlflow blocks without any containing elements are allowed.
-
setAllowEmptyControlflowBlocks
public void setAllowEmptyControlflowBlocks(boolean allowEmptyControlflowBlocks) - Specified by:
setAllowEmptyControlflowBlocks
in interfaceNESTWorkflowValidator
- Parameters:
allowEmptyControlflowBlocks
- Flag, whether controlflow blocks without any containing * elements are allowed.
-
isExpectPartOfEdges
public boolean isExpectPartOfEdges()- Specified by:
isExpectPartOfEdges
in interfaceNESTWorkflowValidator
- Returns:
- Flag, whether part-of edges are expected.
-
setExpectPartOfEdges
public void setExpectPartOfEdges(boolean expectPartOfEdges) - Specified by:
setExpectPartOfEdges
in interfaceNESTWorkflowValidator
- Parameters:
expectPartOfEdges
- Flag, whether part-of edges are expected.
-
isExpectWorkflowNode
public boolean isExpectWorkflowNode()- Specified by:
isExpectWorkflowNode
in interfaceNESTWorkflowValidator
- Returns:
- Flag, whether a workflow node is expected.
-
setExpectWorkflowNode
public void setExpectWorkflowNode(boolean expectWorkflowNode) - Specified by:
setExpectWorkflowNode
in interfaceNESTWorkflowValidator
- Parameters:
expectWorkflowNode
- Flag, whether a workflow node is expected.
-
reset
public void reset()Description copied from interface:NESTGraphValidator
The 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:
reset
in interfaceNESTGraphValidator
- Overrides:
reset
in classNESTGraphValidatorImpl
-
isValidWorkflow
public boolean isValidWorkflow()Description copied from interface:NESTWorkflowValidator
This 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:
isValidWorkflow
in interfaceNESTWorkflowValidator
- Returns:
- True, if nest workflow is valid.
-
isBlockOrientedWorkflow
public boolean isBlockOrientedWorkflow()Description copied from interface:NESTWorkflowValidator
This 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:
isBlockOrientedWorkflow
in interfaceNESTWorkflowValidator
- Returns:
- True, if nest workflow is valid and block oriented.
-
hasFullyConnectedAndNoDuplicateEdges
public boolean hasFullyConnectedAndNoDuplicateEdges()Description copied from interface:NESTGraphValidator
This method checks that all edges have connections and that no edge is duplicated.- Specified by:
hasFullyConnectedAndNoDuplicateEdges
in interfaceNESTGraphValidator
- Overrides:
hasFullyConnectedAndNoDuplicateEdges
in classNESTGraphValidatorImpl
- Returns:
- True, if all edges are valid.
-
hasCorrectPartOfEdges
public boolean hasCorrectPartOfEdges()Description copied from interface:NESTWorkflowValidator
This 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:
hasCorrectPartOfEdges
in interfaceNESTWorkflowValidator
- Returns:
- True, if all part of edges are valid.
-
hasCorrectDataflowEdges
public boolean hasCorrectDataflowEdges()Description copied from interface:NESTWorkflowValidator
This method verifies that all dataflow edges connect a task node to a data node.- Specified by:
hasCorrectDataflowEdges
in interfaceNESTWorkflowValidator
- Returns:
- True, if all dataflow edges are valid.
-
hasNoUnconnectedDataNodes
public boolean hasNoUnconnectedDataNodes()Description copied from interface:NESTWorkflowValidator
This method checks that all data nodes are connected to other elements of the workflow via dataflow edges.- Specified by:
hasNoUnconnectedDataNodes
in interfaceNESTWorkflowValidator
- Returns:
- True, if all data nodes are connected to the workflow.
-
hasCorrectControlflowEdges
public boolean hasCorrectControlflowEdges()Description copied from interface:NESTWorkflowValidator
This 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:
hasCorrectControlflowEdges
in interfaceNESTWorkflowValidator
- Returns:
- True, if controlflow edges are valid.
-
hasUniqueWorkflowNode
public boolean hasUniqueWorkflowNode()Description copied from interface:NESTWorkflowValidator
This method verifies that the workflow node exists and is unique.- Specified by:
hasUniqueWorkflowNode
in interfaceNESTWorkflowValidator
- Returns:
- True, if workflow node is unique.
-
hasSingleStartEndNode
public boolean hasSingleStartEndNode()Description copied from interface:NESTWorkflowValidator
This method verifies that the workflow has only one start node and only one end node.- Specified by:
hasSingleStartEndNode
in interfaceNESTWorkflowValidator
- Returns:
- True, if start and end node are unique.
-
checkControlflowBlocks
public boolean checkControlflowBlocks()Description copied from interface:NESTWorkflowValidator
This 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:
checkControlflowBlocks
in interfaceNESTWorkflowValidator
- Returns:
- True, if all controlflow blocks are valid.
-
checkSemanticDescriptors
public boolean checkSemanticDescriptors()Description copied from interface:NESTWorkflowValidator
This method checks if the classes at the semantic descriptors of the nodes and edges are valid.- Specified by:
checkSemanticDescriptors
in interfaceNESTWorkflowValidator
- Returns:
- True, if all semantic descriptors are valid.
-
getGraph
Description copied from interface:NESTGraphValidator
This method returns the graph object for which the validator was created.- Specified by:
getGraph
in interfaceNESTGraphValidator
- Specified by:
getGraph
in interfaceNESTWorkflowValidator
- Overrides:
getGraph
in classNESTGraphValidatorImpl
- Returns:
- The graph object for which the validator was created.
-