private ProcessorCheckStatus checkProcessor()

in taverna-scufl2-api/src/main/java/org/apache/taverna/scufl2/validation/structural/StructuralValidator.java [192:238]


	private ProcessorCheckStatus checkProcessor() {
		Processor p = validatorState.get().getProcessor();
		Map<InputProcessorPort, Integer> inputDepths = new HashMap<>();
		// Check whether all our input ports have inbound links
		for (InputProcessorPort input : p.getInputPorts()) {
			DataLink mainIncomingLink = validatorState.get()
					.getMainIncomingDataLink(input);
			if (mainIncomingLink == null) {
				validatorState.get().getEventListener()
						.missingMainIncomingLink(input);
				// validatorState.get().addMissingMainIncomingDataLink(input);
				return ProcessorCheckStatus.FAILED;
			}
			Integer dataLinkResolvedDepth = validatorState.get()
					.getDataLinkResolvedDepth(mainIncomingLink);
			if (dataLinkResolvedDepth == null)
				return ProcessorCheckStatus.COULD_NOT_CHECK;

			Integer resolvedDepth = dataLinkResolvedDepth
					+ (validatorState.get().isMergedPort(input) ? 1 : 0);
			validatorState.get().getEventListener()
					.depthResolution(input, resolvedDepth);
			validatorState.get().setPortResolvedDepth(input, resolvedDepth);
			inputDepths.put(input, resolvedDepth);
		}

		Integer resultWrappingDepth = calculateResultWrappingDepth(inputDepths);
		if (resultWrappingDepth == null)
			return ProcessorCheckStatus.FAILED;

		for (OutputProcessorPort output : p.getOutputPorts()) {
			Integer portDepth = output.getDepth();
			Integer resolvedDepth = portDepth + resultWrappingDepth;
			validatorState.get().getEventListener()
					.depthResolution(output, resolvedDepth);
			validatorState.get().setPortResolvedDepth(output, resolvedDepth);
			for (DataLink dl : validatorState.get()
					.getOutgoingDataLinks(output)) {
				validatorState.get().getEventListener()
						.depthResolution(dl, resolvedDepth);
				validatorState.get()
						.setDataLinkResolvedDepth(dl, resolvedDepth);
			}
		}

		return ProcessorCheckStatus.PASSED;
	}