blob: ca511a4b4ace0cf40fad89a78b7153a0d7a822f9 [file] [log] [blame]
/*
* Copyright (c) 2005 IBM Corporation 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
*
* $Id: ConditionalNode.java,v 1.4 2005/12/14 22:34:16 khussey Exp $
*/
package org.eclipse.uml2.uml;
import java.util.Map;
import org.eclipse.emf.common.util.DiagnosticChain;
import org.eclipse.emf.common.util.EList;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Conditional Node</b></em>'.
* <!-- end-user-doc -->
*
* <!-- begin-model-doc -->
* A conditional node consists of one or more clauses. Each clause consists of a test section and a body section. When the conditional node begins execution, the test sections of the clauses are executed. If one or more test sections yield a true value, one of the corresponding body sections will be executed. If more than one test section yields a true value, only one body section will be executed. The choice is nondeterministic unless the test sequence of clauses is specified. If no test section yields a true value, then no body section is executed; this may be a semantic error if output values are expected from the conditional node.
*
*
*
* In general, test section may be executed in any order, including simultaneously (if the underlying execution architecture supports it). The result may therefore be nondeterministic if more than one test section can be true concurrently. To enforce ordering of evaluation, sequencing constraints may be specified among clauses. One frequent case is a total ordering of clauses, in which case the clause execution order is determinate. If it is impossible for more than one test section to evaluate true simultaneously, the result is deterministic and it is unnecessary to order the clauses, as ordering may impose undesirable and unnecessary restrictions on implementation. Note that, although evaluation of test sections may be specified as concurrent, this does not require that the implementation evaluate them in parallel; it merely means that the model does not impose any order on evaluation.
*
*
*
* An "else" clause is a clause that is a successor to all other clauses in the conditional and whose test part always returns true.
*
*
*
* Output values created in the test or body section of a clause are potentially available for use outside the conditional. However, any value used outside the conditional must be created in every clause, otherwise an undefined value would be accessed if a clause not defining the value were executed.
* <!-- end-model-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link org.eclipse.uml2.uml.ConditionalNode#isDeterminate <em>Is Determinate</em>}</li>
* <li>{@link org.eclipse.uml2.uml.ConditionalNode#isAssured <em>Is Assured</em>}</li>
* <li>{@link org.eclipse.uml2.uml.ConditionalNode#getClauses <em>Clause</em>}</li>
* <li>{@link org.eclipse.uml2.uml.ConditionalNode#getResults <em>Result</em>}</li>
* </ul>
* </p>
*
* @see org.eclipse.uml2.uml.UMLPackage#getConditionalNode()
* @model
* @generated
*/
public interface ConditionalNode
extends StructuredActivityNode {
/**
* Returns the value of the '<em><b>Is Determinate</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* If true, the modeler asserts that at most one test will succeed.
* <!-- end-model-doc -->
* @return the value of the '<em>Is Determinate</em>' attribute.
* @see #setIsDeterminate(boolean)
* @see org.eclipse.uml2.uml.UMLPackage#getConditionalNode_IsDeterminate()
* @model dataType="org.eclipse.uml2.uml.Boolean" required="true" ordered="false"
* @generated
*/
boolean isDeterminate();
/**
* Sets the value of the '{@link org.eclipse.uml2.uml.ConditionalNode#isDeterminate <em>Is Determinate</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Is Determinate</em>' attribute.
* @see #isDeterminate()
* @generated
*/
void setIsDeterminate(boolean value);
/**
* Returns the value of the '<em><b>Is Assured</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* If true, the modeler asserts that at least one test will succeed.
* <!-- end-model-doc -->
* @return the value of the '<em>Is Assured</em>' attribute.
* @see #setIsAssured(boolean)
* @see org.eclipse.uml2.uml.UMLPackage#getConditionalNode_IsAssured()
* @model dataType="org.eclipse.uml2.uml.Boolean" required="true" ordered="false"
* @generated
*/
boolean isAssured();
/**
* Sets the value of the '{@link org.eclipse.uml2.uml.ConditionalNode#isAssured <em>Is Assured</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Is Assured</em>' attribute.
* @see #isAssured()
* @generated
*/
void setIsAssured(boolean value);
/**
* Returns the value of the '<em><b>Clause</b></em>' containment reference list.
* The list contents are of type {@link org.eclipse.uml2.uml.Clause}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* Set of clauses composing the conditional.
* <!-- end-model-doc -->
* @return the value of the '<em>Clause</em>' containment reference list.
* @see org.eclipse.uml2.uml.UMLPackage#getConditionalNode_Clause()
* @model type="org.eclipse.uml2.uml.Clause" containment="true" resolveProxies="false" required="true" ordered="false"
* @generated
*/
EList getClauses();
/**
* Creates a {@link org.eclipse.uml2.uml.Clause} and appends it to the '<em><b>Clause</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return The new {@link org.eclipse.uml2.uml.Clause}.
* @see #getClauses()
* @generated
*/
Clause createClause();
/**
* Returns the value of the '<em><b>Result</b></em>' containment reference list.
* The list contents are of type {@link org.eclipse.uml2.uml.OutputPin}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* A list of output pins that constitute the data flow outputs of the conditional.
* <!-- end-model-doc -->
* @return the value of the '<em>Result</em>' containment reference list.
* @see org.eclipse.uml2.uml.UMLPackage#getConditionalNode_Result()
* @model type="org.eclipse.uml2.uml.OutputPin" containment="true" resolveProxies="false"
* @generated
*/
EList getResults();
/**
* Creates a {@link org.eclipse.uml2.uml.OutputPin} and appends it to the '<em><b>Result</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return The new {@link org.eclipse.uml2.uml.OutputPin}.
* @see #getResults()
* @generated
*/
OutputPin createResult();
/**
* Retrieves the {@link org.eclipse.uml2.uml.OutputPin} with the specified '<em><b>Name</b></em>' from the '<em><b>Result</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.OutputPin} to retrieve.
* @return The {@link org.eclipse.uml2.uml.OutputPin} with the specified '<em><b>Name</b></em>', or <code>null</code>.
* @see #getResults()
* @generated
*/
OutputPin getResult(String name);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* The result output pins have no incoming edges.
* true
* <!-- end-model-doc -->
* @model
* @generated
*/
boolean validateResultNoIncoming(DiagnosticChain diagnostics, Map context);
} // ConditionalNode