Page last modified 17:11, 11 Jan 2016 by Antero

asBag, asSet, asOrderedSet, asSequence

    Table of contents

    Description of the method



    Methods asBag, asSet, asOrderedSet and asSequence create a collection of the specified type.

    Please note the usage in collections wiki page.

    • Bag - no order, may contain duplicates
    • Set - no order, duplicates removed   
    • OrderedSet - ordered, duplicates removed
    • Sequence - ordered, may contain duplicates  



    Available for:

    base64binary, boolean, datetime, double/decimal, date, hexBinary, integer, string, double/decimal and integer

    Parameters: -
    Return type: -



    Context: Message
    OCL: self.Header.ControlSum =


    Description: Compares the value of ControlSum against the sum of values in Transaction, which is defined to be in collection type bag.


    The XML snippet below would pass this check. Note the second occurrence of transaction, expression is true because amount is not above 200.

    <?xml version="1.0" encoding="UTF-8"?>
    <Message xmlns="" xmlns:xsi="">

    The other snippet below however would not pass


    (with everything else similar than in the valid file)