Skip to content
Snippets Groups Projects
AbstractDataObject.ocl 1.91 KiB
Newer Older
Dominique Marcadet's avatar
Dominique Marcadet committed
/**
 *  Copyright (c) 2017 CentraleSupélec & EDF.
 *  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
 * 
 *  This file is part of the RiseClipse tool
 *  
 *  Contributors:
 *      Computer Science Department, CentraleSupélec
 *      EDF R&D
 *  Contacts:
 *      dominique.marcadet@centralesupelec.fr
 *      aurelie.dehouck-neveu@edf.fr
 *  Web site:
 *      http://wdi.supelec.fr/software/RiseClipse/
 */
import scl: 'http://www.iec.ch/61850/2003/SCL'

include '../Helpers/BaseSimpleTypes.ocl'

package scl

context AbstractDataObject
Dominique Marcadet's avatar
Dominique Marcadet committed

    -- The name attribute shall be present
    inv AbstractDataObject_name_required
        ( '[OCL validation] name attribute shall be present in ' + self.oclType().toString() + ' (line ' + self.lineNumber.toString() + ')' )
Dominique Marcadet's avatar
Dominique Marcadet committed
    :
        self.name <> null

    -- The name attribute shall be valid
    inv AbstractDataObject_name_valid
        ( '[OCL validation] name attribute shall be valid in ' + self.oclType().toString() + ' (line ' + self.lineNumber.toString() + '). '
Dominique Marcadet's avatar
Dominique Marcadet committed
          + 'Current value is ' + self.name.toString()
        )
    :
        self.name <> null implies self.validSclDataName( name )
Dominique Marcadet's avatar
Dominique Marcadet committed

    inv AbstractDataObject_type_required
        ( '[OCL validation] type attribute shall be present in ' + self.oclType().toString() + ' (line ' + self.lineNumber.toString() + ')' )
    :
        self.type <> null

    -- The type attribute shall be valid
    inv AbstractDataObject_type_valid
        ( '[OCL validation] type attribute shall be valid in ' + self.oclType().toString() + ' (line ' + self.lineNumber.toString() + '). '
          + 'Current value is ' + self.type.toString()
        )
    :
        self.type <> null implies self.validSclName( type )
Dominique Marcadet's avatar
Dominique Marcadet committed

endpackage