blob: 6ed76aa7012acbbcb1a0a4e440a483e669704077 [file] [log] [blame]
/*
* Copyright (c) 2005, 2011 IBM Corporation, CEA, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM - initial API and implementation
* Kenn Hussey (CEA) - 327039
*
* $Id: Transition.java,v 1.23 2008/10/02 20:56:23 jbruck Exp $
*/
package org.eclipse.uml2.uml;
import java.util.Map;
import org.eclipse.emf.common.util.DiagnosticChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Transition</b></em>'.
* <!-- end-user-doc -->
*
* <!-- begin-model-doc -->
* A transition is 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.
* <!-- end-model-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link org.eclipse.uml2.uml.Transition#getEffect <em>Effect</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Transition#getGuard <em>Guard</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Transition#getKind <em>Kind</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Transition#getRedefinedTransition <em>Redefined Transition</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Transition#getSource <em>Source</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Transition#getTarget <em>Target</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Transition#getTriggers <em>Trigger</em>}</li>
* <li>{@link org.eclipse.uml2.uml.Transition#getContainer <em>Container</em>}</li>
* </ul>
* </p>
*
* @see org.eclipse.uml2.uml.UMLPackage#getTransition()
* @model
* @generated
*/
public interface Transition
extends Namespace, RedefinableElement {
/**
* Returns the value of the '<em><b>Kind</b></em>' attribute.
* The default value is <code>"external"</code>.
* The literals are from the enumeration {@link org.eclipse.uml2.uml.TransitionKind}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Indicates the precise type of the transition.
* <!-- end-model-doc -->
* @return the value of the '<em>Kind</em>' attribute.
* @see org.eclipse.uml2.uml.TransitionKind
* @see #setKind(TransitionKind)
* @see org.eclipse.uml2.uml.UMLPackage#getTransition_Kind()
* @model default="external" required="true" ordered="false"
* @generated
*/
TransitionKind getKind();
/**
* Sets the value of the '{@link org.eclipse.uml2.uml.Transition#getKind <em>Kind</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Kind</em>' attribute.
* @see org.eclipse.uml2.uml.TransitionKind
* @see #getKind()
* @generated
*/
void setKind(TransitionKind value);
/**
* Returns the value of the '<em><b>Container</b></em>' container reference.
* It is bidirectional and its opposite is '{@link org.eclipse.uml2.uml.Region#getTransitions <em>Transition</em>}'.
* <p>
* This feature subsets the following features:
* <ul>
* <li>'{@link org.eclipse.uml2.uml.NamedElement#getNamespace() <em>Namespace</em>}'</li>
* </ul>
* </p>
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Designates the region that owns this transition.
* <!-- end-model-doc -->
* @return the value of the '<em>Container</em>' container reference.
* @see #setContainer(Region)
* @see org.eclipse.uml2.uml.UMLPackage#getTransition_Container()
* @see org.eclipse.uml2.uml.Region#getTransitions
* @model opposite="transition" required="true" transient="false" ordered="false"
* @generated
*/
Region getContainer();
/**
* Sets the value of the '{@link org.eclipse.uml2.uml.Transition#getContainer <em>Container</em>}' container reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Container</em>' container reference.
* @see #getContainer()
* @generated
*/
void setContainer(Region value);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* A transition with kind external can source any vertex except entry points.
* (kind = TransitionKind::external) implies
* not (source.oclIsKindOf(Pseudostate) and source.oclAsType(Pseudostate).kind = PseudostateKind::entryPoint)
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateStateIsExternal(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* Returns the value of the '<em><b>Target</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Designates the target vertex that is reached when the transition is taken.
* <!-- end-model-doc -->
* @return the value of the '<em>Target</em>' reference.
* @see #setTarget(Vertex)
* @see org.eclipse.uml2.uml.UMLPackage#getTransition_Target()
* @model required="true" ordered="false"
* @generated
*/
Vertex getTarget();
/**
* Sets the value of the '{@link org.eclipse.uml2.uml.Transition#getTarget <em>Target</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Target</em>' reference.
* @see #getTarget()
* @generated
*/
void setTarget(Vertex value);
/**
* Returns the value of the '<em><b>Redefined Transition</b></em>' reference.
* <p>
* This feature subsets the following features:
* <ul>
* <li>'{@link org.eclipse.uml2.uml.RedefinableElement#getRedefinedElements() <em>Redefined Element</em>}'</li>
* </ul>
* </p>
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The transition that is redefined by this transition.
* <!-- end-model-doc -->
* @return the value of the '<em>Redefined Transition</em>' reference.
* @see #setRedefinedTransition(Transition)
* @see org.eclipse.uml2.uml.UMLPackage#getTransition_RedefinedTransition()
* @model ordered="false"
* @generated
*/
Transition getRedefinedTransition();
/**
* Sets the value of the '{@link org.eclipse.uml2.uml.Transition#getRedefinedTransition <em>Redefined Transition</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Redefined Transition</em>' reference.
* @see #getRedefinedTransition()
* @generated
*/
void setRedefinedTransition(Transition value);
/**
* Returns the value of the '<em><b>Guard</b></em>' reference.
* <p>
* This feature subsets the following features:
* <ul>
* <li>'{@link org.eclipse.uml2.uml.Namespace#getOwnedRules() <em>Owned Rule</em>}'</li>
* </ul>
* </p>
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* A guard is a constraint that provides a fine-grained control over the firing of the transition. The guard is evaluated when an event occurrence is dispatched by the state machine. If the guard is true at that time, the transition may be enabled, otherwise, it is disabled. Guards should be pure expressions without side effects. Guard expressions with side effects are ill formed.
* <!-- end-model-doc -->
* @return the value of the '<em>Guard</em>' reference.
* @see #setGuard(Constraint)
* @see org.eclipse.uml2.uml.UMLPackage#getTransition_Guard()
* @model ordered="false"
* @generated
*/
Constraint getGuard();
/**
* Sets the value of the '{@link org.eclipse.uml2.uml.Transition#getGuard <em>Guard</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Guard</em>' reference.
* @see #getGuard()
* @generated
*/
void setGuard(Constraint value);
/**
* Creates a new {@link org.eclipse.uml2.uml.Constraint}, with the specified '<em><b>Name</b></em>', and sets the '<em><b>Guard</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' for the new {@link org.eclipse.uml2.uml.Constraint}, or <code>null</code>.
* @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.Constraint} to create.
* @return The new {@link org.eclipse.uml2.uml.Constraint}.
* @see #getGuard()
* @generated
*/
Constraint createGuard(String name, EClass eClass);
/**
* Creates a new {@link org.eclipse.uml2.uml.Constraint},with the specified '<em><b>Name</b></em>', and sets the '<em><b>Guard</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' for the new {@link org.eclipse.uml2.uml.Constraint}, or <code>null</code>.
* @return The new {@link org.eclipse.uml2.uml.Constraint}.
* @see #getGuard()
* @generated
*/
Constraint createGuard(String name);
/**
* Returns the value of the '<em><b>Effect</b></em>' containment reference.
* <p>
* This feature subsets the following features:
* <ul>
* <li>'{@link org.eclipse.uml2.uml.Element#getOwnedElements() <em>Owned Element</em>}'</li>
* </ul>
* </p>
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Specifies an optional behavior to be performed when the transition fires.
* <!-- end-model-doc -->
* @return the value of the '<em>Effect</em>' containment reference.
* @see #setEffect(Behavior)
* @see org.eclipse.uml2.uml.UMLPackage#getTransition_Effect()
* @model containment="true" resolveProxies="true" ordered="false"
* @generated
*/
Behavior getEffect();
/**
* Sets the value of the '{@link org.eclipse.uml2.uml.Transition#getEffect <em>Effect</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Effect</em>' containment reference.
* @see #getEffect()
* @generated
*/
void setEffect(Behavior value);
/**
* Creates a new {@link org.eclipse.uml2.uml.Behavior}, with the specified '<em><b>Name</b></em>', and sets the '<em><b>Effect</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' for the new {@link org.eclipse.uml2.uml.Behavior}, or <code>null</code>.
* @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.Behavior} to create.
* @return The new {@link org.eclipse.uml2.uml.Behavior}.
* @see #getEffect()
* @generated
*/
Behavior createEffect(String name, EClass eClass);
/**
* Returns the value of the '<em><b>Trigger</b></em>' containment reference list.
* The list contents are of type {@link org.eclipse.uml2.uml.Trigger}.
* <p>
* This feature subsets the following features:
* <ul>
* <li>'{@link org.eclipse.uml2.uml.Element#getOwnedElements() <em>Owned Element</em>}'</li>
* </ul>
* </p>
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Specifies the triggers that may fire the transition.
* <!-- end-model-doc -->
* @return the value of the '<em>Trigger</em>' containment reference list.
* @see org.eclipse.uml2.uml.UMLPackage#getTransition_Trigger()
* @model containment="true" resolveProxies="true" ordered="false"
* @generated
*/
EList<Trigger> getTriggers();
/**
* Creates a new {@link org.eclipse.uml2.uml.Trigger}, with the specified '<em><b>Name</b></em>', and appends it to the '<em><b>Trigger</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' for the new {@link org.eclipse.uml2.uml.Trigger}, or <code>null</code>.
* @return The new {@link org.eclipse.uml2.uml.Trigger}.
* @see #getTriggers()
* @generated
*/
Trigger createTrigger(String name);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Trigger} with the specified '<em><b>Name</b></em>' from the '<em><b>Trigger</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' of the {@link org.eclipse.uml2.uml.Trigger} to retrieve, or <code>null</code>.
* @return The first {@link org.eclipse.uml2.uml.Trigger} with the specified '<em><b>Name</b></em>', or <code>null</code>.
* @see #getTriggers()
* @generated
*/
Trigger getTrigger(String name);
/**
* Retrieves the first {@link org.eclipse.uml2.uml.Trigger} with the specified '<em><b>Name</b></em>' from the '<em><b>Trigger</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param name The '<em><b>Name</b></em>' of the {@link org.eclipse.uml2.uml.Trigger} to retrieve, or <code>null</code>.
* @param ignoreCase Whether to ignore case in {@link java.lang.String} comparisons.
* @param createOnDemand Whether to create a {@link org.eclipse.uml2.uml.Trigger} on demand if not found.
* @return The first {@link org.eclipse.uml2.uml.Trigger} with the specified '<em><b>Name</b></em>', or <code>null</code>.
* @see #getTriggers()
* @generated
*/
Trigger getTrigger(String name, boolean ignoreCase, boolean createOnDemand);
/**
* Returns the value of the '<em><b>Source</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Designates the originating vertex (state or pseudostate) of the transition.
* <!-- end-model-doc -->
* @return the value of the '<em>Source</em>' reference.
* @see #setSource(Vertex)
* @see org.eclipse.uml2.uml.UMLPackage#getTransition_Source()
* @model required="true" ordered="false"
* @generated
*/
Vertex getSource();
/**
* Sets the value of the '{@link org.eclipse.uml2.uml.Transition#getSource <em>Source</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Source</em>' reference.
* @see #getSource()
* @generated
*/
void setSource(Vertex value);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* A fork segment must not have guards or triggers.
* (source.oclIsKindOf(Pseudostate) and source.kind = #fork) implies (guard->isEmpty() and trigger->isEmpty())
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateForkSegmentGuards(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* A join segment must not have guards or triggers.
* (target.oclIsKindOf(Pseudostate) and target.kind = #join) implies (guard->isEmpty() and trigger->isEmpty())
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateJoinSegmentGuards(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* A transition with kind internal must have a state as its source, and its source and target must be equal.
* (kind = TransitionKind::internal) implies
* (source.oclIsKindOf (State) and source = target)
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateStateIsInternal(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* A fork segment must always target a state.
* (source.oclIsKindOf(Pseudostate) and source.kind = #fork) implies (target.oclIsKindOf(State))
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateForkSegmentState(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* A join segment must always originate from a state.
* (target.oclIsKindOf(Pseudostate) and target.kind = #join) implies (source.oclIsKindOf(State))
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateJoinSegmentState(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Transitions outgoing pseudostates may not have a trigger.
* source.oclIsKindOf(Pseudostate) and (source.kind <> #initial)) implies trigger->isEmpty()
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateOutgoingPseudostates(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* An initial transition at the topmost level (region of a statemachine) either has no trigger or it has a trigger with the stereotype >.
* self.source.oclIsKindOf(Pseudostate) implies
* (self.source.oclAsType(Pseudostate).kind = #initial) implies
* (self.source.container = self.stateMachine.top) implies
* ((self.trigger->isEmpty) or
* (self.trigger.stereotype.name = 'create'))
*
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateInitialTransition(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* In case of more than one trigger, the signatures of these must be compatible in case the parameters of the signal are assigned to local variables/attributes.
* true
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateSignaturesCompatible(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* A transition with kind local must have a composite state or an entry point as its source.
* (kind = TransitionKind::local) implies
* ((source.oclIsKindOf (State) and source.oclAsType(State).isComposite) or
* (source.oclIsKindOf (Pseudostate) and source.oclAsType(Pseudostate).kind = PseudostateKind::entryPoint))
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateStateIsLocal(DiagnosticChain diagnostics,
Map<Object, Object> context);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The redefinition context of a transition is the nearest containing statemachine.
* result = let sm = containingStateMachine() in
* if sm.context->isEmpty() or sm.general->notEmpty() then
* sm
* else
* sm.context
* endif
* <!-- end-model-doc -->
* @model required="true" ordered="false"
* @generated
*/
Classifier redefinitionContext();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The query containingStateMachine() returns the state machine that contains the transition either directly or transitively.
* result = container.containingStateMachine()
* <!-- end-model-doc -->
* @model required="true" ordered="false"
* @generated
*/
StateMachine containingStateMachine();
} // Transition