Search in sources :

Example 41 with ErrorBehaviorState

use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorBehaviorState in project osate2 by osate.

the class CreateStatePaletteCommand method getOperation.

@Override
public Optional<Operation> getOperation(final GetTargetedOperationContext ctx) {
    return Operation.createSimple(ctx.getTarget(), ErrorBehaviorStateMachine.class, stateMachine -> {
        // Create the state
        final ErrorBehaviorState newState = ErrorModelFactory.eINSTANCE.createErrorBehaviorState();
        final String newErrorTypeName = ErrorModelNamingUtil.buildUniqueIdentifier(stateMachine, "new_state");
        newState.setName(newErrorTypeName);
        // Add the new state to the state machine
        stateMachine.getStates().add(newState);
        return StepResultBuilder.create().showNewBusinessObject(ctx.getTarget(), newState).build();
    });
}
Also used : ErrorBehaviorState(org.osate.xtext.aadl2.errormodel.errorModel.ErrorBehaviorState)

Aggregations

ErrorBehaviorState (org.osate.xtext.aadl2.errormodel.errorModel.ErrorBehaviorState)35 TypeSet (org.osate.xtext.aadl2.errormodel.errorModel.TypeSet)20 ErrorPropagation (org.osate.xtext.aadl2.errormodel.errorModel.ErrorPropagation)14 TypeToken (org.osate.xtext.aadl2.errormodel.errorModel.TypeToken)14 ErrorEvent (org.osate.xtext.aadl2.errormodel.errorModel.ErrorEvent)12 EObject (org.eclipse.emf.ecore.EObject)9 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)9 ConditionElement (org.osate.xtext.aadl2.errormodel.errorModel.ConditionElement)7 ErrorBehaviorTransition (org.osate.xtext.aadl2.errormodel.errorModel.ErrorBehaviorTransition)7 NamedElement (org.osate.aadl2.NamedElement)6 QualifiedErrorBehaviorState (org.osate.xtext.aadl2.errormodel.errorModel.QualifiedErrorBehaviorState)6 LinkedList (java.util.LinkedList)5 EList (org.eclipse.emf.common.util.EList)5 ConditionExpression (org.osate.xtext.aadl2.errormodel.errorModel.ConditionExpression)5 EMV2PropertyAssociation (org.osate.xtext.aadl2.errormodel.errorModel.EMV2PropertyAssociation)5 ErrorSource (org.osate.xtext.aadl2.errormodel.errorModel.ErrorSource)4 ErrorType (org.osate.xtext.aadl2.errormodel.errorModel.ErrorType)4 EventOrPropagation (org.osate.xtext.aadl2.errormodel.errorModel.EventOrPropagation)4 SConditionElement (org.osate.xtext.aadl2.errormodel.errorModel.SConditionElement)4 BigDecimal (java.math.BigDecimal)3