001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     *
009     *     http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    package org.apache.commons.scxml;
018    
019    // Used for suggesting replacement in deprecation warnings
020    import org.apache.commons.scxml.semantics.ErrorConstants;
021    
022    /**
023     * An interface for reporting SCXML errors to the host environment,
024     * containing the definition of commonly occuring errors while executing
025     * SCXML documents.
026     *
027     */
028    public interface ErrorReporter {
029    
030        /**
031         * Handler for reporting an error.
032         *
033         * @param errCode
034         *            one of the ErrorReporter's constants
035         * @param errDetail
036         *            human readable description
037         * @param errCtx
038         *            typically an SCXML element which caused an error,
039         *            may be accompanied by additional information
040         */
041        void onError(String errCode, String errDetail, Object errCtx);
042    
043        /**
044         * Missing initial state for a composite state or for the scxml root.
045         *
046         * @see org.apache.commons.scxml.model.SCXML#getInitialState()
047         * @see org.apache.commons.scxml.model.State#getInitial()
048         *
049         * @deprecated Use {@link ErrorConstants#NO_INITIAL} instead.
050         */
051        String NO_INITIAL = "NO_INITIAL";
052    
053        /**
054         * An initial state for a composite state whose Transition does not.
055         * Map to a descendant of the composite state.
056         *
057         * @deprecated Use {@link ErrorConstants#ILLEGAL_INITIAL} instead.
058         */
059        String ILLEGAL_INITIAL = "ILLEGAL_INITIAL";
060    
061        /**
062         * Unknown action - unsupported executable content. List of supported.
063         * actions: assign, cancel, elseif, else, if, log, send, var
064         *
065         * @deprecated Use {@link ErrorConstants#UNKNOWN_ACTION} instead.
066         */
067        String UNKNOWN_ACTION = "UNKNOWN_ACTION";
068    
069        /**
070         * Illegal state machine configuration.
071         * Either a parallel exists which does not have all its AND sub-states
072         * active or there are multiple enabled OR states on the same level.
073         *
074         * @deprecated Use {@link ErrorConstants#ILLEGAL_CONFIG} instead.
075         */
076        String ILLEGAL_CONFIG = "ILLEGAL_CONFIG";
077    
078        /**
079         * Non-deterministic situation has occured - there are more than
080         * one enabled transitions in conflict.
081         *
082         * @deprecated No longer necessary, non determinism is solved based
083         *             on state heirarchy and document order priorities.
084         */
085        String NON_DETERMINISTIC = "NON_DETERMINISTIC";
086    
087        /**
088         * A variable referred to by assign name attribute is undefined.
089         *
090         * @deprecated Use {@link ErrorConstants#UNDEFINED_VARIABLE} instead.
091         */
092        String UNDEFINED_VARIABLE = "UNDEFINED_VARIABLE";
093    
094        /**
095         * An expression language error.
096         *
097         * @deprecated Use {@link ErrorConstants#EXPRESSION_ERROR} instead.
098         */
099        String EXPRESSION_ERROR = "EXPRESSION_ERROR";
100    
101    }