| 1 | /** |
| 2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
| 3 | * |
| 4 | * $Id$ |
| 5 | */ |
| 6 | package de.uka.ipd.sdq.pcm.seff.impl; |
| 7 | |
| 8 | import java.util.Map; |
| 9 | |
| 10 | import org.eclipse.emf.common.util.BasicDiagnostic; |
| 11 | import org.eclipse.emf.common.util.Diagnostic; |
| 12 | import org.eclipse.emf.common.util.DiagnosticChain; |
| 13 | import org.eclipse.emf.ecore.EClass; |
| 14 | import org.eclipse.emf.ecore.plugin.EcorePlugin; |
| 15 | import org.eclipse.emf.ecore.util.EObjectValidator; |
| 16 | import org.eclipse.ocl.ParserException; |
| 17 | import org.eclipse.ocl.ecore.Constraint; |
| 18 | import org.eclipse.ocl.ecore.OCL; |
| 19 | |
| 20 | import de.uka.ipd.sdq.pcm.seff.SeffPackage; |
| 21 | import de.uka.ipd.sdq.pcm.seff.StartAction; |
| 22 | import de.uka.ipd.sdq.pcm.seff.util.SeffValidator; |
| 23 | |
| 24 | /** |
| 25 | * <!-- begin-user-doc --> |
| 26 | * An implementation of the model object '<em><b>Start Action</b></em>'. |
| 27 | * <!-- end-user-doc --> |
| 28 | * <p> |
| 29 | * </p> |
| 30 | * |
| 31 | * @generated |
| 32 | */ |
| 33 | public class StartActionImpl extends AbstractInternalControlFlowActionImpl implements StartAction { |
| 34 | /** |
| 35 | * <!-- begin-user-doc --> |
| 36 | * <!-- end-user-doc --> |
| 37 | * @generated |
| 38 | */ |
| 39 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
| 40 | |
| 41 | /** |
| 42 | * <!-- begin-user-doc --> |
| 43 | * <!-- end-user-doc --> |
| 44 | * @generated |
| 45 | */ |
| 46 | protected StartActionImpl() { |
| 47 | super(); |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * <!-- begin-user-doc --> |
| 52 | * <!-- end-user-doc --> |
| 53 | * @generated |
| 54 | */ |
| 55 | @Override |
| 56 | protected EClass eStaticClass() { |
| 57 | return SeffPackage.Literals.START_ACTION; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * The cached OCL expression body for the '{@link #StartActionPredecessorMustNotBeDefined(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Start Action Predecessor Must Not Be Defined</em>}' operation. |
| 62 | * <!-- begin-user-doc --> |
| 63 | * <!-- end-user-doc --> |
| 64 | * @see #StartActionPredecessorMustNotBeDefined(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 65 | * @generated |
| 66 | * @ordered |
| 67 | */ |
| 68 | protected static final String START_ACTION_PREDECESSOR_MUST_NOT_BE_DEFINED__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = "self.predecessor_AbstractAction.oclIsUndefined()"; |
| 69 | /** |
| 70 | * The cached OCL invariant for the '{@link #StartActionPredecessorMustNotBeDefined(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Start Action Predecessor Must Not Be Defined</em>}' invariant operation. |
| 71 | * <!-- begin-user-doc --> |
| 72 | * <!-- end-user-doc --> |
| 73 | * @see #StartActionPredecessorMustNotBeDefined(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 74 | * @generated |
| 75 | * @ordered |
| 76 | */ |
| 77 | protected static Constraint START_ACTION_PREDECESSOR_MUST_NOT_BE_DEFINED__DIAGNOSTIC_CHAIN_MAP__EOCL_INV; |
| 78 | |
| 79 | /** |
| 80 | * <!-- begin-user-doc --> |
| 81 | * <!-- end-user-doc --> |
| 82 | * @generated |
| 83 | */ |
| 84 | public boolean StartActionPredecessorMustNotBeDefined(DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 85 | if (START_ACTION_PREDECESSOR_MUST_NOT_BE_DEFINED__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { |
| 86 | OCL.Helper helper = EOCL_ENV.createOCLHelper(); |
| 87 | helper.setContext(SeffPackage.Literals.START_ACTION); |
| 88 | try { |
| 89 | START_ACTION_PREDECESSOR_MUST_NOT_BE_DEFINED__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(START_ACTION_PREDECESSOR_MUST_NOT_BE_DEFINED__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); |
| 90 | } |
| 91 | catch (ParserException pe) { |
| 92 | throw new UnsupportedOperationException(pe.getLocalizedMessage()); |
| 93 | } |
| 94 | } |
| 95 | if (!EOCL_ENV.createQuery(START_ACTION_PREDECESSOR_MUST_NOT_BE_DEFINED__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(this)) { |
| 96 | if (diagnostics != null) { |
| 97 | diagnostics.add |
| 98 | (new BasicDiagnostic |
| 99 | (Diagnostic.ERROR, |
| 100 | SeffValidator.DIAGNOSTIC_SOURCE, |
| 101 | SeffValidator.START_ACTION__START_ACTION_PREDECESSOR_MUST_NOT_BE_DEFINED, |
| 102 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "StartActionPredecessorMustNotBeDefined", EObjectValidator.getObjectLabel(this, context) }), |
| 103 | new Object [] { this })); |
| 104 | } |
| 105 | return false; |
| 106 | } |
| 107 | return true; |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * The cached environment for evaluating OCL expressions. |
| 112 | * <!-- begin-user-doc --> |
| 113 | * <!-- end-user-doc --> |
| 114 | * @generated |
| 115 | * @ordered |
| 116 | */ |
| 117 | protected static final OCL EOCL_ENV = OCL.newInstance(); |
| 118 | |
| 119 | } //StartActionImpl |