JBpmPseudostateLogic.java

// license-header java merge-point
//
// Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
//
package org.andromda.cartridges.jbpm.metafacades;

import java.util.Collection;
import org.andromda.core.common.Introspector;
import org.andromda.core.metafacade.MetafacadeBase;
import org.andromda.core.metafacade.MetafacadeFactory;
import org.andromda.core.metafacade.ModelValidationMessage;
import org.andromda.metafacades.uml.ConstraintFacade;
import org.andromda.metafacades.uml.DependencyFacade;
import org.andromda.metafacades.uml.ModelElementFacade;
import org.andromda.metafacades.uml.ModelFacade;
import org.andromda.metafacades.uml.PackageFacade;
import org.andromda.metafacades.uml.PartitionFacade;
import org.andromda.metafacades.uml.PseudostateFacade;
import org.andromda.metafacades.uml.StateFacade;
import org.andromda.metafacades.uml.StateMachineFacade;
import org.andromda.metafacades.uml.StereotypeFacade;
import org.andromda.metafacades.uml.TaggedValueFacade;
import org.andromda.metafacades.uml.TemplateParameterFacade;
import org.andromda.metafacades.uml.TransitionFacade;
import org.andromda.metafacades.uml.TypeMappings;
import org.andromda.translation.ocl.validation.OCLCollections;
import org.andromda.translation.ocl.validation.OCLIntrospector;
import org.andromda.translation.ocl.validation.OCLResultEnsurer;
import org.apache.commons.collections.Predicate;
import org.apache.log4j.Logger;

/**
 * TODO: Model Documentation for org.andromda.cartridges.jbpm.metafacades.JBpmPseudostate
 * MetafacadeLogic for JBpmPseudostate
 *
 * @see JBpmPseudostate
 */
public abstract class JBpmPseudostateLogic
    extends MetafacadeBase
    implements JBpmPseudostate
{
    /**
     * The underlying UML object
     * @see Object
     */
    protected Object metaObject;

    /** Create Metafacade implementation instance using the MetafacadeFactory from the context
     * @param metaObjectIn
     * @param context
     */
    protected JBpmPseudostateLogic(Object metaObjectIn, String context)
    {
        super(metaObjectIn, getContext(context));
        this.superJBpmStateVertex =
           (JBpmStateVertex)
            MetafacadeFactory.getInstance().createFacadeImpl(
                    "org.andromda.cartridges.jbpm.metafacades.JBpmStateVertex",
                    metaObjectIn,
                    getContext(context));
        this.superPseudostateFacade =
           (PseudostateFacade)
            MetafacadeFactory.getInstance().createFacadeImpl(
                    "org.andromda.metafacades.uml.PseudostateFacade",
                    metaObjectIn,
                    getContext(context));
        this.metaObject = metaObjectIn;
    }

    /**
     * The logger instance.
     */
    private static final Logger logger = Logger.getLogger(JBpmPseudostateLogic.class);

    /**
     * Gets the context for this metafacade logic instance.
     * @param context String. Set to JBpmPseudostate if null
     * @return context String
     */
    private static String getContext(String context)
    {
        if (context == null)
        {
            context = "org.andromda.cartridges.jbpm.metafacades.JBpmPseudostate";
        }
        return context;
    }

    private JBpmStateVertex superJBpmStateVertex;
    private boolean superJBpmStateVertexInitialized = false;

    /**
     * Gets the JBpmStateVertex parent instance.
     * @return this.superJBpmStateVertex JBpmStateVertex
     */
    protected JBpmStateVertex getSuperJBpmStateVertex()
    {
        if (!this.superJBpmStateVertexInitialized)
        {
            ((MetafacadeBase)this.superJBpmStateVertex).setMetafacadeContext(this.getMetafacadeContext());
            this.superJBpmStateVertexInitialized = true;
        }
        return this.superJBpmStateVertex;
    }

    private PseudostateFacade superPseudostateFacade;
    private boolean superPseudostateFacadeInitialized = false;

    /**
     * Gets the PseudostateFacade parent instance.
     * @return this.superPseudostateFacade PseudostateFacade
     */
    protected PseudostateFacade getSuperPseudostateFacade()
    {
        if (!this.superPseudostateFacadeInitialized)
        {
            ((MetafacadeBase)this.superPseudostateFacade).setMetafacadeContext(this.getMetafacadeContext());
            this.superPseudostateFacadeInitialized = true;
        }
        return this.superPseudostateFacade;
    }

    /** Reset context only for non-root metafacades
     * @param context
     * @see MetafacadeBase#resetMetafacadeContext(String context)
     */
    @Override
    public void resetMetafacadeContext(String context)
    {
        if (!this.contextRoot) // reset context only for non-root metafacades
        {
            context = getContext(context);  // to have same value as in original constructor call
            setMetafacadeContext (context);
            if (this.superJBpmStateVertexInitialized)
            {
                ((MetafacadeBase)this.superJBpmStateVertex).resetMetafacadeContext(context);
            }
            if (this.superPseudostateFacadeInitialized)
            {
                ((MetafacadeBase)this.superPseudostateFacade).resetMetafacadeContext(context);
            }
        }
    }

    /**
     * @return boolean true always
     * @see JBpmPseudostate
     */
    public boolean isJBpmPseudostateMetaType()
    {
        return true;
    }

    // --------------- attributes ---------------------

   /**
    * @see org.andromda.cartridges.jbpm.metafacades.JBpmPseudostate#getClazz()
    * @return String
    */
    protected abstract String handleGetClazz();

    private String __clazz1a;
    private boolean __clazz1aSet = false;

    /**
     * TODO: Model Documentation for org.andromda.cartridges.jbpm.metafacades.JBpmPseudostate.clazz
     * @return (String)handleGetClazz()
     */
    public final String getClazz()
    {
        String clazz1a = this.__clazz1a;
        if (!this.__clazz1aSet)
        {
            // clazz has no pre constraints
            clazz1a = handleGetClazz();
            // clazz has no post constraints
            this.__clazz1a = clazz1a;
            if (isMetafacadePropertyCachingEnabled())
            {
                this.__clazz1aSet = true;
            }
        }
        return clazz1a;
    }

   /**
    * @see org.andromda.cartridges.jbpm.metafacades.JBpmPseudostate#getClassName()
    * @return String
    */
    protected abstract String handleGetClassName();

    private String __className2a;
    private boolean __className2aSet = false;

    /**
     * TODO: Model Documentation for
     * org.andromda.cartridges.jbpm.metafacades.JBpmPseudostate.className
     * @return (String)handleGetClassName()
     */
    public final String getClassName()
    {
        String className2a = this.__className2a;
        if (!this.__className2aSet)
        {
            // className has no pre constraints
            className2a = handleGetClassName();
            // className has no post constraints
            this.__className2a = className2a;
            if (isMetafacadePropertyCachingEnabled())
            {
                this.__className2aSet = true;
            }
        }
        return className2a;
    }

   /**
    * @see org.andromda.cartridges.jbpm.metafacades.JBpmPseudostate#getDecisionHandlerPackageName()
    * @return String
    */
    protected abstract String handleGetDecisionHandlerPackageName();

    private String __decisionHandlerPackageName3a;
    private boolean __decisionHandlerPackageName3aSet = false;

    /**
     * TODO: Model Documentation for
     * org.andromda.cartridges.jbpm.metafacades.JBpmPseudostate.decisionHandlerPackageName
     * @return (String)handleGetDecisionHandlerPackageName()
     */
    public final String getDecisionHandlerPackageName()
    {
        String decisionHandlerPackageName3a = this.__decisionHandlerPackageName3a;
        if (!this.__decisionHandlerPackageName3aSet)
        {
            // decisionHandlerPackageName has no pre constraints
            decisionHandlerPackageName3a = handleGetDecisionHandlerPackageName();
            // decisionHandlerPackageName has no post constraints
            this.__decisionHandlerPackageName3a = decisionHandlerPackageName3a;
            if (isMetafacadePropertyCachingEnabled())
            {
                this.__decisionHandlerPackageName3aSet = true;
            }
        }
        return decisionHandlerPackageName3a;
    }

   /**
    * @see org.andromda.cartridges.jbpm.metafacades.JBpmPseudostate#getDecisionHandlerFullPath()
    * @return String
    */
    protected abstract String handleGetDecisionHandlerFullPath();

    private String __decisionHandlerFullPath4a;
    private boolean __decisionHandlerFullPath4aSet = false;

    /**
     * TODO: Model Documentation for
     * org.andromda.cartridges.jbpm.metafacades.JBpmPseudostate.decisionHandlerFullPath
     * @return (String)handleGetDecisionHandlerFullPath()
     */
    public final String getDecisionHandlerFullPath()
    {
        String decisionHandlerFullPath4a = this.__decisionHandlerFullPath4a;
        if (!this.__decisionHandlerFullPath4aSet)
        {
            // decisionHandlerFullPath has no pre constraints
            decisionHandlerFullPath4a = handleGetDecisionHandlerFullPath();
            // decisionHandlerFullPath has no post constraints
            this.__decisionHandlerFullPath4a = decisionHandlerFullPath4a;
            if (isMetafacadePropertyCachingEnabled())
            {
                this.__decisionHandlerFullPath4aSet = true;
            }
        }
        return decisionHandlerFullPath4a;
    }

   /**
    * @see org.andromda.cartridges.jbpm.metafacades.JBpmPseudostate#getDecisionHandlerClassName()
    * @return String
    */
    protected abstract String handleGetDecisionHandlerClassName();

    private String __decisionHandlerClassName5a;
    private boolean __decisionHandlerClassName5aSet = false;

    /**
     * TODO: Model Documentation for
     * org.andromda.cartridges.jbpm.metafacades.JBpmPseudostate.decisionHandlerClassName
     * @return (String)handleGetDecisionHandlerClassName()
     */
    public final String getDecisionHandlerClassName()
    {
        String decisionHandlerClassName5a = this.__decisionHandlerClassName5a;
        if (!this.__decisionHandlerClassName5aSet)
        {
            // decisionHandlerClassName has no pre constraints
            decisionHandlerClassName5a = handleGetDecisionHandlerClassName();
            // decisionHandlerClassName has no post constraints
            this.__decisionHandlerClassName5a = decisionHandlerClassName5a;
            if (isMetafacadePropertyCachingEnabled())
            {
                this.__decisionHandlerClassName5aSet = true;
            }
        }
        return decisionHandlerClassName5a;
    }

    // ------------- associations ------------------

    private JBpmSwimlane __getSwimlane1r;
    private boolean __getSwimlane1rSet = false;

    /**
     * TODO: Model Documentation for org.andromda.cartridges.jbpm.metafacades.JBpmPseudostate
     * @return (JBpmSwimlane)handleGetSwimlane()
     */
    public final JBpmSwimlane getSwimlane()
    {
        JBpmSwimlane getSwimlane1r = this.__getSwimlane1r;
        if (!this.__getSwimlane1rSet)
        {
            // jBpmPseudostate has no pre constraints
            Object result = handleGetSwimlane();
            MetafacadeBase shieldedResult = this.shieldedElement(result);
            try
            {
                getSwimlane1r = (JBpmSwimlane)shieldedResult;
            }
            catch (ClassCastException ex)
            {
                // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
                JBpmPseudostateLogic.logger.warn("incorrect metafacade cast for JBpmPseudostateLogic.getSwimlane JBpmSwimlane " + result + ": " + shieldedResult);
            }
            // jBpmPseudostate has no post constraints
            this.__getSwimlane1r = getSwimlane1r;
            if (isMetafacadePropertyCachingEnabled())
            {
                this.__getSwimlane1rSet = true;
            }
        }
        return getSwimlane1r;
    }

    /**
     * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type
     * @return Object
     */
    protected abstract Object handleGetSwimlane();

    /**
     * @return true
     * @see JBpmStateVertex
     */
    public boolean isJBpmStateVertexMetaType()
    {
        return true;
    }

    /**
     * @return true
     * @see PseudostateFacade
     */
    public boolean isPseudostateFacadeMetaType()
    {
        return true;
    }

    /**
     * @return true
     * @see org.andromda.metafacades.uml.StateVertexFacade
     */
    public boolean isStateVertexFacadeMetaType()
    {
        return true;
    }

    /**
     * @return true
     * @see ModelElementFacade
     */
    public boolean isModelElementFacadeMetaType()
    {
        return true;
    }

    // ----------- delegates to JBpmStateVertex ------------
    /**
     * TODO: Model Documentation for
     * JBpmStateVertex.nodeClassName
     * @see JBpmStateVertex#getNodeClassName()
     */
    public String getNodeClassName()
    {
        return this.getSuperJBpmStateVertex().getNodeClassName();
    }

    /**
     * TODO: Model Documentation for
     * JBpmStateVertex.nodePackageName
     * @see JBpmStateVertex#getNodePackageName()
     */
    public String getNodePackageName()
    {
        return this.getSuperJBpmStateVertex().getNodePackageName();
    }

    /**
     * TODO: Model Documentation for JBpmProcessDefinition
     * @see JBpmStateVertex#getProcessDefinition()
     */
    public JBpmProcessDefinition getProcessDefinition()
    {
        return this.getSuperJBpmStateVertex().getProcessDefinition();
    }

    /**
     * True if this element is part of a business process usecase.
     * @see JBpmStateVertex#isContainedInBusinessProcess()
     */
    public boolean isContainedInBusinessProcess()
    {
        return this.getSuperJBpmStateVertex().isContainedInBusinessProcess();
    }

    /**
     * Copies all tagged values from the given ModelElementFacade to this model element facade.
     * @see ModelElementFacade#copyTaggedValues(ModelElementFacade element)
     */
    public void copyTaggedValues(ModelElementFacade element)
    {
        this.getSuperJBpmStateVertex().copyTaggedValues(element);
    }

    /**
     * Finds the tagged value with the specified 'tagName'. In case there are more values the first
     * one found will be returned.
     * @see ModelElementFacade#findTaggedValue(String tagName)
     */
    public Object findTaggedValue(String tagName)
    {
        return this.getSuperJBpmStateVertex().findTaggedValue(tagName);
    }

    /**
     * Returns all the values for the tagged value with the specified name. The returned collection
     * will contains only String instances, or will be empty. Never null.
     * @see ModelElementFacade#findTaggedValues(String tagName)
     */
    public Collection<Object> findTaggedValues(String tagName)
    {
        return this.getSuperJBpmStateVertex().findTaggedValues(tagName);
    }

    /**
     * Returns the fully qualified name of the model element. The fully qualified name includes
     * complete package qualified name of the underlying model element. The templates parameter will
     * be replaced by the correct one given the binding relation of the parameter to this element.
     * @see ModelElementFacade#getBindedFullyQualifiedName(ModelElementFacade bindedElement)
     */
    public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
    {
        return this.getSuperJBpmStateVertex().getBindedFullyQualifiedName(bindedElement);
    }

    /**
     * Gets all constraints belonging to the model element.
     * @see ModelElementFacade#getConstraints()
     */
    public Collection<ConstraintFacade> getConstraints()
    {
        return this.getSuperJBpmStateVertex().getConstraints();
    }

    /**
     * Returns the constraints of the argument kind that have been placed onto this model. Typical
     * kinds are "inv", "pre" and "post". Other kinds are possible.
     * @see ModelElementFacade#getConstraints(String kind)
     */
    public Collection<ConstraintFacade> getConstraints(String kind)
    {
        return this.getSuperJBpmStateVertex().getConstraints(kind);
    }

    /**
     * Gets the documentation for the model element, The indent argument is prefixed to each line.
     * By default this method wraps lines after 64 characters.
     * This method is equivalent to <code>getDocumentation(indent, 64)</code>.
     * @see ModelElementFacade#getDocumentation(String indent)
     */
    public String getDocumentation(String indent)
    {
        return this.getSuperJBpmStateVertex().getDocumentation(indent);
    }

    /**
     * This method returns the documentation for this model element, with the lines wrapped after
     * the specified number of characters, values of less than 1 will indicate no line wrapping is
     * required. By default paragraphs are returned as HTML.
     * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>.
     * @see ModelElementFacade#getDocumentation(String indent, int lineLength)
     */
    public String getDocumentation(String indent, int lineLength)
    {
        return this.getSuperJBpmStateVertex().getDocumentation(indent, lineLength);
    }

    /**
     * This method returns the documentation for this model element, with the lines wrapped after
     * the specified number of characters, values of less than 1 will indicate no line wrapping is
     * required. HTML style determines if HTML Escaping is applied.
     * @see ModelElementFacade#getDocumentation(String indent, int lineLength, boolean htmlStyle)
     */
    public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
    {
        return this.getSuperJBpmStateVertex().getDocumentation(indent, lineLength, htmlStyle);
    }

    /**
     * The fully qualified name of this model element.
     * @see ModelElementFacade#getFullyQualifiedName()
     */
    public String getFullyQualifiedName()
    {
        return this.getSuperJBpmStateVertex().getFullyQualifiedName();
    }

    /**
     * Returns the fully qualified name of the model element. The fully qualified name includes
     * complete package qualified name of the underlying model element.  If modelName is true, then
     * the original name of the model element (the name contained within the model) will be the name
     * returned, otherwise a name from a language mapping will be returned.
     * @see ModelElementFacade#getFullyQualifiedName(boolean modelName)
     */
    public String getFullyQualifiedName(boolean modelName)
    {
        return this.getSuperJBpmStateVertex().getFullyQualifiedName(modelName);
    }

    /**
     * Returns the fully qualified name as a path, the returned value always starts with out a slash
     * '/'.
     * @see ModelElementFacade#getFullyQualifiedNamePath()
     */
    public String getFullyQualifiedNamePath()
    {
        return this.getSuperJBpmStateVertex().getFullyQualifiedNamePath();
    }

    /**
     * Gets the unique identifier of the underlying model element.
     * @see ModelElementFacade#getId()
     */
    public String getId()
    {
        return this.getSuperJBpmStateVertex().getId();
    }

    /**
     * UML2: Retrieves the keywords for this element. Used to modify implementation properties which
     * are not represented by other properties, i.e. native, transient, volatile, synchronized,
     * (added annotations) override, deprecated. Can also be used to suppress compiler warnings:
     * (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require
     * JDK5 compiler level.
     * @see ModelElementFacade#getKeywords()
     */
    public Collection<String> getKeywords()
    {
        return this.getSuperJBpmStateVertex().getKeywords();
    }

    /**
     * UML2: Retrieves a localized label for this named element.
     * @see ModelElementFacade#getLabel()
     */
    public String getLabel()
    {
        return this.getSuperJBpmStateVertex().getLabel();
    }

    /**
     * The language mappings that have been set for this model element.
     * @see ModelElementFacade#getLanguageMappings()
     */
    public TypeMappings getLanguageMappings()
    {
        return this.getSuperJBpmStateVertex().getLanguageMappings();
    }

    /**
     * Return the model containing this model element (multiple models may be loaded and processed
     * at the same time).
     * @see ModelElementFacade#getModel()
     */
    public ModelFacade getModel()
    {
        return this.getSuperJBpmStateVertex().getModel();
    }

    /**
     * The name of the model element.
     * @see ModelElementFacade#getName()
     */
    public String getName()
    {
        return this.getSuperJBpmStateVertex().getName();
    }

    /**
     * Gets the package to which this model element belongs.
     * @see ModelElementFacade#getPackage()
     */
    public ModelElementFacade getPackage()
    {
        return this.getSuperJBpmStateVertex().getPackage();
    }

    /**
     * The name of this model element's package.
     * @see ModelElementFacade#getPackageName()
     */
    public String getPackageName()
    {
        return this.getSuperJBpmStateVertex().getPackageName();
    }

    /**
     * Gets the package name (optionally providing the ability to retrieve the model name and not
     * the mapped name).
     * @see ModelElementFacade#getPackageName(boolean modelName)
     */
    public String getPackageName(boolean modelName)
    {
        return this.getSuperJBpmStateVertex().getPackageName(modelName);
    }

    /**
     * Returns the package as a path, the returned value always starts with out a slash '/'.
     * @see ModelElementFacade#getPackagePath()
     */
    public String getPackagePath()
    {
        return this.getSuperJBpmStateVertex().getPackagePath();
    }

    /**
     * UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the
     * NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from
     * the names of the containing namespaces starting at the root of the hierarchy and ending with
     * the name of the NamedElement itself.
     * @see ModelElementFacade#getQualifiedName()
     */
    public String getQualifiedName()
    {
        return this.getSuperJBpmStateVertex().getQualifiedName();
    }

    /**
     * Gets the root package for the model element.
     * @see ModelElementFacade#getRootPackage()
     */
    public PackageFacade getRootPackage()
    {
        return this.getSuperJBpmStateVertex().getRootPackage();
    }

    /**
     * Gets the dependencies for which this model element is the source.
     * @see ModelElementFacade#getSourceDependencies()
     */
    public Collection<DependencyFacade> getSourceDependencies()
    {
        return this.getSuperJBpmStateVertex().getSourceDependencies();
    }

    /**
     * If this model element is the context of an activity graph, this represents that activity
     * graph.
     * @see ModelElementFacade#getStateMachineContext()
     */
    public StateMachineFacade getStateMachineContext()
    {
        return this.getSuperJBpmStateVertex().getStateMachineContext();
    }

    /**
     * The collection of ALL stereotype names for this model element.
     * @see ModelElementFacade#getStereotypeNames()
     */
    public Collection<String> getStereotypeNames()
    {
        return this.getSuperJBpmStateVertex().getStereotypeNames();
    }

    /**
     * Gets all stereotypes for this model element.
     * @see ModelElementFacade#getStereotypes()
     */
    public Collection<StereotypeFacade> getStereotypes()
    {
        return this.getSuperJBpmStateVertex().getStereotypes();
    }

    /**
     * Return the TaggedValues associated with this model element, under all stereotypes.
     * @see ModelElementFacade#getTaggedValues()
     */
    public Collection<TaggedValueFacade> getTaggedValues()
    {
        return this.getSuperJBpmStateVertex().getTaggedValues();
    }

    /**
     * Gets the dependencies for which this model element is the target.
     * @see ModelElementFacade#getTargetDependencies()
     */
    public Collection<DependencyFacade> getTargetDependencies()
    {
        return this.getSuperJBpmStateVertex().getTargetDependencies();
    }

    /**
     * Get the template parameter for this model element having the parameterName
     * @see ModelElementFacade#getTemplateParameter(String parameterName)
     */
    public Object getTemplateParameter(String parameterName)
    {
        return this.getSuperJBpmStateVertex().getTemplateParameter(parameterName);
    }

    /**
     * Get the template parameters for this model element
     * @see ModelElementFacade#getTemplateParameters()
     */
    public Collection<TemplateParameterFacade> getTemplateParameters()
    {
        return this.getSuperJBpmStateVertex().getTemplateParameters();
    }

    /**
     * The visibility (i.e. public, private, protected or package) of the model element, will
     * attempt a lookup for these values in the language mappings (if any).
     * @see ModelElementFacade#getVisibility()
     */
    public String getVisibility()
    {
        return this.getSuperJBpmStateVertex().getVisibility();
    }

    /**
     * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance
     * is taken into account when searching for the stereotype), false otherwise.
     * @see ModelElementFacade#hasExactStereotype(String stereotypeName)
     */
    public boolean hasExactStereotype(String stereotypeName)
    {
        return this.getSuperJBpmStateVertex().hasExactStereotype(stereotypeName);
    }

    /**
     * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma,
     * pipe, semicolon, or << >>
     * @see ModelElementFacade#hasKeyword(String keywordName)
     */
    public boolean hasKeyword(String keywordName)
    {
        return this.getSuperJBpmStateVertex().hasKeyword(keywordName);
    }

    /**
     * Returns true if the model element has the specified stereotype.  If the stereotype itself
     * does not match, then a search will be made up the stereotype inheritance hierarchy, and if
     * one of the stereotype's ancestors has a matching name this method will return true, false
     * otherwise.
     * For example, if we have a certain stereotype called <<exception>> and a model element has a
     * stereotype called <<applicationException>> which extends <<exception>>, when calling this
     * method with 'stereotypeName' defined as 'exception' the method would return true since
     * <<applicationException>> inherits from <<exception>>.  If you want to check if the model
     * element has the exact stereotype, then use the method 'hasExactStereotype' instead.
     * @see ModelElementFacade#hasStereotype(String stereotypeName)
     */
    public boolean hasStereotype(String stereotypeName)
    {
        return this.getSuperJBpmStateVertex().hasStereotype(stereotypeName);
    }

    /**
     * True if there are target dependencies from this element that are instances of BindingFacade.
     * Deprecated in UML2: Use TemplateBinding parameters instead of dependencies.
     * @see ModelElementFacade#isBindingDependenciesPresent()
     */
    public boolean isBindingDependenciesPresent()
    {
        return this.getSuperJBpmStateVertex().isBindingDependenciesPresent();
    }

    /**
     * Indicates if any constraints are present on this model element.
     * @see ModelElementFacade#isConstraintsPresent()
     */
    public boolean isConstraintsPresent()
    {
        return this.getSuperJBpmStateVertex().isConstraintsPresent();
    }

    /**
     * Indicates if any documentation is present on this model element.
     * @see ModelElementFacade#isDocumentationPresent()
     */
    public boolean isDocumentationPresent()
    {
        return this.getSuperJBpmStateVertex().isDocumentationPresent();
    }

    /**
     * True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript.
     * @see ModelElementFacade#isReservedWord()
     */
    public boolean isReservedWord()
    {
        return this.getSuperJBpmStateVertex().isReservedWord();
    }

    /**
     * True is there are template parameters on this model element. For UML2, applies to Class,
     * Operation, Property, and Parameter.
     * @see ModelElementFacade#isTemplateParametersPresent()
     */
    public boolean isTemplateParametersPresent()
    {
        return this.getSuperJBpmStateVertex().isTemplateParametersPresent();
    }

    /**
     * True if this element name is a valid identifier name in Java, C#, ANSI or ISO C, C++,
     * JavaScript. Contains no spaces, special characters etc. Constraint always applied on
     * Enumerations and Interfaces, optionally applies on other model elements.
     * @see ModelElementFacade#isValidIdentifierName()
     */
    public boolean isValidIdentifierName()
    {
        return this.getSuperJBpmStateVertex().isValidIdentifierName();
    }

    /**
     * Searches for the constraint with the specified 'name' on this model element, and if found
     * translates it using the specified 'translation' from a translation library discovered by the
     * framework.
     * @see ModelElementFacade#translateConstraint(String name, String translation)
     */
    public String translateConstraint(String name, String translation)
    {
        return this.getSuperJBpmStateVertex().translateConstraint(name, translation);
    }

    /**
     * Translates all constraints belonging to this model element with the given 'translation'.
     * @see ModelElementFacade#translateConstraints(String translation)
     */
    public String[] translateConstraints(String translation)
    {
        return this.getSuperJBpmStateVertex().translateConstraints(translation);
    }

    /**
     * Translates the constraints of the specified 'kind' belonging to this model element.
     * @see ModelElementFacade#translateConstraints(String kind, String translation)
     */
    public String[] translateConstraints(String kind, String translation)
    {
        return this.getSuperJBpmStateVertex().translateConstraints(kind, translation);
    }

    /**
     * Models a situation during which some (usually implicit) invariant condition holds. The states
     * of
     * protocol state machines are exposed to the users of their context classifiers. A protocol
     * state
     * represents an exposed stable situation of its context classifier: when an instance of the
     * classifier
     * is not processing any operation, users of this instance can always know its state
     * configuration.
     * @see org.andromda.metafacades.uml.StateVertexFacade#getContainer()
     */
    public StateFacade getContainer()
    {
        return this.getSuperJBpmStateVertex().getContainer();
    }

    /**
     * A directed relationship between a source vertex and a target vertex. It may be part of a
     * compound
     * transition, which takes the state machine from one state configuration to another,
     * representing the
     * complete response of the state machine to an occurrence of an event of a particular type.
     * @see org.andromda.metafacades.uml.StateVertexFacade#getIncomings()
     */
    public Collection<TransitionFacade> getIncomings()
    {
        return this.getSuperJBpmStateVertex().getIncomings();
    }

    /**
     * A directed relationship between a source vertex and a target vertex. It may be part of a
     * compound
     * transition, which takes the state machine from one state configuration to another,
     * representing the
     * complete response of the state machine to an occurrence of an event of a particular type.
     * @see org.andromda.metafacades.uml.StateVertexFacade#getOutgoings()
     */
    public Collection<TransitionFacade> getOutgoings()
    {
        return this.getSuperJBpmStateVertex().getOutgoings();
    }

    /**
     * The partition (if any) to which this vertex belongs.
     * @see org.andromda.metafacades.uml.StateVertexFacade#getPartition()
     */
    public PartitionFacade getPartition()
    {
        return this.getSuperJBpmStateVertex().getPartition();
    }

    /**
     * State machines can be used to express the behavior of part of a system. Behavior is modeled
     * as a
     * traversal of a graph of state nodes interconnected by one or more joined transition arcs that
     * are
     * triggered by the dispatching of series of (event) occurrences. During this traversal, the
     * state
     * machine executes a series of activities associated with various elements of the state
     * machine.
     * @see org.andromda.metafacades.uml.StateVertexFacade#getStateMachine()
     */
    public StateMachineFacade getStateMachine()
    {
        return this.getSuperJBpmStateVertex().getStateMachine();
    }

    // ----------- delegates to PseudostateFacade ------------
    /**
     * TODO: Model Documentation for PseudostateFacade.choice
     * @see PseudostateFacade#isChoice()
     */
    public boolean isChoice()
    {
        return this.getSuperPseudostateFacade().isChoice();
    }

    /**
     * Denotes this pseudostate to be either a join or a fork with a single outgoing transition and
     * more than one incoming transition.
     * @see PseudostateFacade#isCollect()
     */
    public boolean isCollect()
    {
        return this.getSuperPseudostateFacade().isCollect();
    }

    /**
     * TODO: Model Documentation for PseudostateFacade.decisionPoint
     * @see PseudostateFacade#isDecisionPoint()
     */
    public boolean isDecisionPoint()
    {
        return this.getSuperPseudostateFacade().isDecisionPoint();
    }

    /**
     * TODO: Model Documentation for PseudostateFacade.deepHistory
     * @see PseudostateFacade#isDeepHistory()
     */
    public boolean isDeepHistory()
    {
        return this.getSuperPseudostateFacade().isDeepHistory();
    }

    /**
     * TODO: Model Documentation for PseudostateFacade.fork
     * @see PseudostateFacade#isFork()
     */
    public boolean isFork()
    {
        return this.getSuperPseudostateFacade().isFork();
    }

    /**
     * TODO: Model Documentation for PseudostateFacade.initialState
     * @see PseudostateFacade#isInitialState()
     */
    public boolean isInitialState()
    {
        return this.getSuperPseudostateFacade().isInitialState();
    }

    /**
     * TODO: Model Documentation for PseudostateFacade.join
     * @see PseudostateFacade#isJoin()
     */
    public boolean isJoin()
    {
        return this.getSuperPseudostateFacade().isJoin();
    }

    /**
     * TODO: Model Documentation for PseudostateFacade.junction
     * @see PseudostateFacade#isJunction()
     */
    public boolean isJunction()
    {
        return this.getSuperPseudostateFacade().isJunction();
    }

    /**
     * TODO: Model Documentation for PseudostateFacade.mergePoint
     * @see PseudostateFacade#isMergePoint()
     */
    public boolean isMergePoint()
    {
        return this.getSuperPseudostateFacade().isMergePoint();
    }

    /**
     * TODO: Model Documentation for PseudostateFacade.shallowHistory
     * @see PseudostateFacade#isShallowHistory()
     */
    public boolean isShallowHistory()
    {
        return this.getSuperPseudostateFacade().isShallowHistory();
    }

    /**
     * Denotes this pseudostate to be either a join or a fork with a single incoming transition and
     * more than one outgoing transition.
     * @see PseudostateFacade#isSplit()
     */
    public boolean isSplit()
    {
        return this.getSuperPseudostateFacade().isSplit();
    }

    /**
     * @see MetafacadeBase#initialize()
     */
    @Override
    public void initialize()
    {
        this.getSuperJBpmStateVertex().initialize();
        this.getSuperPseudostateFacade().initialize();
    }

    /**
     * @return Object getSuperJBpmStateVertex().getValidationOwner()
     * @see MetafacadeBase#getValidationOwner()
     */
    @Override
    public Object getValidationOwner()
    {
        Object owner = this.getSuperJBpmStateVertex().getValidationOwner();
        if (owner == null)
        {
            owner = this.getSuperPseudostateFacade().getValidationOwner();
        }
        return owner;
    }

    /**
     * @return String getSuperJBpmStateVertex().getValidationName()
     * @see MetafacadeBase#getValidationName()
     */
    @Override
    public String getValidationName()
    {
        String name = this.getSuperJBpmStateVertex().getValidationName();
        if (name == null)
        {
            name = this.getSuperPseudostateFacade().getValidationName();
        }
        return name;
    }

    /**
     * <p><b>Constraint:</b> org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::fork needs a name</p>
     * <p><b>Error:</b> When you model a fork you must give it a (non-empty) name.</p>
     * <p><b>OCL:</b> context JBpmPseudostate inv: split implies name->notEmpty()</p>
     * <p><b>Constraint:</b> org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::decision needs a name</p>
     * <p><b>Error:</b> When you model a decision point you must give it a (non-empty) name.</p>
     * <p><b>OCL:</b> context JBpmPseudostate inv: decisionPoint implies name->notEmpty()</p>
     * <p><b>Constraint:</b> org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::join needs a name</p>
     * <p><b>Error:</b> When you model a join you must give it a (non-empty) name.</p>
     * <p><b>OCL:</b> context JBpmPseudostate inv: collect implies name->notEmpty()</p>
     * <p><b>Constraint:</b> org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::outgoing transitions need guards when exiting a pseudostate</p>
     * <p><b>Error:</b> Transitions exiting a decision point each need a guard.</p>
     * <p><b>OCL:</b> context JBpmPseudostate inv: decisionPoint implies outgoings->forAll(guard->notEmpty())</p>
     * <p><b>Constraint:</b> org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::split needs names on all outgoing transitions</p>
     * <p><b>Error:</b> All fork-nodes require their outgoing transitions to have a non-empty name, otherwise jBpm will not be able to distinguish between them when creating child tokens.</p>
     * <p><b>OCL:</b> context JBpmPseudostate inv: split implies outgoings->forAll(name|name->notEmpty())</p>
     * @param validationMessages Collection<ModelValidationMessage>
     * @see MetafacadeBase#validateInvariants(Collection validationMessages)
     */
    @Override
    public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
    {
        this.getSuperJBpmStateVertex().validateInvariants(validationMessages);
        this.getSuperPseudostateFacade().validateInvariants(validationMessages);
        try
        {
            final Object contextElement = this.THIS();
            boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"split"))).booleanValue()?OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"name")):true));
            if (!constraintValid)
            {
                validationMessages.add(
                    new ModelValidationMessage(
                        (MetafacadeBase)contextElement ,
                        "org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::fork needs a name",
                        "When you model a fork you must give it a (non-empty) name."));
            }
        }
        catch (Throwable th)
        {
            Throwable cause = th.getCause();
            int depth = 0; // Some throwables have infinite recursion
            while (cause != null && depth < 7)
            {
                th = cause;
                depth++;
            }
            logger.error("Error validating constraint 'org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::fork needs a name' ON "
                + this.THIS().toString() + ": " + th.getMessage(), th);
        }
        try
        {
            final Object contextElement = this.THIS();
            boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"decisionPoint"))).booleanValue()?OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"name")):true));
            if (!constraintValid)
            {
                validationMessages.add(
                    new ModelValidationMessage(
                        (MetafacadeBase)contextElement ,
                        "org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::decision needs a name",
                        "When you model a decision point you must give it a (non-empty) name."));
            }
        }
        catch (Throwable th)
        {
            Throwable cause = th.getCause();
            int depth = 0; // Some throwables have infinite recursion
            while (cause != null && depth < 7)
            {
                th = cause;
                depth++;
            }
            logger.error("Error validating constraint 'org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::decision needs a name' ON "
                + this.THIS().toString() + ": " + th.getMessage(), th);
        }
        try
        {
            final Object contextElement = this.THIS();
            boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"collect"))).booleanValue()?OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"name")):true));
            if (!constraintValid)
            {
                validationMessages.add(
                    new ModelValidationMessage(
                        (MetafacadeBase)contextElement ,
                        "org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::join needs a name",
                        "When you model a join you must give it a (non-empty) name."));
            }
        }
        catch (Throwable th)
        {
            Throwable cause = th.getCause();
            int depth = 0; // Some throwables have infinite recursion
            while (cause != null && depth < 7)
            {
                th = cause;
                depth++;
            }
            logger.error("Error validating constraint 'org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::join needs a name' ON "
                + this.THIS().toString() + ": " + th.getMessage(), th);
        }
        try
        {
            final Object contextElement = this.THIS();
            boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"decisionPoint"))).booleanValue()?OCLCollections.forAll(OCLIntrospector.invoke(contextElement,"outgoings"),new Predicate(){public boolean evaluate(Object object){return Boolean.valueOf(String.valueOf(OCLCollections.notEmpty(OCLIntrospector.invoke(object,"guard")))).booleanValue();}}):true));
            if (!constraintValid)
            {
                validationMessages.add(
                    new ModelValidationMessage(
                        (MetafacadeBase)contextElement ,
                        "org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::outgoing transitions need guards when exiting a pseudostate",
                        "Transitions exiting a decision point each need a guard."));
            }
        }
        catch (Throwable th)
        {
            Throwable cause = th.getCause();
            int depth = 0; // Some throwables have infinite recursion
            while (cause != null && depth < 7)
            {
                th = cause;
                depth++;
            }
            logger.error("Error validating constraint 'org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::outgoing transitions need guards when exiting a pseudostate' ON "
                + this.THIS().toString() + ": " + th.getMessage(), th);
        }
        try
        {
            final Object contextElement = this.THIS();
            boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"split"))).booleanValue()?OCLCollections.forAll(OCLIntrospector.invoke(contextElement,"outgoings"),new Predicate(){public boolean evaluate(Object object){return Boolean.valueOf(String.valueOf(OCLCollections.notEmpty(OCLIntrospector.invoke(object,"name")))).booleanValue();}}):true));
            if (!constraintValid)
            {
                validationMessages.add(
                    new ModelValidationMessage(
                        (MetafacadeBase)contextElement ,
                        "org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::split needs names on all outgoing transitions",
                        "All fork-nodes require their outgoing transitions to have a non-empty name, otherwise jBpm will not be able to distinguish between them when creating child tokens."));
            }
        }
        catch (Throwable th)
        {
            Throwable cause = th.getCause();
            int depth = 0; // Some throwables have infinite recursion
            while (cause != null && depth < 7)
            {
                th = cause;
                depth++;
            }
            logger.error("Error validating constraint 'org::andromda::cartridges::jbpm::metafacades::JBpmPseudostate::split needs names on all outgoing transitions' ON "
                + this.THIS().toString() + ": " + th.getMessage(), th);
        }
    }

    /**
     * The property that stores the name of the metafacade.
     */
    private static final String NAME_PROPERTY = "name";
    private static final String FQNAME_PROPERTY = "fullyQualifiedName";

    /**
     * @see Object#toString()
     */
    @Override
    public String toString()
    {
        final StringBuilder toString = new StringBuilder(this.getClass().getName());
        toString.append("[");
        try
        {
            toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
        }
        catch (final Throwable tryAgain)
        {
            try
            {
                toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
            }
            catch (final Throwable ignore)
            {
                // - just ignore when the metafacade doesn't have a name or fullyQualifiedName property
            }
        }
        toString.append("]");
        return toString.toString();
    }
}