List messages = new Vector();
messages.addAll(super.verify());
if (_splitType != _AND
&& _splitType != _OR
&& _splitType != _XOR) {
messages.add(new YVerificationMessage(this, this + " Incorrect value for split type",
YVerificationMessage.ERROR_STATUS));
}
if (_joinType != _AND
&& _joinType != _OR
&& _joinType != _XOR) {
messages.add(new YVerificationMessage(this, this + " Incorrect value for join type",
YVerificationMessage.ERROR_STATUS));
}
if (_splitType != _AND &&
(_splitType == _OR || _splitType == _XOR)) {
int defaultCount = 0;
List postsetFlows = new ArrayList(getPostsetFlows());
Collections.sort(postsetFlows);
long lastOrdering = Long.MIN_VALUE;
for (Iterator iterator = postsetFlows.iterator(); iterator.hasNext();) {
YFlow flow = (YFlow) iterator.next();
if (flow.getEvalOrdering() != null) {
int thisOrdering = flow.getEvalOrdering().intValue();
if (thisOrdering == lastOrdering) {
messages.add(new YVerificationMessage(this,
this + " no two elements may posess the same " +
"ordering (" + flow + ") for the same task.",
YVerificationMessage.ERROR_STATUS));
}
lastOrdering = thisOrdering;
}
if (flow.isDefaultFlow()) {
defaultCount++;
}
}
if (defaultCount != 1) {
messages.add(new YVerificationMessage(this, this + " the postset of any OR/XOR " +
"split must have one default flow. (not " + defaultCount + ")",
YVerificationMessage.ERROR_STATUS));
}
}
if (_multiInstAttr != null) {
messages.addAll(_multiInstAttr.verify());
}
Iterator removeSetIt = _removeSet.iterator();
while (removeSetIt.hasNext()) {
YExternalNetElement element = (YExternalNetElement) removeSetIt.next();
if (element == null) {
messages.add(new YVerificationMessage(this,
this + " refers to a non existant element in its remove set.",
YVerificationMessage.ERROR_STATUS));
} else if (!element._net.equals(_net)) {
messages.add(new YVerificationMessage(this,
this + " and " + element + " must be contained in the same net."
+ " (container " + _net + " & " + element._net + ")",
YVerificationMessage.ERROR_STATUS));
}
}
if (_decompositionPrototype != null) {
messages.addAll(checkParameterMappings());
} else {
if (_dataMappingsForTaskStarting.size() > 0) {
messages.add(new YVerificationMessage(
this, "Syntax error for " + this + " to have startingMappings and no decomposition.",
YVerificationMessage.ERROR_STATUS));
}
if (_dataMappingsForTaskCompletion.size() > 0) {
messages.add(new YVerificationMessage(
this,
"Syntax error for " + this + " to have completionMappings and no decomposition.",
YVerificationMessage.ERROR_STATUS));
}
}