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();
});
}
Aggregations