org.apache.taverna.activities.xpath.XPathActivityHealthChecker Maven / Gradle / Ivy
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.taverna.activities.xpath;
import static org.apache.taverna.activities.xpath.XPathActivityHealthCheck.CORRECTLY_CONFIGURED;
import static org.apache.taverna.activities.xpath.XPathActivityHealthCheck.EMPTY_XPATH_EXPRESSION;
import static org.apache.taverna.activities.xpath.XPathActivityHealthCheck.GENERAL_CONFIG_PROBLEM;
import static org.apache.taverna.activities.xpath.XPathActivityHealthCheck.INVALID_XPATH_EXPRESSION;
import static org.apache.taverna.activities.xpath.XPathActivityHealthCheck.MISSING_NAMESPACE_MAPPINGS;
import static org.apache.taverna.activities.xpath.XPathActivityHealthCheck.NO_EXAMPLE_DOCUMENT;
import static org.apache.taverna.activities.xpath.XPathUtils.XPATH_EMPTY;
import static org.apache.taverna.activities.xpath.XPathUtils.XPATH_INVALID;
import static org.apache.taverna.activities.xpath.XPathUtils.isValid;
import static org.apache.taverna.activities.xpath.XPathUtils.validateXPath;
import static org.apache.taverna.visit.VisitReport.getWorstStatus;
import static org.apache.taverna.visit.VisitReport.Status.OK;
import static org.apache.taverna.visit.VisitReport.Status.SEVERE;
import static org.apache.taverna.visit.VisitReport.Status.WARNING;
import static org.apache.taverna.workflowmodel.health.HealthCheck.NO_PROBLEM;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.taverna.visit.VisitKind;
import org.apache.taverna.visit.VisitReport;
import org.apache.taverna.visit.VisitReport.Status;
import org.apache.taverna.workflowmodel.health.HealthChecker;
import com.fasterxml.jackson.databind.JsonNode;
/**
* A {@link HealthChecker} for a {@link XPathActivity}.
*
* @author Sergejs Aleksejevs
*/
public class XPathActivityHealthChecker implements HealthChecker {
@Override
public boolean canVisit(Object subject) {
return (subject instanceof XPathActivity);
}
@Override
public VisitReport visit(XPathActivity activity, List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy